Open ethanc8 opened 3 months ago
I'm afraid I'm -1 on this; backslashes \
in commonmark have a special meaning of "escaping syntax" so these syntaxes would have a clear incompatibility with spec examples like https://spec.commonmark.org/0.30/#example-562
More so, there should really just be one clear way to add math in myst, and that is with the math
directive:
```{math}
a + b = c
the dollar syntax, which was already moved out of "core" myst and into an extension, is really just there as a compromise for people writing jupyter notebooks, where dollar math is unfortunately the norm.
Even this is already problematic in the way it defers parsing to mathjax: https://github.com/jupyterlab/jupyterlab/issues/8645
Describe the feature you'd like to request
I'd like to be able to start and end equations using
\[
\]
and\(
\)
. This was removed in 34.1. This would increase consistency with theamsmath
extension, as users could then feel free to use all of the most common equation delimiters,$
,$$
,\(
,\[
,\begin{equation}
, and\begin{equation*}
, in either LaTeX or MyST. This is especially important given that it's considered bad style or deprecated to use$
and$$
in LaTeX.My current use case is in generating API documentation from docstrings which were generated using Doxygen Markdown. I don't strictly need this feature, as I've just been replacing
\[
with\begin{equation*}
using a Python script (https://github.com/ethanc8/opencv-doc-parser), but it generally seems useful and reduces astonishment. Additionally, various other Markdown extensions include\[
\]
and\(
\)
, for example Mathpix Markdown, which Facebook's Nougat OCR outputs to.Describe the solution you'd like
A syntax extension
bracketmath
that can be turned on whendollarmath
is turned on, which allows to start and end equations using\[
\]
and\(
\)
. Whenamsmath
is turned on,bracketmath
should also be turned on, so that all of the LaTeX equation-starting macros are supported.Describe alternatives you've considered
No response