LaTeX error "Unicode character α (U+03B1) not set up for use with LaTeX": cause and fix
The source contains a character that pdfLaTeX has no definition for. pdfLaTeX reads UTF-8, but knows only the characters that have a LaTeX command behind them, such as accented letters and €. The message shows the character and its code point.
Why it happens
- A Greek letter or a math sign was typed directly, for example
α,≤or≠. - The text was copied from a PDF, a web page or a word processor and carries characters such as
✓or the Unicode minus sign−(U+2212), which looks like a hyphen. - The source holds an invisible character such as the zero-width space (U+200B), which also arrives through copy and paste.
How to fix it
- Replace the character with its LaTeX command:
$\alpha$,$\leq$,$\neq$, and$-$for a minus sign. - For an invisible character, delete the text around the reported position and type it again. The code point in the message tells you which character it is.
- To keep typing the character, define it once in the preamble:
\DeclareUnicodeCharacter{03B1}{\ensuremath{\alpha}}. - LuaLaTeX and XeLaTeX read every Unicode character without this error. The character still needs a font that contains it; otherwise it is missing from the PDF, see Missing character: There is no L in font nullfont!.
A document that produces the message
\documentclass{article}
\begin{document}
The angle α is small.
\end{document}The corrected document
\documentclass{article}
\begin{document}
The angle $\alpha$ is small.
\end{document}Both documents were compiled with pdfLaTeX from TeX Live 2023. The first produces the message, the second compiles without an error.
Finding the line in the editor
The editor lists every error and warning of a compile run with file and line. Select an entry and the cursor jumps to that line. See Error list with jump to the line.