Skip to content

Issue with \ref command in math environment #10377

Answered by jgm
anontokyo2077 asked this question in Q&A
Discussion options

You must be logged in to vote

We don't support \ref in math yet, sorry. It's difficult to see how to support this. Math conversion is done by texmath, and it wouldn't know how to resolve the reference. Perhaps pandoc could do its own macro substitution and resolve the reference before passing the tex to texmath, but currently there is no tracking of equation numbers.

As a workaround, you might add this to the beginning of your tex file:

\renewcommand{\ref}[1]{?}

This will allow the math to be converted without error, but all references (including those outside of math) will be ?. (Currently pandoc will resolve references to sections and figures outside of math; if you want to keep this you might need to use etoolbox …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@anontokyo2077
Comment options

Answer selected by anontokyo2077
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants