[Tex/LaTex] How to put a line-break in section heading

hyperrefline-breakingsectioningwarnings

I have some section headings occupying two lines and I'm not satisfied with the way XeLaTeX breaks the heading. If I manually add \\ the output looks fine, but I get the following warning:

[hyperref] Token not allowed in a PDF string (PDFDocEncoding): removing `\\'. 

My code looks like that:

\section{this is a very long title I \\ want to break manually}

Is there a way to have a line-break there without the warning?

Best Answer

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}