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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use xelatex, with Ubuntu font, and for some reason I can't insert a \textvisiblespace into my document - all that I get in result is a box: ``. Is there some way to fix that?


share|improve this question
\textvisiblespace does not use any fonts. It constructs the "space character" as 3 rules. What kind of warnings do you receive in your output/.log file? – Werner Sep 22 '12 at 16:40
@Werner - seems that it is not true - since the .log file contains this line: Missing character: There is no ␣ in font Ubuntu/ICU:mapping=tex-text,!. But I would be more than happy to draw it using three rules. How can I achieve this? – Rogach Sep 22 '12 at 17:36
I've referenced a possible solution. It should work in your instance, but I'm unable to test it since I don't have the fonts installed. – Werner Sep 22 '12 at 17:56
up vote 5 down vote accepted

The font Ubuntu doesn't support the Unicode character 2423. Use

\setmainfont[Mapping=tex-text]{DejaVu Serif}

for example. Another alternative maybe:

\newfontface\TVSp{DejaVu Serif}

share|improve this answer
That's sad, I like that font. But maybe you can suggest more conventional font? I'm writing a technical documentation text, that would be probably read on computer screen. – Rogach Sep 22 '12 at 17:45
see edited answer. However, Ubuntu is similiar to Bera Sans – Herbert Sep 22 '12 at 17:46
Thanks! Your suggestions worked perfectly. – Rogach Sep 22 '12 at 17:55
+1, but I suggest \protected\def. It's true that \TVSp will be "robust", but it's perhaps more desirable to write \textvisiblespace in case it appears in a moving argument. – egreg Sep 22 '12 at 18:03
And where is the problem, if it appears for example in a \caption command?? – Herbert Sep 22 '12 at 18:17

I don't have the font installed, so I'm not sure whether this is what you're after:

  1. Redefine \textvisiblespace after loading the Ubuntu font. The following definition is taken from latex.ltx:

       \mbox{\kern.06em\vrule height.3ex}%
       \vbox{\hrule width.3em}%
       \hbox{\vrule height.3ex}}
  2. Capture the contents of \textvisiblespace in a box before loading the new font and restore it afterwards:

    % Document preamble
    % Insert font-related changes here

    Note that this will fix the setting of \textvisiblespace in \normalfont, so it won't change with size changes like \small (for example).

share|improve this answer

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.