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 writing a document with the main font set up with old numbers, but I would like to have the "normal" style in the tables. This works but one particular table has some of the numbers in italic and somehow I cannot find a way of changing the font feature for these.

It turns out that the table is irrelevant and using \itshape or \em or \textit{} in normal text give the same result:

\documentclass[preview,border=2px,12pt]{standalone}

\usepackage{fontspec}
\setmainfont [Numbers = {Proportional,OldStyle}]{Linux Libertine O}

\begin{document}

2189 89283 98239 8098 2983 098023 \textit{1392843902984u29830} {\itshape 1981987092183749280}

{
\addfontfeatures{Numbers={Lining,Monospaced}, ItalicFeatures={Numbers={Lining,Monospaced}}}
2189 89283 98239 8098 2983 098023 \textit{1392843902984u29830} \itshape 1981987092183749280
}

\end{document}

enter image description here

Any idea what I am doing wrong? Or have I hit a bug?

share|improve this question
add comment

3 Answers

up vote 7 down vote accepted

With XeLaTeX I get the warning

*************************************************
* fontspec warning: "icu-feature-not-exist-in-font"
* 
* OpenType feature 'Numbers=Lining,Monospaced' (+tnum) not available for font
* 'Linux Libertine O/BI' with script 'Latin' and language 'Default'.
*************************************************

that's probably the cause for this. I get the expected result by defining a new font family, instead of adding features on the fly:

\documentclass[varwidth,border=2pt,12pt]{standalone}

\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont [Numbers = {Proportional,OldStyle}]{Linux Libertine O}
\newfontfamily{\libertinelf}{Linux Libertine O}

\begin{document}

2189 89283 98239 8098 2983 098023 \textit{1392843902984u29830} {\itshape 1981987092183749280}

{\libertinelf
2189 89283 98239 8098 2983 098023 \textit{1392843902984u29830} \itshape 1981987092183749280
}

\end{document}

enter image description here

share|improve this answer
    
thanks @egreg, I am not getting any such messages with LuaLaTeX, and XeLaTeX for me does not work (can't find the font, but that is a completely different issue). Your solution works though. –  ArTourter Dec 5 '12 at 0:35
add comment

Use libertine.sty:

\usepackage{libertine}
\begin{document}
 2189 89283 98239 8098 2983 098023 \textit{\libertineLF 1392 84390 29842 9830}
\end{document}
share|improve this answer
1  
For this to be a usable answer you need to make this in to a complete working document (e.g. there is no document class and \libertineLF is not defined in the set-up I tried) and perhaps tell us which tex engine is to be used. –  Andrew Swann Dec 6 '12 at 16:01
    
@AndrewSwann: \libertineLF is defined in the latest version of the libertine package (in fact \liningnums —which my answer uses— is defined as \DeclareTextFontCommand{\liningnums}{\libertineLF}). You might want to update. –  Silex Dec 6 '12 at 16:15
    
@AndrewSwann: If you have a recent libertine package installed, \libertineLF will work with any of the LaTeX engines. –  user22108 Dec 6 '12 at 16:27
    
@Silex I confess, it has gone at least 3 days since I updated my distribution on this machine. Adding \documentclass{article} is now sufficient to make the above code run. –  Andrew Swann Dec 6 '12 at 16:33
add comment

Fontspec has some issues with lnum and tnum when already using Oldstyle numbers. One of the easiest ways to resolve this is by using the latest libertine package:

\documentclass[preview,border=2pt,12pt]{standalone}

\usepackage{libertine}

\begin{document}

2189 89283 98239 8098 2983 098023 \textit{1392843902984u29830} {\itshape 1981987092183749280}

\liningnums{%
    \addfontfeature{Numbers = Monospaced}
    2189 89283 98239 8098 2983 098023 \textit{1392843902984u29830} \itshape 1981987092183749280
}
\end{document}

numbers

Monospaced numbers also work (except for italic numbers):

monospaced

share|improve this answer
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.