Custom pandoc filters for converting LaTeX to quarto markdown.
To see the pandoc abstract syntax tree (AST):
pandoc test.tex -f latex+raw_tex -t native -o test.txtTo convert, first inject
\input{filter_markdown}just above \begin{document} into the LaTeX file. Then, execute
pandoc test.tex -f latex+latex_macros -t markdown --lua-filter=filter_markdown.lua --wrap=preserve -o test.mdYou can convert multiple files (do not specify the .tex extension) like so
batch=(
file1
file2
file3
...
)
for item in "${batch[@]}"; do
pandoc "${item}.tex" -f latex+latex_macros -t markdown --lua-filter=filter_markdown.lua --wrap=preserve -o "${item}.qmd"
doneReplaces LaTeX \customidx{param} with markdown {{< indexer add param >}}.
Replaces mlind and mldef LaTeX commands with the corresponding markdown syntax.
From the root directory of the repository render to LaTeX:
quarto render --to=latexFrom the root directory of the repository render to LaTeX:
quarto render ./file.qmd --log-level=info --to=htmlOpen the file:
open _book/file.html