![页码在 scrartcl 中与 tocstyle 一起左对齐吗?](https://linux22.com/image/236181/%E9%A1%B5%E7%A0%81%E5%9C%A8%20scrartcl%20%E4%B8%AD%E4%B8%8E%20tocstyle%20%E4%B8%80%E8%B5%B7%E5%B7%A6%E5%AF%B9%E9%BD%90%E5%90%97%EF%BC%9F.png)
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}