Created
January 17, 2020 12:10
-
-
Save jojonki/af190dfa57d6fccfc1ddd6a62b9d85c4 to your computer and use it in GitHub Desktop.
Revisions
-
jojonki created this gist
Jan 17, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ """Remove latex blocks and replace math functiosn with (MATH) - How to debug: pandoc -t json aaa.tex | python ./this-file.py | pandoc -f json -t plain - How to use: pandoc -s aaa.tex --filter=./this-file.py -o out.text """ from pandocfilters import toJSONFilter, Str def abc(key, value, format, _): if key == 'RawBlock': if value[0] == 'latex': return [] elif key == 'Math': return Str('(MATH)') if __name__ == "__main__": toJSONFilter(abc)