14

Because of some problems in Windows with system-installed Linux Libertine/Biolinum Open Type fonts, I decided to define their usage w.r.t. different font shapes in XeLaTeX with the fontspec package:

\documentclass{artcl}

\usepackage{fontspec}
\newfontfamily\LinuxLibertine[  Path            = fonts/,
                                BoldFont        = LinLibertine_RB.otf,
                                ItalicFont      = LinLibertine_RI.otf,
                                BoldItalicFont  = LinLibertine_RBI.otf,
                                SlantedFont     = LinLibertine_aRL.otf,
                                BoldSlantedFont = LinLibertine_aBL.otf,
                                SmallCapsFont   = LinLibertine_aS.otf,
                                Mapping         = tex-text]{LinLibertine_R.otf}
\setmainfont[                   Path            = fonts/,
                                BoldFont        = LinLibertine_RB.otf,
                                ItalicFont      = LinLibertine_RI.otf,
                                BoldItalicFont  = LinLibertine_RBI.otf,
                                SlantedFont     = LinLibertine_aRL.otf,
                                BoldSlantedFont = LinLibertine_aBL.otf,
                                SmallCapsFont   = LinLibertine_aS.otf,
                                Mapping         = tex-text]{LinLibertine_R.otf}

\begin{document}
Some text here...
\end{document}

Is there a possibility to use the previously defined font family in the \setmainfont command, e.g.:

\setmainfont{\LinuxLibertine}
N.N.
  • 36,163
DigNative
  • 1,255
  • 1
  • 16
  • 29
  • 1
    Welcome to TeX.sx! Your question was migrated here from [so]. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. – N.N. Sep 25 '11 at 10:46
  • It's hard to understand why this code is necessary and the simple \setmainfont doesn't suffice. Could you explain more in your question? – egreg Sep 25 '11 at 11:22
  • @egreg: The Linux Libertine font family comes with many different styles. In general, XeTeX (or better: fontspec) does recognize them correctly, but sometimes it makes errors. Sadly, this is the case with the LL. Steps to reproduce: Install Vanilla TeXLive 2011 on *nix and put the .otf fonts of the LL into ~/.fonts/type1/linuxlibertine/ and the .ttf versions into ~/.fonts/type1/truetype/linuxlibertine/. (cont.) – Frakturfreund Sep 26 '11 at 15:09
  • Compile with xelatex:

    \documentclass{minimal} \usepackage{fonspec} \setmainfont{Linux Libertine O} \begin{document} regular text, but \emph{italics are to bold}. \end{document} So that’s the reason why one want to set up the LL fonts ›by hand‹.

    – Frakturfreund Sep 26 '11 at 15:09
  • @saint: While i understand your problem, i don’t know how to avoid this ugly code repetition. – Frakturfreund Sep 26 '11 at 15:09
  • 1
    @Frakturfreund I don't have any issue. Having two different versions (.otf and .ttf) around can be a source of problems. – egreg Sep 26 '11 at 19:21
  • Hi, sorry for my late response, I didn't get a notification of comments/answers. I had to define these shapes manually because there were some errors by compiling them with automatic font selection (some text was too bold, italic texts doesn't look correct). So the manual specification of the font shapes solved this issue for me. – DigNative Oct 02 '11 at 08:29
  • 2
    I disagree with the close reason. I came here googling exactly this. – Clément Aug 03 '16 at 21:46
  • 1
    This is my problem as well. I don't understand why it was closed and not answered. – Derek May 17 '20 at 20:57

0 Answers0