mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-29 01:41:20 +08:00
0bbbdbcdb6
Certain environments in LaTeX will trigger math mode and can't occur within math mode: e.g., `align` or `equation`. Previously we "downshifted" these, parsing an `align` environment as a Math element with `aligned`, and an `equation` environment as a regular display math element. With this shift, we put these in Math inlines but retain the original environments. This works because: 1) texmath handles these environments just fine, 2) and so does MathJax; 3) when writing LaTeX we detect these environments in Math elements and emit them verbatim instead of putting them in `$..$` or `$$..$$`. Closes #9711. Closes #9296.
16 lines
216 B
Markdown
16 lines
216 B
Markdown
```
|
|
% pandoc -f latex -t native
|
|
\newcommand{\BEQ}{\begin{equation}}
|
|
\newcommand{\EEQ}{\end{equation}}
|
|
|
|
\BEQ
|
|
y=x^2
|
|
\EEQ
|
|
^D
|
|
[ Para
|
|
[ Math
|
|
DisplayMath "\\begin{equation}\ny=x^2\n\\end{equation}"
|
|
]
|
|
]
|
|
```
|