Not to have titles with broken words neither in the title nor in the header

If have long titles in my document, and I do not want them to present broken words. I saw this topic on How do I manually break a line in the title of my thesis -- using the U of Maine package, but after using the proposal, I realized that on the header of the document, the lines where also divided into two lines as introduced with

\section{This is a very long \protect\\ title that I divide into two}

Anyone knows how to have the title in only one row in the header? It is sure that it enters in one line.

You could use \section[short]{long} as shown in the following MWE in order to get a section heading that is manually broken into two lines in the actual section and a heading that is not broken in the table of contents and in the header.

\documentclass{article}
\usepackage{fancyhdr}
\pagestyle{fancy}

\begin{document}

\tableofcontents
\newpage
\section[This is a very long title that I divide into two]{This is a very long \protect\\ title that I divide into two}

\end{document}


I don't think this is quite what you were after but it's another approach.

\documentclass{article}
\usepackage{fancyhdr}
\pagestyle{fancy}
\begin{document}

\tableofcontents
\newpage
\section{\mbox{This is a very long title that I do not divide into two}}

\end{document}


• Thank you but it is not what I was looking for. I need to write the title (in bold) in two different lines without breaking for example di-vide into two parts, and appearing only in one line in the header. – R18 Oct 19 '18 at 16:59