4

I am struggling understanding how to solve this error:

Package inputenc Error: Unicode char ̀ (U+300) (inputenc) not set up for use with LaTeX.

I have seen this related question, but the problem is that I have no idea where I have used this character and it seems I can't find it with find command.

3
  • 5
    Add \DeclareUnicodeCharacter{0300}{HEREHEREHERE} to your document, then you should be able to find it. Jul 25, 2020 at 21:40
  • 1
    Use uconv. See here
    – Fran
    Jul 26, 2020 at 2:13
  • @UlrikeFischer this really point me to the solution/answer to the problem. I think that could be elaborated to an answer for the other user. Thanks a lot, I lost some hours finding the solution until your comment.
    – G M
    Jul 27, 2020 at 8:54

1 Answer 1

7

U+0300 is a combining grave accent. PDFTeX and the 8-bit inputenc package cannot handle combining Unicode characters, only precomposed characters (NFC form).

The following MWE will reproduce your bug, if compiled in PDFTeX:

\documentclass{article}
\tracinglostchars=2
\usepackage[T1]{fontenc}

\begin{document}
à
\end{document}

This is because à is in decomposed form (U+0061 U+0300) instead of the NFC form, à (U+00E0). This is just one example, and there are several other places it could appear. (The most-famous example in English probably is Shakespare’s use of “punishèd.”)

If you compile with LuaLaTeX instead of PDFLaTeX, the engine will understand the combining character, but your 8-bit font will not contain it, so it will not display. The \tracinglostchars=2 line will at least give you a warning message about it.

Since the code I gave would never have compiled, though, it’s not likely that your old document has anything like that in it. Some users report that \'{\i} in their bibliographies causes this bug. In old versions of TeX, you needed to superimpose accents on a dotless ı, not over an i with a dot. That is no longer necessary, as \'{i} will be defined as a text composite.

This gives you the following options:

Use a Unicode Engine

If you remove the 8-bit font packages such as fontenc and inputenc, and compile with LuaTeX or XeTeX, it works:

\documentclass{article}
\tracinglostchars=2
\usepackage{fontspec}

\begin{document}
à
\end{document}

Convert to Precomposed Characters

I happen to have written a little program that normalizes UTF-8 input to NFC form, or you can do a search-and-replace.

This works, because it contains no combining characters, only precomposed characters:

\documentclass{article}
\tracinglostchars=2
\usepackage[T1]{fontenc}

\begin{document}
à
\end{document}

Use Accent Macros

If you must use PDFTeX, and there is no precomposed character for the the grapheme you want, you could write it as

\documentclass{article}
\tracinglostchars=2
\usepackage[T1]{fontenc}

\begin{document}
\`{a}
\end{document}
5
  • Thanks for the answer, I've tried but I can't find any à in my bibliography or chapters. An I see that other characters like è é are properly rendered
    – G M
    Jul 26, 2020 at 14:48
  • 1
    In fact, it was due to the use of {\`\i} that was probably the result of some exportation of the bibliography reference. I replaced this with \`{i} and this solved the issue.
    – G M
    Jul 26, 2020 at 14:58
  • 1
    @GM That’s good. In some older versions of LaTeX, it was necessary to superimpose accents on a dotless i, and in theory that should still work. Today, though, i with a grave accent should be declared as a text composite.
    – Davislor
    Jul 26, 2020 at 21:51
  • Thanks for your comment. Maybe we could add this to your answer for the other users that might look for à while is due to this old convention.
    – G M
    Jul 27, 2020 at 8:52
  • I had the same issue and it was due to \'\i that was the correct way to do it "in earlier times".
    – peschü
    Oct 11, 2021 at 13:01

You must log in to answer this question.

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