Mathematical Formulas¶
TreeMk supports rendering mathematical formulas using LaTeX syntax powered by KaTeX. You can write both inline and display (block) formulas.
Inline Formulas¶
For inline formulas within text, wrap your LaTeX code with single dollar signs $...$:
Example:
Renders as:
The quadratic formula is \(x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}\) where \(a \neq 0\).
Display Formulas¶
For display formulas that appear on their own line, use double dollar signs $$...$$:
Example:
Renders as:
Common Mathematical Notation¶
Fractions and Roots¶
Superscripts and Subscripts¶
Greek Letters¶
Summation and Integration¶
Matrices¶
$$
\begin{pmatrix}
a & b \\
c & d
\end{pmatrix}
\quad
\begin{bmatrix}
1 & 2 & 3 \\
4 & 5 & 6
\end{bmatrix}
$$
Advanced Examples¶
Calculus¶
The derivative of a function:
Linear Algebra¶
System of equations:
Statistics¶
Normal distribution probability density function:
Tips¶
- Preview - Use the preview pane to see your formulas rendered in real-time
- Escaping - To show a literal dollar sign, use
\$ - Alignment - Use
\quadfor spacing or\begin{aligned}...\end{aligned}for multi-line alignment - Reference - For complete LaTeX syntax, see the KaTeX documentation
Troubleshooting¶
Formula not rendering? - Check for matching dollar signs - Ensure LaTeX syntax is correct - Look for unescaped special characters
Common LaTeX commands:
- \frac{numerator}{denominator} - fractions
- \sqrt{x} - square root
- ^ - superscript
- _ - subscript
- \left( ... \right) - auto-sized parentheses
- \text{...} - regular text inside formulas