
所以我有這個編碼相對簡單的book
文檔。
當我嘗試編譯它時,我收到很多Underfull \vbox (badness 10000) has occurred while \output is active
警告(儘管提供的 MWE 中只有一個)。結構book
很簡單:只有標題和文字。
例如,頁面以零件編號、章節編號和文字開頭(是的,我在零件編號和章節編號之間還有圖像,以及使用\includegraphics
指令新增的章節編號和文字)。但即使我刪除了這些圖像,警告仍然會彈出,並顯示更多警告!
之前我遇到了文字底線掛在框架上方的問題,但透過添加到書本中heightrounded
解決了這個問題。 我知道該類別預設使用將文字逐字刷新到框架底部。因此,我嘗試使用許多人建議的方法,但是在解決了警告發生的同時,引入了另一個問題:現在在某些頁面上,底線的基線懸掛在框架上方,有時幾乎高達整行(不幸的是,它不是這在 MWE 中很明顯,但您仍然可以在第 1 頁上看到它)! 所以我很困惑是什麼導致這些警告彈出,因為我的文檔編碼相當簡單? ! 我注意到它在某種程度上與我的標題(零件號和章節號,可能還有圖像)的間隔方式有關。因為當我刪除所有和命令並只留下裸文字時,警告就會消失。和包包有關係嗎? 我原封不動地保留了文件中使用的所有內容,因此您可以輕鬆發現其中一個是否有問題。 PS:不要介意這些警告,我的文字中沒有它們。它們僅在使用時出現。geometry
book
\flushbottom
\raggedbottom
\part
\chapter
titlesec
packages
Overfull \hbox
\lipsum
% !TEX TS-program = LuaLaTeX
\documentclass[11pt,twoside,openany]{book}
\pagestyle{plain}
\usepackage[english, russian]{babel}
\usepackage{fontspec}
\setmainfont{EB Garamond}[
]
\usepackage{microtype}
\usepackage[shortcuts]{extdash}
\usepackage[pagewise]{lineno}
\usepackage[
paperwidth=6in,
paperheight=9in,
inner=13mm,
top=15mm,
outer=20mm,
bottom=24mm, showframe,
heightrounded,
]{geometry}
\usepackage{lettrine}
\setcounter{DefaultLines}{3}
\renewcommand{\DefaultLoversize}{0.1}
\renewcommand{\DefaultLraise}{0}
\renewcommand{\LettrineTextFont}{}
\setlength{\DefaultFindent}{\fontdimen2\font}
\usepackage{lipsum}
\setlength{\parskip}{0pt}
\usepackage{graphicx}
\usepackage[dvipsnames]{xcolor}
\usepackage[pages=some]{background}
\usepackage{fancyhdr}
\fancyhf{}
\renewcommand{\headrulewidth}{0ex}
\fancyfoot[LE,RO]{\thepage}
\pagestyle{fancy}
\fancypagestyle{plain}{%
\fancyhf{}%
\renewcommand{\headrulewidth}{0ex}%
\fancyhf[lef,rof]{\thepage}%
}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{\par}{}{}
\makeatother
%\raggedbottom % If used, it messes up the bottom line the way that its baseline hangs above the frame on some pages
\usepackage{titlesec}
\titleclass{\part}{top}
\titleformat{\part}{\centering\normalfont\large}{\thepart.}{4ex}{\LARGE\centering}
\titlespacing*{\part}{0ex}{2ex}{0ex}
\titleclass{\chapter}{straight}
\titleformat{\chapter}{\centering\normalfont\large}{\thechapter.}{4ex}{\large\centering}
\titlespacing*{\chapter} {0ex}{6ex}{02ex}
\setcounter{secnumdepth}{0}
\usepackage{tocloft}
\begin{document}
\pagestyle{plain}
\pagenumbering{gobble}
\addtocounter{page}{0}
\begin{titlepage}
\centering
{\large TITLE\par}
\vfill
\title{SOME TITLE}
\author{SOME AUTHOR}
\date{}
\end{titlepage}
\clearpage
\frontmatter
\mainmatter
\pagenumbering{arabic}
\part{PART ONE}
\begin{center}
\includegraphics[height=15ex,keepaspectratio]{example-image-a}
\end{center}
\chapter{CHAPTER ONE}
\begin{center}
\includegraphics[height=35ex,keepaspectratio]{example-image-b}
\end{center}
\lipsum[1-12]
\chapter{CHAPTER TWO}
\begin{center}
\includegraphics[height=35ex,keepaspectratio]{example-image-b}
\end{center}
\lipsum[1-12]
\chapter{CHAPTER THREE}
\begin{center}
\includegraphics[height=35ex,keepaspectratio]{example-image-b}
\end{center}
\lipsum[1-12]
\end{document}
答案1
您需要圍繞標題具有一定的靈活性,以便實現齊平底部
也許
\titlespacing*{\chapter} {0ex}{6ex plus 4ex minus 1ex}{2ex}
但是第 3 章之前的頁面出現未滿的警告是因為您刪除了正常內容\clearpage
,但標題和圖像不適合併且沒有膠水來填充頁面,您也許可以\filbreak
像這樣添加以允許章節之前的頁面較短。
\titleformat{\chapter}{\filbreak\centering\normalfont\large}{\thechapter.}{4ex}{\large\centering}