summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tagpdf/ex-spaceglyph-listings.tex
blob: 554efad01ee1f6e92a332d28c48b1da73e4d88dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
% !Mode:: "TeX:DE:UTF-8:Main"
\RequirePackage{pdfmanagement-testphase}
\DeclareDocumentMetadata{uncompress,}
\documentclass{article}
\usepackage{amsmath}
\usepackage[ngerman]{babel}
\usepackage{tagpdf,listings}
\makeatletter
%\def\lst@outputspace{\pdffakespace\ } %not so good
% this here works fine with luatex, if the font has a space glyph:
\def\lst@visiblespace{\lst@ttfamily{\char32}{\char32}}
% with pdftex this could work
%\def\lst@visiblespace{\lst@ttfamily{\pdffakespace\ }{\pdffakespace\ }}
\tagpdfsetup{activate-all,interwordspace=on,show-spaces,log=v}
\begin{document}\pagestyle{empty}
\tagstructbegin{tag=Document}
\tagmcbegin{tag=P}
\begin{lstlisting}[showspaces]
aaa aaa    xxxx
\end{lstlisting}
\tagmcend
\tagstructend
\end{document}