How to put a line-break in section heading?
Use \texorpdfstring
; the first argument can contain (La)TeX code and the second one (text only), will be used for the bookmarks:
\section[this is a very long title I want to break manually]{\texorpdfstring{this is a very long title I\\ want to break manually}{this is a very long title I want to break manually}}
If a ToC is to be produced and the break line is not desired there, a better option is to to use the optional argument of \section
(this will be used for the headers, the ToC and the bookmarks):
\section[this is a very long title I want to break manually]{this is a very long title I\\ want to break manually}
I recently ran into a similar issue where my section title was being split across two lines, but only one or two words were ending up on the second line. I wanted to manually insert a line break so that I could balance it better. I ended up using non-breaking spaces to force the line break to happen earlier instead:
\section{this is a very long title I want~to~break~manually}
This worked better for my table of contents as well, since the section title fit all on one line there (in the smaller font), but the non-breaking spaces forced LaTeX to split the section title more evenly across two lines in the document body.
Just using \\
in the .tex file is enough to break the line in the heading when compiling to dvi file. But when compiling to pdf, the line breaks also in the table of contents and it looks strange. Thus, the best solution I found was converting dvi to pdf directly.
*\section{this is a very long title \\ I want to break manually}*