Custom pandoc filters for converting LaTeX to quarto markdown.
To convert:
pandoc test.tex -f latex+latex_macros -t markdown --lua-filter=filter_markdown.lua --wrap=preserve -o test.md
To see the pandoc abstract syntax tree (AST):
pandoc test.tex -f latex+raw_tex -t native -o test.txt
Replaces LaTeX \customidx{param}
with markdown {{< indexer add param >}}
.
Replaces mlind
and mldef
LaTeX commands with the corresponding markdown syntax.
IMPORTANT: The following code needs to be injected into the LaTeX file preamble for the filter to work:
\input{filter_markdown.tex}