aboutsummaryrefslogtreecommitdiff
path: root/scripts/myemph.py
blob: 0514df317d0073872f9a4882e68fbb645755591e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env python
from pandoc import toJSONFilter, rawInline

"""Pandoc filter that causes emphasis to be rendered using
the custom macro '\myemph{...}' rather than '\emph{...}'
in latex.  Other output formats are unaffected.
"""

def myemph(k, v, f):
  if k == 'Emph' and f == 'latex':
    return [rawInline("latex", "\\myemph{")] + v + [rawInline("latex","}")]

if __name__ == "__main__":
  toJSONFilter(myemph)