2010-07-19 162 views
6

我正在使用書的樣式編寫研究報告,並想知道如何在章節標題前刪除頂部垂直空間。我需要這個'抽象'頁面。我希望它比標準章節更接近頂端。刪除LaTeX中的 chapter之前的空格

+0

我不知道它是否會工作,但你有沒有試過\ vspace {-5cm}? – Vivi 2010-07-19 11:01:22

+1

保證金?你的意思是垂直空間?你看過http://stackoverflow.com/questions/2801107/latex-positions-of-page-numbers-position-of-chapter-headings-chapters-and-tab? – 2010-07-19 11:12:45

+0

@vivi \ vspace不起作用。不管怎麼說,還是要謝謝你。 – ssn 2010-07-19 11:57:39

回答

6

一個簡單的方法是使用titlesec包。其文檔的附錄9.2顯示了標準類如何排列標題 - 根據自己的要求複製和修改這些命令並不難。

15

下面是一些使用titlesec包的示例代碼,Stefan的建議。 titleformat命令會將所有內容都保留爲默認值,但您需要將其包含在內(我認爲)才能使titlespacing更改起作用。第二titlespacing命令設置恢復爲默認值,與假設你想要只爲第一章改變間距:

\documentclass{book} 

\usepackage{titlesec} 

\titleformat{\chapter}[display] 
{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge} 

% this alters "before" spacing (the second length argument) to 0 
\titlespacing*{\chapter}{0pt}{0pt}{40pt} 

\begin{document} 

\chapter{One} 
% this changes "before" spacing back to its default of 50pt 
\titlespacing*{\chapter}{0pt}{50pt}{40pt} 
First sentence of chapter. 

\chapter{two} 
First sentence of chapter. 

\chapter{three} 
First sentence of chapter. 

\end{document} 
0

有同樣的問題,我嘗試了titlesec的解決方案,這在某種程度上沒有按預期工作( OsX上的Texshop 2.47錯誤太多)。

但是,我找出了一個簡單的解決方案(至少對於我的情況)與幾何包。該交易僅針對感興趣的頁面調用新的頁面幾何圖形,然後恢復由fncychap定義的頁面幾何圖形。

% in the preamble 
\documentclass[11pt,a4paper,twoside,openright]{book} 
\usepackage{geometry} 
\usepackage[Sonny]{fncychap} 

% in the document 
\frontmatter 

% adapt geometry options to your needs 
\newgeometry{textwidth=16cm,textheight=28cm,voffset=-2cm,bottom=0cm} 
\chapter*{Abstract} 
\markboth{}{} 
\addcontentsline{toc}{chapter}{Abstract} 
% text 
\restoregeometry 
% from now on fncychap takes over again 
\mainmatter