Tell me more ×
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.

I cannot remember how to create an invisible character in LaTeX, i.e. I want to put a space the that has the width of a particular character, say `M'. I know there is a command for this, and this is a really dumb question, but my Google fu has failed me.

share|improve this question
8  
Please accept either your or TH.s answer to conclude this question. Thank you. – Martin Scharrer May 9 '11 at 18:27

2 Answers

You already found the answer, but let me expand a bit. There are three phantom commands. They each take a single argument.

  1. \hphantom inserts an empty box that has zero height, zero depth, and the width of its argument.
  2. \vphantom inserts an empty box that has the height and depth of the argument, but zero width.
  3. \phantom inserts an empty box with the same dimensions as the arguments.
share|improve this answer
7  
Why is there height, width and depth? 3D in typesetting? – Kit Oct 25 '10 at 2:32
24  
Height is the length above the baseline, depth is the length below. So a character such as "X" will have a height but zero depth, and "g" has (a smaller) height as well as depth. – Will Robertson Oct 25 '10 at 3:44

OK, I finally found it. The command is \phantom.

share|improve this answer
5  
This isn't a dumb question. The answer would be better if it gave an example of its use, or referenced some resource that explained the command. – Charles Stewart Oct 24 '10 at 21:08

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.