-
-
Notifications
You must be signed in to change notification settings - Fork 793
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
Add support for equation numbering and cross-referencing #3518
Comments
Equation numbering is handled by MathJax itself. It can be enabled by setting the You can also give the block and ID so you can reference it from AsciiDoc content.
|
Thanks. Much obliged. This almost works for me except for 2 things:
1. The equation number appears on the left of the equation whereas standard practice is to have the label on the right
2. I would like equation numbers to be prefixed by the chapter number. Right now my equations are numbered 1, 2, 3 and so on. I would like them to be numbered 3.1, 3.2, 3.3 and so on in chapter 3
Is there any way to fix above 2 issues?
…________________________________
From: Dan Allen <notifications@github.com>
Sent: Tuesday, December 24, 2019 4:15 PM
To: asciidoctor/asciidoctor <asciidoctor@noreply.github.com>
Cc: siddjain <siddjain@live.com>; Author <author@noreply.github.com>
Subject: Re: [asciidoctor/asciidoctor] Add support for equation numbering and cross-referencing (#3518)
Equation numbering is handled by MathJax itself. It can be enabled by setting the eqnums document attribute. Other equations can then refer to these numbers.
You can also give the block and ID so you can reference it from AsciiDoc content.
:stem: latexmath
:eqnums:
[latexmath#eq-1,reftext=Equation 1]
++++
\begin{equation}
y = x^2
\end{equation}
++++
see <<eq-1>>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fasciidoctor%2Fasciidoctor%2Fissues%2F3518%3Femail_source%3Dnotifications%26email_token%3DAAFZEMLQ3YJW6UVDWKNXVC3Q2KQZDA5CNFSM4J7ANN2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHTWNFA%23issuecomment-568813204&data=02%7C01%7C%7C0c235ad2fa5a400e263608d788cf83b6%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637128297154263001&sdata=OnU4mdRIiSTAhF4lD07fHvEpp3yUwGzclvvM%2BhcJCls%3D&reserved=0>, or unsubscribe<https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAFZEMKZ6X5E6TO44X4MHX3Q2KQZDANCNFSM4J7ANN2A&data=02%7C01%7C%7C0c235ad2fa5a400e263608d788cf83b6%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637128297154263001&sdata=IjtfbLzTxRcqsrPGOS0yKNU2BH7Si%2F1wkXRVTMKRfw8%3D&reserved=0>.
|
The equation number should be appearing on the right. Here's the output I see: MathJax isn't aware of the chapters in the AsciiDoc document, so it's going to number the equations straight. To change that, you'd need to load an extension to MathJax that changes how the number is done. So no, not without a customization. |
@mojavelinux, is the output you have pasted the result of running asciidoctor-pdf. Below is my asciidoc
and when I process it through asciidoctor-pdf I get The equation number appears on the left. I am using the docker image
Any chance you could add ability for user to customize the equation number so that it can be numbered |
adding a note to help readers later on. the left-side equation numbering got fixed when i upgraded to asciidoctor-pdf v1.5.3. earlier i was using beta7 version of 1.5.0 |
I am testing equation references for Antora as described by @mojavelinux in #3518 (comment) The linking aspects work fine in Antora but the key piece, the equation reference number, is not rendered in the Antora output.
and the link to this is
Here is a link to the issue I created for Antora |
Please direct Antora questions to the Antora community chat at https://antora.zulipchat.com. The Asciidoctor issue tracker is not the appropriate place to be discussing Antora behavior. |
Thanks for the solution. The example works fine for cross-referencing the equation in 'asciidoctor-pdf'. One query though, we see the 'reftext=Equation 1' here is the static test we are using to link. Instead of using static reftext, can we use dynamic equation number to link something like 'reftext={dynamic equation number}'? PS: I have set ':eqnums: AMS' for automatic equation number generation. |
@vishalkrsinha I'm currently using the following template with a counter to automatically generate equation numbers:
Complete example:
This should give you something like this: You can modify the There's at least two downsides to this:
|
Equation numbering works nice, thank you. But how can I align the equation to the left in place of center? Thanks. |
I don't know why, but I can't see the equation number, neither to the right nor to the left. |
Please direct usage questions to the project chat at https://chat.asciidoctor.org. See you there! |
It seems asciidoc has no support for equation numbering and cross-referencing? please see these threads:
asciidoctor/asciidoctor-mathematical#37 (comment)
could support for this be added please?
The text was updated successfully, but these errors were encountered: