Calligraphic L (Lagrangian) in LaTeX (\mathcal{L})

L\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: التعلم الآلي والذكاء الاصطناعي

Minimal compilable example

Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.

S=∫L d4x,  L=12ϕ˙2−VS = \int \mathcal{L}\, d^4x, \; \mathcal{L} = \tfrac{1}{2}\dot{\phi}^2 - V
\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

All الفيزياء →

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.
Math poweredاكتب LaTeX باستخدام الذكاء الاصطناعي

أفضل محرر LaTeX بالذكاء الاصطناعي، بديل Overleaf

يساعد Octree الباحثين من أكثر من 15 جامعة على كتابة أوراق البحث بشكل أسرع باستخدام الذكاء الاصطناعي

  • أنشئ رسوم TikZ جميلة باستخدام الذكاء الاصطناعي
  • ارفع صورة وحولها إلى LaTeX بسلاسة
  • احصل على مساعدة فورية في كتابة وتنسيق أوراق البحث