11

Could anybody tell me why does phantom command create paragraph spacing issues as described in this thread:

This sort of code

Vin.\ i zvat.\ mn.\ imaju akcente kao i im.\ mn.: \emph{zȗbe : zȗbi}, 
\emph{knȅzove : knȅzovi}, \emph{púževe} i t.\ d.

\phantom{a}\symbol{"0311} na ˊ u svima padežima osim onih koji će se 
na po se spomenuti, n.\ p.\ \emph{strȋc} ima u rod.\ jed.\ \emph{stríca}, dat.: 
\emph{strícu}, vin.: \emph{stríca}, tvor.: \emph{strícem}, skaz.: \emph{strícu}; 
tako \emph{dvȏr} ima u im.\ mn.\ \emph{dvóri} i \emph{dvórovi}, i t.\ d.

produces

enter image description here

Why the such a big space between the paragraphs?

Does anybody know?

17

\phantom is not a LaTeX documented box command and does not work the same way as \mbox etc. You need \leavevmode\phantom{...} so the phantom text starts the paragraph.

It's easier to see what is happening if you use \hbox rather than \phantom so you can see where it is placed. \hbox on its own does not start a paragraph, but rather is stacked above the following paragraph, so you see a b flush left. The \phantom case is the same except you can not see the contents.

enter image description here

\documentclass{article}


\begin{document}



1 aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa 
aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa 

\hbox{b}bbb bbb bbb

2 aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa 
aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa 

\leavevmode\hbox{b}bbb bbb bbb


3 aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa 
aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa 

\phantom{b}bbb bbb bbb

4 aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa 
aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa 

\leavevmode\phantom{b}bbb bbb bbb

6 aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa 
aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa 

\end{document}
  • Thank you! I presume that the \hbox then fills the space from b until the end of that line and then comes the indent and the beginning of the new paragraph; however, why is b before the box? – Sylph Aug 22 '13 at 21:20
  • @Sylph no the hbox is just around the b It comes before the paragraph as TeX is in vertical mode so stacks boxes vertically, you need to start horizontal mode to make things stack horizontally, a letter does that or \leavevmode but a box command does not. – David Carlisle Aug 22 '13 at 21:42

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.