fncychap: toF と toT の見出しと最初の要素の間の垂直スペースを削除します

fncychap: toF と toT の見出しと最初の要素の間の垂直スペースを削除します

fncychap パッケージの使用時に発生する垂直方向の間隔を削除しようとしていますが、どうすればよいでしょうか? 次のように記述して、すでに toc でこれを行っています。

\renewcommand\contentsname{Table of Contents}
\tableofcontents
\addtocontents{toc}{\vskip-70pt}

最後の行は、 内のものを元の場所に戻す行です。およびtocでも同様の方法がありますか?loflot

ここに画像の説明を入力してください

答え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

関連情報