-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I prevent asciidoctor-multipage from resetting the latex equation counter after every HTML Page? #39
Comments
It looks like the equation numbers are added by the MathJax script when it runs during page load, and there is no numbering added by Asciidoctor that could be used to correctly number the equations. See this excerpt, the stem block, from the <div id="eqn-normalStrain" class="stemblock">
<div class="content">
\[\begin{align}
\epsilon\ (\text{strain}) = \frac{\Delta L\ (\text{change in length})}{L\ (\text{original length})}
\end{align}\]
</div>
</div> The MathJax script adds the equation numbers as configured in this excerpt, later in MathJax.Hub.Config({
TeX: { equationNumbers: { autoNumber: "Equation" } }
}) As you can see, only Asciidoctor knows the reftext of the stem block. MathJax only knows the numbering prefix (and in this case apparently doesn't use it), but not the actual number. So it seems to me like it is not possible to fix this without changes to Asciidoctor. I'll leave this issue open here for now in case someone has opportunity to work on it. |
Thank you for your response @owenh000 Updated: chap1.adoc== Chapter 1
This is my chapter one.
[stem#eqn-normalStress,reftext='{eqnums} {counter:eqnum}']
++++
\begin{align}\tag{#eqnum#}
\sigma\ (\text{stress}) = \frac{F\ (\text{load})}{A\ (\text{area})}\ \frac{N}{m^2}
\end{align}
++++
From <<#eqn-normalStress>>, you can calculate the normal stress. Updated: chap2.adoc== Chapter 2
This is a test chapter 2.
[stem#eqn-normalStrain,reftext='{eqnums} {counter:eqnum}']
++++
\begin{align}\tag{#eqnum#}
\epsilon\ (\text{strain}) = \frac{\Delta L\ (\text{change in length})}{L\ (\text{original length})}
\end{align}
++++
From <<#eqn-normalStrain>>, you can calculate strain. Updated: chap3.adoc== Chapter 3
This is the final test chapter.
[stem#eqn-twistShear,reftext='{eqnums} {counter:eqnum}']
++++
\begin{align}\tag{#eqnum#}
\text{Shear strain, } \gamma = \frac{R\theta}{L}
\end{align}
++++
Calculate shear strain from <<#eqn-twistShear>>. Python Code to Update
|
Hi Sam, thanks for sharing your workaround. It might be possible to improve this behavior by doing the following in asciidoctor-multipage: (1) disabling MathJax auto-numbering and (2) adding an explicit Latex Note Edit: removed a stray parenthesis |
I'm testing the
asciidoctor-multipage
extension and want to generate asciidoctor HTML multipages. I'm also interested in PDF and one-page HTML.I made the following test documents attached here
["test.adoc", "chap1.adoc", "chap2.adoc", "chap3.adoc"]
.test.adoc
chap1.adoc
chap2.adoc
chap3.adoc
Terminal commands
Having installed the required extension packages on Ubuntu 20.04, I used the following commands to generate the outputs in various directories.
All documents are generated successfully, except that, unlike in the PDF and the one-page HTML output, the
asciidoctor-multipage
HTMLs output seems to reset or forget the latex equation counter on every page. Every equation is labelled (1) even when the cross-reference correctly indicates Equation 3.I would like
asciidoctor-multipage
to remember the counter and match all equation labels as in (1) (2) (3) on various pages. Not (1) (1) (1). How do I force theasciidoctor-multipage
extension to preserve the latex equation numbering similar to the PDF and the one-page HTML?Thank you.
Regards, Sam.
The text was updated successfully, but these errors were encountered: