如何在目录中向所有零件名称添加两行,如下图所示。
\documentclass[a4paper,11pt,openany,french]{book}
\usepackage[french]{babel}
\usepackage{geometry}
\geometry{paperwidth=21cm,paperheight=29.7cm, body={18cm,25.7cm}, top=2.5cm, left=1.5cm}
\usepackage[pdftex,pdfauthor={Moi},pdftitle={Bonjour},pdfpagemode={UseOutlines},bookmarks,bookmarksopen,bookmarksnumbered,pdfstartview={FitH},colorlinks,linkcolor={blue},citecolor={blue},urlcolor={red}]{hyperref}
\begin{document}
{
\frontmatter
\tableofcontents
\cleardoublepage
\chapter*{Preface}
\mainmatter
\part{kafhkahj}
\chapter{lafhjlahf}
\chapter{lafhsfsffasf}
\chapter{l54gfvsahf}
\part{pokjk}
\chapter{32546}
}
\end{document}
答案1
这是一个简单的解决方案titletoc
:
\documentclass[a4paper,11pt,openany,french]{book}
\usepackage{babel}
\usepackage{geometry}
\geometry{body={18cm,25.7cm}, top=2.5cm, left=1.5cm}
\usepackage{mfirstuc, titlecaps}
\newcommand{\Partname}{Partie}%
\usepackage{titletoc}
\titlecontents{part}[0pt]{\bfseries\protect\addvspace{15pt}\titlerule[1pt]\addvspace{1ex}}%
{}{\Partname~}%numbered, unnumbered
{\hfill\contentspage}[\addvspace{0.7ex}{\titlerule[1pt]}\addvspace{1.5ex}]
\usepackage[pdftex]{hyperref}
\begin{document}
{
\frontmatter
\tableofcontents
\cleardoublepage
\chapter*{Préface}
\part{kafhkahj}
\chapter{lafhjlahf}
\chapter{lafhsfsffasf}
\chapter{l54gfvsahf}
\part{pokjk}
\chapter{32546}
}
\end{document}