MyST-Parser icon indicating copy to clipboard operation
MyST-Parser copied to clipboard

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

Open ethanc8 opened this issue 2 weeks ago • 0 comments

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 avatar Jun 28 '24 14:06 ethanc8