关于此代码
\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage{tocbibind}
\usepackage{color}
\title{A book}
\author{PUCK}
\date{\today}
\begin{document}
\maketitle
\Large
\tableofcontents
\newpage
\section{Introduction}
\part[A part]{\Huge{\textcolor{red}{A part}}}
\chapter{A Chapter}
\end{document}
我希望的宽度\part[]{}
更大,大于节和章节的宽度。我该怎么做?谢谢
答案1
使用包titletoc
来格式化零件编号和页码。
(使用\usepackage[nottoc]{tocbibind}
抑制内容来自目录)
\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage[nottoc]{tocbibind} % suppress Contents from toc
\usepackage{xcolor}
\title{A book}
\author{PUCK}
\date{\today}
\usepackage{titletoc}% added <<<<<
\titlecontents{part}
[0pt]
{\addvspace{2pc}}
{}%
{\Huge\bfseries}
{\hspace{1em plus 1fill}\bfseries\Large\contentspage}
[\addvspace{0.5pc}]
\begin{document}
\maketitle
\Large
\tableofcontents
\newpage
\section{Introduction}
\part[\Huge A part]{{\textcolor{red}{A part}}} % changed <<<<
\chapter{A Chapter}
\end{document}
0.1
要从第一部分开始抑制使用
\addcontentsline{toc}{section}{Introduction}
\section*{Introduction}% non numbered section
要放大部分页码,请使用
\titlecontents{part}
[0pt]
{\addvspace{2pc}}
{}
{\Huge\bfseries}
{\hspace{1em plus 1fill}\bfseries\Huge\contentspage}% Huge page number<<<
[\addvspace{0.5pc}]