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?

  • 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?" Jul 27, 2010 at 6:51

2 Answers 2


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:

 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

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.


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.)

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.