![节标题换行](https://linux22.com/image/350778/%E8%8A%82%E6%A0%87%E9%A2%98%E6%8D%A2%E8%A1%8C.png)
我想将我的章节标题拆分成新行。
\section{Underactuated mechanical systems \\ with servo constraints}
但是新行并没有与第一个单词 Underactuated 对齐,而是与第 4.1 节对齐。看起来不太好。
\documentclass[
openright,
listof=totoc,
bibliography=totoc,
twoside,
fontsize=12pt,
english,
parskip=half,
headinclude,
footinclude=false,
headsepline,DIV17,
BCOR16mm,
numbers=noenddot,
2.1headlines,
appendixprefix,
cleardoublepage=empty]
{scrbook}
答案1
一个不需要深入细节的解决方案scrbook
是
\section
[Underactuated mechanical systems with servo constraints]%
{\parbox[t]{15em}{Underactuated mechanical systems with servo constraints}}
目录和页眉需要可选参数。
\documentclass[12pt]{scrbook}
\begin{document}
\setcounter{chapter}{4}
\section
[Underactuated mechanical systems with servo constraints]%
{\parbox[t]{15em}{Underactuated mechanical systems with servo constraints}}
\end{document}
答案2
使用\newline
:
\documentclass{scrbook}
\begin{document}
\section
[Underactuated mechanical systems with servo constraints]
{Underactuated mechanical systems \newline with servo constraints}
\end{document}
或者您可以重新定义\sectionlinesformat
来测量部分编号的宽度,并使用\parbox
部分标题文本:
\documentclass{scrbook}
\newdimen\sectionnumberwidth
\newbox\sectionnumber
%\renewcommand\raggedsection{\raggedleft}
\makeatletter
\renewcommand\sectionlinesformat[4]{%
\sbox\sectionnumber{\hskip#2#3}%
\setlength\sectionnumberwidth{\wd\sectionnumber}%
\@hangfrom%
{\usebox\sectionnumber}%
{\parbox[t]{\dimexpr\textwidth-\sectionnumberwidth\relax}{\raggedsection #4}}%
}
\makeatother
\begin{document}
\tableofcontents
\section
[Underactuated mechanical systems with servo constraints]
{Underactuated mechanical systems \\ with servo constraints}
\end{document}
顺便说一句:使用DIV=17
和BCOR=16mm
代替过时的选项DIV17
和BCOR16mm
。
\documentclass[
%openright,% default
listof=totoc,
bibliography=totoc,
%twoside,% default
fontsize=12pt,
english,
parskip=half,
headinclude,
footinclude=false,
headsepline,
DIV=17,% <- changed
BCOR=16mm,% <- changed
numbers=noenddot,
headlines=2.1,% <- changed
appendixprefix,
%cleardoublepage=empty% default
]
{scrbook}