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.

This is closely related to the OP with title "lining figures in tables and math, old style figures in text", and to the answer provided therein.

The following (semi)MWE is to be run with pdfLaTeX:

\documentclass[12pt]{memoir}

\usepackage{etoolbox}% I tried with \AfterEndPreamble
\usepackage{textcomp}
\usepackage[T1]{fontenc}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}

\AfterEndPreamble{%
    \def\libertine@figurealign{}
    \libertineOsF
    \noindent% memoir indents at the very start 
}

\begin{document}
Text figures: 0123456789
\par\noindent
Math figures: $0123456789$
\end{document}

It leads to lining figures in math mode and text (oldstyle) figures in text mode, but only on the textblock and not so on the headers, where we still get lining figures, as can be seen in the numeral for the page number.

How can we get oldstyle figures on the headers, too?

share|improve this question
1  
It's not only headers, section titles also use lining figures with this setup –  cgnieder Aug 18 '13 at 10:05
    
@cgnieder: Which makes it even worse than I thought. –  Marcos Aug 18 '13 at 10:14

2 Answers 2

up vote 8 down vote accepted

This seems to work:

\documentclass[12pt]{memoir}

\usepackage[T1]{fontenc}
\usepackage[oldstyle]{libertine}

\makeatletter
\renewcommand*\libertine@figurestyle{LF}
\makeatother

\usepackage[libertine]{newtxmath}

\makeatletter
\renewcommand*\libertine@figurestyle{OsF}
\makeatother

\begin{document}


\section{foo 123 bar}

Text figures: 0123456789 \textbf{0123456789}
\par\noindent
Math figures: $0123456789$

\end{document}

enter image description here

share|improve this answer
    
Yes, now it seems to be "fully right" ;-) –  Marcos Aug 18 '13 at 10:40

For the current newtxmath, don't use the osf option before \usepackage[libertine]{newtxmath} but add the following 4 lines immediately after:

\makeatletter
\def\libertine@figurestyle{OsF} %affects \libertine macro
\makeatother
\renewcommand*{\rmdefault}{LinuxLibertineT-OsF} % for normal text

It's in newtxdoc.pdf.

share|improve this answer
    
Ooops, ok, I'm using WinEdt and it couldn't find the doc file... This is one of those cases where you get more than one right answer. I had already marked cgnieder's before reading yours, though. Since none is simpler than the other, I'll stick with that, even though yours is of course valuable, too. Moreover, it is the official way to go. Thanks so much, too. –  Marcos Aug 18 '13 at 10:50

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.