Tag Info

90

The error you get is due to a "no-break space" character, according to what I can gather by copying an pasting your message. This character is not usually set up by the [utf8] option and it's invisible to many editors, so it can slip in a document without the typist knowing it. Solution: add in your preamble \DeclareUnicodeCharacter{00A0}{ } if you don't ...

65

As this is one of the top google hits for this error message, here's a more general answer with an example: The cause is a unicode character in one of your input files that isn't mapped to an output. This may -- especially if you're using the (unicode-supporting) biblatex/biber system -- be in your bibliography. This is a good place to look for errors as ....

40

Don't use utf8x; with an up-to-date TeX distribution it could show necessary only for its most obscure features (faking characters with images from the Web, for instance). The problem with Greek, which was probably the main reason for adopting utf8x instead of utf8, have since be solved and \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]...

37

The basic LaTeX/TeX engine expects (or perhaps is meant to process) pure ASCII input. Whenever your file uses any other characters, the inputenc package comes to the rescue, specifying to the engine how to process the symbols you're typing. So it's quite necessary, whenever you use unicode (non ASCII) characters, to use the inputenc package, in order to ...

35

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 is handled gracefully (ignored in this case). Original answer With inputenc commented out I get despite typing the input in emacs. \documentclass{article} \...

33

For UTF-8 input, use soulutf8; don't forget fontenc! \documentclass[a4paper]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[french]{babel} \usepackage{soulutf8} \usepackage{color} \definecolor{y}{RGB}{245, 255, 189} \sethlcolor{y} \begin{document} \hl{\'e} \hl{é} \end{document} There is no 15pt option for article.

32

With the following setup, you can just type these characters normally, and the copy-paste text in the pdf (the OCR layer) will be correct, too. Your source .tex document should be encoded in UTF8, of course, or you could use latin1, or some other input encoding that includes the characters you desire and is listed in the inputenc documentation. % !TEX ...

30

This works: M\^^22arz Indeed TeX interprets ^^xy (where x and y are digits or abcdef) as the character having "xy (hexadecimal) ASCII code. Since the character code of " is 34, hexadecimal 22, typing \^^22 is the same as typing \". This translation happens before TeX starts to make tokens.

29

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 inter-letter kerns etc. Math is no different: the characters are just normal font characters positioned on the page at locations that TeX has determined. ...

29

I do this: \DeclareUnicodeCharacter{0301}{*************************************} and look into the pdf which char produces this and delete/correct it.

27

Unfortunately, Latvian is quite poorly supported by babel: the letters with the comma diacritic are wrongly realized with a cedilla. Here's a possibly better realization. \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[latvian]{babel} \makeatletter \DeclareTextCommandDefault\textcommaabove[1]{% \hmode@bgroup \...

26

Package hyperref hyperref encodes correctly, but the options should be set after hyperref is loaded. Otherwise LaTeX expands the options the hard way and hyperref will only see the expanded garbage. \usepackage{hyperref} \hypersetup{ pdfauthor={Erwin Schrödinger}, } Extended example: \documentclass{article} \usepackage[utf8]{inputenc}% utf8, for ...

25

How does LaTeX implement UTF-8? The Unicode character é is encoded as two byte in UTF-8, precisely <C3><A9> (I'll use throughout this to denote bytes, also when they are character tokens for TeX). When \usepackage[utf8]{inputenc} is loaded, the byte <C3> is made active and defined to look for the following byte, because <C3> in UTF-8 ...

25

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 Jagellonian University in Kraków) whose name, in BibTeX-speak, becomes Dynarowicz-{\L}{\k{a}}tka, where you see \k. Just add \usepackage[T1]{fontenc} to your document ...

24

\usepackage[utf8x]{inputenc} Ubuntu: You must install texlive-latex-extra before use it. Fedora: You must install texlive-collection-latexextra before use it.

21

Unhappily utf8.def does not show the numerical representation for the missing Unicode character. The missing character <char> is shown directly in macro \u8:<char>. The following example adds the numerical information in the error message: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{stringenc} \usepackage{pdfescape} \...

