Closed FrankMittelbach closed 5 years ago
The fontspec package currently patches \verb
as well as the packages verbatim
, moreverb
, listings
, and fancyvrb
. Do you know off-hand whether any of these packages have also been updated?
My current plan is to check if \verbvisiblespace
has been defined, and if so turn off all patching. This may cause regressions with other packages but might be a good incentive to get updates into those packages...
Would need checking, as there have been some updates at least to listings
and fancyvrb
recently, but I doubt they covered that (verbatim
most certainly hasn't (and it is ours so that is a clear oversight and should be fixed in 2e tools)).
Actually, listings
still needs to be patched; it uses \textvisiblespace
in general, but when the current font family is the monospaced one.
\def\lst@ttfamily#1#2{\ifx\f@family\ttdefault#1\relax\else#2\fi}
\def\lst@visiblespace{\lst@ttfamily{\char32}\textvisiblespace}
Since patching \lst@visiblespace
has been removed, the consequence is that visible spaces are sometimes lost with listings
.
I guess that listings
should be updated to have
\def\lst@visiblespace{\lst@ttfamily\verbvisiblespace\textvisiblespace}
but I'm not sure that can happen soon.
@eg9 why do you think listings couldn't be patched (any time soon)? It would be a more natural place, but of course, as a temporary measure @wspr could add your suggested patch here.
Please adjust code to fit with 2e kernel changes from https://github.com/latex3/latex2e/issues/70