I want to convert old lecture notes from LaTeX to markdown, in order to use them in quarto afterwards. I would like to preserve the raw LaTeX references, \ref{some-label}
and possibly also other raw LaTeX commands. Is there a canonical way to do that, or should I write a filter?
Minimal example: pandoc minimal.tex -o minimal.md
with
minimal.tex
\documentclass{article}
\begin{document}
Refer to \textbf{example} \ref{example1}, blabla
\end{document}
gives
minimal.md
Refer to **example** [\[example1\]](#example1){reference-type="ref"
reference="example1"}, blabla
but I want
Refer to **example** \ref{example1}, blabla
p.s. The reason why I want to preserve references is, that I want to use my own filter to resolve them.
The raw_tex
extension will cause all unknown or difficult to convert TeX commands to be passed through as raw elements:
% pandoc --from=latex+raw_tex minimal.tex
Refer to **example** `\ref{example1}`{=latex}, blabla
Filtering on RawInline
and RawBlock
elements then allows to process these elements in whatever way you see fit.