目录中未编号章节的格式与编号章节的格式相同

目录中未编号章节的格式与编号章节的格式相同

我正在使用classicthesisarsclassica撰写我的论文。

我曾经\addchap添加过未编号的章节,该章节会自动添加到目录中。但是,这些未编号章节的图形格式/字体不同,我想使其与编号章节的格式相同吗?

图片

在图像中,我想将“Sommario、Abstract、Introduzione”更改为与 LOREM 相等(并且,如果可能的话,将它们与 L 对齐)

\documentclass[10pt,%                    
               a4paper,%                  
               twoside,openright,%        
%              oneside,openany,%         
               titlepage,%               
               headinclude,,footinclude,%  
               BCOR5mm,%                  
               cleardoublepage=empty,%    
               captions=tableheading,%       
               ]{scrreprt}    
\usepackage[T1]{fontenc}

\usepackage{lipsum}
\usepackage[utf8]{inputenc}
\usepackage[english,italian]{babel}       

\usepackage[eulerchapternumbers,%        
            beramono,%                   
            eulermath,%                    
            pdfspacing,%                 
            listings,%                  
%           parts,%                       
            ]{classicthesis}   
\usepackage{arsclassica}    
\begin{document}
\hypersetup{pageanchor=false}
\pagestyle{scrheadings} 
\pagenumbering{gobble}


\cleardoublepage
\pdfbookmark{\contentsname}{tableofcontents}
\setcounter{tocdepth}{2}
\tableofcontents
\markboth{\spacedlowsmallcaps{\contentsname}}{\spacedlowsmallcaps{\contentsname}} 
\cleardoublepage

\hypersetup{pageanchor=true}
\pagenumbering{arabic}

\deftripstyle{pgnumtopouter}{}{}{\pagemark}{}{}{}
\renewcommand{\chapterpagestyle}{pgnumtopouter}

\cleardoublepage
\phantomsection
\pdfbookmark{Sommario}{Sommario}
\begingroup
\let\clearpage\relax
\let\cleardoublepage\relax
\let\cleardoublepage\relax

\addchap{Sommario}

Qui Abstract in italiano

\lipsum
\lipsum
\lipsum
\lipsum
\lipsum
\vfill

\selectlanguage{english}
\pdfbookmark{Abstract}{Abstract}

\addchap{Abstract}
\lipsum
\lipsum
\lipsum
Qui abstract in inglese

\selectlanguage{italian}

\endgroup           

\vfill

\chapter{Lorem}
\label{cap:lorem}
\lipsum
\lipsum
\lipsum
\lipsum
\end{document}

谢谢

答案1

为了获得对齐以及正确的字体,一种方法是不要在目录中写入任何内容,并使用\addcontentsline空章节号作为第一个参数,包中的\numberline{}{...} 命令用于在目录行中写入“章节”标题。\spacedlowsmallcapsarsclassica

我添加了一个包装器,它会自动为您的设置执行此操作,假设章节标题也是目录的条目。

\addchap请注意和之间的区别\addchapextended,我只是\addchap{Sommario}有效地做了两次。

扩大的视野

\documentclass[10pt,%                    
               a4paper,%                  
               twoside,openright,%        
%              oneside,openany,%         
               titlepage,%               
               headinclude,,footinclude,%  
               BCOR5mm,%                  
               cleardoublepage=empty,%    
               captions=tableheading,%       
               ]{scrreprt}    
\usepackage[T1]{fontenc}

\usepackage{lipsum}
\usepackage[utf8]{inputenc}
\usepackage[english,italian]{babel}       

\usepackage[eulerchapternumbers,%        
            beramono,%                   
            eulermath,%                    
            pdfspacing,%                 
            listings,%                  
%           parts,%                       
            ]{classicthesis}   
\usepackage{arsclassica}    


