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.

When trying to typeset a table of contents with KOMAscriptand tocstyle(alpha 0.2d), I finally managed to change the font of the pagenumbers (like the rest of the document to CMSS) with \settocfeature{pagenumberhook}{\changefont{cmss}{m}{n}}, however now the page numbers are aligned at the left and not at the right side!
screenshot bad

So how can I change that back to an alignment on the right side of the page numbers like that, but with the sans serif font?
screenshot good

Example:

\documentclass[11pt, a4paper]{scrartcl}
\usepackage[ngerman]{babel}
\usepackage{blindtext}

\newcommand{\changefont}[3]{ \fontfamily{#1} \fontseries{#2} \fontshape{#3} \selectfont}

\usepackage[]{tocstyle}
\usetocstyle{classic}
%\settocstylefeature[1]{entryvskip}{10pt}
%\settocstylefeature[2]{entryvskip}{3pt}
%\settocstylefeature[1]{entryhook}{\bfseries}
\settocfeature{pagenumberhook}{\changefont{cmss}{m}{n}}

\begin{document}

\changefont{cmss}{m}{n}

\tableofcontents

\newpage

\blinddocument
\blinddocument
\blinddocument

\end{document}
share|improve this question

1 Answer 1

up vote 2 down vote accepted

Remove the spaces in your definition of \changefont, i.e change

\newcommand{\changefont}[3]{ \fontfamily{#1} \fontseries{#2} \fontshape{#3} \selectfont}

to

\newcommand{\changefont}[3]{\fontfamily{#1}\fontseries{#2}\fontshape{#3}\selectfont}
share|improve this answer
    
interesting what a little space can do... Indeed that helps. :-) Thank you very much! –  Martin Apr 11 '11 at 7:20

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.