Skip to main content
v2026.11,986 entries · CC-BY 4.0

LaTeX Calligraphic: Mathcal and Script Guide

Format calligraphic and script alphabets in LaTeX with mathcal, mathscr, and mathalpha, including package setup and lowercase solutions for research papers.

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 the mathscr{...} command.
  • Euler Script: Declare usepackage{euscript} for EuScript{...}, or usepackage[mathscr]{euscript} to assign Euler script to mathscr{...}.
  • 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:

  1. 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).
  2. 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.

  3. 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 using label{...} and eqref{...}:
    begin{equation}
    label{eq:lagrangian}
    mathcal{L}(q, dot{q}, t) = T(dot{q}) - V(q)
    end{equation}
  4. Pass uppercase characters to the command: Write the desired Latin character inside curly braces, such as mathcal{A}, mathcal{B}, or mathcal{L}. Standard calligraphic commands only support capital letters A through Z.
  5. Create semantic macro shortcuts: In papers with dozens of functional symbols, avoid hardcoding raw font commands repeatedly. Use the standard newcommand mechanism 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 mathcal to mathscr, you only update a single definition in the preamble.

  6. 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:

  1. 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 in cmsy and fall back to characters from other symbol slots or produce unexpected shapes.

    Solution: To typeset lowercase calligraphic characters, load the mathalpha package 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
  2. 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 as amsfonts, amssymb, mathrsfs, bm, dsfont, and stmaryrd) quickly exhausts this limit.

    Solution: Replace individual ad-hoc font packages with the unified mathalpha package, which manages font allocation efficiently. Alternatively, compile your document with LuaLaTeX or XeLaTeX using usepackage{unicode-math}, which removes the 16-register constraint entirely.
  3. Problem: ! Undefined control sequence. mathscr

    Cause: The mathscr macro is not part of the standard LaTeX kernel; it requires an external package definition.

    Solution: Add usepackage{mathrsfs} to your document preamble. If you prefer Euler script mapped to mathscr, use usepackage[mathscr]{euscript} instead.
  4. Problem: Bold calligraphic letters fail (e.g., mathbf{mathcal{L}} renders regular bold Roman L).

    Cause: In LaTeX, mathbf overrides the current math alphabet rather than applying weight to it.

    Solution: Use the bm (bold math) package. Declare usepackage{bm} after all font packages in the preamble, then write bm{mathcal{L}} or bm{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

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about LaTeX Calligraphic: Mathcal and Script Guide

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →