
我正在嘗試刪除使用 fncychap 套件時出現的垂直間距,但如何做到這一點?我已經在目錄中編寫了以下內容:
\renewcommand\contentsname{Table of Contents}
\tableofcontents
\addtocontents{toc}{\vskip-70pt}
最後一行是將內容移回 中的位置toc
。在lof
and中有類似的方法嗎lot
?
答案1
不要使用fncychap
.所有這些樣式都可以透過以下方式輕鬆生成titlesec
\documentclass{book}
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\huge\filleft\bfseries}
{\titlerule[1pt]%
\vspace{1ex}%
\chaptertitlename\ \thechapter}
{20pt}
{\Huge}[\vspace{1ex}{\titlerule[1pt]}]
\titleformat{name=\chapter,numberless}[display]
{\normalfont\huge\filleft\bfseries}
{}
{0pt}
{\titlerule[1pt]
\vspace{1ex}%
\Huge}[\vspace{1ex}{\titlerule[1pt]}]
\titlespacing*{\chapter} {0pt}{20pt}{20pt} %% adjust these numbers
\titlespacing*{name=\chapter,numberless} {0pt}{20pt}{20pt} %% adjust these numbers
\begin{document}
\tableofcontents
\chapter{Introduction}
\end{document}
答案2
我不得不承認我現在同意@HarishKumar 的觀點。我的問題的解決方案是跳過 fncychap 套件並使用 titlesec 代替。
這是我從 @HarishKumar 的範例生成的程式碼。
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\Large\filleft}
{\sc\chaptertitlename\ \Huge{\thechapter}\\%
\vspace{1.5cm}
\titlerule[1pt]}
{-20pt}
{\Large}[\vspace{2ex}{\titlerule[1pt]}]
\titleformat{name=\chapter,numberless}[display]
{\normalfont\Large\filleft}
{}
{0pt}
{\titlerule[1pt]
\vspace{2ex}%
\Large}[\vspace{2ex}{\titlerule[1pt]}]
\titlespacing*{\chapter} {0pt}{0pt}{40pt} %% adjust these numbers
\titlespacing*{name=\chapter,numberless} {0pt}{0pt}{40pt} %% adjust these numbers