13

When trying to compile my .tex file using the xelatex command in TeXmaker (with MiKTeX), I get this error message:

! fontspec error: "font-not-found"
!
! The font "Linux Libertine O" cannot be found.
!
! See the fontspec documentation for further information.

I have looked at the fontspec documentation, but haven't found anything helpful.

My .tex file looks like this:

\documentclass[11pt]{article}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{Linux Libertine O}
\begin{document}
\section{Unicode support}

\subsection{English}
All human beings are born free and equal in dignity and rights.

\subsection{Íslenska}
Hver maður er borinn frjáls og jafn öðrum að virðingu og réttindum.

\section{Ligatures}
\fontspec[Ligatures={Common, Historical}]{Linux Libertine O Italic}
Questo è strano assai!

\section{Numerals}
\fontspec[Numbers={OldStyle}]{Linux Libertine O}Old style: 1234567\\
\fontspec[Numbers={Lining}]{Linux Libertine O}Lining: 1234567

\end{document}

Does anyone have an idea of how I could fix this problem?

8
  • 1
    Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say "thank you" to users who helped you. Commented Mar 29, 2013 at 23:53
  • Do you have that font installed? I guess that you are using Windows. But that font is default on Linux.
    – Sigur
    Commented Mar 29, 2013 at 23:53
  • 3
    @Sigur - OP is using MikTeX, so Windows not having that font is most likely. Perhaps download it? Commented Mar 29, 2013 at 23:57
  • 2
    Try with \usepackage{libertine} (but make sure you have an up-to-date MiKTeX). Leave out the \setmainfont and \fontspec instructions, first.
    – egreg
    Commented Mar 30, 2013 at 0:14
  • 1
    Ok, I have tried again and everything works fine! So the solution is to replace \setmainfont and \fontspec by \usepackage{libertine}, as per egreg.
    – ben
    Commented Mar 30, 2013 at 0:58

1 Answer 1

9

Choosing the right name for a font is sometimes hard. The specification

\setmainfont[Ligatures=TeX]{Linux Libertine O}

should work if you have the font among the system fonts. However XeTeX is able to use also fonts that reside in the TeX tree and are not in the system fonts.

In the case of Linux Libertine, the call should be something like

\setmainfont
      [ Ligatures = TeX,
        Extension = .otf,
        SmallCapsFeatures={Letters=SmallCaps},
        UprightFont    = *_R,
        ItalicFont     = *_RI,
        BoldFont       = *_B,
        BoldItalicFont = *_BI,
      ] {LinLibertine}

The package libertine frees you from this burden. Check the package documentation to see what options can be passed to the call

\usepackage[...]{libertine}

where ... stands for zero or more option, such as oldstyle or lining to choose between the two styles for figures.

1
  • In order to get \setmainfont to work with the TeX font, I had to substitute the following two lines for the ones given: BoldFont = *_RB, and BoldItalicFont = *_RBI,
    – Steve
    Commented May 27, 2021 at 13:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .