Prime in LaTeX (p)
- LaTeX command
p- Package
- No package needed: built into LaTeX
- Mode
- Text and math mode
Where it is used
Lowercase italic p, the conventional letter for a prime number in number theory.
By convention p, and q for a second prime, denote primes, so statements like 'for every prime p' or sums and products indexed by p need little further explanation. Euler's product \zeta(s) = \prod_p (1 - p^{-s})^{-1} is the classic case where the index runs over primes implicitly. Typing p in math mode gives the italic letter; keep it in math mode in prose too, so it matches the displays. To avoid ambiguity with probabilities or p-values, state the convention early. Prime powers are written p^k, and the p-adic numbers \mathbb{Q}_p.
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\begin{document}
Prime: $p$
\[ \zeta(s) = \prod_{p} \frac{1}{1 - p^{-s}} \]
\end{document}Related symbols
- Prime Notation
p_n - Phi Function
\phi(n) - Perpendicular
\perp - Euler Phi
\varphi(n) - Legendre Symbol
\left(\frac{a}{p}\right) - Modulo
\pmod{n}
Frequently asked questions
- How do I write Prime in LaTeX?
- Type p in math mode, for example $\zeta(s) = \prod_{p} \frac{1}{1 - p^{-s}}$. It works in plain LaTeX without loading any package.
- Which package do I need for p?
- None. p is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
- Can I use p in text mode, or only in math mode?
- Both. p compiles in running text as well as inside $...$; in a formula keep it in math mode so it gets math fonts and spacing.
최고의 AI LaTeX 편집기, Overleaf 대안
Octree는 15개 이상의 대학의 연구자들이 AI를 사용하여 논문을 더 빠르게 작성하도록 도움
- AI로 아름다운 TikZ 다이어그램 생성
- 이미지를 업로드하고 LaTeX로 원활하게 변환
- 논문 작성 및 서식에 대한 즉각적인 지원 받기