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
Please accept either your or TH.s answer to conclude this question. Thank you. –  Martin Scharrer May 9 '11 at 18:27
@MattLeifer: Please accept an answer, as Martin told you years ago ;-) –  Tobi Oct 11 '13 at 7:49
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 '14 at 8:33
@math Take a look at his profile; he hasn't been on in three years. These things happen; that's why there is a voting system. –  Sean Allred Nov 23 '14 at 4:45

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

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

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

protected by Community Nov 23 '14 at 7:26

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.