chirun-ncl / chirun

A Python package providing the command line interface for building flexible and accessible content with Chirun.
https://chirun.org.uk/
Other
30 stars 4 forks source link

LaTeX HTML output: \ref in math mode doesn't pick up references to labels defined in text mode #219

Closed christianp closed 10 months ago

christianp commented 10 months ago

In the HTML output of a LaTeX document, a \ref command in math mode will not recognise labels defined in text mode elsewhere in the document. I think that MathJax makes its own list of references, and plasTeX doesn't fill it with the text mode references. I need to find out if that's possible.

pkra commented 10 months ago

The "usual" author hack is to do $\ref{mathmodelabel}$ when an HTML convertor leaves math mode untouched for MathJax. (I only know one convertor that does it "properly", i.e., resolve label/IDs but still leave good math mode TeX in the output for MathJax.)

christianp commented 10 months ago

Fixed by d2d371e67111336c223509a551944d7acff29352

christianp commented 7 months ago

I think the only way to unit test this is to check the dictionary of labels that MathJax should load.