Our LaTeX macros support LaTeX as well as mhchem.
There are 2 LaTeX macros available:
LaTeX (Block) for block level equations
LaTeX (Inline) for inline equations
Example syntax
LaTeX syntax
Example 1 - Pythagorean theorem
Macro body
Code Block |
---|
x^2 + y^2 = z^2 |
Output:
Example 2 - Mass-energy equivalence
Macro body
Code Block |
---|
E=mc^2 |
Output:
Example 2 - Binomial coefficient
Macro body:
Code Block |
---|
\binom{n}{k} = \frac{n!}{k!(n-k)!} |
Output:
Example 4 - Reference
Description | Syntax | Output |
---|---|---|
Greek letters |
| |
Binary operators |
| |
Relation operators |
| |
Others |
|
mhchem syntax
Comprehensive mhchem syntax documentation is available here.
Chemical equations
Example 1.
Macro body:
Code Block |
---|
\ce{CO2 + C -> 2 CO} |
Output:
Example 2.
Macro body:
Code Block |
---|
\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-} |
Output:
Chemical formulae
Example 1.
Macro body:
Code Block |
---|
\ce{H2O} |
Output:
Example 2.
Macro body:
Code Block |
---|
\ce{Sb2O3} |
Output:
Charges
Example 1.
Macro body:
Code Block |
---|
\ce{CrO4^2-} |
Output:
Example 2.
Macro body:
Code Block |
---|
[AgCl2]- |
Output:
Nuclides, isotopes
Example 1.
Macro body:
Code Block |
---|
\ce{^{227}_{90}Th+} |
or
Code Block |
---|
\ce{^227_90Th+} |
Output:
Example 2.
Macro body:
Code Block |
---|
\ce{^{0}_{-1}n^{-}} |
or
Code Block |
---|
\ce{^0_-1n-} |
Output:
It might be ambiguous whether a superscript belongs to the left or right element. There is automatic detection (digits only = mass number = belongs to right side), but to make sure you can type {}
as a separator.
Example 3.
Macro body:
Code Block |
---|
\ce{H{}^3HO} |
or
Code Block |
---|
\ce{H^3HO} |
Output:
Reaction arrows
Example 1.
Macro body:
Code Block |
---|
\ce{A -> B} |
Output:
Example 2.
Macro body:
Code Block |
---|
\ce{A <- B} |
Output:
Example 3.
Macro body:
Code Block |
---|
\ce{A <-> B} |
Output:
Not to be used according to IUPAC and ACS
Example 4.
Macro body:
Code Block |
---|
\ce{A <--> B} |
Output:
Example 5.
Macro body:
Code Block |
---|
\ce{A <=> B} |
Output:
Example 6.
Macro body:
Code Block |
---|
\ce{A <=>> B} |
Output:
Example 7.
Macro body:
Code Block |
---|
\ce{A <<=> B} |
Output:
Each arrow can take two optional arguments: one for above and one for below. The arrow arguments use the same input syntax as the \ce
command.
Example 8.
Macro body:
Code Block |
---|
\ce{A ->[H2O] B} |
Output:
Example 9.
Macro body:
Code Block |
---|
A ->[{text above}][{text below}] B} |
Output:
Example 10.
Macro body:
Code Block |
---|
\ce{A ->[$x$][$x_i$] B} |
Output:
Parentheses, brackets, braces
Use parentheses ( )
and brackets [ ]
normally. Write braces as \{ \}
.
Example 1.
Macro body:
Code Block |
---|
\ce{(NH4)2S} |
Output:
Example 2.
Macro body:
Code Block |
---|
\ce{[\{(X2)3\}2]^3+} |
Output:
For large parentheses, \left
and \right
macros need to be in the same math environment, so you might have to put \ce
into $
into \ce
, but that’s fine.
Example 3.
Macro body:
Code Block |
---|
\ce{CH4 + 2 $\left( \ce{O2 + 79/21 N2} \right)$} |
Output: