Skip to content

Commit

Permalink
try to handle nested phantom
Browse files Browse the repository at this point in the history
  • Loading branch information
u-fischer committed Jan 25, 2025
1 parent caf249c commit 1fa6cb3
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions required/latex-lab/math-tagging-issues/phantom.tex
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,19 @@
\else
\expandafter\makeph@nt
\fi}

\cs_set:Npn \mathph@nt #1 #2 {%
%
\setbox \z@ = \hbox {
$
\m@th
#1
{\SuspendTagging{phantom}#2}
{% nested phantoms should not be tagged and annotated to avoid
% Package tagpdf Warning: structure with label 20 has already been used
% and faulty structure
% is suppressing annotation the right thing?
\SuspendTagging{phantom}
\luamml_annotate:en{core=false}{#2}}
% save
\luamml_save:nNn {mathphant} #1 {mphantom}
$
}
Expand All @@ -59,9 +64,8 @@

abc $x_1^2 \mathstrut_1^2 \vphantom{\int}_1^2 $

%$ \vphantom{x\mathstrut} $ gives
% Package tagpdf Warning: structure with label 20 has already been used
% and faulty structure
abc $ \vphantom{x\mathstrut}_1^2 $

abc $ x\hphantom{x\mathstrut}_1^2 $

\end{document}
\end{document}

0 comments on commit 1fa6cb3

Please sign in to comment.