lierdakil / pandoc-crossref

Pandoc filter for cross-references
https://lierdakil.github.io/pandoc-crossref/
GNU General Public License v2.0
909 stars 73 forks source link

LaTeX to DOCX, \eqref{label} to be Eq.[label] not Eq.(number)? How to DO! #438

Closed pbpf closed 1 month ago

pbpf commented 1 month ago

I'm no expert, but often need to convert latex to docx, where formula references can't be converted to the correct number, although -M autoEqnLabels can generate numbers for the formula itself.

\documentclass{article}

\begin{document}

This is a test for Eq.~\eqref{eq:test}
\begin{equation}
    x=1\label{eq:test}
\end{equation}

\end{document}

Let us do

pandoc a.tex    -M autoEqnLabels    --filter pandoc-crossref -o output.docx

Then, you got! image

lierdakil commented 1 month ago

Latex is not officially supported as an input format, but see https://github.com/lierdakil/pandoc-crossref/issues/250.