Allow for custom math delimiter

Use case or problem

Standard LaTeX math delimiter is \(...\) and \[...\]. Currently, obsidian only supports the legacy $...$ and $$...$$ due to markdown having \(, \), \[, and \] as registered escape sequence.
Allowing a custom math delimiter to invoke LaTeX would allow users to choose if they want to use the outdated TeX math syntax ($...$ and $$...$$), the modern LaTeX syntax (\(...\) and \[...\]) or another delimiter of their choice.

Proposed solution

Create a setting where users could choose which delimiter they want to use for math.
Settings could be the following

  • Default ($...$ and $$...$$)
  • Modern(\(...\) and \[...\]) with the caveat that markdown native \(, \), \[, \] would be written using their HTML entities (, ), [, and ] instead. (just like \( and \), (, ) would be needed in extremely niche situations: an escaped parenthesis right after a link, or inside a link)
  • Cusom (use choose a custom delimiter)

It could also be controlled at the note-level with math-inline-delimiter and math-equation-delimiter attributes.

MathJax uses \(...\) and \[...\] as default delimiters anyways, and it also supports custom delimiters, implementing this feature should be straightforward.

1 Like

Here are two related FRs:

↑ comment to ↑