Skip to main content
91 votes

! Package inputenc Error: Unicode char ́ (U+301)(inputenc)

I do this: \DeclareUnicodeCharacter{0301}{*************************************} and look into the pdf which char produces this and delete/correct it.
Felix's user avatar
  • 1,011
60 votes
Accepted

Is there any reason to use inputenc?

Update as of April 2018: The community has changed its default encoding to UTF-8 as of April 2018 (see https://tug.org/TUGboat/tb39-1/tb121ltnews28.pdf). So, the remark regarding LuaTeX or XeTeX ...
Moriambar's user avatar
  • 11.5k
57 votes
Accepted

Command \k unavailable in encoding OT1 (error takes me to line which doesn't even have "\k" in it

The error happens when LaTeX is reading line 538 in the bibliography file, probably generated by BibTeX. The entry refers to an author named Patrycja Dynarowicz-Łątka (a chemist at the ...
egreg's user avatar
  • 1.1m
40 votes

Is there any reason to use inputenc?

With the 2018 release of LaTeX the test file below produces as UTF-8 is assumed as the default input encoding unless you specify a different encoding to inputenc and the BOM at the start of the file ...
David Carlisle's user avatar
29 votes
Accepted

How is a mathematical formula represented in PDF?

Essentially in pdf every letter (or run of letters) is positioned by coordinates so even a normal word might be encoded as individual letters positioned to "look" like text, so as to take account of ...
David Carlisle's user avatar
23 votes
Accepted

! Package inputenc Error: Unicode char ́ (U+301)(inputenc)

If you copy/paste some source, it may happen that é had been coded as U+0065 U+0301 which in Unicode aware environments is rendered as expected. Unfortunately pdflatex is not Unicode aware and ...
egreg's user avatar
  • 1.1m
21 votes

Typesetting smileys in the input

\DeclareUnicodeCharacter takes the codepoint in hexadecimal notation: \documentclass{article} \usepackage{wasysym} \DeclareUnicodeCharacter{1F600}{\smiley} \begin{document} Hello 😀 \end{document}
Phelype Oleinik's user avatar
21 votes
Accepted

How do I make LaTeX understand Unicode characters ↔︎ and ↕︎

Actually, LaTeX has a pretty good Unicode support (better yet since the October 2019 update). You just need to define the character you want to type: \documentclass{article} \DeclareUnicodeCharacter{...
Phelype Oleinik's user avatar
20 votes

Problem with LaTeX (missing $ inserted)

The error can only be reproduced if the file is saved in UTF-8 encoding. Indeed, in this case, ó is really stored as the bytes 0xC3 and 0xB3. In the latin1 encoding, the first is à and the second is ³...
20 votes

How do I make LaTeX understand Unicode characters ↔︎ and ↕︎

I would recommend the newunicodechar package for this: \usepackage{newunicodechar} \newunicodechar{↔}{\ensuremath{\leftrightarrow}} \newunicodechar{↕︎}{\ensuremath{\updownarrow}} You could also ...
Davislor's user avatar
  • 45k
20 votes
Accepted

Why do German umlauts and sharp s (ß) work without a package in LaTeX?

Since the April 2018 release, LaTeX considers UTF-8 as default input encoding Thus calling \usepackage[utf8]{inputenc} at the start is no longer required. If a file has a different encoding than UTF-...
egreg's user avatar
  • 1.1m
19 votes

Can we stop recommending fontspec as first choice in case lualatex is used?

fontspec doesn't change the math setup to unicode math fonts -- this is done by unicode-math -- it only change some math alphabet like \mathrm and with the option no-math you could avoid this too. So ...
Ulrike Fischer's user avatar
19 votes
Accepted

inputenc is no longer needed?

UTF-8 has been the default (essentially by building in [utf8]{inputenc}) for a few years. Since the early 2018 LaTeX release, see ltnews issue 28
David Carlisle's user avatar
18 votes

What is the function \usepackage[utf8]{inputenc} used for and why we should add this in latex document?

The inputenc package allows you to tell LaTeX about the input (file) encoding of your TeX document. The input encoding controls how the various characters you type are stored in your document (...
moewe's user avatar
  • 177k
16 votes
Accepted

Interpreting unicode ², ³, etc... characters in math mode

ConTeXt does it right. \starttext x²³ and $x²³$ \stoptext The same can be achieved with LaTeX and unicode-math. \documentclass{article} \usepackage{unicode-math} \begin{document} x²³ and $x²³$ \...
Henri Menke's user avatar
15 votes
Accepted

Can we stop recommending fontspec as first choice in case lualatex is used?

One reason to rely on fontspec over luainputenc comes from the package documentation of the second package. The abstract says simply: Input encoding management for LuaTeX, needed only for ...
jon's user avatar
  • 22.4k
15 votes
Accepted

How do I prevent "s from turning into ß with babel?

The character " should never be used in running text to denote quotes. For double English quotes, use ``Test'' s If you want German style quotes, use "`Test"' s With UTF-8 input, you can use “...
egreg's user avatar
  • 1.1m
14 votes
Accepted

How to solve the `Package inputenc Error: Unicode char not set up for use with LaTeX` problem?

You can declare these characters. For example, like this: \DeclareUnicodeCharacter{25CF}{$\bullet$} \DeclareUnicodeCharacter{251C}{\mbox{\kern.23em \vrule height2.2exdepth1exwidth.4pt\vrule height2....
wipet's user avatar
  • 75.5k
14 votes
Accepted

Package *selinput* | Recommended for LaTeX Beginners?

No. Time has moved on and I wouldn't recommend this package to beginners, or use it in my documents. Given the author, it is of course technically good at solving the problem it tries to solve but... ...
David Carlisle's user avatar
13 votes
Accepted

How is the TeX engine informed of the OS's end-of-line marker and file encoding?

The record terminator is OS dependent, but Web2C based TeX distributions (TeX Live and MiKTeX) can decide it on the fly. I created three identical files containing abc def \bye but with different ...
egreg's user avatar
  • 1.1m
13 votes

Thích Nhất Hạnh in LaTeX tufte-book class

\usepackage{ucs} is never the answer. What you want is to use T5 (Vietnamese) encoding for the name. The EB-Garamond fonts don't support Vietnamese, but there is an implementation of Garamond that ...
egreg's user avatar
  • 1.1m
13 votes

Thích Nhất Hạnh in LaTeX tufte-book class

We often use \usepackage[utf8]{vietnam} for typing Vietnamese language in LaTeX (I am a Vietnamese). Hope this helps! \documentclass{tufte-book} \title{A Tufte-Style Book\thanks{Thanks to Edward R.~...
Black Mild's user avatar
  • 17.9k
12 votes
Accepted

How to put an acute on an i using Biber: issues with "\'{\i}"

Since day 1 of LaTeX2e, when the font encoding is T1, one can get “í” with \'i; the same has been possible with OT1 since May 2001; here's the excerpt from ltoutenc.dtx: % Here we are adding some ...
egreg's user avatar
  • 1.1m
12 votes
Accepted

issues with undefined(inputenc)

It's a bug in pdfx.sty: at line 1398 (where the error message points to) we find \ifcat^^c0\active \pdf@activecharstrue\fi Now, when inputenc is loaded with the utf8 encoding, the character ^^c0 is ...
egreg's user avatar
  • 1.1m
12 votes

Unreadable Russian TeX files

The text seems to be encoded as CP866. According to Wikipedia on this encoding: Code page 866 (CCSID 866) (CP 866, "DOS Cyrillic Russian") is a code page used under DOS and OS/2 in Russia ...
Marijn's user avatar
  • 38.5k
11 votes

LaTeX baffled by BOM---Unicode's byte order mark.

With the upcoming LaTeX release (2018) the BOM issue will be resolved on kernel level so that there will be no need any more for the gymnastics attempted in the other answers (which of course have ...
Frank Mittelbach's user avatar
11 votes
Accepted

Why this UTF-8 error is solved with a simple \clearpage

It happens when latex tries to typeset the page heading. This happens at page shipout time; if the CJK* environment has ended before the last page ships out, the necessary definitions for doing the ...
Harald Hanche-Olsen's user avatar
11 votes

How to put an acute on an i using Biber: issues with "\'{\i}"

This is an issue in Biber: it's turning \'\i into two codepoints, ı and ́, rather than the single codepoint í. (The 'correct' Unicode outcome here is a single í.) As LaTeX says, the combining ...
Joseph Wright's user avatar
  • 261k
11 votes

Is there any reason to use inputenc?

Here are some examples to make explicit some detail (implicit in the other answers), which may help clear up any remaining confusion. Consider the following Unicode text añ©ⱥ which consists of: U+...
ShreevatsaR's user avatar
  • 45.7k

Only top scored, non community-wiki answers of a minimum length are eligible