blob: 31e7d31ef62dcdd220a3d66bc53c44bbec1bd622 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
% \iffalse meta-comment
%
%% File: latex-lab-mathpkg.dtx
%
% Copyright (C) 2022-2024 The LaTeX Project
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
% license or (at your option) any later version. The latest version
% of this license is in the file
%
% https://www.latex-project.org/lppl.txt
%
%
% The development version of the bundle can be found below
%
% https://github.com/latex3/latex2e/required/latex-lab
%
% for those people who are interested or want to report an issue.
%
%<*driver>
\documentclass{l3doc}
\EnableCrossrefs
\CodelineIndex
\begin{document}
\DocInput{latex-lab-mathpkg.dtx}
\end{document}
%</driver>
%
% \fi
%
%
% \title{The \texttt{latex-lab-mathpkg} code\thanks{}}
% \author{\LaTeX{} Project}
%
% \maketitle
%
% \newcommand\fmi[1]{\begin{quote} TODO: \itshape #1\end{quote}}
% \newcommand\NEW[1]{\marginpar{\mbox{}\hfill\fbox{New: #1}}}
% \providecommand\class[1]{\texttt{#1.cls}}
% \providecommand\pkg[1]{\texttt{#1}}
% \providecommand\hook[1]{\texttt{#1}}
%
% \begin{abstract}
% \end{abstract}
%
% \tableofcontents
%
% \section{Introduction}
%
% This file implements adaptions to various math packages needed for
% the tagging project.
%
% \MaybeStop{\setlength\IndexMin{200pt} \PrintIndex }
%
% \section{The Implementation}
%
% \begin{macrocode}
%<@@=math>
% \end{macrocode}
%
% \begin{macrocode}
%<*kernel>
% \end{macrocode}
%
% \subsection{File declaration}
% \begin{macrocode}
\ProvidesFile{latex-lab-mathpkg.ltx}
[2023-01-05 v0.1a mathpkg adaptions]
% \end{macrocode}
%
% \subsection{breqn}
% \begin{macrocode}
\AddToHook{package/breqn/after}{
\RegisterMathEnvironment{dmath}
\RegisterMathEnvironment{dgroup*}
\AddToHook{env/dmath/begin}{\tagpdfparaOff}
\AddToHook{env/dgroup*/begin}{\tagpdfparaOff}
}
% \end{macrocode}
%
% \subsection{cases}
% Force loading of \pkg{amsmath} before \pkg{cases}.
% \begin{macrocode}
\AddToHook {package/cases/before}{\RequirePackage{amsmath}}
\AddToHook{package/cases/after}{
\RegisterMathEnvironment{subnumcases}
}
% \end{macrocode}
%
% \subsection{bm}
% Similar to the amsbsy code in latex-lab-amsmath for \cs{pmb} we need to mark up
% copies as artifact:
%
% \begin{macrocode}
\ExplSyntaxOn
\AddToHook{package/bm/after}
{
\def\bm@pmb@@@@#1#2#3{{%
\hbox_set:Nn\l_@@_tmpa_box{$\m@th#1#3$}%
\dimen@#2\wd\tw@
\rlap{\box_use:N\l_@@_tmpa_box}%
\tag_mc_end:\tag_mc_begin:n{artifact}
\tag_mc_reset_box:N\l_@@_tmpa_box
\kern\dimen@
\raise1.5\dimen@\rlap{\box_use:N\l_@@_tmpa_box}%
\kern\dimen@
\box_use_drop:N\l_@@_tmpa_box
\tag_mc_end:\tag_mc_begin:n{}%
}}
}
\ExplSyntaxOff
% \end{macrocode}
% \begin{macrocode}
%</kernel>
% \end{macrocode}
% \subsection{Wrapper files for testphase key}
% \Finale
%
|