# Whitespace as wide as a character [duplicate]

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?

-

## marked as duplicate by Werner, Gonzalo Medina, Guido, T. Verron, Harish KumarJul 21 '13 at 5:29

Easiest way seems to be \phantom{CHARACTERHERE}

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

\newlength{\characterlength}
\settowidth{\characterlength}{CHARACTERHERE}


then use

\hspace{\characterlength}

-
\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