Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Possible Duplicate:
Prevent hyphenation and use line break in block of text

When some word at the end of sentence does not fit in the line - I would like it to be moved to the new line, and not marked with - in half of it and then moved to new line.

For example: "Some sentence that have some-[line_break_here]-longword." - I would like otherwise: ""Some sentence that have [line_break_here] somelongword."

There must be an option to set this. Thanks in advance.

share|improve this question
2  
1  
For one-off cases, using \mbox{somelongword} would suffice. –  Werner Jul 12 '12 at 19:57
add comment

marked as duplicate by Werner, egreg, ienissei, percusse, Torbjørn T. Jul 17 '12 at 14:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers

if this word is never to be broken, \hyphenation{somelongword} in the preamble will keep it from being hyphenated, but it may still just hang off the end, depending on the rest of the text in the paragraph.

the microtype package does make line breaks nicer, but i can't give an easy example either.

in desperation, wrap

\begin{sloppypar}
....
\end{sloppypar}

around the paragraph, but only as a last resort.

share|improve this answer
add comment

Please, simply use \usepackage{microtype}. This package improves the ability of LaTeX to deal with such cases a lot.

share|improve this answer
    
Please, could you write some example that uses microtype package to deal with my question? –  Teddy Jul 12 '12 at 20:19
    
@Teddy Just give it a try. You are aware that you get the manual of nearly any package by typing texdoc packagename on the command line? –  Keks Dose Jul 12 '12 at 20:34
    
@Keks I guess the OP just wants a very simplified example, or at least a pointer: the microtype doc is just 206 pages long :-) –  chl Jul 12 '12 at 20:58
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.