I would like to produce whitespace as wide as a particular character. One trick I have figured out is to use {\color{white} x} (if for example this would produce whitespace as wide as the character x) with the color package. However, this is problematic, as when I create a pdf (e.g. using pdflatex), the character will still be there, so that if a user copies some text they have selected including the "invisible" character, they will also copy that character. Are there better methods to accomplish what I want?


Easiest way seems to be \phantom{CHARACTERHERE}

EDIT: A slightly fancier way is to create a new length:


then use

  • 5
    \phantom also produces vertical white space (though, most times this will not matter). For only horizontal white space, use \hphantom, for vertical, \vphantom. – Qrrbrbirlbel Jul 21 '13 at 4:22

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