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.txt
To 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.md
You 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"
done
Replaces 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=latex
From the root directory of the repository render to LaTeX:
quarto render ./file.qmd --log-level=info --to=html
Open the file:
open _book/file.html