[Tex/LaTex] No hyphen for a word

hyphenationline-breaking

I want to put pdflatex to not put a hyphen in a word went it comes to the end of the line.

I tried to put a \- in the beginning or the end of that word but it doesn't work.

For example if I put:This is a very long sentence that needs two lines with thatshouldnot\- be hyphened I will get:

This is a very long sentence that needs two lines with thatshouldnot-
be hyphened

and if I do it this way: This is a very long sentence that needs two lines with \-thatshouldnot be hyphened I will get:

This is a very long sentence that needs two lines with –
thatshouldnot be hyphened

I want 'thatshouldnot' to stay in one word and with no hyphen in the beginning or the end of the word.

Best Answer

if this word appears more than once in your document, and you never want it to be hyphenated, you can suppress hyphenation everywhere by putting this line in the preamble:

\hyphenation{thatshouldnot}

if it only occurs once, then david's answer using \mbox suffices.

Related Question