WIP: FEATURE: custom inline and block math delimiters #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Per several user requests, this PR adds two new settings for users to specify custom (possibly multiple) math delimiters. Note that users using the old plugin have no good way to upgrade without this functionality.
The new code also handles things like
\begin{align}...\end{align}
. These must be treated as a special case because they need to be passed to MathJax.Here's my test code:
And here's how it looks:
(note that the \begin{align} does what it's supposed to do, i.e. align multiple equations on
=
)TODO / TO DISCUSS:
The current approach does not allow for different delimiters for beginning and end, such asDONE ✔️\[ display \]
. If we want to support all that's out there, we should allow this.The current code only allows for single-character inline math delimiters (because that's how it was written originally), but one of standard TeX syntax for inline math is
\( inline \)
so we should allow this.Instead of requiring admins to insert every
\begin{*}...\end{*}
environment they want to support, we could have a switch to process every block math of this form. This would be MathJaX only, KaTeX does not support these, although it might in near future. DONE: ✔️