LaTeX error · Packages, files and fonts

LaTeX Error: Unicode character ≈ (U+2248) not set up for use with LaTeX.

Quick answer

pdfLaTeX reads UTF-8, but it only knows how to typeset the characters its font encodings cover. A symbol pasted from a PDF, Word or a website, such as ≈, →, ✓, a non-breaking zero-width space or a Chinese character, has no definition, so LaTeX stops. Replace it with the LaTeX command ($\approx$, $\rightarrow$), map it once with \DeclareUnicodeCharacter{2248}{\ensuremath{\approx}}, or compile with XeLaTeX or LuaLaTeX and a font that contains the character.

The error in the log

This is how the message appears in the .log file (and in the compile output). The line starting with l. is the line number where TeX noticed the problem; the real mistake is there or just before it.

! LaTeX Error: Unicode character ≈ (U+2248)
               not set up for use with LaTeX.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...

l.4 The result is ≈
                    3.14.

Why it happens

  • Math symbols typed or pasted as Unicode in text: ≈, ≤, →, ±, ×, Greek letters.
  • Invisible characters copied from a PDF or web page: zero-width space (U+200B), thin space (U+2009) or a narrow no-break space (U+202F).
  • Emoji, CJK or other scripts that need a different engine and font.
  • An older TeX Live in which the same problem is reported as Package inputenc Error: Unicode character ... not set up for use with LaTeX.

How to fix it

Look at the line after l. in the log: the character is printed there and its code point is in the message (here U+2248). Replace it with the proper LaTeX command, which is usually the cleanest fix for math symbols.

If the character appears many times (for example in pasted data), declare it once in the preamble with \DeclareUnicodeCharacter{2248}{\ensuremath{\approx}} (or \newunicodechar{≈}{\ensuremath{\approx}} from the newunicodechar package). For whole passages in another script, switch to XeLaTeX or LuaLaTeX with fontspec.

Broken: reproduces the error

\documentclass{article}
\usepackage[utf8]{inputenc}
\begin{document}
The result is ≈ 3.14.
\end{document}

Try this in Octree — free LaTeX editor with AI, compiles in your browser

Fixed: compiles cleanly

\documentclass{article}
\usepackage[utf8]{inputenc}
% Either write $\approx$ in the text, or map the character once:
\DeclareUnicodeCharacter{2248}{\ensuremath{\approx}}
\begin{document}
The result is ≈ 3.14, or $\approx 3.14$ written as a command.
\end{document}

Package inputenc Error: Unicode character ≈ (U+2248) not set up for use with LaTeX.

This is the same error as printed by older LaTeX releases, where the inputenc package did the UTF-8 decoding. The causes and fixes are identical: replace the character, declare it with \DeclareUnicodeCharacter, or move to XeLaTeX or LuaLaTeX.

Related errors

Frequently Asked Questions

How do I find the invisible character LaTeX complains about?

The message gives its code point, for example U+200B (zero-width space) or U+2009 (thin space). Search for it in your editor (many accept \u200B in a regular-expression search) or retype the words around the position shown after l. in the log.

Does XeLaTeX fix "Unicode character not set up for use with LaTeX"?

Yes, as long as the font you use contains the character. XeLaTeX and LuaLaTeX read Unicode directly, so the error disappears; if the font lacks the glyph you get a "Missing character" warning in the log and a blank in the PDF instead.

What is the LaTeX command for a symbol I pasted?

Common ones: ≈ is \approx, ≤ is \leq, → is \rightarrow, ± is \pm, × is \times, ° is \textdegree or ^\circ in math, ✓ is \checkmark from amssymb. The Octree symbol reference lists the rest.

Paste your document into Octree — compile errors get a Fix with AI button

When a compile fails, Octree shows the error next to the line that caused it and offers a one-click fix that you can review before applying. Free, nothing to install.

Fix it in Octree →