Pi in LaTeX (\pi)

π\pi
LaTeX command
\pi
Package
No package needed: built into LaTeX
Mode
Math mode only
Copy the Unicode character
πU+03C0

Where it is used

Lowercase Greek pi, the circle constant 3.14159…, also used for permutations and policies.

\pi is the ratio of a circle's circumference to its diameter, appearing in A = \pi r^2, e^{i\pi} + 1 = 0, and radian angles like \pi/2. Reinforcement learning uses \pi for a policy \pi(a \mid s), combinatorics uses it for a permutation, and number theory writes \pi(x) for the prime-counting function. The variant \varpi is a different glyph. When pi is a constant some style guides prefer an upright form, but standard LaTeX gives an italic \pi. Do not use the large operator \prod in place of \pi, or vice versa.

Also listed under: 三角法, 幾何学

Minimal compilable example

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

eiπ+1=0,A=πr2e^{i\pi} + 1 = 0, \quad A = \pi r^2
\documentclass{article}
\begin{document}
Pi: $\pi$

\[ e^{i\pi} + 1 = 0, \quad A = \pi r^2 \]
\end{document}

Related symbols

All ギリシャシンボル →

Frequently asked questions

How do I write Pi in LaTeX?
Type \pi in math mode, for example $e^{i\pi} + 1 = 0, \quad A = \pi r^2$. It works in plain LaTeX without loading any package.
Which package do I need for \pi?
None. \pi is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use \pi in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\pi$ in running text. If you only need the glyph in text, paste the Unicode character π instead (with XeLaTeX or LuaLaTeX and a font that has it).
Math poweredAIでLaTeXを書く

最高のAI LaTeXエディタ、Overleaf代替

Octreeは15以上の大学の研究者がAIを使って論文をより速く書くのを支援

  • AIで美しいTikZダイアグラムを生成
  • 画像をアップロードしてシームレスにLaTeXに変換
  • 論文の執筆とフォーマットに即座にサポートを取得