21

UTF8 and ASCII are byte for byte identical for characters in the ascii range so if you have a plain text file that is ascii encoded it is also UTF-8 encoded, and similarly if it is UTF-8 encoded but only has characters in the range x00 - x7F then they are encoded directly as themselves with bytes in the same range so are valid ASCII files.

21

\DeclareUnicodeCharacter takes the codepoint in hexadecimal notation: \documentclass{article} \usepackage{wasysym} \DeclareUnicodeCharacter{1F600}{\smiley} \begin{document} Hello 😀 \end{document}

20

To get rid off the warning you can change the input code to utf8 for your .tex-file. With the following changed MWE I have no warnings or errors from biber and only one warning with the .tex-file (because package filecontents generates this warning). I marked the changes with %!!!!!!!! Your MWE with some changes: \RequirePackage{filecontents} \begin{...

20

inputenc is abandoned because it does absolutely nothing with XeTeX or LuaLaTeX. Better said, it would do bad! See fontenc vs inputenc Essentially, the task performed by inputenc is translating input characters into their LICR form. With an 8 bit engine, « is two byte long and inputenc is able to translate them into \guillemotleft and » into \...

20

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 ³, which inputenc translates into \~A and \maththreesuperior. The latter is in turn converted into {^3}, which requires math mode and this is the cause for your ...

20

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{2194}{\ensuremath{\leftrightarrow}} \DeclareUnicodeCharacter{2195}{\ensuremath{\updownarrow}} \begin{document} How can I type ↔ and ↕ in \LaTeX? \end{document} ...

20

I would recommend the newunicodechar package for this: \usepackage{newunicodechar} \newunicodechar{↔}{\ensuremath{\leftrightarrow}} \newunicodechar{↕︎}{\ensuremath{\updownarrow}} You could also write ^^^^2194 for ↔. This package has the advantage of working in PDFLaTeX, LuaLaTeX and XeLaTeX, whereas \DeclareUnicodeCharacter is part of inputenc and only ...

19

Based on this LaTeX website, there are following solutions for your problem. According the subsection "indirekte Eingabe von Umlauten" you can write \"A, \"O, \"U, \"a, \"o, \"u and \ss{} or {\"A}, {\"O}, {\"U}, {\"a}, {\"o}, {\"u} and {\ss} to get german letters. If you include the german or ngmerman (ngerman has the new hyphentation rules), you can write ...

17

I usually start out using pdflatex and make sure the students have \usepackage[utf8]{inputenc} in their preamble to begin with, which so far has proven to work on all systems. After a bit of introduction I then compare this to XeLaTeX - in part because of the ease of using utf-8. Since this also work on all platforms I and my students use, it works here. ...

17

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 if you have a good (sans-serif)math setup that works with pdflatex or with lualatex and luainputenc you can use it with lualatex and fontspec too. Beside ...

15

In collaborative projects with source files being edited on a variety of platforms, editors, and locales, encoding issues can become a real PITA. In such setting, it is best to define one "right", mandatory encoding (UTF-8), communicate this clearly and stick to it. However, in many cases the collaborators, especially if they stem from the Windows or Mac ...

15

As Psyconaut points out an updated version of magyar.ldf is now available on CTAN fixing the problem. There is some mistake in the tests for input encodings in magyar.ldf. You get the same error message if you choose latin2 as the encoding. The relevant part of magyar.ldf is: \def\magyar@sugg@ie@lowb#1{\@latex@warning@no@line{Please use \string\...

15

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-8, the proper encoding should, of course, be declared. The utf8x add-on, together with the ucs package, used to be needed for some special application or, ...

14

If you only need to print the jobname, then \scantokens\expandafter{\jobname\noexpand} is sufficient. The problem is that all characters in the expansion of \jobname have category code 12, so they aren't interpreted in the correct way for printing. With \scantokens we make TeX reread them, but first we need to expand \jobname. The final \noexpand is for ...

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