I wish I knew how this happened. Using Texshop, under Preferences, encoding is UTF-8. File contains the following lines in the preamble:


When I compiled the file, I got all sorts of instances like the following:


When I went to Macros=>Encoding it seems the file is encoded in MacOsRoman. I changed that setting to UTF8 (I don't know if this overrides TexShop's global preferences) but I'm still getting these wild characters.

-How do I get rid of them?

The file otherwise compiles properly.

Edit: I did convert the file to UTF8. I used Textwrangler to "Zap Gremlins" and most of these disappeared. However, I have to go back and add back in some high-ASCII characters that ere deleted, like é.

But wait! Now when compiling I get the following error:

Package inputenc Error: Unicode char \u8:éMa not set up for use with LaTeX.


I used the utf8x package instead of utf8, and added the following to the beginning of the file:

    % !TEX encoding = UTF-8 Unicode

which was a suggestion by user27221 in a related question.

I'd still like to know how to get rid of these without resorting to an obscure command (Zep Gremlins) in a specialized program that I may not always have access to.

  • Probably the file was initially encoded in MacOS Roman. Try to convert it to UTF8 before compiling. – Bernard Jun 18 '16 at 17:22
  • If your file is encoded in MacOsRoman you need to first convert it to utf8 before invoking inputenc with the utf8 setting. – Alexis Jun 18 '16 at 17:22
  • Could possibly be that you used to typeset using XeLaTeX and now the program is set to typeset in PdfLaTex or simular. – Runar Jun 18 '16 at 17:43
  • @runartrollet pdfLaTeX is fine with UTF-8 encoding since that option is given to inputenc. – cfr Jun 18 '16 at 23:17

Your Answer

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

Browse other questions tagged or ask your own question.