README file from
GithubBetter MathJax for Obsidian
Better MathJax suggests MathJax commands and environments while you type math in Obsidian. You can change any built-in symbol and add your own.
Features
For all features, with screenshots, see Features.
- Suggestions in math. Type a command name in
$…$or$$…$$to see matching symbols with rendered previews. You do not have to type the backslash:fracsuggests\frac, andpmatsuggests a fullpmatrixblock. - Snippets with fields. Accept
\fracto insert\frac{@1@}{@2@}. PressTabto go to the next field. - Tab stops. In math,
Tabalso moves past closing brackets. It goes first past the brackets that the plugin or Obsidian added for you.Shift+Tabmoves back. - Macros from the note. Macros that a note defines with
\newcommand,\DeclareMathOperatorand similar commands become suggestions in that note. - Auto-braces. Type
_or^in math to get_{}or^{}. - Formatting. Indent environments, align
&columns and remove extra spaces. The math renders the same as before. - Math without indentation. One setting stops all indentation in math, from
Tab,Enter, snippets and the formatter. - Symbol reference. See the description, examples and related symbols of a command.
- Symbol browser. Search about 1,260 built-in symbols. Customize or disable any of them.
- Custom symbols. Add your own symbols in a form with a live preview. Keep them in the plugin settings, or in a note that you or an AI agent can edit.
- Backups. Before a change replaces or removes a symbol, the plugin saves a backup that you can restore.
Setup
- Install Better MathJax from Settings → Community plugins and turn it on.
- Open the plugin settings. The hotkey guide at the top shows the commands that have no hotkey.
- Assign hotkeys in Settings → Hotkeys. The plugin does not set hotkeys, but
Tab,Enterand the arrow keys work without them.
Upgrading from 1.x
Your settings and hotkeys stay the same, with one exception. These three commands have new IDs, so you must assign their hotkeys again:
- Select next placeholder
- Select previous placeholder
- Show symbol reference (before 2.0: Show mathjax helper on current selection)
The hotkey guide in the plugin settings shows the commands that have no hotkey.
The first time 2.0 starts, it imports the symbols from your old symbol note. The plugin finds the note from your 1.x settings, or uses symbols.md. A message tells you how many symbols it found. The plugin does not change the note, so you can send it to the trash after the import. To import a note in the old format later, use Import from note in the settings or run Import custom symbols from note.
Version 2.0 also makes these changes:
- It removes the fuzzy-search setting. One ranker puts an exact match first, then names that start with the query, then names that contain it. Letter case counts, so
\deltaand\Deltaare different suggestions. - It removes the debug-log setting.
- The subscript and superscript option now works while you type. Thus the Insert subscript/superscript commands are gone.
Development
For the build commands, the code layout and the release steps, see Development.
Credits
- Symbol data: MathJax TeX syntax reference (CC 2.5), completed from the MathJax command tables
- BetterLatexForObsidian, the first version (MIT)