1

I'm trying to typeset a document using xelatex with main font Linux Libertine. Here's the minimal working example:

\documentclass{article}
\usepackage{fontspec}
\setromanfont[
  Ligatures      = TeX,
  BoldFont       = {Linux Libertine Bold},
  ItalicFont     = {Linux Libertine Italic},
  BoldItalicFont = {Linux Libertine Bold Italic}
]{Linux Libertine}
\begin{document}
\textit{1 foo}
\textbf{\emph{1 foo}}
\textbf{1 foo}
\end{document}

When compiled, the second and third "1 foo"s appear as they should, but the "1" is missing from the first "1 foo", like this:

Missing '1' in italic

It seems as though Linux Libertine does not support italic numerals.

What am I doing wrong here? Is there any way to make xelatex support the Linux Libertine font in a way that makes italic numerals possible?

If it helps, I'm using TeXWorks on an HP running Windows 8.1.

Edit: The only strange thing that shows up in the log file is a warning:

* LaTeX warning: "xparse/redefine-command"
* 
* Redefining document command \oldstylenums with arg. spec. 'm' on line 144.

Edit 2: When I tweak the document so that the only content is \textit{0123456789}, compilation with xelatex fails, and the following error is output:

** WARNING ** Invalid CMap
** ERROR ** pdf_ref_obj(): passed invalid object.

Near the end of the log file, there is a bunch of warnings looking like this:

Missing character: There is no   in font Linux Libertine Italic/OT:script=latn;
language=DFLT;mapping=tex-text;mapping=tex-text;!
Missing character: There is no 0 in font Linux Libertine Italic/OT:script=latn;
language=DFLT;mapping=tex-text;mapping=tex-text;!
8
  • I reckon that Linux Libertine is not a standard font of Windows 8.1. I tried to reproduce the problem, and for me it worked with the OTF version of the font. However, it was named Linux Libertine O, with an extra capital o at the end. How did you install the font?
    – Harald
    Oct 14, 2014 at 11:15
  • I installed the font from one of the files at the sourceforge page sourceforge.net/projects/linuxlibertine/files/linuxlibertine/…. Should I have installed the font differently? Oct 14, 2014 at 11:18
  • No, I guess the source is correct. As said above, I used the OTF version and added a capital o to the font names in your example. Worked for me. Any details in the tex log?
    – Harald
    Oct 14, 2014 at 11:23
  • Perhaps xelatex is finding the wrong font (as xelatex uses a two-step process it can be confused if a font exists twice). Add \XeTeXtracingfonts= 1 to the document and compile with xelatex --no-pdf file and xdvipdfmx -vv file then inpect the log-file and the output of xdvipdfmx. Oct 14, 2014 at 11:38
  • @UlrikeFischer I tried what you suggested, and there wasn't anything obvious in the log files between what I just mentioned in the second edit. Oct 14, 2014 at 11:54

3 Answers 3

2

Both the .ttf fonts, called Linux Libertine, and the .otf fonts, called Linux Libertine O, work fine on my Windows 7 system.

\documentclass{article}
\usepackage{fontspec}
\setromanfont[
  BoldFont       = {Linux Libertine Bold},
  ItalicFont     = {Linux Libertine Italic},
  BoldItalicFont = {Linux Libertine Bold Italic}
]{Linux Libertine}
\begin{document}
\textit{1 foo}
\textbf{\emph{1 foo}}
\textbf{1 foo}
\end{document}

enter image description here

\documentclass{article}
\usepackage{fontspec}
\setromanfont[
  BoldFont       = {Linux Libertine O Bold},
  ItalicFont     = {Linux Libertine O Italic},
  BoldItalicFont = {Linux Libertine O Bold Italic}
]{Linux Libertine O}
\begin{document}
\textit{1 foo}
\textbf{\emph{1 foo}}
\textbf{1 foo}
\end{document}

enter image description here

Something probably went wrong when you installed your fonts, so I suggest you simply reinstall them and try again.

1
  • Not sure why, but on my system, only the .otf font Linux Libertine O works. No strange warnings or error messages this way either. Oct 14, 2014 at 13:25
1

Your code works fine. I get the following result

libertine

4
  • It appears that the problem may be with my installation of Linux Libertine rather than with the code. Thanks for checking this. Oct 14, 2014 at 11:19
  • 1
    @DanielMiller Your code works fine for me, too. I also run TeXworks in a Windows environment. Try re-installing your fonts.
    – Sverre
    Oct 14, 2014 at 12:29
  • @Sverre That worked - if you make reinstalling fonts (from OTF not TFF) an answer, I'll accept it. Oct 14, 2014 at 12:55
  • @DanielMiller Done (although I don't understand why you're saying "not TFF" here, since those are the fonts you used in your MWE, and which work fine for me).
    – Sverre
    Oct 14, 2014 at 13:08
0

Use

\documentclass{article}
\usepackage{libertine}% detects itself the used engine pdftex, xetex, luatex
\begin{document}
\textit{1 foo}
\textbf{\emph{1 foo}}
\textbf{1 foo}
\end{document}

The package libertine does the correct font setting for you. Install the package from CTAN and the fonts too. Then you have all in the right place.

2
  • I'd like to use xelatex so as to have unicode support. When including the package libertine, a bunch of weird fontspec warnings result. Is there any way to have a clean compilation with xelatex and Linux Libertine? Oct 14, 2014 at 11:35
  • Sure, as I wrote, the package itself does the setting autimacally for pdflatex, xelatex, and lualatex. No need for a specific setting of main, serif and mono font.
    – user2478
    Oct 14, 2014 at 14:28

You must log in to answer this question.

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