For alignment reasons (for boxes that align themselves on the text they contain), I currently use this command :


to make all boxes with the same height by adding an invisible "TJPtjp" before and after the text. But the problem is when someone copy/paste the text from the pdf: he can see the "TJPtjp".

Instead of text, how to put one invisible "box" of the height of "TJPtjp" before and after the text, aligned as a text, so that it will act as a vertical spacer.

  • 1
    \leavevmode\phantom{0.}? – egreg Sep 15 '15 at 7:50
  • Can you explain a little more, what would be the whole replacement of my \newcommand? – Vincent Sep 15 '15 at 7:56

LaTeX has an undocumented but very useful feature:


will create “phantoms”; they occupy the same space of text, but \hphantom just for the width (no height and depth) and \vphantom just for the height and depth (no width). In any case no character will appear, just the space they would occupy.

For TeXnical reasons, you should add \leavevmode before any of these commands (unless you are sure they will be used in LR-mode or math mode).

So what you want seems to be


and \fake{0.} instead of \transparent{0.). Your code would become

  • Just curious, were you joking when you said that the phantom commands are undocumented? In what sense are they undocumented? For example, they are mentioned in "The LaTeX Companion". – James Sep 15 '15 at 11:04

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.