Mac OS X and LaTeX

Since I use Apple Mac OS X on my Macbook laptop, I often have to deal with its weaknesses. Someone may rather say ‘differences’, but since today I lost almost one hour for eventually finding a simple workaround, I would rather stick with « weaknesses »…

I used to believe that OS X fully supports UTF-8. In fact, it’s a slightly different version from Apple, and almost invisible for an everyday use. Even for using LaTeX with french accentuated characters, since pdflatex can handle them. But if you usually declare \usepackage[utf8]{inputenc}, which is the classic charset declaration in a LaTeX document, this will success if working with a single file, but will fail if using file inclusion! Thus, it is not the classic error claiming a missing latex-ucs package.

Indeed, even if I had already written some documents with LaTeX on OS X, I never used the \input command until today. This allows to fragment your LaTeX document in several files for a more convenient writing.

Except that pdflatex will fail with this error message :

! Package inputenc Error: Unicode char \u8: not set up for use with LaTeX

And the faulty line was always the first line of the .tex included, despite any correction attempt.

After a long search, I have found that you have to explicitly use Apple’s UTF-8 with \usepackage[utf8x]{inputenc}.

And voilà, pdflatex does not complain anymore…