1

How can we do this type of space? Maybe with \textvisiblespace, but how can I customize it?

enter image description here

Werner
  • 603,163
Nataila
  • 11

2 Answers2

1

Visible space: slot 32 of the cmtt (Computer Modern Typewriter) font.

If another font provides the "customization" you are seeking, you only need invoke the font prior to the visible space, as shown here for Palatino.

Another option is to snag an image of the desired symbol, and scale the \includegraphics to the proper size and position, something like what is done in this question: How to use a custom, scalable, symbol in LaTeX or create latex symbol from vector graphics.

I show, in a crude way, this done on the 3rd line of output, using a clipped version of the graphic you provide. It scales to the vertical footprint of a comma. Obviously, we would want an image with a white or transparent background, and preferably vector graphics.

Correctly scales in math mode (line 4).

\documentclass{article}
\usepackage{scalerel,stackengine,graphicx}
\def\visspc{\scalerel*{\includegraphics{VisibleSpace}}{,}}

\begin{document}
x\texttt{\char32}z Computer Modern

x{\fontfamily{pcr}\selectfont\char32}z Palatino

x\visspc z \LARGE x\visspc z \Huge x\visspc z\normalsize

$x\visspc z_{x\visspc z_{x\visspc z}}$
\end{document}

enter image description here

Mentioned in egreg's answer to this question: How does \verb* set the visible space?

1

In Unicode, this is ␣ (U+2423), but I’m not aware of any Unicode font that includes an angled variant. There is a shouldered open box ⍽ (U+237D).

I couldn’t find the symbol you want in detexify or in Unicode, but there might be some package out there that has it. As a fallback, you might draw it as a vector graphic in TikZ.

Davislor
  • 44,045