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

Re-add support for \[, \], \(, and \) #941

Open
ethanc8 opened this issue Jun 28, 2024 · 1 comment
Open

Re-add support for \[, \], \(, and \) #941

ethanc8 opened this issue Jun 28, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@ethanc8
Copy link

ethanc8 commented Jun 28, 2024

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 the amsmath 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 when dollarmath is turned on, which allows to start and end equations using \[ \] and \( \). When amsmath 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

@ethanc8 ethanc8 added the enhancement New feature or request label Jun 28, 2024
@chrisjsewell
Copy link
Member

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: jupyterlab/jupyterlab#8645

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants