0

I have installed a clean version of MacOs and also a new versione of MacTex. While compiling a tex file, i get the following error

Package inputenc Error: Unicode character γ (U+3B3)(inputenc) not set up for use with LaTeX.

If I compile the same file on the old version of MacOs I don't get this error. Is there any setting of the package inputenc should I change?

It is an error arising from the bibliography file .bbl

  • U+03B3 is GREEK SMALL LETTER GAMMA. Maybe you can find the problematic entry with that information. You could also try \DeclareUnicodeCharacter{03B3}{XXXX Here I am XXX} and search for XXX in the output. – moewe Mar 18 '19 at 12:13
  • Thank you. But I don't understand why the compilation works in the old version of MacOs and not in the new clean installation of the operating system. – apt45 Mar 18 '19 at 12:16
  • 1
    In April 2018 LaTeX made UTF-8 the default encoding for .tex documents (latex-project.org/news/latex2e-news/ltnews28.pdf). Earlier LaTeX would essentially assume ASCII input and characters not in ASCII range would not be handled as expected. The new default handles UTF-8 chars as expected, but not all characters have been set up for use. Previously the gamma would not have errored, but I would be surprised if the output had been as expected. – moewe Mar 18 '19 at 12:19
  • What input encoding are you using? What is the encoding of your .bib file? – Herb Schulz Mar 18 '19 at 13:49
1

I had the same error from a reference in a bib file. I left the bib file as is and used \DeclareUnicodeCharacter{03B3}{$\gamma$} and it worked a treat. Now the $\gamma$ comes up nicely!

| improve this answer | |
0

Glad you solved this. Your options include:

  • Load the unicode-math package in a native Unicode engine, such as LuaLaTeX. It will understand all Unicode characters. This is what I would recommend, unless your publisher or professor requires you to use legacy 8-bit fonts.
  • Load \usepackage[LGR,T1]{inputenc} on a modern distribution, and it should understand γ in text mode. The kernel will only set up the Unicode characters that are in a text encoding that you loaded.
  • Do a search-and-replace in your source file.
  • Recent versions of babel should be able to automatically switch to a Greek font when they see Greek letters.
  • Define a command to display γ (either with inputenc or newunicodechar). This should probably be something like \ifmmode\gamma\else\textgamma\fi so it will work in either text or math mode.
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.