XeLaTeX is the easiest approach, it works out of the box:
\documentclass[a4paper,10pt]{article}
\usepackage{xltxtra} \usepackage[french]{polyglossia}
\begin{document} Donne-moi 5\,€. \end{document}
LaTeX requires the use of textcomp
to get the euro symbol:
]]>\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc} \usepackage{textcomp} \usepackage[frenchb]{babel} \usepackage[T1]{fontenc}
\begin{document} Donne-moi 5\,€. \end{document}
\newif\ifxelatex \ifx\XeTeXglyph\undefined \xelatexfalse \else \xelatextrue \fi % You can now use \ifxelatex to execute XeLaTeX-specific stuff \ifxelatex \usepackage[french]{polyglossia} \usepackage{xltxtra} \setmainfont[Mapping=tex-text]{Times New Roman} \else \usepackage{babel} \usepackage[utf8]{inputenc} \usepackage{times} \usepackage[T1]{fontenc} \fi
The trick here is the check whether the \XeTeXglyph
primitive is present; if it is, the file is being XeLaTeX’ed, otherwise it’s probably PDFLaTeX’ed, or even LaTeX’ed, or whatever. The same can be achieved by importing the ifxetex
package, which provides a ifxetex
command.
Strangely enough, when defining french
as a documentclass
option, it doesn’t automatically get passed to polyglossia
, as I’d expect it, as it does for PDFLaTeX – almost made me believe for a while that polyglossia was broken for the French language, when it was just not getting the option.
First, you obviously have to have a local texmf
directory, hashed properly:
mkdir ~/texmf texhash ~/texmf
You can then stick all your “local” LaTeX files in there (as the TDS spec indicates, it is unclear what “local” means, either any file outside your TeX distribution, or a file created locally. Whatever you prefer, I guess); it is all very well explained there: https://help.ubuntu.com/community/LaTeX.
Now, I happened to want to install Latin Modern after reading the frenchb documentation (Goodness me, memories, memories…), and the FAQ linked above seemed to be indicating that it was a mere piece of cake. Well, if you happened to download the gzipped tar version of the archive like I did (as opposed to the zip archive), the files are stored like this:
/tex-archive/fonts/lm/
And then, you have the correct tex
, doc
, fonts
structure. These are the folders you must stick right under ~/texmf
— the fonts
folder right under tex-archive
really got me there. You then run as per the FAQ:
updmap --enable Map lm.map
(Not sure if this matters — I’m not familiar with updmap yet… — but I ran this in /tex-archive/fonts/lm/
). Import lmodern
and fontenc
with the T1 option, and that should be it.
Now, I’ve not played with LaTeX for quite a long time, but man this looks good…