\verb*
fails to produce visible space, under XeLaTeX. The problem repairs if package fontspec
is loaded. By the way, \textvisiblespace
produces visible space under both occasions.
Moreover, \verb*
works alright under pdfLaTeX, but the output of \textvisiblespace
is somewhat strange.
Questions
- Why
\verb*
fails to produce visible space withoutfontspec
under XeLaTeX? - What did
fontspec
do to get the problem repaired under XeLaTeX? - Under pdfLaTeX, why
\textvisiblespace
produces the different output (symbol) as what\verb*| |
does? How to get the same output as\verb*| |
, using symbol-generating command (like\textvisiblespace
)?
Example
\documentclass{minimal}
%\usepackage{fontspec} % problem repaired if fontspec loaded
\begin{document}
\verb*|x x| % failed under XeLaTeX, succeed under pdfLaTeX
\texttt\textvisiblespace % succeed under both engine,
% but strange under pdfLaTeX
\end{document}
Output
Version info
- TeX Live 2018 3.14159265-2.6
- XeTeX 0.99999
- pdfTeX 1.40.19
- LaTeX2e <2018-04-01> patch level 2
- fontspec 2018/07/30 v2.6h
Font info under XeLaTeX
- font family
\TU/lmtt/m/n/10
- font used
texmf-dist/fonts/opentype/public/lm/lmmono10-regular.otf
- with
fontspec
, the space symbol inside\verb*{...}
is mapped to symbolU+2423
(found by using\XeTeXtracingfonts=1
)