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?
Asked
Active
Viewed 3,219 times
0
Adam Liter
- 12,567
1 Answers
3
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}
Francis
- 6,183
\phantomalso 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 04:22