Text FormattingLining figures in ToC

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Lining figures in ToC

Post by AleCes »

Hello everybody, I normally use Text Figures in the body text, but since ToC entries are all caps, I need chapter numbers to be Lining Figures. How can I do that? Can tocloft help me achieve that?

Code: Select all

\documentclass{book}
\usepackage{fontspec}
\setmainfont[Mapping=tex-text, Numbers=OldStyle]{Latin Modern Roman}

\begin{document}

\tableofcontents

\chapter{Introduction}

\section{blah}

\chapter{Conclusion}

\section{blah}

\end{document}
Thanks!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Lining figures in ToC

Post by Johannes_B »

Simply like this?

Code: Select all

\documentclass{book}
\usepackage{fontspec}
\setmainfont[Mapping=tex-text, %Numbers=OldStyle
]{Latin Modern Roman}

\begin{document}

\tableofcontents
\addfontfeatures{Numbers=OldStyle}

\chapter{123678 Introduction}
1234567890
\section{blah}
\chapter{Conclusion}
\section{blah}
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Lining figures in ToC

Post by AleCes »

Thanks Johannes_B, but you see, I'm rather picky about that: I want lining figures as chapter numbers (because titles are all caps), but text figures in page numbers.

Is it possible to get that?
Post Reply