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.

This question already has an answer here:

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?

share|improve this question

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

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

up vote 3 down vote accepted

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