Cross reference equations

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Cross reference equations

MattPalermo
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 <<my-eqn>>.
Reply | Threaded
Open this post in threaded view
|

Re: Cross reference equations

MattPalermo
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

\begin{equation}\label{myequation}
c^2 = a^2 + b^2 + 5
\end{equation}

I refer back to \eqref{myequation}.

This will work well for what I need at the moment.
Reply | Threaded
Open this post in threaded view
|

Re: Cross reference equations

MattPalermo
Whoops, it seems that a passthrough block is still necessary:

= Test eqn cross-ref
:stem: latexmath
:eqnums:

== Let's try

[stem]
++++
\begin{equation}\label{myequation}
c^2 = a^2 + b^2 + 5
\end{equation}
++++

I refer back to \eqref{myequation}.

the
[stem]
 label seems optional but I'll include it just in case.
Reply | Threaded
Open this post in threaded view
|

Re: Cross reference equations

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

Re: Cross reference equations

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

Re: Cross reference equations

YuVV
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.
Reply | Threaded
Open this post in threaded view
|

Re: Cross reference equations

MattPalermo
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
Reply | Threaded
Open this post in threaded view
|

Re: Cross reference equations

YuVV
The strange thing is that numeration itself works fine for me both in HTML and in PDF! What is not working is just referencing! Probably I should ask people from asciidoctor-mathematical...
Reply | Threaded
Open this post in threaded view
|

Re: Cross reference equations

MattPalermo
That's interesting. I think you're right.
 Definitely worth a look to see if mathematical can help.

On Wed., 2 May 2018, 7:46 pm YuVV [via Asciidoctor :: Discussion], <[hidden email]> wrote:
The strange thing is that numeration itself works fine for me both in HTML and in PDF! What is not working is just referencing! Probably I should ask people from asciidoctor-mathematical...


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Cross-reference-equations-tp6226p6295.html
To unsubscribe from Cross reference equations, click here.
NAML