TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


\documentclass[11pt, a4paper]{scrartcl}

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







share|improve this question
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}


share|improve this answer
interesting what a little space can do... Indeed that helps. :-) Thank you very much! – MostlyHarmless Apr 11 '11 at 7:20

Your Answer


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.