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.

Throughout my PDF document, generated text on the end of the line is spilled out to the margin. That is, if I use, e.g., \ref{} or \cite{}, then LaTeX does not consider the actual size of the generated text when calculating the output text, so that it is sometimes spilled out to the margin.

I thought to solve this by putting \mbox around the \ref or \cite command, as I thought that the \mbox command forse latex to compile the inner command first, but it did not helped. Am I wrong about the \mbox command?

Anyone has any idea how to solve this?

share|improve this question
1  
Welcome to TeX.sx! Any text inside \mbox will be placed in an own box which cannot be broken, so using it is counterproductive here. This has nothing to do with the order of compilation. LaTeX just couldn't break the word or place it on the next line, so it went to the margin. It prefers overlong lines before underfull ones. Please consider to add a minimal working example (MWE). –  Martin Scharrer Jul 12 '11 at 6:58

1 Answer 1

use

\begin{sloppypar}
text .... \ref{} ... text
\end{sloppypar}

for such paragraphs where the interwordspace is too small to allow good line breaking.

share|improve this answer
    
thanks!!! it works! –  Giris Jul 12 '11 at 7:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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