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.

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
19  
Please accept either your or TH.s answer to conclude this question. Thank you. –  Martin Scharrer May 9 '11 at 18:27
2  
@MattLeifer: Please accept an answer, as Martin told you years ago ;-) –  Tobi Oct 11 '13 at 7:49
2  
Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. –  Jubobs Oct 11 '13 at 8:25
    
-1: Is there any reason not to accept one of the answers? –  math Apr 4 at 8:33
add comment

2 Answers 2

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
14  
Why is there height, width and depth? 3D in typesetting? –  Kit Oct 25 '10 at 2:32
41  
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
1  
@Kit: You might also want to see the illustration in the question tex.stackexchange.com/q/151584/25077 –  strpeter May 27 at 15:00
add comment

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

share|improve this answer
11  
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
add comment

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.