%\newcommand{\addchapextended}[1]{%  Old version without alignment
%\addchap[\noexpand\spacedlowsmallcaps{#1}]{#1}%
%}%




\makeatletter
\newcommand{\addchapextended}[1]{%
\phantomsection%


\makeatletter
\newcommand{\addchapextended}[1]{%
\phantomsection%
\addchap[]{#1}%  Do the unnumbered chapter head in the content section 
\markboth{\spacedlowsmallcaps{#1}}{\spacedlowsmallcaps{#1}} 
\pdfbookmark[0]{#1}{\thepage::\thechapter}%
%Add a contentsline to the TOC, omit the chapter number and align correctly
\begingroup%
\renewcommand{\Hy@writebookmark}[5]{}{}{}{}{}%   Drop the automatic writing of bookmarks by addcontentsline%
\addcontentsline{toc}{chapter}{%
\numberline{}{\noexpand\spacedlowsmallcaps{#1}}}%
\endgroup%
}%
\makeatother%



\begin{document}
\hypersetup{pageanchor=false}
\pagestyle{scrheadings} 
\pagenumbering{gobble}


\cleardoublepage
\pdfbookmark{\contentsname}{tableofcontents}
\setcounter{tocdepth}{2}
\tableofcontents
\markboth{\spacedlowsmallcaps{\contentsname}}{\spacedlowsmallcaps{\contentsname}} 
\cleardoublepage

\hypersetup{pageanchor=true}
\pagenumbering{arabic}

\deftripstyle{pgnumtopouter}{}{}{\pagemark}{}{}{}
\renewcommand{\chapterpagestyle}{pgnumtopouter}

\cleardoublepage
\phantomsection
%\pdfbookmark{Sommario}{Sommario}
\begingroup
\let\clearpage\relax
\let\cleardoublepage\relax
\let\cleardoublepage\relax

%\phantomsection
%\chapter*{Sommario}%
%\addcontentsline{toc}{chapter}{\protect{\scshape Sommario}}

\addchapextended{Sommario}%
\addchap{Sommario}


%\addchap[\noexpand\MakeTextLowercase{\sffamily\textsc{Sommario}}]{Sommario}%

%\addchap[\sffamily\textsc{Lorem}]{Sommario}%

Qui Abstract in italiano

\lipsum
\lipsum
\lipsum
\lipsum
\lipsum
\vfill

\selectlanguage{english}
\pdfbookmark{Abstract}{Abstract}

\addchapextended{Abstract}
\addchapextended{Lorem}

\lipsum
\lipsum
\lipsum
Qui abstract in inglese

\selectlanguage{italian}

\endgroup           

\vfill

\chapter{Lorem}
\label{cap:lorem}
\lipsum
\lipsum
\lipsum
\lipsum

\chapter{Lorem Nr. 2}

\end{document}

在此处输入图片描述

在此处输入图片描述

答案2

以下是使用该titletoc包的解决方案:

\documentclass[10pt,%
               a4paper,%
               twoside,openright,%
% oneside,openany,%
               titlepage,%
               headinclude,,footinclude,%
               BCOR5mm,%
               cleardoublepage=empty,%
               captions=tableheading,%
               ]{scrreprt}
\usepackage[T1]{fontenc}

\usepackage{lipsum}
\usepackage[utf8]{inputenc}
\usepackage[english,italian]{babel}

\usepackage[eulerchapternumbers,%
 beramono,%
 eulermath,%
 pdfspacing,%
 %listings,%
% parts,%
 ]{classicthesis}
\usepackage{arsclassica}
\usepackage{hyperref}

\usepackage{titletoc}
 \titlecontents{chapter}[1.44em]{\smallskip}%\vspace{1cm}
 {{\contentslabel[\thecontentslabel.]{1.25em}}}%numbered
 {\spacedlowsmallcaps}%numberless
 {\quad\contentspage}[\medskip]%


\begin{document}
\hypersetup{pageanchor=false}
\pagestyle{scrheadings}
\pagenumbering{gobble}


\cleardoublepage
\pdfbookmark{\contentsname}{tableofcontents}
\setcounter{tocdepth}{2}
\tableofcontents
\markboth{\spacedlowsmallcaps{\contentsname}}{\spacedlowsmallcaps{\contentsname}}
\cleardoublepage

\hypersetup{pageanchor=true}
\pagenumbering{arabic}

\deftripstyle{pgnumtopouter}{}{}{\pagemark}{}{}{}
\renewcommand{\chapterpagestyle}{pgnumtopouter}

\cleardoublepage
\phantomsection
\pdfbookmark{Sommario}{Sommario}
\begingroup
\let\clearpage\relax
\let\cleardoublepage\relax
\let\cleardoublepage\relax

\addchap{Sommario}

Qui Abstract in italiano

\lipsum
\lipsum
\lipsum
\lipsum
\lipsum
\vfill

\selectlanguage{english}
\pdfbookmark{Abstract}{Abstract}

\addchap{Abstract}
\lipsum
\lipsum
\lipsum
Qui abstract in inglese

\selectlanguage{italian}

\endgroup

\vfill

\chapter{Lorem}
\label{cap:lorem}
\lipsum
\lipsum
\lipsum
\lipsum
\end{document} 

在此处输入图片描述

答案3

我一直在使用classicthesis,也遇到了同样的问题。这里的答案对我没有帮助,但指导了我找到解决方案。

对于新章节,我现在使用\addchap{\tocEntry{>CHAPTERNAME<}},它既出现在 pdf 中,也出现在 LoC 中的小写字母中。

对于内容,您将自动收到目录条目,但不是按照样式classicthesis,我使用了这个(这里用于 LoC):

\phantomsection
\addcontentsline{toc}{chapter}{{\tocEntry{\contentsname}}}%
\tableofcontents

对于glossaries,我需要另一种解决方法,即:

\renewcommand{\glossarysection}[2][]{}
\addchap{\tocEntry{Symbols}}
\printglossary[type=symbols]

\newpage

\addchap{\tocEntry{Acronyms}}
\printglossary[type=\acronymtype]

我希望这也能帮助解决下一位读者的问题。干杯!

相关内容