I am new in the LaTeX world, so I don't understand everything about it, especially about the use of fonts.
I installed Linux Libertine font on my distribution (I use Gentoo, so I installed the package media-fonts/libertine-ttf
), and it works fine using WYSIWYG programs, like LibreOffice. I can use the Linux Libertine O
, Linux Libertine O C
etc.
But, using XeTeX, it doesn't work. I set in my header
\setmainfont[Mapping=tex-text,Ligatures={Contextual, Common, Historical, Rare, Discretionary}]{Linux Libertine O}
But when I compile with xelatex
, it says
(/usr/share/texmf-dist/tex/latex/carlisle/scalefnt.sty)kpathsea: Invalid fontname `Linux Libertine O', contains ' ' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! fontspec error: "font-not-found" ! ! The font "Linux Libertine O" cannot be found. ! ! See the fontspec documentation for further information. ! For immediate help type H . !...............................................
When I remove the O
in Linux Libertine O
, it says:
fontspec warning: OpenType feature 'Ligatures=Contextual' (+clig) not availabl e (fontspec) for font 'Linux Libertine', (fontspec) with script 'Latin', and language 'Default'. fontspec warning: OpenType feature 'Ligatures=Contextual' (+clig) not availabl e (fontspec) for font 'Linux Libertine', (fontspec) with script 'Latin', and language 'Default'. fontspec warning: OpenType feature 'Ligatures=Contextual' (+clig) not availabl e (fontspec) for font 'Linux Libertine', (fontspec) with script 'Latin', and language 'Default'. fontspec warning: OpenType feature 'Ligatures=Contextual' (+clig) not availabl e (fontspec) for font 'Linux Libertine/B', (fontspec) with script 'Latin', and language 'Default'. fontspec warning: OpenType feature 'Ligatures=Contextual' (+clig) not availabl e (fontspec) for font 'Linux Libertine/B', (fontspec) with script 'Latin', and language 'Default'. fontspec warning: OpenType feature 'Ligatures=Contextual' (+clig) not availabl e (fontspec) for font 'Linux Libertine/I', (fontspec) with script 'Latin', and language 'Default'. fontspec warning: OpenType feature 'Ligatures=Contextual' (+clig) not availabl e (fontspec) for font 'Linux Libertine/I', (fontspec) with script 'Latin', and language 'Default'. fontspec warning: OpenType feature 'Ligatures=Contextual' (+clig) not availabl e (fontspec) for font 'Linux Libertine/BI', (fontspec) with script 'Latin', and language 'Default'. fontspec warning: OpenType feature 'Ligatures=Historical' (+hlig) not availabl e (fontspec) for font 'Linux Libertine/BI', (fontspec) with script 'Latin', and language 'Default'. fontspec warning: OpenType feature 'Letters=SmallCaps' (+smcp) not available (fontspec) for font 'Linux Libertine/BI', (fontspec) with script 'Latin', and language 'Default'. LaTeX Font Warning: Font shape `OT1/LinuxLibertine(0)/m/n' undefined (Font) using `OT1/cmr/m/n' instead on input line 26.
What is wrong with my code (shown below)?
\documentclass[12pt]{lettre}
\usepackage{xunicode}
\usepackage{fontspec}
\usepackage{xltxtra}
\usepackage{lmodern}
\usepackage{eurosym}
\usepackage[frenchb]{babel}
%\setromanfont[Mapping=tex-text, Numbers=OldStyle, Ligatures=Historical]{Linux Libertine}
\setmainfont[Mapping=tex-text,Ligatures={Contextual, Common, Historical, Rare, Discretionary}]{Linux Libertine}
\begin{document}
\begin{letter}{Régie Trouduc'\\42, rue de tes fesses\\69007 Lyon}
\name{Lenny Baralair}
\address{Georges Dupont\\42, rue du chariot d'or\\69001 Lyon\\
{\addfontfeature{Letters=SmallCaps} Numéro de référence locataire : 654654654} }
\lieu{Paris}
\telephone{06 42 42 42 42}
\nofax
\conc{pouet}
\opening{Madame, Monsieur,}
Ceci est ma lettre que je ne veux pas rendre public sur ce site.
\closing{Je vous prie d'agréer,
Madame, Monsieur,
l'expression de mes salutations distinguées.}
\end{letter}
\end{document}
babel
with XeLaTeX. Use Polyglossia instead.babel
can't work in many cases because it knows little, if nothing, about Unicode, andpolyglossia
is a reimplementation, rather than extension, ofbabel
, and often can do less (and the code quality may be worse than that ofbabel
, IMHO). And it's complicated for LuaLaTeX users, too. It would be a lot better if there was a consolidated effort to produce a package that works for all languages and on all engines.xetexintercharclass
it's incompatible, IIRC.babel
'sfrenchb
with both XeTeX and LuaTeX without a problem, and I've heard polyglossia does a poorer job with French.