我正在使用它titletoc
来制作整本书的目录,并且使用它minitoc
来制作每个章节的目录。
subsection
我可以为书籍目录和章节目录的样式分配一些不同的样式吗?
例如,全书的目录标题之间的行距应该较大,章节的目录标题之间的行距应该较小。
如何?
母公司:
\NeedsTeXFormat{LaTeX2e}
\LoadClass[11pt,onecolumn,titlepage,twoside,openany]{book}
\RequirePackage[utf8]{inputenc}
\RequirePackage{kpfonts}
\RequirePackage{xcolor}
\definecolor{tssteelblue}{RGB}{70,130,180}
\definecolor{tsorange}{RGB}{255,138,88}
\definecolor{tsblue}{RGB}{23,74,117}
\RequirePackage{tikz}
% Chapter styling
%--------------------------------------------------------------------------
\makeatletter
% Numbered chapters (with minitoc)
\renewcommand{\@makechapterhead}[1]{
\begin{tikzpicture}[remember picture,overlay]
\node at (current page.north west)
{
\begin{tikzpicture}[remember picture,overlay]
% Background image
%\node[anchor=north west,inner sep=0pt] at (0,0)
%{\includegraphics[width=\paperwidth]{background}};
% Chapter heading
\draw[anchor=west, inner sep=0pt] (-0.1cm,-1.5cm) node
[black,
ultra thick,
fill=tsorange!10,
fill opacity=.6,
inner sep=10pt]
(0,0)
{\parbox[t][1.6cm][t]{\paperwidth}
{\huge\bfseries\sffamily\flushleft\thechapter. #1}};
% Chapter contents
\draw[anchor=west,inner sep=0pt] (8.8cm,-7cm) node
[tssteelblue,
ultra thick,
fill=white,
fill opacity=.8,
draw=tssteelblue,
draw opacity=1,
line width=1.5pt,
rounded corners,
inner sep=0pt]
(0,0)
{\hspace{1cm}\parbox[t][7.1cm][t]{11cm}
{\vspace{-1cm}\huge\bfseries\sffamily\flushleft
\textcolor{black}{\sffamily\minitoc}}};
\end{tikzpicture}
};
\end{tikzpicture}
\vspace{7.5cm}
}
% Unnumbered chapters (without minitoc)
\renewcommand{\@makeschapterhead}[1]{
\begin{tikzpicture}[remember picture,overlay]
\node at (current page.north west)
{
\begin{tikzpicture}[remember picture,overlay]
% Background image
%\node[anchor=north west,inner sep=0pt] at (0,0)
% {\includegraphics[width=\paperwidth]{background}};
% Chapter heading
\draw[anchor=west,inner sep=0pt] (-0.1cm,-1.5cm) node
[black,
ultra thick,
fill=tsorange!10,
fill opacity=.6,
inner sep=10pt]
(0,0)
{\parbox[t][1.6cm][t]{\paperwidth}
{\huge\bfseries\sffamily\flushleft #1}};
\end{tikzpicture}
};
\end{tikzpicture}
\vspace{8cm}
}
% Minitoc styling
%--------------------------------------------------------------------------
\RequirePackage{minitoc}
\setcounter{minitocdepth}{2}
\dominitoc[n]
\nomtcrule
\nomtcpagenumbers
\renewcommand{\mtifont}{\large\sffamily}
\renewcommand{\mtcfont}{\small\sffamily}
\renewcommand{\mtcSfont}{\small\sffamily}
\renewcommand{\mtcSSfont}{\small\sffamily}
\renewcommand{\mtcSSSfont}{\small\sffamily}
% Table of contents styling
%--------------------------------------------------------------------------
\RequirePackage{titletoc}
\setcounter{tocdepth}{2}
\titlecontents{chapter}[0cm]
{\addvspace{14pt}\large\sffamily\bfseries}
{\color{tssteelblue}\contentslabel[\Large\thecontentslabel]{1.25cm}}{}
{\color{tssteelblue}\normalsize\sffamily\bfseries
\;\titlerule*[.5pc]{.}\;\thecontentspage}
\titlecontents{section}[0cm]
{\addvspace{6pt}\sffamily\bfseries}
{\contentslabel[\thecontentslabel]{1.25cm}}{}
{\sffamily\hfill\color{black}\thecontentspage}[]
% Index
\RequirePackage{makeidx}
\makeindex
\begin{document}
\tableofcontents
\chapter{This is I}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortis facilisis sem. Nullam
nec mi et neque pharetra sollicitudin. Praesent imperdiet mi nec ante. Donec ullamcorper,
felis non sodales commodo, lectus velit ultrices augue, a dignissim nibh lectus placerat
pede. Vivamus nunc nunc, molestie ut, ultricies vel, semper in, velit. Ut porttitor. Praesent
in sapien. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis fringilla tristique
neque. Sed interdum libero ut metus. Pellentesque placerat. Nam rutrum augue a leo. Morbi
sed elit sit amet ante lobortis sollicitudin. Praesent blandit blandit mauris. Praesent lectus
tellus, aliquet aliquam, luctus a, egestas a, turpis. Mauris lacinia lorem sit amet ipsum. Nunc
quis urna dictum turpis accumsan semper.
\section{I-1}
\subsection{I-1-aaa}
\subsection{I-1-bbb}
\section{I-2}
\subsection{title I-2-eee}
\subsection{title I-2-fff}
\subsection{title I-2-ggg}
\subsection{title I-2-hhh}
\subsection{title I-2-iii}
\section{I-3}
\subsection{title I-3-333}
\subsection{title I-3-333}
\section{I-4}
\subsection{title I-4-444}
\subsection{title I-4-444}
\chapter{This is II}
\end{document}