When trying to build my LaTeX-file with latexmk in VS Code using Latex Workshop extension, the following error is thrown:

Package inputenc: Unicode character ≤ (U+2264) (inputenc) not set up for use with LaTeX.

This happens even though my LaTeX-file encoding is UTF-8, and the package inputenc is given the option utf8 (see following excerpt of my preamble):


%%%%%%%% SPRACH- UND FONTPAKETE %%%%%%%%

% * Declare special unicode characters which lead to errors otherwise * %
% Docs: https://tex.stackexchange.com/questions/558402/elsevier-paper-article-class-does-not-work-with-all-ascii-characters-and-package

As can be seen, I've already had a problem with another Unicode character 00B3. The character in question this time is "is less than or equal to", i.e. in LaTeX it'd be \leq, or in unicode U+2264.

The affected part in my LaTeX-script appears twice almost in the same way like so:

The measurement accuracy related to $\textrm{H}_{2}\textrm{S}$ is either $\leq
\pm 3 \, \%$ or $\leq \pm 0.5 \, \textrm{ppm}$, whichever is the greater value.

Moreover, the literal is present in a table like so:

%% Table containing the problematic literal `≤` %%
        Average percentage of measurements $≤ \, \nicefrac{\textrm{D}}{\textrm{T}} \, (\%)$   & 76.7    & 66.7    & 85.7    & 85.7       \\

Trying to resolve this problem again in the same way as done with the other unicode character, declaring it specifically in my preamble, didn't work out this time:


I'd like to understand two things:

  1. Main question: how do I get rid of the error and make the LaTeX-file compile correctly?
  2. Optional question: why this error came about in the first place, when it had been working flawlessly all the time before?

System specifics:

Lubuntu 20.04 LTS, VS Code

  • 3
    You must have a literal "≤" in your input file... the $\leq$ will not trigger that error. Could you possibly post a MWE?
    – Rmano
    Commented Jan 13, 2021 at 12:25
  • 2
    You definitely shouldn't write \DeclareUnicodeCharacter{U+2264}{$\leq$}, but at most \DeclareUnicodeCharacter{2264}{\leq}. But as Rmano pointed out,the origin of the error is something else.
    – campa
    Commented Jan 13, 2021 at 12:28
  • 1
    @Rmano you were right, I hadn't noticed someone had sent me a word-table, which I converted to a LaTeX-table. Within that, there was a literal causing the issue. Now, I replaced it with $\leq$ and it works like a charm.
    – Andreas L.
    Commented Jan 13, 2021 at 12:48
  • note that \usepackage[utf8]{inputenc} (which isn't needed in current latex) specifies that latex should interpret the bytes in the file as UTF-8 which is why it recognises ≤ as the character U+2264 it does not mean that latex has rules and fonts loaded to typeset every Unicode character Commented Jan 13, 2021 at 12:54
  • @DavidCarlisle the first part of your comment is clear to me, but the second part "it does not mean that latex has rules and fonts loaded to typeset every Unicode characte" is not. Could you please elaborate a little further what you mean by that?
    – Andreas L.
    Commented Jan 13, 2021 at 12:57

2 Answers 2


One solution is to replace your font packages with \usepackage{unicode-math} and compile with LuaLaTeX or XeLateX. This supports all of Unicode.

Another solution that’s compatible with any TeX engine is:


  • Thanks for pointing out different options. I might consider them in the future, if needed.
    – Andreas L.
    Commented Jan 13, 2021 at 16:50
  • Alternatively use utf8x (read comments there) tex.stackexchange.com/a/34609/250119
    – user202729
    Commented Oct 26, 2021 at 3:08
  • Side note -- "all of Unicode" as long as the font has the character, otherwise you get blank space.
    – user202729
    Commented Jun 2, 2022 at 15:20

As @Rmano pointed out correctly in the first comment of my question, there was an unnoticed literal within a value-table causing the issue.

This came about as I'd incorporated a Word-table which I converted into a LaTeX-table via the LaTeX-table-generator.

The only thing I had to do is replace the culprit literal with $\leq$ to make the document compile with errors.

So beware when inserting contents from external sources into your LaTeX-file as they could contain some unusual characters.

  • 1
    I had the same error, accidentally, when copying a formula I lost the ≤ symbol inside the $a≤5$, when I changed it to $a\leq 5$ the problem was solved. Thanks for the help! Commented Oct 28, 2022 at 14:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .