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.

If I have some text and then \phantom{more text}, will LaTeX just allow an overfull (invisible) box at the end of the line, or could it potentially put in a line break and then have the invisible box at the start of the next line?

share|improve this question
1  
I feel that this isn't a good question as phrased. There are obvious tests that I would hope anyone asking a question here could do. The questioner ought to indicate that they have already done those tests and so ask a more specific question. For example, "I've observed that sometimes \phantom{some text} leaves a space at the end of the line and sometimes at the beginning; does anyone know the rule for when it does which?" –  Loop Space Jul 27 '10 at 6:51

2 Answers 2

up vote 2 down vote accepted

According to the test I just did, LaTeX will break the line before the invisible box under certain circumstances; however the box has to begin very close to the end of the line in order for this to happen. Otherwise it'll just complain about an overfull (invisible) hbox.

To see it yourself, try compiling this:

\documentclass{article}
\begin{document}
 blah blah blah blah blah blah blah blah blah blah blah blah
 blah blah % remove this line to get overfull hbox
 \phantom{blah blah blah foo blah blah blah blah blah blah}
 blah blah blah blah
\end{document}

As it is, this document produces a blank space on the beginning of the second line. But if you remove the last two blahs before the \phantom, you get the blank space appearing at the end of the first line, and the second line starting at the left margin.

share|improve this answer

Of course it will. \phantom produces a box -- one that happens to be empty -- just like anything else, and all that a regular word is in TeX is a box. (Okay, a potentially breakable one, but you get the idea.)

share|improve this answer

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.