Skip to content

LaTeX Annotations

To put ΔG = ΔH − TΔS beside an energy diagram, or an equilibrium constant under a reaction arrow, add a LaTeX annotation. Molkit compiles your input with MathJax 4 and stores the result as SVG, which stays sharp at any zoom and exports as vector graphics. 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

Click the LaTeX tool in the toolbar (the summation icon) or press M, then click the canvas where the equation should go. The click point becomes the insertion point, and grid snap applies if the grid is on. Insert > LaTeX Equation… opens the same editor and places 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.

A multi-step derivation can also become an animation that plays one line at a time. Choose Insert > Import LaTeX Solution… (Ctrl+Shift+L), which opens this editor with its Animate derivation (step-by-step) checkbox already on, or tick that box yourself. Paste the steps as an align* block and the insert button changes to Import Animation. Molkit checks what each line does to the one before it and captions every step. See LaTeX solutions for the whole workflow.

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 STIX 2 (default), Computer Modern, Latin Modern, DejaVu, Fira, and TeX Classic. Your choice is remembered for future equations, and an equation you reopen keeps its own font. 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 pass through SVG export as vector graphics. If exported text must look the same on every machine, see Font embedding.

See also