节标题换行

节标题换行

我想将我的章节标题拆分成新行。

\section{Underactuated mechanical systems \\ with servo constraints}

但是新行并没有与第一个单词 Underactuated 对齐,而是与第 4.1 节对齐。看起来不太好。

\documentclass[
openright,
listof=totoc,
bibliography=totoc,
two‌​side,
fontsize=12pt,
e‌​nglish,
parskip=half,‌​
headinclude,
footincl‌​ude=false,
headseplin‌​e,DIV17,
BCOR16mm,
num‌​bers=noenddot,
2.1hea‌​dlines,
appendixprefi‌​x,
cleardoublepage=em‌​pty]
{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=17BCOR=16mm代替过时的选项DIV17BCOR16mm

\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}

相关内容