Written and maintained by CASRAI Editorial Board
Published
On this page
Quick answer: In LaTeX math mode, write calligraphic letters with the built-in command mathcal{A}, which renders uppercase Latin characters (A–Z) in Computer Modern Calligraphic. For formal script letters with sharper slants and flourishes, load usepackage{mathrsfs} and write mathscr{A}. For Euler script, load usepackage{euscript} and use EuScript{A}. If your manuscript requires lowercase calligraphic letters or unified scaling, use usepackage[cal=boondox]{mathalpha}.
What it is used for in research
Calligraphic and script typefaces serve as essential mathematical alphabets across quantitative research disciplines. Because academic papers frequently combine scalar variables, vectors, matrices, operators, and spaces within the same derivation, standard italic Latin letters quickly become overcrowded. Calligraphic notation provides an unmistakable visual distinction for higher-level algebraic structures, functionals, and measure spaces.
- Physics and Engineering: Researchers designate the Lagrangian density as $mathcal{L}$, the Hamiltonian operator as $mathcal{H}$, and magnetic field intensity as $mathcal{H}$. In thermodynamics and quantum mechanics, script letters help separate coordinate frames and canonical ensembles from ordinary state variables. When expressing integral transforms, see our guide on Laplace transform notation for styling transform kernels alongside calligraphic symbols.
- Statistics and Machine Learning: Calligraphic letters represent loss functions $mathcal{L}(theta)$, hypothesis spaces $mathcal{H}$, sample spaces $mathcal{S}$, datasets $mathcal{D} = {(x_i, y_i)}_{i=1}^N$, and Gaussian process priors $mathcal{GP}(m, k)$. In statistical decision theory, parameter spaces and risk functionals rely on distinct calligraphic alphabets to prevent ambiguity against indexed data matrices.
- Pure Mathematics and Theoretical Computer Science: Category theory, differential geometry, and algebraic topology rely heavily on script alphabets for categories $mathcal{C}$ and $mathcal{D}$, sheafs of rings $mathscr{F}$ and $mathscr{O}_X$, power sets $mathcal{P}(X)$, and Borel $sigma$-algebras $mathcal{B}$. In complex derivations spanning multiple lines, researchers often format these equations inside multiline equation environments to keep derivations structured.
- Information Theory and Cryptography: Authors use calligraphic symbols to denote finite alphabets $mathcal{X}$ and $mathcal{Y}$, message spaces $mathcal{M}$, and cipher suites $mathcal{K}$.
When authoring papers that involve multiple related concepts, such as a vector of field operators, authors combine calligraphic bases with standard vector accents. Consult our guide on formatting vector notation for combining accents like vec{mathcal{F}} or boldsymbol{mathcal{X}} cleanly.
Install or access (official source only)
The standard LaTeX calligraphic command mathcal is built directly into the LaTeX kernel and the Computer Modern Symbols font (cmsy). It requires no package installation or preamble declaration in any standard distribution.
For specialized calligraphic and script alphabets, modern TeX distributions (TeX Live, MacTeX, and MiKTeX) distribute the relevant packages in their standard package repositories via the official Comprehensive TeX Archive Network (CTAN). Web-based LaTeX editors such as Overleaf, TeXPage, and Papeeria provide these packages pre-installed in their standard compilation images.
To access formal script and alternate calligraphic alphabets in your manuscript, declare the relevant package in your document preamble before begin{document}:
- Standard Calligraphic: Built-in; no package needed for
mathcal{...}. - Ralph Smith’s Formal Script (RSFS): Declare
usepackage{mathrsfs}to activate themathscr{...}command. - Euler Script: Declare
usepackage{euscript}forEuScript{...}, orusepackage[mathscr]{euscript}to assign Euler script tomathscr{...}. - Unified Math Alphabets: Declare
usepackage[cal=euler, scr=rsfs]{mathalpha}to load and scale multiple script styles without font collisions.
Step-by-step task (numbered, with menu names or commands exactly as in the current docs)
Follow these steps to configure, write, and manage calligraphic math in your research manuscript:
- Identify your required math alphabet: Review your target journal’s formatting guidelines. Determine whether your derivation needs standard rounded calligraphic (
mathcal), ornate formal cursive (mathscr), or an upright pen style (EuScript). - Declare package dependencies in the preamble: If using formal script, open your document preamble and insert:
documentclass{article} usepackage{amsmath} usepackage{mathrsfs}If you only need standard uppercase calligraphic characters,
usepackage{amsmath}is sufficient. - Enter math mode: Place calligraphic commands inside inline delimiters
$...$or displayed equation environments. When numbering key equations for cross-referencing, follow best practices for labeling and numbering equations usinglabel{...}andeqref{...}:begin{equation} label{eq:lagrangian} mathcal{L}(q, dot{q}, t) = T(dot{q}) - V(q) end{equation} - Pass uppercase characters to the command: Write the desired Latin character inside curly braces, such as
mathcal{A},mathcal{B}, ormathcal{L}. Standard calligraphic commands only support capital letters A through Z. - Create semantic macro shortcuts: In papers with dozens of functional symbols, avoid hardcoding raw font commands repeatedly. Use the standard
newcommandmechanism to define semantic shortcuts in your preamble (see our guide on creating custom macros):newcommand{Lagr}{mathcal{L}} newcommand{Ham}{mathcal{H}} newcommand{Fourier}{mathcal{F}} newcommand{Sheaf}{mathscr{F}}Using semantic macros ensures that if a reviewer or journal editor requests changing from
mathcaltomathscr, you only update a single definition in the preamble. - Compile and inspect output: Compile your document using pdfLaTeX, XeLaTeX, or LuaLaTeX. Check that the rendered PDF glyphs display high-contrast lines and correct character spacing.
Output and how to read it
Understanding the visual distinction between different calligraphic and script alphabets is critical for clarity in mathematical prose. The table below outlines how common research symbols render across standard LaTeX commands:
| Symbol Name | LaTeX Command | Required Package | Visual Characteristics | Typical Research Application |
|---|---|---|---|---|
| Lagrangian | mathcal{L} |
None (built-in) | Rounded loop, moderate slant, classic Computer Modern serif base | Classical mechanics, field theory, variational optimization |
| Hamiltonian | mathcal{H} |
None (built-in) | Double vertical stem with calligraphic cross-flourish | Quantum mechanics, control theory, dynamical systems |
| Fourier Transform | mathcal{F} |
None (built-in) | Open top curve with curved horizontal bar | Signal processing, harmonic analysis, partial differential equations |
| Formal Sheaf | mathscr{F} |
mathrsfs |
Steep 25° slant, high stroke contrast, pronounced cursive loops | Algebraic geometry, sheaf cohomology, complex analysis |
| Euler Dataset | EuScript{D} |
euscript |
Upright, pen-drawn aesthetic, unslanted curves designed by Zapf | Applied probability, categorical logic, machine learning priors |
| Borel Sigma-Algebra | mathcal{B} |
None (built-in) | Classic rounded double-lobed capital letter | Measure theory, integration, stochastic processes |
| Power Set | mathcal{P} |
None (built-in) | Curved upper bowl with open tail | Set theory, combinatorics, discrete mathematics |
When inspecting output, ensure that distinct concepts use distinct typefaces. For example, if $mathcal{F}$ represents a sigma-algebra filtration, using $mathscr{F}$ for a sheaf over a manifold prevents readers from confusing probabilistic conditioning with geometric structures.
Troubleshooting
Below are solutions to the four most frequent errors encountered when working with calligraphic latex in academic documents:
- Problem: Lowercase letters produce strange symbols or garbled output (e.g.,
mathcal{a}yields non-script glyphs).
Cause: The default Computer Modern Symbols font (cmsy) only maps ASCII positions 65 to 90 (uppercase A–Z). Lowercase positions are unassigned incmsyand fall back to characters from other symbol slots or produce unexpected shapes.
Solution: To typeset lowercase calligraphic characters, load themathalphapackage with an alphabet that includes lowercase glyphs, such as Boondox or Dutchcal:usepackage[cal=boondox]{mathalpha} % Now mathcal{a}, mathcal{b}, mathcal{z} render valid lowercase calligraphic letters - Problem:
! LaTeX Error: Too many math alphabets used in version normal.
Cause: Classic 8-bit TeX engines (pdfLaTeX) allow a maximum of 16 math alphabet registers per document. Loading multiple math packages (such asamsfonts,amssymb,mathrsfs,bm,dsfont, andstmaryrd) quickly exhausts this limit.
Solution: Replace individual ad-hoc font packages with the unifiedmathalphapackage, which manages font allocation efficiently. Alternatively, compile your document with LuaLaTeX or XeLaTeX usingusepackage{unicode-math}, which removes the 16-register constraint entirely. - Problem:
! Undefined control sequence. mathscr
Cause: Themathscrmacro is not part of the standard LaTeX kernel; it requires an external package definition.
Solution: Addusepackage{mathrsfs}to your document preamble. If you prefer Euler script mapped tomathscr, useusepackage[mathscr]{euscript}instead. - Problem: Bold calligraphic letters fail (e.g.,
mathbf{mathcal{L}}renders regular bold Roman L).
Cause: In LaTeX,mathbfoverrides the current math alphabet rather than applying weight to it.
Solution: Use thebm(bold math) package. Declareusepackage{bm}after all font packages in the preamble, then writebm{mathcal{L}}orbm{mathscr{F}}.
Free alternatives (table)
Researchers can choose from several free, open-source CTAN packages to customize math script typography. All packages listed below are included in standard TeX Live and MiKTeX installations:
| Package Name | Primary Command | Font Origin | Lowercase Available | Best Use Case |
|---|---|---|---|---|
Standard LaTeX (cmsy) |
mathcal{A} |
Computer Modern (Knuth) | No (A–Z only) | Standard journal articles without custom preamble requirements |
mathrsfs |
mathscr{A} |
Ralph Smith’s Formal Script | No (A–Z only) | Formal mathematics, sheaf theory, and quantum field theory |
euscript / eucal |
EuScript{A} / mathcal{A} |
Euler Script (Hermann Zapf) | No (A–Z only) | Upright, distinctive math notation designed to complement Euler fonts |
mathalpha |
mathcal{A}, mathscr{A} |
Unified font manager (20+ styles) | Yes (with boondox, dutchcal) |
Complex manuscripts requiring lowercase script and tight scaling control |
urwchancal |
mathcal{A} |
URW Chancery | Yes (a–z and A–Z) | Casual cursive and informal script notation in engineering notes |
unicode-math |
symcal{A}, symscr{A} |
OpenType Math (STIX Two, Latin Modern) | Yes (full Unicode math blocks) | Modern LuaLaTeX and XeLaTeX workflows with native OpenType fonts |
FAQ
How do I write calligraphic latex in an equation?
Within any math environment (such as $...$, [...], or begin{equation}), wrap your uppercase letter in mathcal{...}. For instance, $mathcal{E} = -frac{dPhi}{dt}$ typesets electromotive force using standard calligraphic notation.
What is the difference between mathcal and mathscr in LaTeX?
The command mathcal produces standard Computer Modern calligraphic glyphs, which have a moderate slant and rounded terminals. The command mathscr (provided by the mathrsfs package) produces Ralph Smith’s Formal Script, characterized by a sharp 25-degree rightward slant, high stroke contrast, and ornate flourishes.
Can I use lowercase letters with mathcal?
Not in standard LaTeX. The default Computer Modern font only contains uppercase calligraphic glyphs; calling mathcal{a} yields unintended symbols. To use lowercase calligraphic letters, load usepackage[cal=boondox]{mathalpha} or usepackage{urwchancal}.
How do I make a calligraphic symbol bold?
Do not use mathbf{mathcal{L}}, which reverts to standard Roman bold. Instead, include usepackage{bm} in your preamble and write bm{mathcal{L}} or bm{mathscr{F}} to generate bold script characters.
Does usepackage{mathrsfs} replace mathcal?
No. The mathrsfs package defines a new, independent macro mathscr while leaving mathcal untouched. You can use both commands alongside each other in the same document.
Sources (official docs)
- Knappen, J. (1996). The mathrsfs package: RSFS fonts in LaTeX. Comprehensive TeX Archive Network (CTAN). Available at: https://ctan.org/pkg/mathrsfs
- American Mathematical Society. (2009). The eucal package: Euler script font. Comprehensive TeX Archive Network (CTAN). Available at: https://ctan.org/pkg/eucal
- Sharpe, M. (2024). The mathalpha package: Unified math alphabet loader. Comprehensive TeX Archive Network (CTAN). Available at: https://ctan.org/pkg/mathalpha
- Pakin, S. (2024). The Comprehensive LaTeX Symbol List. Comprehensive TeX Archive Network (CTAN). Available at: https://ctan.org/pkg/comprehensive
- Overleaf. (2024). Mathematical fonts. Overleaf Documentation. Available at: https://www.overleaf.com/learn/latex/Mathematical_fonts







