我尝试将目录中的部件名称改为大写字母,但不幸的是,它不起作用。有人知道如何将标题改为大写,但将部件编号设置为小写(使用正常字体),而不影响部件页面吗?
\documentclass[ final,
fontsize=12pt,
open=right,
twoside = true,
paper=a4,
listof=totoc,
captions=tableheading,
listof=totoc,
numbers=noenddot,
headings=big,
chapterprefix=false] %
{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{blindtext}
\usepackage{color}
\usepackage{xcolor}
\setkomafont{disposition}{\rmfamily}
\addtokomafont{chapter}{\normalsize\scshape}
\setkomafont{sectioning}{\rmfamily}
\addtokomafont{section}{\normalsize\scshape}
\addtokomafont{subsection}{\normalsize\itshape}
\setkomafont{chapterentry}{\mdseries\scshape\lowercase}
\setkomafont{chapterentrypagenumber}{\normalfont\normalcolor}
\usepackage{lmodern}
%Part
\RedeclareSectionCommand[tocnumwidth=1.1em]{part}
\RedeclareSectionCommand[innerskip=0mm]{part}
\renewcommand*{\partpagestyle}{empty}
\setkomafont{part}{\large\color{red}\scshape\MakeUppercase}
\setkomafont{partnumber}{\large}
\setkomafont{partentry}{\color{red}\scshape%\MakeUppercase
} %%?????
\setkomafont{partentrypagenumber}{\normalfont\color{red}}
\begin{document}
\pagenumbering{roman}
\tableofcontents
\listoffigures
\listoftables
\newpage
\pagenumbering{arabic}
\part{Stuff}
\blinddocument
\part{More Stuff}
\blinddocument
\end{document}
答案1
也许我不明白零件编号应该如何格式化。但你可以重新定义\addparttocentry
:
\renewcommand\addparttocentry[2]{%
\addtocentrydefault{part}{\protect\lowercase{#1}}{\protect\MakeUppercase{#2}}}
\documentclass[
final,
fontsize=12pt,
open=right,
twoside = true,
paper=a4,
listof=totoc,
captions=tableheading,
listof=totoc,
numbers=noenddot,
headings=big,
chapterprefix=false]
{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{blindtext}
\usepackage{xcolor}
\setkomafont{disposition}{\rmfamily}
\addtokomafont{chapter}{\normalsize\scshape}
\addtokomafont{section}{\normalsize\scshape}
\addtokomafont{subsection}{\normalsize\itshape}
\setkomafont{chapterentry}{\mdseries\scshape\lowercase}
\setkomafont{chapterentrypagenumber}{\normalfont\normalcolor}
\usepackage{lmodern}
%Part
\RedeclareSectionCommand[
tocnumwidth=1.1em,
innerskip=0mm
]{part}
\renewcommand*{\partpagestyle}{empty}
\setkomafont{part}{\large\color{red}\scshape\MakeUppercase}
\setkomafont{partnumber}{\large}
\renewcommand\addparttocentry[2]{%
\addtocentrydefault{part}{\protect\lowercase{#1}}{\protect\MakeUppercase{#2}}}
\setkomafont{partentry}{\color{red}\scshape}
\setkomafont{partentrypagenumber}{\normalfont\color{red}}
\begin{document}
\pagenumbering{roman}
\tableofcontents
\listoffigures
\listoftables
\cleardoubleoddpage
\pagenumbering{arabic}
\part{Stuff}
\blinddocument
\part{More Stuff}
\blinddocument
\end{document}
请注意,您必须使用\cleardoubleoddpage
before\pagenumbering{arabic}
来确保在第 1 页之前有一个左(偶数)页。(在您的示例中,第 v 页之后是第 1 页)。
此外,elementsectioning
只是 element 的别名dispostion
。
更新
带包装hyperref
使用:
\renewcommand\addparttocentry[2]{%
\addtocentrydefault{part}{\protect\lowercase{#1}}{%
\protect\texorpdfstring{\MakeUppercase{#2}}{#2}}}
代码:
\documentclass[
final,
fontsize=12pt,
open=right,
twoside = true,
paper=a4,
listof=totoc,
captions=tableheading,
listof=totoc,
numbers=noenddot,
headings=big,
chapterprefix=false]
{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{blindtext}
\usepackage{xcolor}
\setkomafont{disposition}{\rmfamily}
\addtokomafont{chapter}{\normalsize\scshape}
\addtokomafont{section}{\normalsize\scshape}
\addtokomafont{subsection}{\normalsize\itshape}
\setkomafont{chapterentry}{\mdseries\scshape\lowercase}
\setkomafont{chapterentrypagenumber}{\normalfont\normalcolor}
\usepackage{lmodern}
\usepackage{hyperref}
%Part
\RedeclareSectionCommand[
tocnumwidth=1.1em,
innerskip=0mm
]{part}
\renewcommand*{\partpagestyle}{empty}
\setkomafont{part}{\large\color{red}\scshape\MakeUppercase}
\setkomafont{partnumber}{\large}
\renewcommand\addparttocentry[2]{%
\addtocentrydefault{part}{\protect\lowercase{#1}}{%
\protect\texorpdfstring{\MakeUppercase{#2}}{#2}}}
\setkomafont{partentry}{\color{red}\scshape}
\setkomafont{partentrypagenumber}{\normalfont\color{red}}
\begin{document}
\pagenumbering{roman}
\tableofcontents
\listoffigures
\listoftables
\cleardoubleoddpage
\pagenumbering{arabic}
\part{Stuff}
\blinddocument
\part{More Stuff}
\blinddocument
\end{document}