-
Notifications
You must be signed in to change notification settings - Fork 115
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 numbering change when fold equations with <details> #879
Comments
Is what you would like to have that when you fold you have
and when you unfold it's 1-2-3 ? sorry I don't really understand what you're expecting. What's for sure is that all the references are generated before the document is displayed, not on the fly, so here Franklin generates three references because there are three labels. Maybe you can have some CSS tricks in terms of how the |
ah no I imagine you want Yeah you'll have to play with how the |
This works but is probably not very nice, maybe if you just give a special class to details {
counter-increment: eqnum;
}
details[open] summary {
counter-increment: eqnum -1;
} foldedunfoldedNotesI think that's what you want right? you could tweak this by having several classes indicating by how much there should be an increment like if in your detail there's 2 equations, there could be a class |
The problem is that the reference and the equation mismatch when the content is folded. I don't have a strong preference for one of them: I think A is already enough for me, but now I get a dynamic label. Anyway, thanks for your advice on how to make B work. I think it could be a feature if |
Ok so just to check: With the trick I gave above in the CSS, the number corresponds to the references in folded/not folded; the bottom equation will always show as number (3). I assumed this is what you wanted? I.e. all references are correct so what I did is (A) not (B). In terms of dynamic, I can basically already tell you that it's not going to happen any time soon. Franklin generates fully static content meaning that no matter what you do on the website, everything is already pre-baked; you can get dynamic stuff if you have some clever CSS (as above) or some additional JS but it's not Franklin that will do the dynamic stuff. PS: it's possible that I misunderstood what you're suggesting, in this case I apologise and please kindly tell me again 😄 |
I’m sorry. I was me who misunderstood. I used to think that is the solution for B. I will try tomorrow since it is 12:00am here |
It does work although with a lot of handmade adjustments. I search it on Google and Github. And I find that the fundamental problem is that KaTeX does not provide good automatic numbering support, as stated in KaTeX/KaTeX#350. The automatic equation numbering in The good news is that Mathjax provides automatic equation numbering. I will try that later. |
MathJax performed perfectly as I expected. foldedunfoldedRenderI find that you suggest tex-svgtex-mml-chtml |
Good if MathJax does what you expect! out of curiosity did you try the CSS trick I mentioned earlier with Anyway there may be other reasons why you're not considering this so maybe I'm missing something. Also if MathJax works well for you, that's great (you might get some other discrepancies but overall it should be fine). Note that the KaTeX numbering feature is a distraction, the numbering as is done in Franklin is a CSS trick that comes from the KaTeX community, is well known and works very reliably with only one difficulty that I know of which is the positioning of the number when you have multiline equations or overflowing equations. PS: I don't see the difference between your last two screenshots :) |
Yes, I have tried that and it works. I know it is well known after searching but I think this method needs an extra operation every time I fold an equation. (I answer it here) So I decided to go to the MathJax side. If I have any problem with MathJax, I will try to solve it and give feedback here or in
Oh, that is probably because my screen is a low dpi (dot per inch) one, 27inch but 1080p. The first one is a little bit blur though still very readable. The second one is clear and sharp. They are in fact quite different in visual experience. Perhaps I should also mention I use Arch Linux and KDE desktop environment with AMD GPU. |
thanks for the feedback! |
I found that I fold an equation with
<details>
, the numbering for the equations after the folding content will all shift forward. I don't know whether this is a feature or a bug. In fact, I love the way the site interacts with me.However
\eqref
is broken in this case, because it always gives the number as everything is unfolded.An example
A markdown example
The text was updated successfully, but these errors were encountered: