答案1
此宏\allowbreak
提供允许的但非强制的断点(无连字符)。如果希望断点可连字符(也称为可选连字符),则应\-
使用。
我们可以看出,尽管第一种情况下小节标题超出了\hbox
,第二种情况下小节标题没有连字符就断开,而第三种情况下小节标题用连字符断开,但目录条目都是相同的。
\documentclass{report}
\begin{document}
\tableofcontents
\subsection{This is a testtesttest This is a testtesttest This tezzzzzzzz
This is a testtesttest This is a testtesttest }
\subsection{This is a testtesttest This is a testtesttest This tezz\allowbreak zzzzzz
This is a testtesttest This is a testtesttest }
\subsection{This is a testtesttest This is a testtesttest This tezz\-zzzzzz
This is a testtesttest This is a testtesttest }
\end{document}