Cross reference equations

9 messages
Open this post in threaded view
|

Cross reference equations

 Is it possible to cross reference equations? I've tried the following with no luck. Also, I can't seem to get the :eqnums: option to make any difference. Here is what I've tried: = Test eqn cross-ref :stem: latexmath :eqnums: == Let's try .My equation [#my-eqn] [stem] ++++ c^2 = a^2 + b^2 + 5 ++++ I refer back to <>. 
Open this post in threaded view
|

Re: Cross reference equations

 After reading the MathJax documentation a second time, I figured out how to use MathJax to achieve the cross referencing and equation numbering: = Test eqn cross-ref :stem: latexmath :eqnums: == Let's try $$\label{myequation} c^2 = a^2 + b^2 + 5$$ I refer back to \eqref{myequation}. This will work well for what I need at the moment.
Open this post in threaded view
|

Re: Cross reference equations

 Whoops, it seems that a passthrough block is still necessary: = Test eqn cross-ref :stem: latexmath :eqnums: == Let's try [stem] ++++ $$\label{myequation} c^2 = a^2 + b^2 + 5$$ ++++ I refer back to \eqref{myequation}. the [stem] label seems optional but I'll include it just in case.
Open this post in threaded view
|

Re: Cross reference equations

 How did you manage to reference your equation? I can create numbering with \label{myequation} syntax, but referencing does not work with \eqref{myequation}
Open this post in threaded view
|

Re: Cross reference equations

 The sample that I posted above works for me. Can you get that to work?
Open this post in threaded view
|

Re: Cross reference equations

 Oh, ok, I've managed to produce a valid output for your example, but for very basic case just by running bare asciidoctor. In my real case same source file is used to produce both HTML and PDF (with asciidoctor-pdf) versions of a document and I also use asciidoctor-mathematical and all this together does not work as required. It gives my either '(???)' in HTML or '\eqref{euation}' in PDF.
Open this post in threaded view
|

Re: Cross reference equations

 Oh yes. I see the problem now. My solution relies on Mathjax (script in HTML output) to render it. Asciidoctor normally just passes it straight through. That's why it doesn't work for PDF. I don't know how asciidoctor-mathematical interacts with it.Mathjax does a pretty good job but it would be nice to find a better solution.On Wed., 2 May 2018, 5:52 pm YuVV [via Asciidoctor :: Discussion], <[hidden email]> wrote: Oh, ok, I've managed to produce a valid output for your example, but for very basic case just by running bare asciidoctor. In my real case same source file is used to produce both HTML and PDF (with asciidoctor-pdf) versions of a document and I also use asciidoctor-mathematical and all this together does not work as required. It gives my either '(???)' in HTML or '\eqref{euation}' in PDF. If you reply to this email, your message will be added to the discussion below: http://discuss.asciidoctor.org/Cross-reference-equations-tp6226p6292.html To unsubscribe from Cross reference equations, click here. NAML