Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
2  
You should never use babel with XeLaTeX. Use Polyglossia instead. –  Andrey Vihrov Sep 6 '11 at 17:29
2  
@Andrey as a one-time dispenser of such advice too, I discovered that it's a bit more complicated than that. French, however maybe one of those languages where the advice is well taken, although the french in babel is does much much more than the french in polyglossia. See Polyglossia, babel and xelatex –  Alan Munn Sep 6 '11 at 19:30
    
@Alan Munn: Thanks. I will now be more careful with such statements. Needless to say that I don't like the current situation with internationalization at all. babel can't work in many cases because it knows little, if nothing, about Unicode, and polyglossia is a reimplementation, rather than extension, of babel, and often can do less (and the code quality may be worse than that of babel, 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. –  Andrey Vihrov Sep 6 '11 at 20:20
    
@Andrey Yes, I agree on all counts. (No comment on the code quality.) But polyglossia was developed before LuaTeX was really viable, and because it uses xetexintercharclass it's incompatible, IIRC. –  Alan Munn Sep 6 '11 at 20:44
    
@Andrey: I use babel's frenchb with both XeTeX and LuaTeX without a problem, and I've heard polyglossia does a poorer job with French. –  ℝaphink Sep 7 '11 at 7:49
show 1 more comment

1 Answer

First, a font does not necessarily support all types of ligatures. Linux Libertine supports only (checked here) Ligatures={Common,Rare,Discretionary}.

The OpenType variant of Linux Libertine shipped with media-fonts/libertine-ttf works on an up-to-date Gentoo with TeX Live 2011. Another option is to install the dev-texlive/texlive-fontsextra package, which also contains the font. To use it and to be able to select it by name, run this command after installation:

eselect fontconfig enable 09-texlive.conf

This will allow all programs to access fonts installed in the TeX Live texmf tree.

Then this code will work as expected:

\documentclass{article}

\usepackage{fontspec}
\setmainfont[Mapping=tex-text,Ligatures={Common,Rare,Discretionary}]{Linux Libertine O}

\begin{document}

Hello World

\end{document}

Note: This was tested on TeX Live 2011. Gentoo has TeX Live 2010 as the stable version. If you keep experiencing problems, try upgrading to the newer version of TeX Live.

share|improve this answer
    
It works, thank you ! –  DaveNull Sep 6 '11 at 17:44
6  
@DaveNull: if this answers your question, please check the answer. –  ℝaphink Sep 7 '11 at 7:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.