timtylin / scholdoc

Fork of Pandoc for the implementation of a ScholarlyMarkdown parser
scholdoc.scholarlymarkdown.com
GNU General Public License v2.0
335 stars 16 forks source link

can't reference an equation that contains an array #21

Open ghennequin opened 8 years ago

ghennequin commented 8 years ago
```math #foo
\begin{array}{ccc}
1+1 & = & 2
\end{array}
```
Equation (#foo) shows as Equation (???).

Inspecting the html code, schodoc seems to be doing the right thing - is this a known mathjax issue then?

timtylin commented 8 years ago

It might be, depending on which version of MathJax you're using. I seem to recall filing a similar issue ticket to the MathJax repo before. Try to verify that you're using the latest MathJax?

timtylin commented 8 years ago

So here's the relevant MathJax issue: https://github.com/mathjax/MathJax/issues/1020

It's not quite the same, but in general it does seem to apply to any form of aligned environment block inside an equation environment with a single reference. I did put in a workaround though, and it is supposed to be live in the released Pandoc versions.

Unfortunately that issue seems to be languishing a bit, so it might not have been fixed at all on their side.

For now, maybe you can try the implicit multiline math mode? Put multiple single-line (in terms of the equation itself, not the tex code) scholdoc math blocks on top of each other (without any blank lines in-between them), and they'll automatically be put into a gather environment. Put the appropriate & symbols in all the equations, and it'll automatically get turned into an align environment. You can then attach the label to whichever block you want, and it'll be associated with that line. As far as I know, labels within gather and align blocks still work properly in MathJax.