1

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?

  • 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

use

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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