Skip to content

LaTeX Annotations

LaTeX annotations let you place typeset equations on the canvas. Molkit compiles your input with MathJax 4 and stores the result as a scalable SVG, so equations stay sharp at any zoom level and export cleanly. Input is math-mode TeX: write \frac{a}{b} or \Delta G = \Delta H - T\Delta S directly, with no $...$ delimiters and no document preamble. Use \text{...} for words inside an equation and \ce{...} (mhchem) for chemical formulas and reactions.

Inserting an equation

Three ways to open the LaTeX editor:

  • Click the LaTeX tool in the toolbar (the summation icon), then click the canvas where you want the equation. The click point becomes the insertion point, and grid snap applies if the grid is active.
  • Press M to activate the LaTeX tool, then click the canvas.
  • Choose Insert > LaTeX Equation to open the editor and place the result at the center of the view.

In the editor, press Ctrl+Enter to insert, or Esc to cancel. After inserting, Molkit switches back to the Select tool and selects the new annotation.

The editor dialog

The editor shows a live preview that re-renders about 300 ms after you stop typing. MathJax errors appear in the preview pane so you can fix syntax before inserting. A layout toggle in the header switches between stacked and side-by-side arrangements of the input and preview.

The editor also has an Animate checkbox: turn it on and paste a multi-step derivation (an align* block) to import it as a step-by-step animation instead of a static equation, with the insert button changing to Import Animation. See Animation States for working with the result.

Snippet library

Tabs below the input insert common fragments at the cursor:

  • Math: \frac{}{}, \sqrt{}, sums, integrals, limits, matrices, align and cases environments
  • Greek: lowercase and uppercase letters such as \alpha, \Delta, \Sigma
  • Arrows: \rightarrow, \Rightarrow, \xrightarrow{}, and others
  • Accents: \hat{}, \vec{}, \overline{}, braces
  • Chem: mhchem helpers like \ce{H2O}, \ce{<=>}, and \pu{kJ/mol}

A Recent tab keeps your last ten inserted equations. The gear button lists available LaTeX packages: base, ams, color, and newcommand are always loaded; mhchem, cancel, physics, mathtools, braket, and several others load automatically on first use. You can also load any extension inline with \require{package}.

Fonts and colors

A font dropdown offers eleven MathJax font sets, including Computer Modern (default), STIX 2, Latin Modern, DejaVu, Fira, and TeX Classic. Your choice is remembered for future equations. Two swatches set the equation color and a background fill (transparent by default); the preview updates immediately, and each swatch has a reset button. The recolor only replaces black glyphs, so explicit \color{red}{...} markup is preserved.

The footer also has Copy (PNG to clipboard) and Export buttons that save the previewed equation as a standalone SVG or PNG file, independent of the canvas.

Editing and resizing

Double-click a LaTeX annotation with the Select tool, or right-click it and choose Edit LaTeX Equation…, to reopen the editor with its source, font, and colors loaded. Click Update to re-render; if you had resized the annotation, the new render keeps your scale ratio.

Drag the selection handles to resize. LaTeX annotations always scale proportionally so the typesetting is never stretched. The properties panel adds numeric width and height fields with an aspect-ratio lock, an opacity slider, an optional border with color and width controls, and an Edit LaTeX button that reopens the editor like double-click does.

Rendered equations are vector SVG, so they pass through SVG export at full quality. See the font embedding page if you need exported text to match across machines.

See also