# Re: Documentation (was Re: [OS X TeX] Kanbun (漢文) and French...)

Herbert Schulz herbs at wideopenwest.com
Sun Jan 4 11:31:55 EST 2009

On Jan 4, 2009, at 9:42 AM, Jean-Christophe Helary wrote:

> On lundi 05 janv. 09, at 00:25, cfrees at imapmail.org wrote:
>
>> Well, TNR is obviously not an option since it is not free.
>
> I only mentioned TNR because it was the font discussed in the quote
> I used.
>
>> The default must be guaranteed to be available on all the platforms
>> TeX runs on.
>
> No. It certainly must not. There are software ways to test which
> platform the application is running on to allow for settings
> specific to that platform. Which means you could have a Windows
> default font, a Mac default font and if the platform is not
> recognized for whatever reason, use the application embedded default
> font.
>
>> The default choices have to work in a huge variety of situations.
>
> Indeed. And that is not the case with Computer Modern. Computer
> Modern works for exactly 2 languages in the world. English, and a
> minority language that uses exactly the same characters. _That_ is
> very far from a "huge variety of situations".
>
>> These are not _MacTeX_ choices at all.
>
> Then what is the point of MacTex at all ? If MacTex is made for the
> OSX, then I can't see how changing the TeX default font to use a
> font provided by default by the OS is a problem ?
>
>
>
> Jean-Christophe Helary

Howdy,

Using LaTeX I can simply save the file as UTF-8 (so that the accented
characters are retained as such) and tell TeX that the file is encoded
in UTF-8. So

%%!TEX TS-program = pdflatex
%%!TEX encoding = UTF-8 Unicode
\documentclass{article}
\usepackage[utf8]{inputenc} % use this when using (pdf)latex
\begin{document}
This an è and an é!
\end{document}

works and is very simple. Unfortunately once you use characters
outside the ASCII set there are multiple, incompatible representations
so the second line is to tell TeXShop that the file should be saved
and opened with UTF-8 encoding so the characters are displayed
correctly; for other Editors use whatever they need for this. The
fourth line tells LaTeX (pdflatex in this case) that UTF-8 is being
used to encode the extensions from ASCII.

For XeLaTeX I'd use

%%!TEX TS-program = xelatex
%%!TEX encoding = UTF-8 Unicode
\documentclass{article}
\usepackage{xltxtra} % use this when using xelatex
\begin{document}
This an è and an é!
\end{document}

to accomplish the same thing. By default the xltxtra package uses the
fontspec package which uses Latin Modern as the default font (supplied
with MacTeX/TeX Live) and will display the accented characters
correctly even without defining a font to use.

In either case one extra line must be used to let the processor know
that extensions to ASCII are being used.

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)