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 have changed the default serif font of my document to use old-style numerals (I think they look quite nice). However, in the serif entries of the subsections (section entries are in a sans-serif font) in the table of contents, the old-style numerals are quite strange as section and page numbers. I would like to change them to the "normal" numerals. I can set the section entry font with \setkomafont{sectionentry} and \setkomafont{sectionentrypagenumber}, but there is no such facility for other entries, and setting the font in the block around \tableofcontents doesn't help either.

How could I achive the effect I desire?

EDIT

Here is a MWE.

\documentclass{scrartcl}

\usepackage{fontspec}
\setmainfont[Numbers=OldStyle,Mapping=tex-text]{Linux Libertine}
\setsansfont[Mapping=tex-text]{Linux Biolinum}
\newfontfamily\NoOldStyleNumsSerif[Mapping=tex-text]{Linux Libertine}

\begin{document}

{\NoOldStyleNumsSerif \tableofcontents}

\section{foo}

\subsection{bar}

Some text 0123456789

\end{document}

Notice that the page number is still rendered with old-style numerals:

Example rendering

share|improve this question
1  
Please add a minimal working example (MWE) that illustrates your problem. –  Werner Feb 6 '12 at 20:01
    
Try: setkomafont{disposition} –  Marco Daniel Feb 6 '12 at 20:01
    
@MarcoDaniel That would change the font in which section headings are written in the document, not in the TOC, wouldn't it? –  Kristóf Marussy Feb 7 '12 at 16:27
    
@Werner I added an example. –  Kristóf Marussy Feb 7 '12 at 16:33
add comment

1 Answer

up vote 4 down vote accepted

Disclaimer: I don't use fontspec, so there may be more elegant ways to do this.

\documentclass{scrartcl}

\usepackage{fontspec}
\setmainfont[Numbers=OldStyle]{Cambria}
\setsansfont{Calibri}
\newfontfamily\tocmainfont{Cambria}

\usepackage{tocloft}
\renewcommand*{\cftsecfont}{\sffamily\bfseries}
\renewcommand*{\cftsecpagefont}{\sffamily\bfseries}
\renewcommand*{\cftsubsecfont}{\tocmainfont}
\renewcommand*{\cftsubsecpagefont}{\tocmainfont}

\begin{document}

\tableofcontents

\section{foo}

\subsection{bar}

Some text 0123456789

\end{document}

enter image description here

share|improve this answer
    
It indeed renders right with tocloft. Although I was hoping scrartcl could do this without additional packages. –  Kristóf Marussy Feb 7 '12 at 16:41
    
@KristófMarussy You could use`tocstyle`. It’s a separate package, too, but part of the KOMA-Script bundle. When using you will get a warning, that it is in alpha state (according to the author it isn’t enough tested), but with KOMA-Script I didn't see any serious problems (I must admit, I used it with pdflatex only). –  Speravir Feb 7 '12 at 18:15
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.