diff options
Diffstat (limited to 'scripts/myemph.py')
-rwxr-xr-x | scripts/myemph.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/myemph.py b/scripts/myemph.py index e527a0b2e..2a322b385 100755 --- a/scripts/myemph.py +++ b/scripts/myemph.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -from pandoc import toJSONFilter, rawInline +from pandoc import toJSONFilter """ Pandoc filter that causes emphasis to be rendered using @@ -7,9 +7,12 @@ the custom macro '\myemph{...}' rather than '\emph{...}' in latex. Other output formats are unaffected. """ +def latex(s): + return {'RawInline': ['latex', s]} + def myemph(k, v, f): if k == 'Emph' and f == 'latex': - return [rawInline("latex", "\\myemph{")] + v + [rawInline("latex","}")] + return [latex('\\myemph{')] + v + [latex('}')] if __name__ == "__main__": toJSONFilter(myemph) |