Calligraphic L (Lagrangian) in LaTeX (\mathcal{L})
- LaTeX command
\mathcal{L}- Package
- No package needed: built into LaTeX
- Mode
- Math mode only
Where it is used
Calligraphic L, the standard symbol for a Lagrangian density and, in machine learning, a loss function.
Field theory writes the action as S = \int \mathcal{L}\, d^4x, with the Euler-Lagrange equation \partial_\mu \frac{\partial \mathcal{L}}{\partial(\partial_\mu \phi)} = \frac{\partial \mathcal{L}}{\partial \phi}. Classical mechanics often uses plain L for the Lagrangian itself and reserves \mathcal{L} for densities. Machine-learning papers use \mathcal{L}(\theta) for a loss, and engineers use it for the Laplace transform \mathcal{L}\{f\}(s). In optimization, the Lagrangian function with multipliers is also \mathcal{L}(x, \lambda). Introduce whichever meaning you need explicitly. Its counterpart via the Legendre transform is the Hamiltonian \mathcal{H}.
Also listed under: 機械学習・AI
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Calligraphic L (Lagrangian): $\mathcal{L}$
\[ S = \int \mathcal{L}\, d^4x, \; \mathcal{L} = \tfrac{1}{2}\dot{\phi}^2 - V \]
\end{document}Related symbols
- Calligraphic H (Hamiltonian)
\mathcal{H} - D'Alembertian
\Box - Psi (Upper)
\Psi - Laplacian
\nabla^2 - Omega
\omega - Nabla
\nabla
Frequently asked questions
- How do I write Calligraphic L (Lagrangian) in LaTeX?
- Type \mathcal{L} in math mode, for example $S = \int \mathcal{L}\, d^4x, \; \mathcal{L} = \tfrac{1}{2}\dot{\phi}^2 - V$. It works in plain LaTeX without loading any package.
- Which package do I need for \mathcal{L}?
- None. \mathcal{L} is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
- Can I use \mathcal{L} in text mode, or only in math mode?
- Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\mathcal{L}$ in running text.