KOMAscript
当尝试使用和(alpha 0.2d)排版目录时tocstyle
,我最终设法使用将页码的字体(与文档的其余部分一样更改为 CMSS)\settocfeature{pagenumberhook}{\changefont{cmss}{m}{n}}
但现在页码在左侧对齐而不是在右侧!
那么,我怎样才能将其改回像那样的页码右侧对齐,但使用无衬线字体呢?
例子:
\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}
答案1
删除定义中的空格\changefont
,即更改
\newcommand{\changefont}[3]{ \fontfamily{#1} \fontseries{#2} \fontshape{#3} \selectfont}
到
\newcommand{\changefont}[3]{\fontfamily{#1}\fontseries{#2}\fontshape{#3}\selectfont}