mystmd: MD -> LaTeX: `gather` is not properly generated
Description
Consider the following document:
Some introduction text
\begin{gather}
E=mc^2
\end{gather}
The issue is that the LaTeX document that it generates becomes:
Some introduction text
\begin{equation}
\begin{gather}
E=mc^2
\end{gather}
\end{equation}
This should not be surrounded by equation block
Proposed solution
- Distinguish which environments need to be within a math environment, e.g.
gatheredvsgather - Distinguish which environments handle numbering
gatheredvsgather - Distinguish when we want something to be numbered and not
gathervsgather*
Then conditionally add either equation or equation* or nothing to the LaTeX document
About this issue
- Original URL
- State: closed
- Created 4 months ago
- Comments: 17 (10 by maintainers)
Could
mathGroupbehave likeadmonitionsin that on the markdown side it’s a container like the\begin{}environments that we can pass specificclass: align? Something likewould generate
Not sure how to deal with
labelin that case either unless we just allow them to be defined in there as well and just parse the contents of it from TeX and back.Yes, there are two questions here:
I think we should look to fix this as-is, and discuss longer-term AST changes in a new issue 😃
I think we should try and strip the ASMMath environment so that we can add labels. This makes things more complicated, but is the “right” thing to do imo.
@LecrisUT I just had a meeting with @rowanc1 where it became clear I think I misunderstood the document type that you’re using; I’d thought you were using LaTeX -> LaTeX, but it seems like you’re actually reading MyST -> LaTeX. I’m just working on some other PRs at the moment, but I’ll circle back around to this shortly.