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

LaTeX blocks with tags don't render correctly #42

Closed
amake opened this issue Apr 28, 2021 · 10 comments
Closed

LaTeX blocks with tags don't render correctly #42

amake opened this issue Apr 28, 2021 · 10 comments
Labels
bug Something isn't working

Comments

@amake
Copy link
Owner

amake commented Apr 28, 2021

As reported in #22 (comment), a LaTeX block with a tag (implied or otherwise) will render with the tag overlapping the main body:

\begin{equation}
a + b = c
\end{equation}

IMG_1927

@amake amake added the bug Something isn't working label Apr 28, 2021
@amake
Copy link
Owner Author

amake commented Apr 28, 2021

I think it's going to be quite hard to get this to work with all possible layout scenarios:

  • LaTeX blocks that are too wide should be allowed to scroll horizontally; in that case, where should the tag go?
  • For LaTeX blocks that are narrower than the window, must the tag hug the right side?

Prior to v1.18.0 the equation environment was simply dropped, so this was not an issue (the tag was suppressed). Suppressing the tag through some mechanism could be the best solution if people aren't wedded to the tag being shown.

@amake
Copy link
Owner Author

amake commented Apr 28, 2021

Things that are easy to do:

  • Remove tags entirely
  • Show tags at a fixed offset from the right edge of the main content (not aligned to the right of the screen)

@amake
Copy link
Owner Author

amake commented Apr 28, 2021

@fountainer Can you comment on what you expect in terms of how tags should be presented?

@fountainer
Copy link

fountainer commented Apr 28, 2021

@fountainer Can you comment on what you expect in terms of how tags should be presented?

I personally don't care much about the tags. I prefer the solution that tags are removed. However, I also accept other solutions as long as they don't overlap with the formulas.

@fountainer
Copy link

fountainer commented Apr 29, 2021

Another option is to put tags on the left side of the formulas.

@amake
Copy link
Owner Author

amake commented Apr 29, 2021

I think I will go with

Show tags at a fixed offset from the right edge of the main content (not aligned to the right of the screen)

and if you don't want tags shown at all then you can use equation* instead of equation.

@amake
Copy link
Owner Author

amake commented Apr 30, 2021

This is addressed in v1.18.1, which is now available in Test Flight.

@fountainer
Copy link

The equation numbers are always one. Is it a bug?
IMG_C2645E4E9BD0-1

@amake
Copy link
Owner Author

amake commented Apr 30, 2021

It's a limitation of the current implementation. Each block has its own context, and I don't know how to share the context such that the numbering could continue.

@amake
Copy link
Owner Author

amake commented Apr 30, 2021

Actually it seems that it's a limitation of the rendering engine itself. If you want meaningful tags you need to specify the contents manually like \tag{foo}.

This is wrong; KaTeX can correctly auto-number equations. I've opened amake/flutter_tex_js#9 to track this, but I don't think I'm going to be able to solve this any time soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants