我將標題放在外邊距中,它們不應該佔用任何垂直空間。我雖然透過使用來實現這一點\vbox to 0pt{...}
,但fancyhdr
沒有購買。這是錯誤訊息:
Package Fancyhdr Warning: \headheight is too small (12.0pt):
Make it at least 15.60004pt.
We now make it that large for the rest of the document.
This may cause the page layout to be inconsistent, however.
我不知道 15.60004pt 這個數字是從哪裡來的,也不知道如何以不佔用任何垂直空間的方式寫標題。 MWE 封閉;關鍵宏是\nrlefthead
. (這個例子不是很簡單,但是用文字長度取代所有命名長度會使其難以閱讀。)
\documentclass[twoside]{book}
\newdimen\blockwidth
\newdimen\blockheight
\blockwidth=120mm
\blockheight=220mm
\usepackage{etex}
\usepackage[twoside,top=10mm,body={\blockwidth,\blockheight}]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[EL]{\nrlefthead}
\renewcommand\headrulewidth{0pt}
\newdimen\nrheaddrop
\nrheaddrop=1.5in
\newdimen\nrleftheadrightmargin
\setlength\nrleftheadrightmargin{-20mm}
\newdimen\myheadwidth
\setlength{\myheadwidth}{180pt}
\newcommand\nrlefthead{%
\vbox to 0pt{\vspace*{\nrheaddrop}%
\llap{\parbox{\myheadwidth}%
{\raggedright\noindent\itshape
\nouppercase{\leftmark}}%
\hspace*{\nrleftheadrightmargin}}%
\vss}}
\renewcommand\chaptermark[1]{\markboth{#1}{}}
\usepackage{lipsum}
\begin{document}
\chapter{An innocuous title}
\lipsum[23-30]
\end{document}
答案1
\vbox
如果您不知道,請避免。
\documentclass[twoside]{book}
\newdimen\blockwidth
\newdimen\blockheight
\blockwidth=120mm
\blockheight=220mm
\usepackage[twoside,top=10mm,body={\blockwidth,\blockheight}]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[EL]{\nrlefthead}
\renewcommand\headrulewidth{0pt}
\newdimen\nrheaddrop
\nrheaddrop=1.5in
\newdimen\nrleftheadrightmargin
\setlength\nrleftheadrightmargin{-20mm}
\newdimen\myheadwidth
\setlength{\myheadwidth}{180pt}
\newcommand\nrlefthead{%
\parbox[t][0pt]{\textwidth}{%
\vspace*{\nrheaddrop}%
\llap{%
\parbox[b]{\myheadwidth}{%
\raggedright\noindent\itshape
\nouppercase{\leftmark}%
}%
\hspace*{\nrleftheadrightmargin}%
}%
}%
}
\renewcommand\chaptermark[1]{\markboth{#1}{}}
\usepackage{lipsum}
\begin{document}
\chapter{An innocuous title}
\lipsum[23-50]
\end{document}