Sign up ×
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'm wondering about the best way to do an explicit space character (I don't even know what it's properly called), like the ones you get in the \begin{verbatim*} environment. The closest I've found is


in math mode, but it seems like a bit of a hack to me. Is there any text symbol for what I'm looking for?

share|improve this question

3 Answers 3

up vote 27 down vote accepted

Nothing special is needed here; standard LaTeX provides \textvisiblespace:



An explicit space: a\textvisiblespace b


enter image description here

A simple variation of the original definition:

  \mbox{\kern.06em\vrule \@height.3ex}%
  \vbox{\hrule \@width.3em}%
  \hbox{\vrule \@height.3ex}}

allows to control the width using an optional argument:


  \mbox{\kern.06em\vrule height.3ex}%
  \vbox{\hrule width#1}%
  \hbox{\vrule height.3ex}}


An explicit space: a\textvisiblespace b

An explicit space: a\Vtextvisiblespace b

An explicit 1em space: a\Vtextvisiblespace[1em]b

An explicit 1cm space: a\Vtextvisiblespace[1cm]b


enter image description here

share|improve this answer
that's pretty cool. Is there an easy way to control the amount of space to its left and right? I use this in monospace, and it gets too close to its right neighbour. – lenz Jun 20 '13 at 13:03
@lenz please feel free to open a new question. – Gonzalo Medina Jun 20 '13 at 13:49

The simplest way to get it is by printing character 32 in typewriter font:

share|improve this answer
This relies imho to much on the font encoding. E.g. it won't work if you use xetex/fontspec or if you type in greek (LGR-encoding). – Ulrike Fischer Apr 5 '12 at 9:01

You can store that character (a squat-u) inside a box and use it as necessary:

enter image description here

\verb*! !
Hi\aspace there!

You cannot directly store it in a macro, since verbatim content cannot be passed as an argument. However, boxing it via an lrbox environment works. Use the squat-u via \aspace.

share|improve this answer
Thanks for that! – Josh Chen Apr 5 '12 at 5:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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