Skip to content
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

Equation label of math not work before make clean when math_numfig=True #886

Closed
berlin2123 opened this issue Mar 9, 2024 · 7 comments
Closed

Comments

@berlin2123
Copy link

berlin2123 commented Mar 9, 2024

Here is the initial description of the phenomenon, but the bug is not really related to the Dollar math. Actual testing of directive math does the same issue. See comment 3.

I want to using math_numfig to show equation label like (m.n) instead of (n).

However, the dollar math shows a empty (), when:

math_numfig = True
numfig = True
numfig_secnum_depth = 2

but the directive {math} works fine.

here is the test.md

{math}`a^2 + b^2 = c^2`

```{math} e^{i\pi} + 1 = 0
:label: euler
```                                          #(just show this ``` inside github)
$$a^2 + b^2 = c^2$$(label: mymath3)

Error, when using numfig: empty ()

YX`SKBNGS2GQRY11Z8J5 7R

Fine, when disabled numfig: type as (n)

O%W0KEIC{6L1Q07F7SC%Y}V

However, that not what I wanted type (1.2).

Copy link

welcome bot commented Mar 9, 2024

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

@berlin2123
Copy link
Author

I've identified the real issue:

After add a new dollar math with a label, if only run make html or just only using sphinx-autobuild, it will be a empty () .
However, after make clean; make html, all lable will be fine.

It may be a bug related to the build process.

@berlin2123
Copy link
Author

the same issue for directive math too.
Regardless of whether the newly added formula is writen as directive or dollar, you have to run make clean before it works.

@berlin2123 berlin2123 changed the title Equation label of dollar math not work when math_numfig=True Equation label of math not work before make clean when math_numfig=True Mar 11, 2024
@berlin2123
Copy link
Author

So it could be a bug in sphix, not MyST ?

@chrisjsewell
Copy link
Member

Yep it sounds like it. Perhaps you could try a math directive in a restructuredtext file

@berlin2123
Copy link
Author

the same issue for adding math in a rst file.

@berlin2123
Copy link
Author

fixed by sphinx-doc/sphinx#11939

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants