h16nning / typora-gitbook-theme

This is a Typora theme is inspired by gitbook.com. Most of the user interface has been overhauled. It contains three variants: two light variants and one dark theme.
GNU General Public License v3.0
305 stars 51 forks source link

Minor Math Block Counter Error #10

Closed Yuxin-Ren-SZ closed 3 years ago

Yuxin-Ren-SZ commented 3 years ago

Hi! Again, thank you for bring this theme to us and helped me a lot!

Running on Win 10; Version 1.6.1

When I add the math block at first, the counter is (1), as it should be. However, after I modified it somehow, it jumpped to (2)

This is the oringal one which display correct

$$ prod_{i=1}^n p_i^{-p_i},\ where\ D\ is\ Diversity\ Index $$

This is after modification:

$$ D=\prod_{i=1}^n p_i^{-p_i},\ where\ D\ is\ Diversity\ Index $$

If you enter it correctly at the first time, this bug will not appear. I tried several time later, but I still can't tell what action it is.

image

Yuxin-Ren-SZ commented 3 years ago

Got some idea about how did it happened. It seems to related to the quote block, too. After I start a math block in the quote block, typora automatically add on a blank line after the math block and in the quote block like this:

> $$
> MATH PART
> $$
>

If I click somewhere outside the block, the counter may jump to (2)

h16nning commented 3 years ago

Hello @Williams-Ren, I could reproduce the issue, both on macOS and Windows. I noticed some other situations in which it occurs too. However, this seems to be unrelated to this theme. As it appears in different themes too, including the preinstalled Typora ones. To give an example, here is a screenshot of the Newsprint theme:

Bildschirmfoto 2021-01-14 um 18 09 30

It is probably some kind of Typora (or maybe even a MathJax) issue. To my knowledge there is not really a way to fix this just using css :/

I briefly looked at some of the Typora issues about auto numbering and I haven't found this specific problem on their repo. I would consider reporting the issue there.

Here are the links to the issue pages: https://github.com/typora/typora-issues/issues https://github.com/mathjax/MathJax/issues?q=is%3Aissue+auto+number