diff options
Diffstat (limited to 'Master')
61 files changed, 7098 insertions, 199 deletions
diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/README.md b/Master/texmf-dist/doc/latex-dev/latex-lab/README.md index 53461372a30..ca44363c895 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/README.md +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/README.md @@ -1,6 +1,6 @@ # LaTeX laboratory -Release 2023-06-01 pre-release 2 +Release 2023-06-01 pre-release 3 ## Overview diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/TODOS-unsorted.md b/Master/texmf-dist/doc/latex-dev/latex-lab/TODOS-unsorted.md new file mode 100644 index 00000000000..1e2771ae679 --- /dev/null +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/TODOS-unsorted.md @@ -0,0 +1,33 @@ + +# A number of todos (unsorted and incomplete) + + +## Code extensions / cleanup + +### theorem-like envs + + - this can currently only handle the simple version from LaTeX2e + - it is missing a proper set of templates + - it is missing extensions to support different styles (a la amsmath and the like) + + +## Missing basic support + + - `\textbf` should probably mapt to `<Strong>` + - `\emph` should probably map to `<Em>` + + - Logos such as `\TeX` and `\LaTeX` should produce proper ActualText + + + + +## Package Support + +### csquotes + + - we can't really grab TeX's basic quotes, e.g. + ``` + some quotes around ``text'' here +``` + at least not easily, but we can support `\enquote` and the like + diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/blocks-code.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/blocks-code.pdf Binary files differindex 300f15ecbf1..26e27ee8ec2 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/blocks-code.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/blocks-code.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/blocks-doc.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/blocks-doc.pdf Binary files differindex ccff6f95eb6..43851c76e73 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/blocks-doc.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/blocks-doc.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/changes.txt b/Master/texmf-dist/doc/latex-dev/latex-lab/changes.txt index 853a06dc5f4..baefa835e3c 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/changes.txt +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/changes.txt @@ -1,3 +1,40 @@ +2023-05-20 Ulrike Fischer <Ulrike.Fischer@latex-project.org> + * renamed latex-lab-sec-tagging -> latex-lab-sec for consistency + + +2023-05-19 Ulrike Fischer <Ulrike.Fischer@latex-project.org> + * new latex-lab-bib.dtx: + tagging support for cite and bibliography with standard LaTeX and natbib + * small corrections/adaptions in latex-lab-sec-tagging and latex-lab-toc-tagging + +2023-05-18 Ulrike Fischer <Ulrike.Fischer@latex-project.org> + * new latex-lab-floats.dtx: + tagging support for float environments + * new latex-lab-graphic.dtx + tagging support for includegraphics and picture environment + * new latex-lab-minipage.dtx + tagging support for minipage and parbox + +2023-05-16 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * latex-lab-block-tagging.dtx (subsubsection{Verbatim instances}): + verbatim environments get their own block instances so that they can receive + special formatting instructions. + This also fixes a bug that we forgot to set par-skip to 0pt by default (tagpdf/74) + + (paragraph{Helper commands for verbatim}): + The \legacyverbatimsetup command needs to execute \@@par inside a group, because + we need to preserve any outer setup to \parshape (tagpdf/79) + +2023-04-09 Ulrike Fischer <Ulrike.Fischer@latex-project.org> + * latex-lab-sec-tagging.dtx: + don't load extra glyphtounicode if \pdfglyphtounicode is not defined. + +2023-04-09 Ulrike Fischer <Ulrike.Fischer@latex-project.org> + * latex-lab-footnotes.dtx: + made \footnote and \footnotetext long + + 2023-03-08 Frank Mittelbach <Frank.Mittelbach@latex-project.org> * latex-lab-block-tagging.dtx: diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/documentmetadata-support-code.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/documentmetadata-support-code.pdf Binary files differindex f088c780ad9..24e12ed18dd 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/documentmetadata-support-code.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/documentmetadata-support-code.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/documentmetadata-support-doc.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/documentmetadata-support-doc.pdf Binary files differindex 7f9430fe293..8922aaec6d2 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/documentmetadata-support-doc.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/documentmetadata-support-doc.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-amsmath.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-amsmath.pdf Binary files differindex 765870ac619..a302eebeb6e 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-amsmath.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-amsmath.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-bib.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-bib.pdf Binary files differnew file mode 100644 index 00000000000..f01786b536a --- /dev/null +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-bib.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-block-tagging.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-block-tagging.pdf Binary files differindex 92be446ea7e..46e660a4516 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-block-tagging.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-block-tagging.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-float.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-float.pdf Binary files differnew file mode 100644 index 00000000000..120baf04fcd --- /dev/null +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-float.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-footnotes.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-footnotes.pdf Binary files differindex de5dbb1e21f..4012dd031af 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-footnotes.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-footnotes.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-graphic.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-graphic.pdf Binary files differnew file mode 100644 index 00000000000..83de1b66ccb --- /dev/null +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-graphic.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-mathpkg.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-mathpkg.pdf Binary files differindex 219b39d6cbf..25aede8aef8 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-mathpkg.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-mathpkg.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-mathtagging.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-mathtagging.pdf Binary files differindex 270cf6d7213..be06230f296 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-mathtagging.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-mathtagging.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-mathtools.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-mathtools.pdf Binary files differindex 1272745dd91..ba5758f433d 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-mathtools.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-mathtools.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-minipage.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-minipage.pdf Binary files differnew file mode 100644 index 00000000000..79fd78a62c5 --- /dev/null +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-minipage.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-new-or-1.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-new-or-1.pdf Binary files differindex e9f69f428b2..429fb807c26 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-new-or-1.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-new-or-1.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-new-or-2.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-new-or-2.pdf Binary files differindex 449f43110a4..623ce1e27f4 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-new-or-2.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-new-or-2.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-sec-tagging.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-sec.pdf Binary files differindex 09e73151bc7..55f295aba4b 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-sec-tagging.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-sec.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-testphase.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-testphase.pdf Binary files differindex a525ce9013f..c907166e23a 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-testphase.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-testphase.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc-hyperref-changes.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc-hyperref-changes.pdf Binary files differindex 444d701cdf9..cea32c82bc5 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc-hyperref-changes.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc-hyperref-changes.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc-kernel-changes.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc-kernel-changes.pdf Binary files differindex 1e8357e8118..99d66248133 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc-kernel-changes.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc-kernel-changes.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc-tagging-functions.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc-tagging-functions.pdf Binary files differindex b0b3f531dba..d5065171f83 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc-tagging-functions.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc-tagging-functions.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-footnotemark.md b/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-footnotemark.md new file mode 100644 index 00000000000..ad50b367320 --- /dev/null +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-footnotemark.md @@ -0,0 +1,189 @@ +# Packages that alter \@footnotemark ... + +Scan of TeXlive 2022 for checking ... may not be longer accurate and may contain a few false positives + +``` +% bibarts + +\let\ba@footnmark=\@footnotemark +\def\@footnotemark{\ifhmode{\nobreak \hskip 0.04em plus 0.01em}\else\leavevmode\fi\ba@footnmark}% + + +% ./bxjscls/bxjsja-minimal.def + +\def\bxjs@cjk@loaded{% + \def\@footnotemark{% + \leavevmode + \ifhmode + \edef\@x@sf{\the\spacefactor}% + \ifdim\lastkern>\z@\ifdim\lastkern<5sp\relax + \unkern\unkern + \ifdim\lastskip>\z@ \unskip \fi + \fi\fi + \nobreak + \fi + \@makefnmark + \ifhmode \spacefactor\@x@sf \fi + \relax}% + \let\bxjs@cjk@loaded\relax +} + +% ./arabtex/afoot.sty + +\let \a@@footnotemark \@footnotemark + +\def \a@footnotemark {% inside Arabic environment +\iftrans \unskip \unskip \nobreak \@makefnmark \fi +\ifarab \a@spacefalse \putwordb@x \@makefnmark \a@spacetrue \fi } + +% ./hyperref/hyperref.sty + + \def\@footnotemark{% + \leavevmode + \ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi + \stepcounter{Hfootnote}% + \global\let\Hy@saved@currentHref\@currentHref + \hyper@makecurrent{Hfootnote}% + \global\let\Hy@footnote@currentHref\@currentHref + \global\let\@currentHref\Hy@saved@currentHref + \hyper@linkstart{link}{\Hy@footnote@currentHref}% + \@makefnmark + \hyper@linkend + \ifhmode\spacefactor\@x@sf\fi + \relax + }% + + +% ./hypdvips/hypdvips.sty + + \def\@footnotemark{% + \leavevmode + \ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi + \stepcounter{Hfootnote}% + \global\let\Hy@saved@currentHref\@currentHref + \hyper@makecurrent{Hfootnote}% + \global\let\Hy@footnote@currentHref\@currentHref + \global\let\@currentHref\Hy@saved@currentHref + \ifHy@draft% + \@makefnmark% + \else% + \pp@hyperfootnote% + \fi% + \ifhmode\spacefactor\@x@sf\fi + \relax + } + + \newcommand{\pp@hyperfootnote}{% + \ifx\pp@activerect\pp@true% + \@makefnmark% + \else% + \ifpp@smallfootnotes% + \let\pp@backup@@thefnmark\@thefnmark% + \renewcommand{\@thefnmark}{\pdf@rect{\pp@backup@@thefnmark}}% + \Hy@colorlink\@footnotecolor% + \@makefnmark% + \Hy@endcolorlink% + \pdfmark{% + pdfmark=/ANN,% + linktype=footnote,% + Subtype=/Link,% + AcroHighlight=\@pdfhighlight,% + Border=\@pdfborder,% + BorderStyle=\@pdfborderstyle,% + Color=\@footnotebordercolor,% + Dest=\Hy@footnote@currentHref,% + Raw=H.B% + }% + \let\@thefnmark\pp@backup@@thefnmark% + \else% + \pdfmark[\@makefnmark]{% + pdfmark=/ANN,% + linktype=footnote,% + Subtype=/Link,% + AcroHighlight=\@pdfhighlight,% + Border=\@pdfborder,% + BorderStyle=\@pdfborderstyle,% + Color=\@footnotebordercolor,% + Dest=\Hy@footnote@currentHref% + }% + \fi% + \fi% + } + + +% ./memoir/memhfixc.sty + +\ifHy@hyperfootnotes + \def\@footnotemark{% + \leavevmode + \ifhmode\edef\@x@sf{\the\spacefactor}% + \m@mmf@check% <--- added + \nobreak\fi + \stepcounter{Hfootnote}% + \global\let\Hy@saved@currentHref\@currentHref + \hyper@makecurrent{Hfootnote}% + \global\let\Hy@footnote@currentHref\@currentHref + \global\let\@currentHref\Hy@saved@currentHref + \hyper@linkstart{link}{\Hy@footnote@currentHref}% + \@makefnmark + \hyper@linkend + \m@mmf@prepare% <--- added + \ifhmode\spacefactor\@x@sf\fi + \relax + }% +\fi + + +% caption3.sty + +% this is altering the top-level when inside a float + + +% ./koma-script/scrlttr2.cls + +\newcommand*{\scr@footnotemark}{% + \leavevmode + \ifhmode\edef\@x@sf{\the\spacefactor}\FN@mf@check\nobreak\fi + \@makefnmark + \csname FN@mf@prepare\endcsname + \ifhmode\spacefactor\@x@sf\fi + \relax} + +% tested against this ... + +\newcommand*{\scr@saved@footnotemark}{% + \leavevmode + \ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi + \@makefnmark + \ifhmode\spacefactor\@x@sf\fi + \relax} + + +% ./chextras/chextras.sty + +\ifstd@notes\else + \let\std@footnotemark\@footnotemark + \def\alt@footnotemark{\unskip\thinspace\std@footnotemark} + \let\@footnotemark\alt@footnotemark + +% footmisx.sty + + \newcommand*\@footmisxnotemark{% + \leavevmode + \ifhmode + \edef\@x@sf{\the\spacefactor}% + \FN@mf@check + \nobreak + \fi + \@footmicx@makefnmark + \ifFN@pp@towrite + \FN@pp@writetemp + \FN@pp@towritefalse + \fi + \FN@mf@prepare + \ifhmode\spacefactor\@x@sf\fi + \relax + } + + +``` diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-footnotetext.md b/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-footnotetext.md new file mode 100644 index 00000000000..deda69fcd86 --- /dev/null +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-footnotetext.md @@ -0,0 +1,848 @@ +# Packages that alter \@footnotetext ... + +Scan of TeXlive 2022 for checking ... may not be longer accurate and may contain a few false positives + +``` + +% ./bibarts/bibarts.sty + +\let\ba@footnotetext=\@footnotetext +\long\def\@footnotetext#1{\ba@footnotetext{% + \global\let\thisto@ba=-% + \global\let\thisti@ba=-% + \global\let\thisp@ba=-% + \global\let\thisvol@ba=-% + \global\let\thiss@ba=-% + \global\let\thisn@ba=-% + \global\let\pos@ba=0% + \kern 0.1em\nulskip@ba{\@footnotetrue\ignorespaces + #1\nulskip@ba\ba@textmode}\global\let\lastto@ba=\thisto@ba + \global\let\lastti@ba=\thisti@ba + \global\let\lastp@ba=\thisp@ba + \global\let\lastvol@ba=\thisvol@ba + \global\let\lasts@ba=\thiss@ba + \global\let\lastn@ba=\thisn@ba}}% + + +% ./fnbreak/fnbreak.sty + + \let\fnb@orig@footnotetext\@footnotetext + \long\def\@footnotetext#1{\fnb@orig@footnotetext{\fnb@fnstart#1\fnb@fnend}}% + + +% ./revtex4-1/revtex4-1.cls ./revtex/ltxutil.sty ./revtex/revtex4-2.cls ... + +\long\def\@footnotetext{% + \insert\footins\bgroup + \make@footnotetext +}% +\long\def\@mpfootnotetext{% + \minipagefootnote@pick + \make@footnotetext +}% +\long\def\make@footnotetext#1{% + \set@footnotefont + \set@footnotewidth + \@parboxrestore + \protected@edef\@currentlabel{% + \csname p@\@mpfn\endcsname\@thefnmark + }% + \color@begingroup + \@makefntext{% + \rule\z@\footnotesep\ignorespaces#1% + \@finalstrut\strutbox\vadjust{\vskip\z@skip}% + }% + \color@endgroup + \minipagefootnote@drop +}% + + +% ./nrc/nrc1.cls ./nrc/nrc2.cls + +% this is missing the \par at the end and \@currentcounter + +\long\def\@footnotetext#1{% + \insert\footins{% + \reset@font\smallt + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth \@parboxrestore + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark + }% + \color@begingroup + \@makefntext{% + \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox + }% + \color@endgroup + }% +}% + +%------------------------------------- + +% ./bigfoot/bigfoot.sty + + \def\@footnotetext{\Footnotetextdefault{}}% + +%------------------------------------- + + +% ./uafthesis/uafthesis.cls + +% this is missing the \par at the end and \@currentcounter + +%% this little gem provides for single-spaced footnotes +\long\def\@footnotetext#1{\insert\footins{% + \ssp + \reset@font\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth \@parboxrestore + \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}\@makefntext + {\rule{\z@}{\footnotesep}\ignorespaces + #1\strut}}} + +%------------------------------------- + + + +% ./resphilosophica/resphilosophica.cls + +% I wonder if this \, is really intended below ... + +\long\def\@footnotetext#1{% + \insert\footins{% + \normalfont\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep \splitmaxdepth \dp\strutbox + \floatingpenalty\@MM \hsize\columnwidth + \@parboxrestore \parindent\normalparindent \sloppy + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark}% + \@makefntext{% + \,\rule\z@\footnotesep\ignorespaces#1\unskip\strut\par}}} + +%------------------------------------- + + + +% ./setspace/setspace.sty + +% this is missing the \par at the end and \@currentcounter + +\long\def\@footnotetext#1{% + \insert\footins{% +% GT: Next line added. Hook desired here! + \def\baselinestretch {\setspace@singlespace}% + \reset@font\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth + \@parboxrestore + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark + }% + \color@begingroup + \@makefntext{% + \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}% + \color@endgroup}} + +%------------------------------------- + + + +% ./linguex/linguex.sty + + +\let\predefinedfootnotetext=\@footnotetext +\long\def\@footnotetext#1{\@noftnotefalse\predefinedfootnotetext{#1}% + \@noftnotetrue} + + +%------------------------------------- + + +% ./fnpara/fnpara.sty + +\long\def\@footnotetext#1{\insert\footins{% + \reset@font\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth \@parboxrestore + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark + }% + \color@begingroup + \setbox0=\hbox{% + \@makefntext{% + \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox + \penalty -10 + \hskip\footglue + }% + }% + \dp0=0pt \ht0=\fudgefactor\wd0 \box0 + \color@endgroup}} + +%------------------------------------- + + +% ./footmisc/footmisc.sty (para option) + +% this is missing the \par at the end and \@currentcounter + + \long\def\FN@footnotetext#1{% + \insert\footins{% + \ifFN@setspace + \let\baselinestretch\FN@baselinestretch + \fi + \reset@font\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox + \floatingpenalty\@MM + \hsize\columnwidth + \@parboxrestore + \protected@edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}% + \color@begingroup + \setbox\FN@tempboxa\hbox{% + \@makefntext{\ignorespaces#1\strut + \penalty-10\relax + \hskip\footglue + }% end of \@makefntext parameter + }% end of \hbox + \dp\FN@tempboxa\z@ + \ht\FN@tempboxa\dimexpr\wd\FN@tempboxa *% + \footnotebaselineskip / \columnwidth\relax + \box\FN@tempboxa + \color@endgroup + }% + \FN@mf@prepare + } + +%------------------------------------- + + +% ./footmisc/footmisc.sty (normal) + +% this is missing the \par at the end and \@currentcounter + + \long\def\FN@footnotetext#1{% + \insert\footins{% + \ifFN@setspace + \let\baselinestretch\FN@baselinestretch + \fi + \reset@font\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox + \floatingpenalty\@MM + \hsize\columnwidth + \@parboxrestore + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark + }% + \color@begingroup + \@makefntext{% + \rule\z@\footnotesep + \ignorespaces#1\@finalstrut\strutbox + }% + \color@endgroup + }% + \FN@mf@prepare + }% + + + +%------------------------------------- + + +% ./footmisc/footmisc.sty (side option) + + \long\def\FN@footnotetext#1{% + \marginpar{% + \ifFN@setspace + \let\baselinestretch\FN@baselinestretch + \fi + \reset@font\footnotesize + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark + }% + \color@begingroup + \@makefntext{% + \ignorespaces#1% + }% + \color@endgroup + }% + \FN@mf@prepare + }% + + + +%------------------------------------- + + + +% ./bxjscls/bxjsarticle.cls ./bxjscls/bxjsbook.cls ... + +\long\def\@footnotetext{% + \insert\footins\bgroup + \normalfont\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth \@parboxrestore + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark + }% + \color@begingroup + \@makefntext{% + \rule\z@\footnotesep\ignorespaces}% + \futurelet\jsc@next\jsc@fo@t} +\def\jsc@fo@t{\ifcat\bgroup\noexpand\jsc@next \let\jsc@next\jsc@f@@t + \else \let\jsc@next\jsc@f@t\fi \jsc@next} +\def\jsc@f@@t{\bgroup\aftergroup\jsc@@foot\let\jsc@next} +\def\jsc@f@t#1{#1\jsc@@foot} +\def\jsc@@foot{\@finalstrut\strutbox\color@endgroup\egroup + \ifx\pltx@foot@penalty\@undefined\else + \ifhmode\null\fi + \ifnum\pltx@foot@penalty=\z@\else + \penalty\pltx@foot@penalty + \pltx@foot@penalty\z@ + \fi + \fi} + + +not covered so far supports \footnote{ catcode changes ...} but also +\foonote A --- the latter is questionable I would say + + +%------------------------------------- + + +% ./fn2end/fn2end.sty + +obsolete I guess, ignored in evaluation + + +%------------------------------------- + + +% ./hyperref/hyperref.sty + + \long\def\@footnotetext#1{% + \H@@footnotetext{% + \ifHy@nesting + \expandafter\ltx@firstoftwo + \else + \expandafter\ltx@secondoftwo + \fi + {% + \expandafter\hyper@@anchor\expandafter{% + \Hy@footnote@currentHref + }{\ignorespaces #1}% + }{% + \Hy@raisedlink{% + \expandafter\hyper@@anchor\expandafter{% + \Hy@footnote@currentHref + }{\relax}% + }% + \let\@currentHref\Hy@footnote@currentHref + \let\@currentlabelname\@empty + \ignorespaces #1% + }% + }% + }% + + +Handling of anchors (in nested context) I guess. This needs to be +married with the anchor setting that the tagging currently does and +the latter improved/adjusted + + +%------------------------------------- + +% ./biblatex-gb7714-2015/gb7714-2015ms.bbx ./biblatex-gb7714-2015/gb7714-2015mx.bbx ... + + \long\def\@footnotetext##1{\insert\footins{% + \reset@font\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth \@parboxrestore + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark + }% + \color@begingroup + \leftskip \footbibmargin%增加的左侧缩进 + \@makefntext{% + \rule\z@\footnotesep\ignorespaces##1\@finalstrut\strutbox% + }% + \color@endgroup}}% + +fits the structure +%------------------------------------- + + +% ./amscls/amsbook.cls ./amscls/amsproc.cls ./amscls/amsart.cls ... + +\long\def\@footnotetext#1{% + \insert\footins{% + \normalfont\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep \splitmaxdepth \dp\strutbox + \floatingpenalty\@MM \hsize\columnwidth + \@parboxrestore \parindent\normalparindent \sloppy + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark}% + \@makefntext{% + \rule\z@\footnotesep\ignorespaces#1\unskip\strut\par}}} + +fits the structure +%------------------------------------- + + +% ./umich-thesis/umich-thesis.cls + +% change LaTeX's footnotes to get vertical spacing correct +\skip\footins \baselinestretch2\skip\footins +\long\def\@footnotetext#1{% + \insert\footins{% + \def\baselinestretch {\setspace@singlespace}% + \reset@font\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth + \@parboxrestore + \vskip 1.2\baselineskip + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark + }% + \color@begingroup + \@makefntext{% + \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}% + \color@endgroup}} + +fits the structure +%------------------------------------- + + +% ./nostarch/nostarch.cls + +\long\def\@footnotetext#1{\insert\footins{% + \reset@font\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth \@parboxrestore + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark + }% + \color@begingroup + \@makefntext{% + \rule\z@{13.5pt}\ignorespaces#1}% + \color@endgroup}}% + +fixed \footsep, probably very old +fits the structure +%------------------------------------- + + + +% ./coursepaper/coursepaper.cls + +\long\def\@footnotetext#1{% + \insert\footins{% + \def\baselinestretch {1}% + \reset@font\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth + \@parboxrestore + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark + }% + \color@begingroup + \@makefntext{% + \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}% + \color@endgroup}} + +fits the structure +%------------------------------------- + + + +% ./ucthesis/ucthesis.cls + +% Single-space footnotes. +\long\def\@footnotetext#1{\insert\footins{\ssp\reset@font\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth \@parboxrestore + \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}\@makefntext + {\rule{\z@}{\footnotesep}\ignorespaces + #1\strut}}} + +fits the structure +%------------------------------------- + + + +% ./jura/jura.cls + +\long\def\@footnotetext#1{\insert\footins{% + \linespread{\J@FootnoteSpread}\reset@font\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth \@parboxrestore + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark + }% + \color@begingroup + \@makefntext{% + \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}% + \color@endgroup}}% + +fits the structure +%------------------------------------- + + +% ./asaetr/asaesub.sty + +2.09 + +%------------------------------------- + + +% ./lineno/fnlineno.sty + +%% |\FNLN@@text| stores the `\@footnotetext' found, +%% we might check if it is `\FNLN@ltx@fntext' ... %% TODO +\let\FNLN@@text\@footnotetext +\def\@footnotetext{% + \ifLineNumbers \expandafter \FNLN@text + \else \expandafter \FNLN@@text + \fi} + + +\def \FNLN@text {% %% 2010/12/31 arg read later + \vadjust{\penalty-\FNLN@M@swap@codepen}% +%% Standard \LaTeX's `\@footnotetext' expands `\@thefnmark' +%% to produce the footnote mark at the page bottom, +%% right after it has been determined for the mark +%% in the main text. \emph{Here} the footnote text +%% will be typeset only when \emph{other} footnote marks +%% may have been formed for typesetting the main text +%% paragraph before. +%% %%% (TODO clearer wording) +%% In the \strong{footnote list} +%% macro |\FNLN@list|, the (\dqtd{`&\protect'ed}) +%% \emph{current} expansion <mark> of `\@thefnmark' +%% is stored as an item preceding the footnote text +%% <text>. One footnote entry in `\FNLN@list' +%% thus has the form \lq`<mark>\@lt<text>\@lt'\rq. +%% \LaTeX's internal `\g@addto@macro' is used to \emph{append} +%% an entry to the list (at the right). The OTR will later +%% take the entries from the left of the list. +%% +%% The argument of the auxiliary/temporary `\@tempa' +%% will contain the footnote text and thus must be able to +%% carry `\par' tokens. We therefore need a `\long' version of +%% `\protected@edef': + \let\@@protect\protect + \let\protect\@unexpandable@protect + \afterassignment\restore@protect + \long \edef \@tempa ##1{% + \noexpand\g@addto@macro \noexpand\FNLN@list {% + \@thefnmark \noexpand\@lt ##1\noexpand \@lt}}% +%% ... issuing +%% \lq`\g@addto@macro\FNLN@list{<mark>\elt<text>\@lt}'\rq\ ... + \@tempa %% reads arg +} +%% Here we initialize |\FNLN@list|: +\let\FNLN@list\@empty + + + +probably continues working but needs separate checking + +%------------------------------------- + + + +% ./jurabib/jurabib.sty + + \long\def\@footnotetext#1{% + \Orig@tabularx@footnotetext{% + \jb@fntrue + #1% + \setcounter{jb@cites@in@footnote}{0}% + }% + }% + + \let\jbsaved@footnotetext\@footnotetext + \long\def\@footnotetext#1{% + \begingroup + \jb@fntrue + \jbsaved@footnotetext{#1}% + \setcounter{jb@cites@in@footnote}{0}% + \endgroup + }% + + +first is table notes, second +fits the structure +%------------------------------------- + + + +% ./york-thesis/york-thesis.cls + +\long\def\@footnotetext#1{% + \insert\footins{% + \def\baselinestretch {1}% + \reset@font\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth + \@parboxrestore + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark}% + \color@begingroup + \@makefntext{% + \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}% + \color@endgroup}} + +fits the structure +%------------------------------------- + + +% ./ucdavisthesis/ucdavisthesis.cls + +\long\def\@footnotetext#1{\insert\footins{\renewcommand\baselinestretch{1} + \footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth \@parboxrestore + \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}\@makefntext + {\rule{\z@}{\footnotesep}\ignorespaces + #1\strut}\renewcommand\baselinestretch{\@spacing}}} + +looks old ... +fits the structure +%------------------------------------- + + +% ./ledmac/afoot.sty + +fairly old and buggy in some aspects + +%%% Make the LaTeX \cs{footnote} catcode-safe, like in Plain TeX. + +\def \@footnotetext {% new, do not yet read footnote text + \insert \footins \bgroup + \ifx \footglue \undefined % prepare normal footnote + \interlinepenalty \interfootnotelinepenalty \floatingpenalty \@MM + \splittopskip \footnotesep \splitmaxdepth \dp \strutbox + \else + \global\long\def \@makefntext ##1{{$^{\@thefnmark }$}##1\nobreak }% + \setbox0=\hbox \bgroup % fnpara.sty is present + \floatingpenalty=20000 \footnotesize + \fi + \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}% + \a@fntext } + + +%------------------------------------- + + +% ./toptesi/toptesi.sty + + +\long\def\@footnotetext#1{\insert\footins{\linespread{1}\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth \@parboxrestore + \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}% + \@makefntext{\rule{\z@}{\footnotesep}\ignorespaces#1\strut}}} + + +fits the structure +%------------------------------------- + + +% ./gb4e/gb4e.sty + +\let\@gbsaved@footnotetext=\@footnotetext +\long\def\@footnotetext#1{% + \@noftnotefalse\setcounter{fnx}{0}% + \@gbsaved@footnotetext{#1}% + \@noftnotetrue} + +fits the structure +%------------------------------------- + + + +% ./koma-script/scrlttr2.cls ./koma-script/scrextend.sty ./koma-script/scrreprt.cls ... + +same bug as footmisc: the @prepare is in the wrong place + +fits the structure +%------------------------------------- + + + +% ./tabu/tabu.sty + +not checked what that does + + +%------------------------------------- + + +% ./uwthesis/uwthesis.cls + +does chapter notes -- ignore for now + +%------------------------------------- + + +% ./tools/multicol.sty + +\long\def\mult@footnotetext#1{\begingroup + \columnwidth\textwidth + \orig@footnotetext{#1}\endgroup} + + +fits the structure, but need to think what makes sense here as this a +temporary redefinition for the environment only + +%------------------------------------- + + +% ./fancyvrb/fancyvrb.sty + +\long\def\V@footnotetext{% + \afterassignment\V@@footnotetext + \let\@tempa} +\def\V@@footnotetext{% + \insert\footins\bgroup + \csname reset@font\endcsname + \footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth\dp\strutbox + \floatingpenalty \@MM + \hsize\columnwidth + \@parboxrestore + \def\@currentcounter{footnote}% + \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}% + \@makefntext{}% + \rule{\z@}{\footnotesep}% + \bgroup + \aftergroup\V@@@footnotetext + \ignorespaces} +\def\V@@@footnotetext{\strut\egroup} + + +another one of the footnote commands that do not read they argument as an argument + +%------------------------------------- + + +% ./savefnmark/savefnmark.sty + +obsolete + +%------------------------------------- + + +% ./changebar/changebar.sty + +\let\ltx@footnotetext\@footnotetext +\long\def\cb@footnotetext#1{% + \cb@trace@stack{end footnote on page \the\c@page}% + \cb@pop\cb@currentstack + \ifnum\cb@topleft=\cb@nil + \ltx@footnotetext{#1}% + \else + \cb@push\cb@currentstack + \edef\cb@temp{\the\cb@curbarwd}% + \ltx@footnotetext{\cb@start[\cb@temp]#1\cb@end}% + \fi} +\let\@footnotetext\cb@footnotetext + + +% ./eledmac/eledmac.sty + +\apptocmd{\@footnotetext}{\m@mmf@prepare}{}{} +\pretocmd{\@footnotetext}{% + \ifnumberedpar@ + \edtext{}{\l@dbfnote{#1}}% + \else + }{}{} +\apptocmd{\@footnotetext}{\fi}{}{}% + + +% ./yafoot/dblfnote.sty + +\long\def\dfn@footnotetext#1{{\setbox\dfn@boxa\vbox{ + \let\insert\dfn@gobble + \columnwidth\DFNcolumnwidth \hbadness\c@DFNsloppiness + \def\@makefnmark{\smash{\dfn@makefnmark}} + \dfn@latex@footnotetext{#1}\par \boxmaxdepth\dfn@fnmaxdp}% + \dfn@dima\ht\dfn@boxa \advance\dfn@dima\dp\dfn@boxa + \ifdim\dfn@dima>\z@\else + \dfn@dima1sp\relax + \setbox\dfn@boxa\vbox{\vbox to1sp{\unvbox\dfn@boxa\vfil}}\fi + \global\setbox\dfn@ins\vbox{\boxmaxdepth\dfn@fnmaxdp + \ifvoid\dfn@ins\else + \unvbox\dfn@ins \allowbreak \nointerlineskip \fi + \ifdfn@allowcbreak \unvbox \else \box \fi \dfn@boxa}% + \setbox\dfn@boxa\copy\dfn@ins + \dfn@split{.5\ht\dfn@boxa}\dfn@boxa\dfn@boxb\dfn@fnmaxdp\footnotesep + \advance\@tempdima\@tempdimb \@tempdimb\@tempdima + \advance\@tempdima-\dfn@fnht \global\dfn@fnht\@tempdimb + \insert\footins{\floatingpenalty\@MM \vbox to\@tempdima{}}% + \xdef\dfn@list{\dfn@list\@elt{\number\dfn@dima}{\number\@tempdima}}}} +\let\dfn@latex@footnotetext\@footnotetext +\let\@footnotetext\dfn@footnotetext + + +% ./ftnxtra/ftnxtra.sty + +not checked what this does + + +% ./acmart/acmart.cls + +\if@ACM@sigchiamode +\long\def\@footnotetext#1{\marginpar{% + \reset@font\small + \interlinepenalty\interfootnotelinepenalty + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark + }% + \color@begingroup + \@makefntext{% + \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}% + \color@endgroup}}% +\fi + + +% ./memoir/memoir.cls + + this needs some further analysis + +``` diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-kern-kern.md b/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-kern-kern.md new file mode 100644 index 00000000000..aac597db60f --- /dev/null +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-kern-kern.md @@ -0,0 +1,88 @@ +# Packages that use double \kern's + +Scan of TeXlive 2022 for checking ... may not be longer accurate and may contain a few false positives +(definitely contains bogus entries right now) + + +``` + + \ifdim\lastkern>\z@\ifdim\lastkern<5sp\relax +./bxjscls/bxjsja-minimal.def + + + + \ifdim\lastkern=-3sp \unkern + \ifdim\lastkern=3sp \kern-3sp + {\kern\MT@outer@kern\kern3sp\kern-3sp\relax}% +./microtype/letterspace.sty + + + \ifdim\lastkern=-3sp \unkern + \ifdim\lastkern=3sp \kern-3sp + {\kern\MT@outer@kern\kern3sp\kern-3sp\relax}% +./microtype/microtype-pdftex.def + + + \ifdim\lastkern=-3sp \unkern + \ifdim\lastkern=3sp \kern-3sp + {\kern\MT@outer@kern\kern3sp\kern-3sp\relax}% +./microtype/microtype-luatex.def + + + +\providecommand*{\multiplefootnotemarker}{3sp} +./eledmac/eledmac.sty + + + +\providecommand*{\multiplefootnotemarker}{3sp} +./reledmac/reledmac.sty + + +\edef\CJK@kern{\kern -2sp\kern 2sp} +\edef\CJK@CJK{\kern -1sp\kern 1sp} +./cjk/texinput/CJK.sty + + +\edef\ruby@kern{\kern -5sp\kern 5sp} +./cjk/texinput/ruby.sty + + +% hyphenation between pinyin syllables. Values 1sp-3sp are already used +\edef\py@sp{\kern -4sp\kern 4sp} +./cjk/texinput/pinyin.sty + + +\providecommand*{\multiplefootnotemarker}{3sp} +./tufte-latex/tufte-common.def + + + +\newcommand*{\multiplefootnotemarker}{3sp} +./memoir/memoir.cls + + +\providecommand*{\multiplefootnotemarker}{3sp} +./parnotes/parnotes.sty + + +\providecommand*{\multiplefootnotemarker}{3sp} +./lwarp/lwarp-footmisc.sty + + + \bgroup \kern-3sp\kern3sp % kerns so I can test for beginning of list +./examdesign/examdesign.cls + + + \kern-1sp \kern1sp } + \kern-2sp \kern2sp } + \kern-3sp \kern3sp } + \kern-4sp \kern4sp } +./polyglossia/gloss-korean.ldf + + + +\NewDocumentCommand \@sidenotes@multisign { } {3sp} +./sidenotes/sidenotes.sty + +``` diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-makefntext.md b/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-makefntext.md new file mode 100644 index 00000000000..d7cb0a9b920 --- /dev/null +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-makefntext.md @@ -0,0 +1,1751 @@ +# Packages that alter \@makefntext ... + +Scan of TeXlive 2022 for checking ... may not be longer accurate and may contain a few false positives + +``` + +% ./footmisc/footmisc.sty + +% latex def (used with para option) + + + + \long\def\@makefntext#1{% + \ifFN@hangfoot + \bgroup + \setbox\@tempboxa\hbox{% + \ifdim\footnotemargin>0pt + \hb@xt@\footnotemargin{\@makefnmark\hss}% + \else + \@makefnmark + \fi + }% + \leftmargin\wd\@tempboxa + \rightmargin\z@ + \linewidth \columnwidth + \advance \linewidth -\leftmargin + \parshape \@ne \leftmargin \linewidth + \footnotesize + \@setpar{{\@@par}}% + \leavevmode + \llap{\box\@tempboxa}% + \parskip\hangfootparskip\relax + \parindent\hangfootparindent\relax + \else + \parindent1em + \noindent + \ifdim\footnotemargin>\z@ + \hb@xt@ \footnotemargin{\hss\@makefnmark}% + \else + \ifdim\footnotemargin=\z@ + \llap{\@makefnmark}% + \else + \llap{\hb@xt@ -\footnotemargin{\@makefnmark\hss}}% + \fi + \fi + \fi + \footnotelayout#1% + \ifFN@hangfoot + \par\egroup + \fi + } + + + + +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/aastex/aastex631.cls +--------------------------------------------------------- +\def\@makefntext#1{\hsize=\columnwidth\mbox{}\hspace*{3mm}\@makefnmark~#1} +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/paper/paper.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hbox to1.8em{\hss$\m@th^{\@thefnmark}$}##1}% +... + \long\def\@makefntext#1{% + \leftskip 2.0em% + \noindent + \hbox to 0em{\hss\@makefnmark\kern 0.25em}#1} +... + \long\def\@makefntext#1{% + \parindent 1em% + \noindent + \hbox to 1.8em{\hss\@makefnmark\kern 0.25em}#1} +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/revtex4-1/aip4-1.rtx +--------------------------------------------------------- +\def\@makefntext#1{% + \def\baselinestretch{1}% + \leftskip1em% + \parindent1em% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/revtex4-1/aps4-1.rtx +--------------------------------------------------------- +\long\def\@makefntext#1{% + \def\baselinestretch{1}% + \leftskip1em% + \parindent1em% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/revtex4-1/revtex4-1.cls +--------------------------------------------------------- +\def\@makefntext#1{% + \def\baselinestretch{1}% + \parindent1em% + \noindent +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/smflatex/smfart.cls +--------------------------------------------------------- +\def\@makefntext{\parindent0pt\sloppy\indent\@makefnmark} +\hfuzz=1pt \vfuzz=\hfuzz +\def\sloppy{\tolerance9999 \emergencystretch 3em\relax} +\setcounter{topnumber}{4} +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/smflatex/smfbook.cls +--------------------------------------------------------- +\def\@makefntext{\parindent0pt\sloppy\indent\@makefnmark} +\hfuzz=1pt \vfuzz=\hfuzz +\def\sloppy{\tolerance9999 \emergencystretch 3em\relax} +\setcounter{topnumber}{4} +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/koma-script/scrlttr2.cls +--------------------------------------------------------- + \long\def\@makefntext##1{% + \raggedfootnote + \leftskip #2 + \l@addto@macro\@trivlist{% +... + \long\def\@makefntext##1{% + \setlength{\@tempdimc}{#3}% + \def\@tempa{#1}\ifx\@tempa\@empty + \@setpar{\@@par +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/koma-script/scrextend.sty +--------------------------------------------------------- + \long\def\@makefntext##1{% + \raggedfootnote + \leftskip #2 + \l@addto@macro\@trivlist{% +... + \long\def\@makefntext##1{% + \setlength{\@tempdimc}{#3}% + \def\@tempa{#1}\ifx\@tempa\@empty + \@setpar{\@@par +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/koma-script/scrreprt.cls +--------------------------------------------------------- + \long\def\@makefntext##1{% + \raggedfootnote + \leftskip #2 + \l@addto@macro\@trivlist{% +... + \long\def\@makefntext##1{% + \setlength{\@tempdimc}{#3}% + \def\@tempa{#1}\ifx\@tempa\@empty + \@setpar{\@@par +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/koma-script/scrartcl.cls +--------------------------------------------------------- + \long\def\@makefntext##1{% + \raggedfootnote + \leftskip #2 + \l@addto@macro\@trivlist{% +... + \long\def\@makefntext##1{% + \setlength{\@tempdimc}{#3}% + \def\@tempa{#1}\ifx\@tempa\@empty + \@setpar{\@@par +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/koma-script/scrbook.cls +--------------------------------------------------------- + \long\def\@makefntext##1{% + \raggedfootnote + \leftskip #2 + \l@addto@macro\@trivlist{% +... + \long\def\@makefntext##1{% + \setlength{\@tempdimc}{#3}% + \def\@tempa{#1}\ifx\@tempa\@empty + \@setpar{\@@par +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/uafthesis/uafthesis.cls +--------------------------------------------------------- +\long\def\@makefntext#1{% + \parindent 1em% + \noindent + \hbox to 1.8em{\hss\@makefnmark}#1} +... + \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}\@makefntext + {\rule{\z@}{\footnotesep}\ignorespaces + #1\strut}}} + +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/uwthesis/uwthesis.cls +--------------------------------------------------------- +\long\def\@makefntext#1{\parindent 1em\noindent \hangindent\parindent + \def\baselinestretch{1.0}\normalfont + \hb@xt@1.8em{\hss\@makefnmark}#1} + +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/uwa-letterhead/uwa-letterhead.sty +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \global\@topnum\z@ +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/onrannual/onrannual.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \newpage +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls +--------------------------------------------------------- +\long\def\@makefntext#1{% + \begingroup + % 序号取消上标 + \def\@makefnmark{\hbox{\normalfont\@thefnmark}}% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/gaceta/gaceta.cls +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/jpsj/jpsj2.cls +--------------------------------------------------------- + \long\def\@makefntext##1{%\vskip2\p@ + \hangindent8\p@ \hangafter1 \noindent + \hb@xt@1em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/gmutils/gmtypos.sty +--------------------------------------------------------- + \ampulexdef#1{\long\def\@makefntext}% + \if@twocolumn{\gmu@ATfootnotes\if@twocolumn}% Ampulex redefinition + % of \incs{maketitle} for \pk{mwcls}. +} +... + \long\pdef\@makefntext##1{% + \ifdefined\@parindent \parindent\@parindent + \else \parindent 1em\relax + \fi +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/resphilosophica/resphilosophica.cls +--------------------------------------------------------- +\def\@makefntext{\noindent\@makefnmark + \if@enddoc\else + \immediate\write\@mainaux% + {\string\xdef\string\lastfootnote@page{\the\c@page}}% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/tools/ftnright.sty +--------------------------------------------------------- +\long\def\@makefntext#1{\parindent 1em + \noindent\hbox to 2em{}% + \llap{\@thefnmark.\,\,}#1} +\setlength{\skip\footins} +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/elegantnote/elegantnote.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \if@twocolumn +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/ntgclass/rapport1.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent\z@ + \def\labelitemi{\textendash}\@revlabeltrue + \leavevmode\@textsuperscript{\@thefnmark}\kern1em\relax ##1} + \renewcommand*\thefootnote{\@fnsymbol\c@footnote}% +... + \long\def\@makefntext{\@xmakefntext{% + \@textsuperscript{\normalfont\@thefnmark}}}% + \if@twocolumn + \ifnum \col@number=\@ne +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/ntgclass/brief.cls +--------------------------------------------------------- +\long\def\@makefntext#1{% + \noindent\hb@xt@\leftmargini{\normalfont\@thefnmark.\hfil}#1} +\newcommand*\dutchbrief{% + \def\uwbrieftekst{Uw brief van} +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/ntgclass/boek.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent\z@ + \def\labelitemi{\textendash}\@revlabeltrue + \leavevmode\@textsuperscript{\@thefnmark}\kern1em\relax ##1} + \renewcommand*\thefootnote{\@fnsymbol\c@footnote}% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/ntgclass/rapport3.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent\z@ + \def\labelitemi{\textendash}\@revlabeltrue + \leavevmode\@textsuperscript{\@thefnmark}\kern1em\relax ##1} + \renewcommand*\thefootnote{\@fnsymbol\c@footnote}% +... + \long\def\@makefntext{\@xmakefntext{% + \@textsuperscript{\normalfont\@thefnmark}}}% + \if@twocolumn + \ifnum \col@number=\@ne +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/ntgclass/boek3.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent\z@ + \def\labelitemi{\textendash}\@revlabeltrue + \leavevmode\@textsuperscript{\@thefnmark}\kern1em\relax ##1} + \renewcommand*\thefootnote{\@fnsymbol\c@footnote}% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/ntgclass/artikel2.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent\z@ + \def\labelitemi{\textendash}\@revlabeltrue + \leavevmode\@textsuperscript{\@thefnmark}\kern1em\relax ##1} + \renewcommand*\thefootnote{\@fnsymbol\c@footnote}% +... + \long\def\@makefntext##1{\parindent\z@ + \def\labelitemi{\textendash}% + \leavevmode\hb@xt@.5\unitindent{% + \@textsuperscript{\normalfont\@thefnmark}\hfil}##1} +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/ntgclass/artikel3.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent\z@ + \def\labelitemi{\textendash}\@revlabeltrue + \leavevmode\@textsuperscript{\@thefnmark}\kern1em\relax ##1} + \renewcommand*\thefootnote{\@fnsymbol\c@footnote}% +... + \long\def\@makefntext{\@xmakefntext{% + \@textsuperscript{\normalfont\@thefnmark}}}% + \if@twocolumn + \ifnum \col@number=\@ne +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/ntgclass/artikel1.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent\z@ + \def\labelitemi{\textendash}\@revlabeltrue + \leavevmode\@textsuperscript{\@thefnmark}\kern1em\relax ##1} + \renewcommand*\thefootnote{\@fnsymbol\c@footnote}% +... + \long\def\@makefntext{\@xmakefntext{% + \@textsuperscript{\normalfont\@thefnmark}}}% + \if@twocolumn + \ifnum \col@number=\@ne +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/cdpbundl/letteracdp.cls +--------------------------------------------------------- +\long\def\@makefntext#1{% + \noindent + \hangindent 5\p@ + \hb@xt@5\p@{\hss\@makefnmark}#1} +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/courseoutline/courseoutline.cls +--------------------------------------------------------- +\setlength {\evensidemargin}{0.0in} % right margin 1.0 inch +\setlength {\textwidth}{6.5in} % right margin 1.0 inch +\setlength {\footnotesep}{14pt} % baseline skip for fn's 1st line +\setlength {\headheight}{0.2in} % make room for header +\setlength {\headsep}{0.2in} % modest header separation +\setlength {\parskip}{0.2in} % set a paragraph skip +\setlength {\parindent}{0.0in} % no para indents +% +% redefine the titlematter +% +\renewcommand\maketitle{\par + \begingroup + \renewcommand\thefootnote{\@fnsymbol\c@footnote}% + \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}% + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \newpage + \global\@topnum\z@ % Prevents figures from going at top of page. + \@maketitle + \thispagestyle{empty}\@thanks + \endgroup + \setcounter{footnote}{0}% + \global\let\thanks\relax + \global\let\maketitle\relax + \global\let\@maketitle\relax + \global\let\@thanks\@empty + % + \global\let\university\@empty + \global\let\department\@empty + \global\let\coursename\@empty +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/stellenbosch/ustitle.sty +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \if@twocolumn +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/chextras/chextras.sty +--------------------------------------------------------- + \long\def\@makefntext#1{\settowidth\@tempdima{.\kern\marginparsep} + \parindent\z@ + \advance\parindent-\@tempdima + \rule\z@\footnotesep +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/aiaa/aiaa-tc.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \newpage +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/oberdiek/enparen.sty +--------------------------------------------------------- + \long\def\@makefntext##1{% + \enparen@org@makefntext{% + \enparenBeginContext{footnote}% + ##1% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/cleveref/cleveref.sty +--------------------------------------------------------- +\long\def\@makefntext{% + \cref@constructprefix{footnote}{\cref@result}% + \protected@edef\cref@currentlabel{% + [footnote][\arabic{footnote}][\cref@result]% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/ametsoc/ametsoc.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\footnotesize\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1 + \vskip1sp +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/combine/combine.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \if@twocolumn +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/active-conf/active-conf.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent##1}% + \@note + \setcounter{footnote}{0} + \global\def\note##1{% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/iso/isov2.cls +--------------------------------------------------------- +\long\def\@makefntext#1{% + \parindent 1em% + \noindent + \hbox to 1.8em{\hss\@makefnmark}#1} +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/elegantpaper/elegantpaper.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@0.1em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \if@twocolumn +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/fnpara/fnpara.sty +--------------------------------------------------------- +\long\def\@makefntext#1{% +% \parindent 1em% +% \noindent +% \hb@xt@1.8em{\hss\@makefnmark}#1 +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/bxjscls/bxjsarticle.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\advance\leftskip 3\jsZw + \parindent 1\jsZw\noindent + \llap{\@textsuperscript{\normalfont\@thefnmark}\hskip0.3\jsZw}##1}% + \if@twocolumn +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/bxjscls/bxjsbook.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\advance\leftskip 3\jsZw + \parindent 1\jsZw\noindent + \llap{\@textsuperscript{\normalfont\@thefnmark}\hskip0.3\jsZw}##1}% + \if@twocolumn +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/bxjscls/bxjsslide.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\advance\leftskip 3\jsZw + \parindent 1\jsZw\noindent + \llap{\@textsuperscript{\normalfont\@thefnmark}\hskip0.3\jsZw}##1}% + \if@twocolumn +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/bxjscls/bxjsreport.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\advance\leftskip 3\jsZw + \parindent 1\jsZw\noindent + \llap{\@textsuperscript{\normalfont\@thefnmark}\hskip0.3\jsZw}##1}% + \if@twocolumn +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/lettre/lettre.cls +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/titlefoot/titlefoot.sty +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \if@twocolumn +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/revtex/aip4-2.rtx +--------------------------------------------------------- +\def\@makefntext#1{% + \def\baselinestretch{1}% + \leftskip1em% + \parindent1em% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/revtex/aps4-2.rtx +--------------------------------------------------------- +\long\def\@makefntext#1{% + \def\baselinestretch{1}% + \leftskip1em% + \parindent1em% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/revtex/revtex4-2.cls +--------------------------------------------------------- +\def\@makefntext#1{% + \def\baselinestretch{1}% + \parindent1em% + \noindent +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/revtex/sor4-2.rtx +--------------------------------------------------------- +\def\@makefntext#1{% + \def\baselinestretch{1}% + \leftskip1em% + \parindent1em% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/revtex/aapm4-2.rtx +--------------------------------------------------------- +\def\@makefntext#1{% + \def\baselinestretch{1}% + \leftskip1em% + \parindent1em% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/lni/lni.cls +--------------------------------------------------------- + \long\def\@makefntext##1{% + \@setpar{\@@par + \@tempdima = \hsize + \advance\@tempdima -1em +... +\long\def\@makefntext#1{% + \parindent \fnindent% + \leftskip \fnindent% Einrückung vor der footnotemark + \noindent +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/arabtex/arabrep.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{\hss\@makefnmark}##1}% + \if@twocolumn + \ifnum \col@number=\@ne +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/arabtex/arabrep1.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{\hss\@makefnmark}##1}% + \if@twocolumn + \ifnum \col@number=\@ne +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/llncs/llncs.cls +--------------------------------------------------------- +\long\def\@makefntext#1{% + \parindent \fnindent% + \leftskip \fnindent% + \noindent +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/frankenstein/blkcntrl.sty +--------------------------------------------------------- +\defcommand\@makefntext [1] {% + \setlength\parindent{\@ne em}% + \noindent + \hb@xt@ 1.8em{\hss\@makefnmark}% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/frankenstein/blkcntrl.stq +--------------------------------------------------------- +\defcommand\@makefntext [1] {% + \setlength\parindent{\@ne em}% + \noindent + \hb@xt@ 1.8em{\hss\@makefnmark}% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/cmpj/cmpj2.sty +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \if@twocolumn +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/cmpj/cmpj3.sty +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \if@twocolumn +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/cmpj/cmpj.sty +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \if@twocolumn +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/pracjourn/pracjourn.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \newpage +... +\def\@makefntext#1{% + \parindent 0em\relax + \makebox[1.5em][l]{\normalfont\footnotesize\@thefnmark.}#1} +\def\@ifx@empty#1{% Implicit #2#3 +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/extsizes/extbook.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \if@twocolumn +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/extsizes/extletter.cls +--------------------------------------------------------- +\long\def\@makefntext#1{% + \noindent + \hangindent 5\p@ + \hb@xt@5\p@{\hss\@makefnmark}#1} +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/extsizes/extarticle.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \if@twocolumn +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/extsizes/extproc.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \twocolumn[\@maketitle]% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/extsizes/extreport.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \if@twocolumn +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/h2020proposal/h2020proposal.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \newpage +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ms.bbx +--------------------------------------------------------- + \long\def\@makefntext##1{%增加了脚注标记与正文的间隔 + \parindent 1em\noindent \hb@xt@ 0em{\hss \@makefnmark\makebox[\footbiblabelsep]{}}##1} + + } +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015mx.bbx +--------------------------------------------------------- + \long\def\@makefntext##1{%增加了脚注标记与正文的间隔 + \parindent 1em\noindent \hb@xt@ 0em{\hss \@makefnmark\makebox[\footbiblabelsep]{}}##1} + + } +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ay.bbx +--------------------------------------------------------- + \long\def\@makefntext##1{%增加了脚注标记与正文的间隔 + \parindent 1em\noindent \hb@xt@ 0em{\hss \@makefnmark\makebox[\footbiblabelsep]{}}##1} + + } +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.bbx +--------------------------------------------------------- + \long\def\@makefntext##1{%增加了脚注标记与正文的间隔 + \parindent 1em\noindent \hb@xt@ 0em{\hss \@makefnmark\makebox[\footbiblabelsep]{}}##1} + + } +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/suftesi/suftesi.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \if@twocolumn +... + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \if@twocolumn +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/mwcls/mwrep.cls +--------------------------------------------------------- + \long\def\@makefntext##1{ + \parindent\@parindent + \@textsuperscript{\normalfont\@thefnmark}\enspace##1}% + \if@twocolumn +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/mwcls/mwart.cls +--------------------------------------------------------- + \long\def\@makefntext##1{ + \parindent\@parindent + \@textsuperscript{\normalfont\@thefnmark}\enspace##1}% + \if@twocolumn +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/mwcls/mwbk.cls +--------------------------------------------------------- + \long\def\@makefntext##1{ + \parindent\@parindent + \@textsuperscript{\normalfont\@thefnmark}\enspace##1}% + \if@twocolumn +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/tugboat/ltugboat.cls +--------------------------------------------------------- +\long\def\@makefntext#1{\parindent 1em\noindent\hb@xt@2em{}% + \llap{\@makefnmark}\null$\mskip5mu$#1} + +%% \long\def\@makefntext#1{\parindent 1em +... + \def\@makefntext##1{##1}% + \footnotetext{\noindent #1#2}% + \endgroup +} +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/ptptex/ptptex.cls +--------------------------------------------------------- +\long\def\@makefntext#1{% +\parindent 1.5em\noindent \footnotesize % +\hbox to 2.5em{\hss$^{\@thefnmark}$}\hskip3\p@#1} +\gdef\@thanks{} +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/aguplus/aguplus.sty +--------------------------------------------------------- + \long\def\@makefntext##1{##1} + \footnotetext{{\parindent=1em\indent + \let\@elt=\par\@titlenote}} + \fi +... + \long\def\@makefntext##1{##1} + \footnotetext{{\parindent=10pt\indent + \parskip=6pt\let\@elt=\par\@titlenote}} + \fi +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/aguplus/aguplus.cls +--------------------------------------------------------- + \long\def\@makefntext##1{##1} + \footnotetext{{\parindent=1em\indent + \let\@elt=\par\@titlenote}} + \fi +... + \long\def\@makefntext##1{##1} + \footnotetext{{\parindent=10pt\indent + \parskip=6pt\let\@elt=\par\@titlenote}} + \fi +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/protocol/protocol.cls +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/cje/cje.cls +--------------------------------------------------------- + \long\def\@makefntext##1{%\parindent 1em + \noindent +% \hb@xt@1.8em{% +% \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% +... +\long\def\@makefntext#1{\raggedright\@setpar{\@@par\@tempdima \hsize + \advance\@tempdima-\@footindent + \parshape \@ne \@footindent \@tempdima}\par + \noindent \hbox to \z@{\hss\@thefnmark\enskip}#1} +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/tufte-latex/tufte-common.def +--------------------------------------------------------- +\long\def\@makefntext#1{\@textsuperscript{\@tufte@sidenote@font\tiny\@thefnmark}\,\footnotelayout#1} + +% Set the in-text footnote mark in the same typeface as the body text itself. +\def\@makefnmark{\hbox{\@textsuperscript{\normalfont\footnotesize\@thefnmark}}} +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/amscls/amsdtx.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hbox to1.8em{\hss$\m@th^{\@thefnmark}$}##1}% + \if@twocolumn + \ifnum \col@number=\@ne +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/amscls/amsbook.cls +--------------------------------------------------------- +\def\@makefntext{\indent\@makefnmark} +\long\def\@footnotetext#1{% + \insert\footins{% + \normalfont\footnotesize +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/amscls/amsproc.cls +--------------------------------------------------------- +\def\@makefntext{\indent\@makefnmark} +\long\def\@footnotetext#1{% + \insert\footins{% + \normalfont\footnotesize +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/amscls/amsart.cls +--------------------------------------------------------- +\def\@makefntext{\indent\@makefnmark} +\long\def\@footnotetext#1{% + \insert\footins{% + \normalfont\footnotesize +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/quantumarticle/quantumarticle.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \ifbool{@twocolumn} +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/ltxmisc/iagproc.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \twocolumn[\@maketitle]% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/acmart/acmart.cls +--------------------------------------------------------- +\def\@makefntext{\noindent\@makefnmark} +\if@ACM@sigchiamode +\long\def\@footnotetext#1{\marginpar{% + \reset@font\small +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/memoir/memoir.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\makethanksmark ##1} + \if@twocolumn + \ifnum \col@number=\@ne + \@maketitle +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/footnotebackref/footnotebackref.sty +--------------------------------------------------------- +% than redefine the \@makefntext and \@makefnmark +% The \@makefnmark macro is redefined in the space of +% the \@makefntext macro +% So the footnote numbers in the main text are not influenced +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/bangtex/barticle.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \if@twocolumn +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/bangtex/bletter.cls +--------------------------------------------------------- +\long\def\@makefntext#1{% + \noindent + \hangindent 5\p@ + \hb@xt@5\p@{\hss\@makefnmark}#1} +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/bangtex/bbook.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\sbng\@thefnmark}}##1}% + \if@twocolumn +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/elbioimp/elbioimp.cls +--------------------------------------------------------- + \def \@makefntext ##1{\noindent + \small \@thefnmark. \it ##1} + \renewcommand{\thempfootnote}% + {\arabic{mpfootnote}} +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/ebsthesis/ebsthesis.cls +--------------------------------------------------------- + \long\def\@makefntext#1{% + \bgroup + \setbox\@tempboxa\hbox{% + \ifdim\footnotemargin>0pt +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/coursepaper/coursepaper.cls +--------------------------------------------------------- + \setlength {\evensidemargin}{0.5in} % right margin 1.5 inch + \setlength {\textwidth}{5.5in} % right margin 1.5 inch + \spacing{2} % double spacing for final + \renewenvironment{quote} % redef as single spaced + {\oldquote\spacing{1}} + {\oldendquote\spacing{2}} + \renewenvironment{quotation} % redef as single spaced + {\oldquotation\spacing{1}} + {\oldendquotation\spacing{2}} + \renewenvironment{verse} % redef as single spaced + {\oldquotation\spacing{1}} + {\oldendquotation\spacing{2}} +} +\setlength {\footnotesep}{14pt} % baseline skip for fn's 1st line +\setlength {\headheight}{0.2in} % make room for header +\setlength {\headsep}{0.2in} % modest header separation +\setlength {\parskip}{0.2in} % set a paragraph skip +\setlength {\parindent}{0.2in} % I hate unindented first lines +\renewenvironment{bibliography}[1] % automatically enter toc line + {\addcontentsline{toc}{chapter}{Bibliography}\oldbibliography {#1}} + {\oldendbibliography} +% +% Make footnotes single spaced +% +% code shamelessly stolen from setspace.sty +% written by Geoffrey Tobin <G.Tobin@latrobe.edu.au> +% +\long\def\@footnotetext#1{% + \insert\footins{% + \def\baselinestretch {1}% + \reset@font\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth + \@parboxrestore + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark + }% + \color@begingroup + \@makefntext{% + \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}% + \color@endgroup}} +% +% redefine the titlematter +% +\renewcommand\maketitle{\par + \begingroup + \renewcommand\thefootnote{\@fnsymbol\c@footnote}% + \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}% + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \newpage + \global\@topnum\z@ % Prevents figures from going at top of page. + \@maketitle + \thispagestyle{empty}\@thanks + \endgroup + \setcounter{footnote}{0}% + \global\let\thanks\relax + \global\let\maketitle\relax + \global\let\@maketitle\relax + \global\let\@thanks\@empty + \global\let\@author\@empty + \global\let\@date\@empty + \global\let\@title\@empty + % + \global\let\@studentnumber\@empty + \global\let\@coursenumber\@empty + \global\let\@coursename\@empty + \global\let\@coursesection\@empty + \global\let\@instructor\@empty + \global\let\@college\@empty + % + \global\let\title\relax + \global\let\author\relax + \global\let\date\relax + \global\let\and\relax +} +% +\def\@maketitle{% + \newpage + \null + \vskip 2em% + \begin{flushleft}% + \begin{spacing}{1}% + {\sffamily \LARGE \@title \par}% + \vskip 2em% + {\sffamily \large\lineskip .75em\@author}\\% + \sffamily \@studentnumber% + \vskip 1em% + \sffamily \@date + \vskip 3em% + \sffamily \@college\\% + \sffamily \@coursenumber\hskip 6pt\@coursesection\hskip 6pt% + \@coursename\\% + \sffamily For: \@instructor% + \par% + \end{spacing}% + \end{flushleft}\hrule\vskip 1em\par + \par + \vskip 1.5em} +% +% make section titles less obnoxious +% +\renewcommand\section{\@startsection {section}{1}{\z@}% + {-3.5ex \@plus -1ex \@minus -.2ex}% + {2.3ex \@plus.2ex}% + {\normalfont\large\bfseries}} +\renewcommand\subsection{\@startsection{subsection}{2}{\z@}% + {-3.25ex\@plus -1ex \@minus -.2ex}% + {1.5ex \@plus .2ex}% + {\normalfont\normalsize\bfseries}} +\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% + {-3.25ex\@plus -1ex \@minus -.2ex}% + {1.5ex \@plus .2ex}% + {\normalfont\normalsize\bfseries}} +\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}% + {3.25ex \@plus1ex \@minus.2ex}% + {-1em}% + {\normalfont\normalsize\bfseries}} +\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}% + {3.25ex \@plus1ex \@minus .2ex}% + {-1em}% + {\normalfont\normalsize\bfseries}} +% +% Set up headers +% +\def\ps@myheadings{% + \let\@oddfoot\@empty\let\@evenfoot\@empty + \def\@evenhead{\thepage -- \slshape\leftmark\hfil}% + \def\@oddhead{\hfil{\slshape\rightmark} -- \thepage}% + \let\@mkboth\@gobbletwo + \let\sectionmark\@gobble + \let\subsectionmark\@gobble + } +% +% Position the abstract depending on presence of titlepage +% +\if@titlepage + \renewenvironment{abstract}{% + \titlepage + \null\vfil + \@beginparpenalty\@lowpenalty + \begin{center}% + \bfseries \abstractname + \@endparpenalty\@M + \end{center}}% + {\par\vfil\null\endtitlepage} +\fi +% +% change some names +% +\renewcommand\contentsname{Table of Contents} +\renewcommand\refname{Bibliography} +% +% \epigraph{text}{byline} +% +\newcommand{\epigraph}[2]{\begin{flushright}\begin{minipage}{4in}% + \spacing{1}#1\begin{flushright}#2\end{flushright}% + \hrule\end{minipage}\vskip 12pt\end{flushright}} +% +%% End of file `coursepaper.cls'. +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/kotex-utf/contrib/dhucsfn.sty +--------------------------------------------------------- + \long\def\@makefntext#1{ + \settowidth{\foot@parindent}{\fn@markstyle} + \@setpar{\@@par\@tempdima \hsize + \advance\@tempdima-\foot@parindent +... + \long\def\@makefntext#1{% + \hbox{\fn@markstyle\hskip\footnumbersep #1} + }% +} +... + \long\def\@makefntext#1{% + \fn@markstyle\ifdim\footnumbersep=\z@\else~\fi #1 + }% +} +... + \long\def\@makefntext#1{ + \settowidth{\foot@parindent}{\reset@font 각주} + \settowidth{\footnumbersep}{\reset@font 주} + \divide\footnumbersep by2 +... + \long\def\@makefntext#1{ + \settowidth{\leftskip}{\reset@font 각주} + \settowidth{\foot@parindent}{\fn@markstyle} + \settowidth{\footnumbersep}{\reset@font 주} +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/ucthesis/ucthesis.cls +--------------------------------------------------------- +% \long\def\@makefntext#1{\@setpar{\@@par\@tempdima \hsize +% \advance\@tempdima-10pt\parshape \@ne 10pt \@tempdima}\par +% \parindent 1em\noindent +% \hbox to \z@{\hss$\m@th^{\@thefnmark}$}#1} +... +\long\def\@makefntext#1{\parindent 1em\noindent + \hbox to 1.8em{\hss$\m@th^{\@thefnmark}$}#1} + +% \@makefnmark : A macro to generate the footnote marker that goes +... + \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}\@makefntext + {\rule{\z@}{\footnotesep}\ignorespaces + #1\strut}}} + +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/apa/apa.cls +--------------------------------------------------------- +\long\def\@makefntext#1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont{\tiny\@thefnmark}\hspace{1.5pt}}}#1}% + +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/uestcthesis/uestcthesis.cls +--------------------------------------------------------- +\def\@makefntext #1{\ifFN@hangfoot \bgroup \setbox \@tempboxa \hbox {\ifdim +\footnotemargin >0pt \hb@xt@ \footnotemargin {\hbox { \normalfont \@thefnmark} +\hss }\else \hbox { \normalfont \@thefnmark} \fi }\leftmargin \wd \@tempboxa +\rightmargin \z@ \linewidth \columnwidth \advance \linewidth -\leftmargin +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/gmdoc/gmdoc.sty +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \if@twocolumn \twocolumn [\@maketitle ]% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/titling/titling.sty +--------------------------------------------------------- + \long\def\@makefntext##1{\makethanksmark ##1} + \null\vfil + \vskip 60\p@ + \vspace*{\droptitle} +... + \long\def\@makefntext##1{\makethanksmark ##1} + \if@twocolumn + \ifnum \col@number=\@ne + \@maketitle +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/chletter/chletter.cls +--------------------------------------------------------- +\long\def\@makefntext#1{\noindent\hb@xt@\z@{\hss\@makefnmark}#1} +\def\fromname{\@author} +\def\fromsig{\@author} +\let\fromlocation\@empty +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/jurarsp/jurarsp.sty +--------------------------------------------------------- +\long\def\@makefntext#1{% + \rsp@fntrue% + \@setpar{\@@par + \@tempdima = \hsize +... +/usr/local/texlive/2021/texmf-dist/tex/latex/kluwer/klunote.sty +--------------------------------------------------------- +% \long\def\@makefntext#1{\parindent 1em\noindent +% \hbox to 1.5em{\hss$^{\@thefnmark}$}\hskip0.5em\footnotesize#1} +% \def\@makefnmark{\hbox{$^{\@thefnmark}\m@th$}} +% SK: reimplemented with \textsuperscript, following LaTeX format +... +\long\def\@makefntext#1{\parindent 1em\noindent + \hbox to 1.5em{\hss\textsuperscript{\@thefnmark}}% + \hskip0.5em\footnotesize#1} +\def\@makefnmark{\hbox{\textsuperscript{\@thefnmark}}} +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/kluwer/kluwer.cls +--------------------------------------------------------- +\long\def\@makefntext#1{\parindent 1em\noindent + \hbox to 1.5em{\hss\textsuperscript{\@thefnmark}}% + \hskip0.5em\footnotesize#1} +\def\@makefnmark{\hbox{\textsuperscript{\@thefnmark}}} +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/asaetr/asaesub.sty +--------------------------------------------------------- + \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}\@makefntext + {\rule{\z@}{\footnotesep}\ignorespaces + #1\strut}}} + +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/asaetr/asaetr.sty +--------------------------------------------------------- +\long\def\@makefntext#1{\parindent 1em\noindent + \hbox to 1.8em{\hss$^{\@thefnmark}$}#1} + + +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/refman/refrep.cls +--------------------------------------------------------- + \long\def\@makefntext##1{% + \@setpar{\@@par + \@tempdima = \hsize + \advance\@tempdima -1em +... + \long\def\@makefntext##1{% + \@setpar{\@@par + \@tempdima = \hsize + \advance\@tempdima -1em +... +\long\def\@makefntext#1{% + \@setpar{\@@par + \@tempdima = \hsize + \advance\@tempdima -1em +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/refman/refart.cls +--------------------------------------------------------- + \long\def\@makefntext##1{% + \@setpar{\@@par + \@tempdima = \hsize + \advance\@tempdima -1em +... + \long\def\@makefntext##1{% + \@setpar{\@@par + \@tempdima = \hsize + \advance\@tempdima -1em +... +\long\def\@makefntext#1{% + \@setpar{\@@par + \@tempdima = \hsize + \advance\@tempdima -1em +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/lwarp/lwarp-footnote.sty +--------------------------------------------------------- +\long\def\@makefntext#1{\textsuperscript{\@thefnmark}~#1} + +\LWR@ProvidesPackagePass{footnote}[1997/01/28] + +... +\long\def\@makefntext#1{\textsuperscript{\@thefnmark}~{#1}} + +\def\spewnotes{% + \endgroup% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/lwarp/lwarp.sty +--------------------------------------------------------- +\long\def\@makefntext#1{\textsuperscript{\@thefnmark}~{#1}} +\def\@makefnmark{% + \textsuperscript{\@thefnmark}% +} +... +\long\def\@makefntext##1{% +\textsuperscript{\@thefnmark}~% +{##1}% +}% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/lwarp/lwarp-titling.sty +--------------------------------------------------------- + \long\def\@makefntext##1{% + \makethanksmark~% + {##1}% + }% \@makefntext +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/afthesis/afthesis.cls +--------------------------------------------------------- + \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}\@makefntext + {\rule{\z@}{\footnotesep}\ignorespaces + #1\strut}}} + +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/ijmart/ijmart.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\noindent\hangindent=2em\hangafter=1 + \hb@xt@2em{% + \hss\@textsuperscript{\normalfont\footnotesize\@thefnmark\space}}##1}% + \def\footnoterule{\kern-3pt\hrule width 2in\kern 2.6pt} +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/oup-authoring-template/oup-authoring-template.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 3mm\noindent + \if@traditional\if@small\@hangfrom{{\normalfont\@thefnmark}\enskip}\else\@textsuperscript{\normalfont\@thefnmark}\fi\else\@textsuperscript{\normalfont\@thefnmark}\fi + ##1}% + \if@twocolumn +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/akletter/akletter.cls +--------------------------------------------------------- +\long\def\@makefntext#1{% + \noindent + \hangindent 5\p@ + \hb@xt@5\p@{\hss\@makefnmark}#1} +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/revtex4/aps.rtx +--------------------------------------------------------- +\def\@makefntext#1{% + \def\baselinestretch{1}% + \reset@font + \footnotesize +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/revtex4/revtex4.cls +--------------------------------------------------------- +\def\@makefntext#1{% + \def\baselinestretch{1}% + \reset@font\footnotesize + \parindent 1em% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/hitreport/hitreport.cls +--------------------------------------------------------- +\long\def\@makefntext#1{% + \begingroup + % 序号取消上标 + \def\@makefnmark{\hbox{\normalfont\@thefnmark}}% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/footnotehyper/footnotehyper.sty +--------------------------------------------------------- + \def\FNH@prefntext{\@makefntext{}}% + \iffootnotehyperwarn + \PackageInfo{footnotehyper}% + {Using the \string\@makefntext{} approach (see doc).\FNH@msgbk +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/basque-book/basque-book.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \if@twocolumn +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/dinbrief/dinbrief.cls +--------------------------------------------------------- +\long\def\@makefntext#1{% + \noindent + \hangindent 5pt% + \hbox to 5pt{\hss $^{\@thefnmark}$}#1} +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/beamer/beamerbaseframecomponents.sty +--------------------------------------------------------- +\def\@makefntext#1{% + \def\insertfootnotetext{#1}% + \def\insertfootnotemark{\@makefnmark}% + \usebeamertemplate***{footnote}} +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/ucdavisthesis/ucdavisthesis.cls +--------------------------------------------------------- + \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}\@makefntext + {\rule{\z@}{\footnotesep}\ignorespaces + #1\strut}\renewcommand\baselinestretch{\@spacing}}} +\ps@plain % 'plain' page style +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/computational-complexity/cclayout.sty +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/footmisx/footmisx.sty +--------------------------------------------------------- + \long\def\@makefntext#1{\leavevmode + \@makefnmark\nobreak + \hskip.5em\relax#1% + } +... + \long\def\@makefntext#1{% + \ifFN@hangfoot + \bgroup + \setbox\@tempboxa\hbox{% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/amsdtx.hyp +--------------------------------------------------------- + \long\def\@makefntext##1{% + \hyper@currentfnmark% + \bgroup% + \edef\@currenthyper{\hyper@current@fnmark}% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/slides.hyp +--------------------------------------------------------- +\long\def\@makefntext#1{% + \bgroup% + \hyper@currentfnmark% + \edef\@currenthyper{\hyper@current@fnmark}% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/book.hyp +--------------------------------------------------------- +\long\def\@makefntext#1{% + \bgroup% + \hyper@currentfnmark% + \edef\@currenthyper{\hyper@current@fnmark}% +... + \long\def\@makefntext##1{% + \hyper@currentfnmark% + \bgroup% + \edef\@currenthyper{\hyper@current@fnmark}% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/ltxguide.hyp +--------------------------------------------------------- +\long\def\@makefntext#1{% + \bgroup% + \hyper@currentfnmark% + \edef\@currenthyper{\hyper@current@fnmark}% +... + \long\def\@makefntext##1{% + \hyper@currentfnmark% + \bgroup% + \edef\@currenthyper{\hyper@current@fnmark}% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/ltnews.hyp +--------------------------------------------------------- +\long\def\@makefntext#1{% + \bgroup% + \hyper@currentfnmark% + \edef\@currenthyper{\hyper@current@fnmark}% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/doc.hyp +--------------------------------------------------------- + \long\def\@makefntext##1{% + \hyper@currentfnmark% + \bgroup + \edef\@currenthyper{\hyper@current@fnmark} +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/ftnright.hyp +--------------------------------------------------------- +\long\def\@makefntext#1{% + \hyper@currentfnmark% + \bgroup% + \edef\@currenthyper{\hyper@current@fnmark}% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/letter.hyp +--------------------------------------------------------- +\long\def\@makefntext#1{% + \bgroup% + \hyper@currentfnmark% + \edef\@currenthyper{\hyper@current@fnmark}% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/amsbook.hyp +--------------------------------------------------------- +\long\def\@makefntext#1{\indent% + \hyper@currentfnmark% + \bgroup% + \edef\@currenthyper{\hyper@current@fnmark}% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/ltxdoc.hyp +--------------------------------------------------------- +\long\def\@makefntext#1{% + \bgroup% + \hyper@currentfnmark% + \edef\@currenthyper{\hyper@current@fnmark}% +... + \long\def\@makefntext##1{% + \hyper@currentfnmark% + \bgroup% + \edef\@currenthyper{\hyper@current@fnmark}% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/proc.hyp +--------------------------------------------------------- +\long\def\@makefntext#1{% + \bgroup% + \hyper@currentfnmark% + \edef\@currenthyper{\hyper@current@fnmark}% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/amsart.hyp +--------------------------------------------------------- +\long\def\@makefntext#1{\indent% + \hyper@currentfnmark% + \bgroup% + \edef\@currenthyper{\hyper@current@fnmark}% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/amsproc.hyp +--------------------------------------------------------- +\long\def\@makefntext#1{\indent% + \hyper@currentfnmark% + \bgroup% + \edef\@currenthyper{\hyper@current@fnmark}% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/article.hyp +--------------------------------------------------------- +\long\def\@makefntext#1{% + \bgroup% + \hyper@currentfnmark% + \edef\@currenthyper{\hyper@current@fnmark}% +... + \long\def\@makefntext##1{% + \hyper@currentfnmark% + \bgroup% + \edef\@currenthyper{\hyper@current@fnmark}% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/report.hyp +--------------------------------------------------------- +\long\def\@makefntext#1{% + \bgroup% + \hyper@currentfnmark% + \edef\@currenthyper{\hyper@current@fnmark}% +... + \long\def\@makefntext##1{% + \hyper@currentfnmark% + \bgroup% + \edef\@currenthyper{\hyper@current@fnmark}% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/hitec/hitec.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \newpage +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/emulateapj/emulateapj.cls +--------------------------------------------------------- +\def\@makefntext#1{\mbox{}\hspace*{3mm}\@makefnmark~#1} + +\def\notetoeditor#1{}% % We do not need notes to editor in the preprint +\def\placetable#1{}% % We do not need notes to editor in the preprint +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/ledmac/afoot.sty +--------------------------------------------------------- + \long\def\@makefntext#1{{$^{\@thefnmark}$}#1\nobreak } +\fi + +%%% Make the LaTeX \cs{footnote} catcode-safe, like in Plain TeX. +... + \global\long\def \@makefntext ##1{{$^{\@thefnmark }$}##1\nobreak }% + \setbox0=\hbox \bgroup % fnpara.sty is present + \floatingpenalty=20000 \footnotesize + \fi +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/footmisc/footmisc.sty +--------------------------------------------------------- + \long\def\@makefntext#1{\leavevmode + \@makefnmark\nobreak + \hskip.5em\relax#1% + } +... + \long\def\@makefntext#1{% + \ifFN@hangfoot + \bgroup + \setbox\@tempboxa\hbox{% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/footmisc/footmisc-2011-06-06.sty +--------------------------------------------------------- + \long\def\@makefntext#1{\leavevmode + \@makefnmark\nobreak + \hskip.5em\relax#1% + } +... + \long\def\@makefntext#1{% + \ifFN@hangfoot + \bgroup + \setbox\@tempboxa\hbox{% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/base/book.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \if@twocolumn +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/base/slides.cls +--------------------------------------------------------- +\long\def\@makefntext#1{ + \noindent + \hangindent 10\p@ + \hb@xt@10\p@{\hss\@makefnmark}#1} +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/base/doc.sty +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hbox to1.8em{\hss$\m@th^{\@thefnmark}$}##1}% + \if@twocolumn \twocolumn [\@maketitle ]% + \else \newpage \global \@topnum \z@ \@maketitle \fi +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/base/proc.sty +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \twocolumn[\@maketitle]% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/base/proc.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \twocolumn[\@maketitle]% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/base/doc-v3beta.sty +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hbox to1.8em{\hss$\m@th^{\@thefnmark}$}##1}% + \if@twocolumn \twocolumn [\@maketitle ]% + \else \newpage \global \@topnum \z@ \@maketitle \fi +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/base/article.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \if@twocolumn +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/base/report.cls +--------------------------------------------------------- + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \if@twocolumn +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/twoinone/2in1.sty +--------------------------------------------------------- +\long\def\@makefntext##1{\parindent 1em\noindent +\hb@xt@1.8em{% +\hss\@textsuperscript{\normalfont\@thefnmark}}##1}% +\@maketitle +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/ltxtools/ltxtools-review.sty +--------------------------------------------------------- + \long\def\@makefntext##1{\rule\z@\footnotesep\parindent1em\noindent + \hb@xt@2em{\hss\@textsuperscript + {\normalfont\textcolor{#1}{\@thefnmark}}}% + \hspace{2\p@}\ignorespaces\textcolor{#1}{##1}% +... + \long\def\@makefntext##1{% + \rule\z@\footnotesep\parindent1em\noindent + \hb@xt@0em{\hss\@textsuperscript{\normalfont\color{#1}\@thefnmark}}% + \hspace{2\p@}\color{#1}\ignorespaces##1% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/skeyval/skeyval-testclass.cls +--------------------------------------------------------- + \long\def\@makefntext##1{% + \parindent1em\relax\noindent + \hb@xt@1.8em{\hss\@textsuperscript{% + \normalfont\skv@fnsymbol\@thefnmark}% +... +--------------------------------------------------------- +/usr/local/texlive/2021/texmf-dist/tex/latex/newlfm/newlfm.cls +--------------------------------------------------------- +\long\def\@makefntext#1{% +\noindent \hangindent 5\p@% +\hb@xt@5\p@{\hss\@makefnmark}#1}% +\renewcommand{\thefigure}{\@arabic\c@figure}% +... +--------------------------------------------------------- + +``` diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-bib.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-bib.dtx new file mode 100644 index 00000000000..20332d1c9e6 --- /dev/null +++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-bib.dtx @@ -0,0 +1,343 @@ +% \iffalse meta-comment +% +%% File: latex-lab-bib.dtx (C) Copyright 2023 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-bib.dtx} +\end{document} +%</driver> +% +% \fi +% +% \title{The \textsf{latex-lab-bib} package\\ +% Changes and additions to the kernel related to tagging and links in citations and +% bibliography entries} +% \author{\LaTeX{} Project\thanks{Initial implementation done by Ulrike Fischer}} +% \date{Version 0.80 2023-05-10} +% +% \maketitle +% +% \newcommand{\xt}[1]{\textsl{\textsf{#1}}} +% \newcommand{\TODO}[1]{\textbf{[TODO:} #1\textbf{]}} +% \newcommand{\docclass}{document class \marginpar{\raggedright document class +% customizations}} +% +% \providecommand\hook[1]{\texttt{#1}} +% +% \begin{abstract} +% \end{abstract} +% +% \section{Introduction} +% +% The followings contains small changes to improve tagging of +% bibliography entries and citations. +% +% The tagging of the bibliography is actually quite straightforward: +% A bibliography is typically a list with a heading and the sec and block tagging +% code handles that. +% +% There are here only two problems: +% +% \begin{itemize} +% \item The structure number of the \texttt{LI} element +% create by a \cs{bibitem} must be recorded somehow to allow to reference it in +% a \cs{cite}. +% \item \pkg{hyperref} redefines the item command and so breaks the list structure +% see \url{https://github.com/latex3/latex2e/discussions/1010#discussioncomment-5565418} +% \end{itemize} +% +% Both problems are rather easy to resolve, but it must be checked if other packages +% interfere again by redefining the commands. +% +% More difficult is the tagging of citation commands. Citations should be inside +% a Reference structure and contain a /Ref entry pointing to the relevant +% item in the bibliography. For simple citations like +% \enquote{[1]} or \enquote{Doody (2023)} this is easy, but it is not obvious how +% to handle combined citations like \enquote{Doody (2003,2018)} (or even compressed citations +% like \enquote{[1-3]}). The implementation follows here the links: whatever hyperref would +% link is set as the reference. +% +% An additional problem are the various packages trying to improve citation commands +% which all should be checked. Currently only natbib has been tried. +% +% The biblatex package isn't handled yet. +% +% +% \section{Implementation} +% \begin{macrocode} +%<*package> +%<@@=tag> +% \end{macrocode} +% \begin{macrocode} +\ProvidesExplPackage {latex-lab-testphase-bib} {2023-05-18} {0.8} + {Code related to the tagging of bibliography and cite command} +% \end{macrocode} +% We need at least the block tagging code. +% \begin{macrocode} +\RequirePackage{latex-lab-testphase-block-tagging} +% \end{macrocode} +% +% At first we suppress the patches from hyperref. This will only work with the next +% hyperref! +% \begin{macrocode} +\def\hyper@nopatch@bib{} +% \end{macrocode} + +% \begin{macro}{\@extra@binfo,\@extra@b@citeb} +% These are taken from hyperref, they are for chapterbib compability (and also +% signal to chapterbib not to change the citation commands) +% \begin{macrocode} +\providecommand*\@extra@binfo{}% +\providecommand\@extra@b@citeb{} +% \end{macrocode} +% \end{macro} +% +% \begin{variable}{\l_@@_bib_target_tl} +% Items should add a target, to avoid that user code +% interferes we don't rely on \cs{@currentHref} +% \begin{macrocode} +\tl_new:N\l_@@_bib_target_tl +% \end{macrocode} +% \end{variable} + +%\subsection{Handling the bibliography} +% \begin{macro}{\lbibitem} +% The item command if an optional argument is use. +% +% We only prepend some code. +% If we had already generic hooks with arguments +% we could probably use them \ldots +% \begin{macrocode} +\def\@lbibitem[#1]#2{% +% \end{macrocode} +% we store the target name for the following code. +% \begin{macrocode} + \tl_set:Nx\l_@@_bib_target_tl{cite.#2\@extra@b@citeb} +% \end{macrocode} +% The target is added at the begin of the paragraph. +% \begin{macrocode} + \AddToHookNext{para/begin}{\makebox[0pt][r]{\MakeLinkTarget*{\l_@@_bib_target_tl}\hspace{\leftmargin}}} + \item[\@biblabel{#1}\hfill]\if@filesw + {\let\protect\noexpand + \immediate + \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces} +% \end{macrocode} +% we make a copy to be able to reinstate the definition. This is e.g. +% currently needed with hyperref. +% \begin{macrocode} +\let\@kernel@copy@lbibitem\@lbibitem +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@bibitem} +% Similar for bibitem. +% TODO: If hyperref is loaded we will get a second target from the refstepcounter, +% but this is ignored for now. +% \begin{macrocode} +\def\@bibitem#1{ + \tl_set:Nx\l_@@_bib_target_tl{cite.#1\@extra@b@citeb}% + \AddToHookNext{para/begin}{\makebox[0pt][r]{\MakeLinkTarget*{\l_@@_bib_target_tl}\hspace{\leftmargin}}} + \item\if@filesw \immediate\write\@auxout + {\string\bibcite{#1}{\the\value{\@listctr}}}\fi\ignorespaces} +\let\@kernel@copy@bibitem\@bibitem +% \end{macrocode} +% \end{macro} +% +% TODO The LI-structure should set a label, we redefine the internal command locally for +% now, but perhaps this need a receipe? +% +% \begin{macrocode} +\AddToHook{env/thebibliography/begin} + {\cs_set:Npn \__block_list_item_begin: + { \tagstructbegin{tag=\LItag,label=\l_@@_bib_target_tl}} + } +% \end{macrocode} +% +% \subsection{Handling citation commands} +% We redefine similar to hyperref the \cs{bibcite} command to inject link and +% structure. Even if it looks a bit odd it is now used for many years and so +% hopefully compatible with various packages. But differently to hyperref we use +% the new hooks with arguments. +% TODO: consider name. Perhaps use the generic names? +% \begin{macrocode} +\NewMirroredHookPairWithArguments{bibcite/before}{bibcite/after}{2} +\def\bibcite#1#2{% + \@newl@bel{b}{#1\@extra@binfo}{% + \UseHookWithArguments{bibcite/before}{2}{#1}{#2} + #2 + \UseHookWithArguments{bibcite/after}{2}{#1}{#2} + }% + }% +\let\@kernel@copy@bibcite\bibcite +% \end{macrocode} +% Now we add the tagging structure. +% TODO: the ref key should expand its argument directly! +% \begin{macrocode} +\AddToHookWithArguments{bibcite/before} + { + \tag_mc_end_push: + \exp_args:Nx\tagstructbegin{tag=Reference,ref=cite.#1\@extra@b@citeb} + \tagmcbegin{} + } +\AddToHookWithArguments{bibcite/after}[tag] + { + \tag_mc_end: + \tagstructend + \tag_mc_begin_pop:n{} + } +% \end{macrocode} +% At last the code for hyperref, the link will be inside the reference, but +% this can be changed with a rule. +% \begin{macrocode} +\AddToHook{package/hyperref/after} + { +% \end{macrocode} +% the next hyperref will allow to suppress the bib patches, but with older +% versions we muss reinstated them. +% \begin{macrocode} + \@ifpackagelater{hyperref}{2023-05-01}{} + { + \@ifpackageloaded{natbib}{} + {\let\@lbibitem\@kernel@copy@lbibitem + \let\@bibitem\@kernel@copy@bibitem + \let\bibcite\@kernel@copy@bibcite} + } + \AddToHookWithArguments{bibcite/before}{\hyper@linkstart{cite}{cite.#1\@extra@b@citeb}} + \AddToHookWithArguments{bibcite/after}{\hyper@linkend} + } +% \end{macrocode} +% +% \subsection{Natbib support} +% natbib offers various hooks that can be used. The main problem is +% to coordinate with the hyperref use of the same hooks. +% We also have to add something at the begin of \cs{@lbibitem}. +% As generic hooks with arguments aren't available yet, we have to copy the definition +% +% \begin{macrocode} +\AddToHook{package/natbib/after} + { + \def\hyper@natanchorstart#1{\MakeLinkTarget*{#1}} + \def\@lbibitem[#1]#2{% + \tl_set:Nx\l__tag_bib_target_tl{cite.#2\@extra@b@citeb} + \if\relax\@extra@b@citeb\relax\else + \@ifundefined{br@#2\@extra@b@citeb}{}{% + \@namedef{br@#2}{\@nameuse{br@#2\@extra@b@citeb}}% + }% + \fi + \@ifundefined{b@#2\@extra@b@citeb}{% + \def\NAT@num{}% + }{% + \NAT@parse{#2}% + }% + \def\NAT@tmp{#1}% + \expandafter\let\expandafter\bibitemOpen\csname NAT@b@open@#2\endcsname + \expandafter\let\expandafter\bibitemShut\csname NAT@b@shut@#2\endcsname + \@ifnum{\NAT@merge>\@ne}{% + \NAT@bibitem@first@sw{% + \@firstoftwo + }{% + \@ifundefined{NAT@b*@#2}{% + \@firstoftwo + }{% + \expandafter\def\expandafter\NAT@num\expandafter{\the\c@NAT@ctr}% + \@secondoftwo + }% + }% + }{% + \@firstoftwo + }% + {% + \global\advance\c@NAT@ctr\@ne + \@ifx{\NAT@tmp\@empty}{\@firstoftwo}{% + \@secondoftwo + }% + {% + \expandafter\def\expandafter\NAT@num\expandafter{\the\c@NAT@ctr}% + \global\NAT@stdbsttrue + }{}% + \bibitem@fin + \item[\hfil\NAT@anchor{#2}{\NAT@num}]% + \global\let\NAT@bibitem@first@sw\@secondoftwo + \NAT@bibitem@init + }% + {% + \NAT@anchor{#2}{}% + \NAT@bibitem@cont + \bibitem@fin + }% + \@ifx{\NAT@tmp\@empty}{% + \NAT@wrout{\the\c@NAT@ctr}{}{}{}{#2}% + }{% + \expandafter\NAT@ifcmd\NAT@tmp(@)(@)\@nil{#2}% + }% + }% +% \end{macrocode} +% we redefine the hook to use latex hooks. +% \begin{macrocode} + \NewMirroredHookPairWithArguments{natbib/linkstart}{natbib/linkend}{1} + \renewcommand\hyper@natlinkstart[1]{\UseHookWithArguments{natbib/linkstart}{1}{#1}} + \renewcommand\hyper@natlinkend{\UseHookWithArguments{natbib/linkend}{1}{}} + \AddToHookWithArguments{natbib/linkstart} + { + \leavevmode + \tag_mc_end_push: + \exp_args:Nx\tagstructbegin{tag=Reference,ref=cite.#1\@extra@b@citeb} + \tagmcbegin{} + } + \AddToHook{natbib/linkend} + { + \tag_mc_end: + \tagstructend + \tag_mc_begin_pop:n{} + } + } +% \end{macrocode} +% if hyperref is loaded we have to repeat the definition +% +% \begin{macrocode} +\AddToHook{package/hyperref/after} + { + \renewcommand\hyper@natlinkstart[1]{\UseHookWithArguments{natbib/linkstart}{1}{#1}} + \renewcommand\hyper@natlinkend{\UseHookWithArguments{natbib/linkend}{1}{}} + \AddToHookWithArguments{natbib/linkstart} + { + \Hy@backout{#1}% + \hyper@linkstart{cite}{cite.#1}% + \def\hyper@nat@current{#1} + } + \AddToHook{natbib/linkend} + { + \hyper@linkend + } + } +% \end{macrocode} +% \begin{macrocode} +%</package> +% \end{macrocode} +% \begin{macrocode} +%<*latex-lab> +\ProvidesFile{bib-latex-lab-testphase.ltx} + [2023-05-18 v0.8 code related to the tagging of bib and citations] + +\RequirePackage{latex-lab-testphase-bib} + +%</latex-lab> +% \end{macrocode} diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-block-tagging.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-block-tagging.dtx index 1a1dce3a648..124c51163cc 100644 --- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-block-tagging.dtx +++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-block-tagging.dtx @@ -26,8 +26,8 @@ % \fi % -\def\ltblocksversion{v0.8a} -\def\ltblocksdate{2023/03/08} +\def\ltblocksversion{v0.8c} +\def\ltblocksdate{2023/05/16} % % \title{Prototype reimplementation of \LaTeXe{}'s block environments using templates} @@ -1066,6 +1066,11 @@ \AddToHook{begindocument/before}{ \RenewDocumentEnvironment{verbatim}{ !O{} } { \UseInstance{blockenv}{verbatim} {#1} +% \end{macrocode} +% This is the part of the code where \env{verbatim} +% and\env{verbatim*} differ. +% \begin{macrocode} + \@setupverbinvisiblespace\frenchspacing\@vobeyspaces \@xverbatim } { \endblockenv } @@ -1088,7 +1093,15 @@ % % % \begin{macro}{\legacyverbatimsetup} -% +% +% This code resembles the \LaTeXe{} verbatim implementation with a +% slight twist: in \LaTeXe{} each code line was a paragraph using +% \cs{leftskip}=\cs{@totalleftmargin}. This was possible because +% the whole environment was implemented as a trivlist. As this is +% no longer the case setting \cs{leftskip} would alter the layout +% of a surrounding list. So instead we need to make sure that the +% paragraph end is executed in a group so that any parshape setup +% is preserved. % \begin{macrocode} %<@@=> \def\legacyverbatimsetup{% @@ -1096,10 +1109,10 @@ \@tempswafalse \def\par{% \if@tempswa - \leavevmode \null \@@par\penalty\interlinepenalty + \leavevmode \null {\@@par}\penalty\interlinepenalty \else \@tempswatrue - \ifhmode\@@par\penalty\interlinepenalty\fi + \ifhmode{\@@par}\penalty\interlinepenalty\fi \fi}% \let\do\@makeother \dospecials \obeylines \verbatim@font \@noligs @@ -1109,8 +1122,6 @@ % \begin{macrocode} \tl_set:Nn \l__tag_para_main_tag_tl {codeline} \tagtool{paratag=Code}% oder faster: \tl_set:Nn\l__tag_para_tag_tl{Code} - \@setupverbinvisiblespace - \frenchspacing \@vobeyspaces } %<@@=block> % \end{macrocode} @@ -1279,31 +1290,125 @@ % \subsubsection{Theorem-like environments} % % Theorem-like environments are defined in \LaTeX{} with the help of -% \cs{newtheorem} declarations. Internally they use a list with a -% single item. For now we keep this approach and only add appropriate -% tagging support wihtin the internal commands. -% +% \cs{newtheorem} declarations. Internally they used a list with a +% single item. Using lists was convenient back then, but in a tagged +% document you end up with a strange structure. We therefore alter the +% mechanism. % -% \begin{macro}{\@begintheorem,\@opargbegintheorem} % -% We use \struct{theorem-like} as the structure name and rollmap it -% to a list (\struct{L}). +% \begin{macro}{\newtheorem} +% This is a slightly streamlined version of \cs{newtheorem}, but it +% still uses a lot of the 2e code for now. Eventually this will change. % \begin{macrocode} -\tag_if_active:T { - \tagpdfsetup{add-new-tag={tag=theorem-like,role=L}} +\RenewDocumentCommand \newtheorem { m O{#1} m o } +{ + \expandafter\@ifdefinable\csname #1\endcsname + { + \str_if_eq:nnTF{#1}{#2} + { + \@definecounter {#2} + \IfNoValueTF {#4} + { % @ynthm + \tl_gset:cx { the #2 } + { + \@thmcounter{#2} + } + } + { % @xnthm + \@newctr{#1}[#4] + \tl_gset:cx { the #2 } + { + \expandafter\noexpand\csname the#4\endcsname + \@thmcountersep + \@thmcounter{#2} + } + } + } + { % @othm + \@ifundefined{c@#2} + { \@nocounterr{#2} } + { + \tl_gset:cn { the #1 } + { \UseName { the #2 } } + } + } + \global\@namedef{#1} { \@thm{#2}{#3} } + \global\@namedef{end#1}{ \@endtheorem } + } } % \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@begintheorem,\@opargbegintheorem} % -% With that done, we only have to tell the \env{trivlist} what -% \key{tag-name} it should use. +% The \cs{@thm} command expands to either \cs{@beginthorem} or +% \cs{@opargbegintheorem}. For the moment we stick with this as it +% will help with the transion. But instead of using a +% \env{trivlist} we use a blockenv and some tagging for the title +% (as a Caption). +% +% \begin{macrocode} +\def\@begintheorem#1#2{ + \UseInstance{blockenv}{theorem}{} + \tagpdfparaOff + \textbf{ + \tag_struct_begin:n{tag=Caption} + \tag_mc_begin:n {} + #1\ + \tag_mc_end: + \tag_struct_begin:n{tag=Lbl} + \tag_mc_begin:n {} + #2 + \tag_mc_end: + \tag_struct_end: + \tag_struct_end: + } + \tagpdfparaOn +% \end{macrocode} +% +% \begin{macrocode} + \@@_start_para_structure_unconditionally:n { \PARALABEL } +% \end{macrocode} +% +% \begin{macrocode} + \itshape + \hskip\labelsep + \ignorespaces +} +\def\@opargbegintheorem#1#2#3{ + \UseInstance{blockenv}{theorem}{} + \tagpdfparaOff + \textbf{ + \tag_struct_begin:n{tag=Caption} + \tag_mc_begin:n {} + #1\ + \tag_mc_end: + \tag_struct_begin:n{tag=Lbl} + \tag_mc_begin:n {} + #2 + \tag_mc_end: + \tag_struct_end: + \tag_mc_begin:n {} + \ (#3) + \tag_mc_end: + \tag_struct_end: + } + \tagpdfparaOn +% \end{macrocode} +% +% \begin{macrocode} + \@@_start_para_structure_unconditionally:n { \PARALABEL } +% \end{macrocode} +% % \begin{macrocode} -\def\@begintheorem#1#2{\trivlist[tag-name=theorem-like]% - \item[\hskip \labelsep{\bfseries #1\ #2}]\itshape} + \itshape + \hskip\labelsep + \ignorespaces +} % \end{macrocode} % % \begin{macrocode} -\def\@opargbegintheorem#1#2#3{\trivlist[tag-name=theorem-like] - \item[\hskip \labelsep{\bfseries #1\ #2\ (#3)}]\itshape} +\def\@endtheorem{\endblockenv} % \end{macrocode} % \end{macro} % @@ -1569,15 +1674,24 @@ % So this is for now always done. Probably \cs{l_@@_topsepadd_skip} above % should be added only if the paragraph ends here and not if it % continues, so this need some further cleanup.\fmi{decide} + % \begin{macrocode} + \bool_if:NTF \l_@@_standalone_bool +% \end{macrocode} +% It is possible that \texttt{@endpe} is true because a +% displayblock has just ended before we end the standalone +% displayblock and in that casevthere is no outer +% \struct{text-unit} so we have to explicitly set \texttt{@endpe} +% back to false to prevent it from closing a structure later that +% isn't there. % \begin{macrocode} - \legacy_if_gset_true:n { @endpe } + { \legacy_if_gset_false:n { @endpe } } + { \legacy_if_gset_true:n { @endpe } } } % \end{macrocode} % % \end{macro} % % -% % \begin{macro}{\__kernel_displayblock_end:} % The kernel hook for tagging at the end of the block. % \begin{macrocode} @@ -1589,6 +1703,14 @@ % % % +% \begin{macro}{\l_@@_standalone_bool} +% +% \begin{macrocode} +\bool_new:N \l_@@_standalone_bool +\bool_set_false:N \l_@@_standalone_bool +% \end{macrocode} +% \end{macro} +% % % % @@ -2393,6 +2515,32 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\@@_recipe_standalone:} +% +% The \texttt{standalone} recipe produces a block that ensures that +% a previous \texttt{text-unit} ends and that after the block a new +% \texttt{text-unit} starts. +% \begin{macrocode} +\cs_new:Npn \@@_recipe_standalone: { + \cs_set_eq:NN \__kernel_displayblock_beginpar_hmode:w + \prg_do_nothing: + \cs_set_eq:NN \__kernel_displayblock_beginpar_vmode: + \prg_do_nothing: + \cs_set_eq:NN \__kernel_displayblock_begin: \@@_inner_begin: + \cs_set_eq:NN \__kernel_displayblock_end: \@@_inner_end: +% \end{macrocode} +% +% \begin{macrocode} + \bool_set_true:N \l_@@_standalone_bool +% \end{macrocode} +% +% \begin{macrocode} + \tl_if_empty:NTF \l_@@_tag_name_tl + { \tl_set:Nn \l_@@_tag_inner_tag_tl {Sect} } + { \tl_set_eq:NN \l_@@_tag_inner_tag_tl \l_@@_tag_name_tl } +} +% \end{macrocode} +% \end{macro} % % \begin{macro}{\@@_recipe_standard:} % The \texttt{standard} recipe does the following: @@ -2680,6 +2828,34 @@ % } % \end{macrocode} % + +% +% \begin{macrocode} +\DeclareInstance{blockenv}{theorem}{display} +{ + env-name = theorem-like, + tag-name = theorem-like, + tag-class = , + tagging-recipe = standalone, + inner-level-counter = , + level-increase = false, + setup-code = , + block-instance = displayblock , +% inner-instance-type = innerblock , +% inner-instance = theorem, +} +% \end{macrocode} +% +% We use \struct{theorem-like} as the structure name and rollmap it +% to a \struct{Sect} because that can hold a \struct{Caption}. +% \begin{macrocode} +\tag_if_active:T { + \tagpdfsetup{add-new-tag={tag=theorem-like,role=Sect}} +} +% \end{macrocode} +% +% +% % % \subsubsection{Verbatim instances} % @@ -2707,7 +2883,7 @@ inner-level-counter = , level-increase = false, setup-code = , - block-instance = displayblock , + block-instance = verbatimblock , inner-instance = , final-code = \legacyverbatimsetup , } @@ -2840,8 +3016,44 @@ \DeclareInstanceCopy{block}{displayblock-6}{displayblock-0} % \end{macrocode} % \end{instance} +% +% +% +% \subsubsection{Verbatim instances} +% +% Verbatim instances have there own levels so that one can specify +% specific indentations or vertical separations between line. % -% +% \begin{instance}{block verbatimblock-0, +% block verbatimblock-1, +% block verbatimblock-2, +% block verbatimblock-3, +% block verbatimblock-4, +% block verbatimblock-5, +% block verbatimblock-6 } +% +% \begin{macrocode} +\DeclareInstance{block}{verbatimblock-0}{display} + { + leftmargin = 0pt , + parindent = 0pt , + par-skip = 0pt , + } +% \end{macrocode} +% +% \begin{macrocode} +\DeclareInstanceCopy{block}{verbatimblock-1}{verbatimblock-0} +\DeclareInstanceCopy{block}{verbatimblock-2}{verbatimblock-0} +\DeclareInstanceCopy{block}{verbatimblock-3}{verbatimblock-0} +\DeclareInstanceCopy{block}{verbatimblock-4}{verbatimblock-0} +\DeclareInstanceCopy{block}{verbatimblock-5}{verbatimblock-0} +\DeclareInstanceCopy{block}{verbatimblock-6}{verbatimblock-0} +% \end{macrocode} +% \end{instance} +% +% +% +% % \subsubsection{Quote/quotationblock instances} % % Quote and quotation are not flattened, i.e., they change levels, @@ -2868,6 +3080,8 @@ % \end{macrocode} % \end{instance} % +% +% % \begin{instance}{block quotationblock-1, % block quotationblock-2, % block quotationblock-3, @@ -3147,7 +3361,6 @@ % then have to avoid adding another \texttt{text-unit}. % \begin{macrocode} { -% \typeout{-->G1~ (\int_use:N \l_@@_flattened_level_int)} \int_compare:nNnT \l_@@_flattened_level_int < 2 { \int_gincr:N \g__tag_para_main_begin_int @@ -3217,7 +3430,7 @@ \bool_if:NF \l__tag_para_flattened_bool { \@@_debug_typeout:n{Structure-end~ - \l__tag_para_main_tag_tl\space after~ list \on@line } + \l__tag_para_main_tag_tl\space after~ displayblock \on@line } \int_gincr:N \g__tag_para_main_end_int \tag_struct_end: %text-unit } @@ -3256,32 +3469,66 @@ % case we only start a new MC (because the \struct{text} tag is still open from % before the list --- one of the reasons why lists are always put % \enquote{inside} paragraphs. +% +% We do this in a separate command, because it is needed elsewhere too. % \begin{macrocode} - \@@_debug_typeout:n - { @endpe = \legacy_if:nTF { @endpe }{true}{false} - \on@line } - \legacy_if:nF { @endpe } - { - \bool_if:NF \l__tag_para_flattened_bool - { - \int_gincr:N \g__tag_para_main_begin_int - \tag_struct_begin:n{tag=\l__tag_para_main_tag_tl} - } - } - \int_gincr:N \g__tag_para_begin_int - \@@_debug_typeout:n{increment~ P \on@line } - \tag_struct_begin:n - { - tag=\l__tag_para_tag_tl - ,attribute-class=\l_tag_para_attr_class_tl - } - \__tag_check_para_begin_show:nn {green}{\PARALABEL} - \tag_mc_begin:n {} + \@@_start_para_structure:n { \PARALABEL } } } } % \end{macrocode} % +% +% \begin{macro}{\@@_start_para_structure:n} +% +% \begin{macrocode} +\cs_new_protected:Npn \@@_start_para_structure:n #1 { + \@@_debug_typeout:n + { @endpe = \legacy_if:nTF { @endpe }{true}{false} + \on@line } + \legacy_if:nF { @endpe } + { + \bool_if:NF \l__tag_para_flattened_bool + { + \int_gincr:N \g__tag_para_main_begin_int + \tag_struct_begin:n{tag=\l__tag_para_main_tag_tl} + } + } + \int_gincr:N \g__tag_para_begin_int + \@@_debug_typeout:n{increment~ P \on@line } + \tag_struct_begin:n + { + tag=\l__tag_para_tag_tl + ,attribute-class=\l_tag_para_attr_class_tl + } + \__tag_check_para_begin_show:nn {green}{#1} + \tag_mc_begin:n {} +} +% \end{macrocode} +% The same code, but without testing \texttt{@endpe}. This is not +% needed in the standalong e case and wrong inside lists. +% \begin{macrocode} +\cs_new_protected:Npn \@@_start_para_structure_unconditionally:n #1 { + \bool_if:NF \l__tag_para_flattened_bool + { + \int_gincr:N \g__tag_para_main_begin_int + \tag_struct_begin:n{tag=\l__tag_para_main_tag_tl} + } + \int_gincr:N \g__tag_para_begin_int + \@@_debug_typeout:n{increment~ P \on@line } + \tag_struct_begin:n + { + tag=\l__tag_para_tag_tl + ,attribute-class=\l_tag_para_attr_class_tl + } + \__tag_check_para_begin_show:nn {green}{#1} + \tag_mc_begin:n {} +} +% \end{macrocode} +% \end{macro} +% +% +% % \begin{macrocode} \tag_if_active:T { % \tagpdfsetup{add-new-tag={tag=text-unit,role=Part}} @@ -3400,25 +3647,7 @@ \cs_set:Npn \__kernel_list_label_after: { \bool_if:NT \l__tag_para_bool { - \bool_if:NF \l__tag_para_flattened_bool - { -% \typeout{-->G3} - \int_gincr:N \g__tag_para_main_begin_int - \tag_struct_begin:n{tag=\l__tag_para_main_tag_tl} - } - \int_gincr:N \g__tag_para_begin_int - \@@_debug_typeout:n{increment~ P \on@line } - \tag_struct_begin:n { - tag=\l__tag_para_tag_tl - ,attribute-class=\l_tag_para_attr_class_tl - } - \bool_if:NT \l__tag_para_show_bool - { - \tag_mc_begin:n {artifact} - \llap {\color_select:n {blue}\tiny Li-\int_use:N \g__tag_para_begin_int \ } - \tag_mc_end: - } - \tag_mc_begin:n {tag=P} + \@@_start_para_structure_unconditionally:n { LI- } } } % \end{macrocode} diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-float.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-float.dtx new file mode 100644 index 00000000000..ed8b8390e26 --- /dev/null +++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-float.dtx @@ -0,0 +1,492 @@ +% \iffalse meta-comment +% +%% File: latex-lab-float.dtx (C) Copyright 2023 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-float.dtx} +\end{document} +%</driver> +% +% \fi +% +% +% \title{The \textsf{latex-lab-floats} package\\ +% Tagging of floats } +% \author{\LaTeX{} Project\thanks{Initial implementation done by Ulrike Fischer}} +% \date{v0.8 2023-05-17} +% +% \maketitle +% +% \newcommand{\xt}[1]{\textsl{\textsf{#1}}} +% \newcommand{\TODO}[1]{\textbf{[TODO:} #1\textbf{]}} +% \newcommand{\docclass}{document class \marginpar{\raggedright document class +% customizations}} +% +% \providecommand\hook[1]{\texttt{#1}} +% \begin{documentation} +% \begin{abstract} +% The following code implements a first draft for the tagging of float +% environments +% \end{abstract} +% +% +% \section{Introduction} +% +% The code here handle the tagging of float environments. +% +% Figures (and tables) are in \LaTeX{} typically typeset in float environments. +% These are boxes which can \emph{float} away to special float areas on the pages, +% e.g., to the top or the bottom of a page or to special float pages. +% If the rules allow it they can also be placed in the main text stream (\enquote{here}). +% Floats can also be collected at the end of the document. +% In either case the order within each type of floats +% (e.g., figures, tables, algorithms, etc.) is preserved. +% +% A special type, called a H-float, (provided by the float package) +% is always placed in the main text stream and does not +% necessarly preserve the order with normal floats of the same type: It is basically +% a minipage with a caption. +% +% Floats typically contain a figure (or a table, etc.) and a caption, +% but more complex constructions with subfigures, +% copyright statements, sources or additional description are possible too. +% +% In the \LaTeX{} source a float is normally more or less at the place of +% the first call-out, but when preparing a document for print the code +% is sometimes moved to place floats in a more visually pleasing way. +% +% \section{Tagging} +% +% Floats (with the exception of H-floats) do not belong into the text stream, they +% are \enquote{consultation objects}: Readers must be able to choose if and when they read the float. +% Floats have captions, the PDF rules require that a \texttt{Caption} is the first or last +% structure in its parent structure. +% This poses some challenges on a good tagging. +% +% In PDF~2.0 there is the suitable \texttt{Aside} tag which hopefully will +% be handled correctly regarding the reading order once processor actually support +% PDF~2.0. But in PDF~1.7 we rolemap it to \texttt{Note} and this doesn't lead to +% a good reading order. The code therefore collect the float structures and moves +% them to a \texttt{Sect} the end of the document or the chapter +% (H-floats once they are handled will not be moved). +% +% To fulfill the requirement that a \texttt{Caption} should be at the begin or end, we always +% move it to the begin of the structure. If a float has two captions the author +% has to insert a command which splits the float in two. +% +% Subfigures and subcaptions are currently not handled, but will be implemented +% as simple \texttt{Part} with their own \texttt{Caption}. +% +% \section{Links} +% The code disable the caption patches from hyperref. It will add an anchor at the +% begin of the float or a split. It changes caption so that a link to a caption label +% will go to the begin of the float. +% +% \section{Tools} +% +% The code add two keys for the \cs{tagtool} command +% +% \begin{description} +% \item[flush-floats] This will flush out the collected floats sofar (currently +% table and figure. The value is a sectioning level, e.g. \texttt{section} or \texttt{chapter}, +% the floats will then inserted as a \texttt{Sect} of this level (all \texttt{Sect} of smaller or equal +% level are closed). The key then starts a new container for following floats. +% If no value is given, the \texttt{Sect} is at the document level. The code automatically +% flush all open floats at the end of the document. +% +% \item[split-float] This can be used inside a float if there are two captions. +% It will only work reasonably well if the content of the float parts are in a sensible order +% and can be separated by this command. More complex setups with tabulars will need more +% thoughts +% +% \end{description} +% +% +% \begin{macrocode} +%<@@=tag> +%<*package> +% \end{macrocode} +% \end{documentation} +% \begin{implementation} +% \section{Implementation} +% \begin{macrocode} +\ProvidesExplPackage {latex-lab-testphase-float} {2023-04-28} {0.8} + {Code related to the tagging of floats} +% \end{macrocode} +% \subsection{Variables} +% We rolemap to Aside, and float sections to Sect +% +% \begin{macrocode} +\tagpdfsetup{add-new-tag=float/Aside} +\tagpdfsetup{add-new-tag=figures/Sect} +\tagpdfsetup{add-new-tag=tables/Sect} +% \end{macrocode} +% +% \begin{variable}{ +% \g_@@_float_sect_prop, +% \g_@@_float_types_seq +% } +% These variables will hold the structure number for the float container +% and the list of float types. Currently only figure and table are supported +% TODO: interface to declare new float types. +% \begin{macrocode} +\prop_new:N \g_@@_float_sect_prop +\seq_new:N \g_@@_float_types_seq +\seq_gput_right:Nn \g_@@_float_types_seq {figure} +\seq_gput_right:Nn \g_@@_float_types_seq {table} +% \end{macrocode} +% \end{variable} +% +% \begin{variable}{\g_@@_float_sect_bool} +% With this boolean float collection is switched on and off. +% Currently it is always on and set globally. +% TODO: think if an interface is needed. +% TODO: would a local variable make more sense? +% \begin{macrocode} +\bool_new:N \g_@@_float_sect_bool +\bool_gset_true:N \g_@@_float_sect_bool +% \end{macrocode} +% \end{variable} +% +% +%\subsection{Moving float structures} +% +% Currently it is for all float types or none. +% Probably we will need some more options here to select some float types. +% +% \begin{macro}{\@@_float_init_collect:} +% This initializes a container structure for every float type. +% It can be used more than once in a document, this allows to have e.g. +% chapter wise containers. +% \begin{macrocode} +\cs_new_protected:Npn\@@_float_init_collect: + { + \bool_if:NT\g_@@_float_sect_bool + { + \seq_map_inline:Nn\g_@@_float_types_seq + { + \tag_struct_begin:n{tag=##1s,stash} + \prop_gput:Nnx\g_@@_float_sect_prop {##1-struct}{\int_use:N\c@g__tag_struct_abs_int} + \tag_struct_end: + } + } + } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@@_float_stop_sect:} +% This pushes out the floats. For every type is checks if there is actually +% a float of this type and then writes out the container structure. +% \begin{macrocode} +\cs_new_protected:Npn \@@_float_stop_sect: + { + \bool_if:NT\g_@@_float_sect_bool + { + \seq_map_inline:Nn\g_@@_float_types_seq + { + \prop_get:NnNT\g_@@_float_sect_prop{##1-used}\l_@@_tmpa_tl + { + \exp_args:Ne + \tag_struct_use_num:n{\prop_item:Nn\g_@@_float_sect_prop{##1-struct}} + \prop_gremove:Nn \g_@@_float_sect_prop{##1-used} + } + } + } + } +% \end{macrocode} +% \end{macro} + +% \begin{macro}{flush-floats} +% This is a key for \cs{tagtool} to flush out the collected floats. +% The value allows to set to which level the create Sect contains. +% So \texttt{section} will close all previous Sect until the section level +% and create a new section. +% \begin{macrocode} +\keys_define:nn { tag / tool} + { + flush-floats .code:n = + { + \keys_set:nn {tag / tool} {sec-stop=#1} + \@@_float_stop_sect: + \@@_float_init_collect: + }, + flush-float .default:n = Document + } +% \end{macrocode} +% \end{macro} +% We need at least one pair +% \begin{macrocode} +\AddToHook{begindocument/end}[latex-lab/float] + {\@@_float_init_collect:} +\AddToHook{tagpdf/finish/before}[latex-lab/float] + {\par\__tag_sec_end:n{-10}\@@_float_stop_sect:} +\DeclareHookRule{tagpdf/finish/before}{latex-lab/float}{before}{tagpdf} +% \end{macrocode} +% \subsection{Splitting floats} +% \begin{macro}{split-float} +% TODO: check if the target affect spacing!! +% \begin{macrocode} +\keys_define:nn { tag / tool} + { + split-float .code:n = + { + \@@_float_end: + \@@_float_begin: + \MakeLinkTarget[tagstructure]{g__tag_struct_abs_int} + } + } +% \end{macrocode} +% \end{macro} + +% \subsection{Patching} +% \begin{macro}{\@@_float_stop_par:,\@@_float_start_par:} +% if a float is in a par, we need commands to stop and restart the P-mc +% \begin{macrocode} +\cs_new_protected:Npn \@@_float_stop_par: + { + \tag_mc_end: + \bool_if:NF \g_@@_float_sect_bool + { + \tag_struct_end: + } + } +\cs_new_protected:Npn \@@_float_start_par: + { + \bool_if:NF \g_@@_float_sect_bool + { + \tag_struct_begin:n{tag=text}% + } + \tag_mc_begin:n{tag=P} + } + +% \end{macrocode} +% \end{macro} +% These commands are the main commands to start and end the float tagging. +% +% \begin{macrocode} +\cs_new_protected:Npn \@@_float_begin: + {% +% \end{macrocode} +% We test if the float structure should be included directly or move to a dedicated section. +% \begin{macrocode} + \bool_if:NTF\g_@@_float_sect_bool + { + \exp_args:Ne + \tag_struct_begin:n{tag=float,parent=0\prop_item:No\g_@@_float_sect_prop{\@captype-struct}}% + \prop_gput:Nxx \g_@@_float_sect_prop {\@captype-used}{true} + } + { + \tag_struct_begin:n{tag=float} + } + \tl_set:Nx\@current@float@struct{\tag_get:n{struct_num}}% + \typeout{Float structure: \@current@float@struct} + } + +\cs_new_protected:Npn\@@_float_end:{\tag_struct_end:} %end Aside + +% \end{macrocode} +% This patches the main command \cs{@xfloat}. +% There is a : in the code, so we disable expl3 syntax +% \begin{macrocode} +\ExplSyntaxOff +\def\@xfloat #1[#2]{% + \@nodocument + \def \@captype {#1}% + \def \@fps {#2}% + \@onelevel@sanitize \@fps + \def \reserved@b {!}% + \ifx \reserved@b \@fps + \@fpsadddefault + \else + \ifx \@fps \@empty + \@fpsadddefault + \fi + \fi + \ifhmode + \@bsphack +% \end{macrocode} +% If the float is in hmode we have to interrupt the P +% \begin{macrocode} + \@nameuse{@@_float_stoppar:} %<---end P + \@floatpenalty -\@Mii + \else + \@floatpenalty-\@Miii + \fi + \ifinner + \@parmoderr\@floatpenalty\z@ + \else + \@next\@currbox\@freelist + {% + \@tempcnta \sixt@@@@n + \expandafter \@tfor \expandafter \reserved@a + \expandafter :\expandafter =\@fps + \do + {% + \if \reserved@a h% + \ifodd \@tempcnta + \else + \advance \@tempcnta \@ne + \fi + \else\if \reserved@a t% + \@setfpsbit \tw@ + \else\if \reserved@a b% + \@setfpsbit 4% + \else\if \reserved@a p% + \@setfpsbit 8% + \else\if \reserved@a !% + \ifnum \@tempcnta>15 + \advance\@tempcnta -\sixt@@@@n\relax + \fi + \else + \@latex@error{Unknown float option `\reserved@a'}% + {Option `\reserved@a' ignored and `p' used.}% + \@setfpsbit 8% + \fi\fi\fi\fi\fi + }% + \@tempcntb \csname ftype@\@captype \endcsname + \multiply \@tempcntb \@xxxii + \advance \@tempcnta \@tempcntb + \global \count\@currbox \@tempcnta + }% + \@fltovf + \fi +% \end{macrocode} +% This starts the structure for the float. +% \begin{macrocode} + \@nameuse{@@_float_begin:}% + \global \setbox\@currbox + \color@vbox + \normalcolor + \vbox \bgroup + \hsize\columnwidth + \@parboxrestore + \@floatboxreset +% \end{macrocode} +% We add a target for links. TODO: check that it doesn't affect spacing!! +% \begin{macrocode} + \MakeLinkTarget[tagstructure]{g__tag_struct_abs_int}% +}% +% \end{macrocode} +% The end code of the float ... +% \begin{macrocode} +\def\end@float{% + \@endfloatbox + \@nameuse{@@_float_end:}% + \ifnum\@floatpenalty <\z@ + \@largefloatcheck + \@cons\@currlist\@currbox + \ifnum\@floatpenalty <-\@Mii + \penalty -\@Miv + \@tempdima\prevdepth + \vbox{}% + \prevdepth\@tempdima + \penalty\@floatpenalty + \else + \vadjust{\penalty -\@Miv \vbox{}\penalty\@floatpenalty}\@Esphack + \@nameuse{@@_float_start_par:} %restart P safe here?? + \fi + \fi +} +\ExplSyntaxOn +% \end{macrocode} +% +% \subsection{Handling captions} +% +% To avoid that hyperref interferes we disable its patches: +% \begin{macrocode} +\def\hyper@nopatch@caption{} +% \end{macrocode} +% As we will use the structure number in the target, we need to provide a +% theH-representation. (Once the kernel will create +% theH-representation generally this will be provided automatically, as tagpdf uses +% \cs{newcounter}) +% \begin{macrocode} +\providecommand\theHg__tag_struct_abs_int{\int_use:N\c@g__tag_struct_abs_int} +% \end{macrocode} + +% \begin{macro}{\@makecaption} +% \cs{@makecaption} is defined by the classes so we overwrite it for now +% at begin document. +% \begin{macrocode} +\AddToHook{begindocument} + { + \long\def\@makecaption#1#2{% + \vskip\abovecaptionskip + \xdef\@currentHref{tagstructure.\@current@float@struct}% +% \end{macrocode} +% we don't want tagging when storing the caption for the singleline check +% \begin{macrocode} + \tag_stop:n{caption} + \sbox\@tempboxa{#1:~#2}% + \tag_start:n{caption} +% \end{macrocode} +% we stop paratagging. TODO: check +% \begin{macrocode} + \tagtool{para=false} + \tag_struct_begin:n{tag=Caption,parent=\@current@float@struct} +% \end{macrocode} +% move the caption to the begin of the float structure: +% \begin{macrocode} + \seq_gpop_right:cN {g__tag_struct_kids_\@current@float@struct _seq}\l_@@_tmpa_tl + \seq_gput_left:cV {g__tag_struct_kids_\@current@float@struct _seq}\l_@@_tmpa_tl + \ifdim \wd\@tempboxa >\hsize + \tag_struct_begin:n{tag=Lbl} + \tag_mc_begin:n{} + #1:~ + \tag_mc_end: + \tag_struct_end: + \tag_mc_begin:n{} + #2\par + \tag_mc_end: + \else +% \end{macrocode} +% we don't reuse the box as it doesn't contain tagging, but set the text explicitly. +% \begin{macrocode} + \global \@minipagefalse + \hb@xt@\hsize{\hfil + \tag_struct_begin:n{tag=Lbl} + \tag_mc_begin:n{} + #1:~ + \tag_mc_end: + \tag_struct_end: + \tag_mc_begin:n{} + #2\par + \tag_mc_end:\hfil}% + \fi + \tag_struct_end: %caption + \vskip\belowcaptionskip} + } +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +%</package> +% \end{macrocode} + +% \begin{macrocode} +%<*latex-lab> +\ProvidesFile{float-latex-lab-testphase.ltx} + [2023-04-30 v0.8 code related to the tagging of floats] +\RequirePackage{latex-lab-testphase-float} +%</latex-lab> +% \end{macrocode} +% \end{implementation} diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-footnotes.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-footnotes.dtx index 29261a594b6..4c8c9b73a61 100644 --- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-footnotes.dtx +++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-footnotes.dtx @@ -1324,7 +1324,7 @@ % % \begin{macro}{\footnotetext} % \begin{macrocode} -\DeclareDocumentCommand\footnotetext {om} +\DeclareDocumentCommand\footnotetext {o+m} { \fnote_set_fnmark:nn {#1} \@mpfn \@footnotetext {#2} @@ -1335,7 +1335,7 @@ % % \begin{macro}{\footnote} % \begin{macrocode} -\DeclareDocumentCommand\footnote {om} +\DeclareDocumentCommand\footnote {o+m} { \fnote_step_fnmark:nn {#1} \@mpfn \cs_set_eq:NN \@@_footnotemark_finish: \prg_do_nothing: diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-graphic.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-graphic.dtx new file mode 100644 index 00000000000..f9457e0524f --- /dev/null +++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-graphic.dtx @@ -0,0 +1,1073 @@ +% \iffalse meta-comment +% +%% File: latex-lab-graphic.dtx (C) Copyright 2022-2023 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-graphic.dtx} +\end{document} +%</driver> +% +% \fi +% +% +% \title{The \textsf{latex-lab-graphic} package\\ +% Tagging of included graphics } +% \author{\LaTeX{} Project\thanks{Initial implementation done by Ulrike Fischer}} +% \date{v0.8 2023-04-07} +% +% \maketitle +% +% \newcommand{\xt}[1]{\textsl{\textsf{#1}}} +% \newcommand{\TODO}[1]{\textbf{[TODO:} #1\textbf{]}} +% \newcommand{\docclass}{document class \marginpar{\raggedright document class +% customizations}} +% +% \providecommand\hook[1]{\texttt{#1}} +% \begin{documentation} +% \begin{abstract} +% The following code implements a first draft for the tagging of graphics +% included with \cs{includegraphics}. +% \end{abstract} +% +% +% \section{Introduction} +% +% The code here handle the tagging of pictures included with \cs{includegraphics} +% and the picture environment. Pictures drawn with \texttt{l3draw} or \texttt{tikz} +% or similar packages aren't handled yet. +% +% Tagging of graphics included with \cs{includegraphics} is at a first glance trivial: +% They are either only decorations, in which case they should be in a \texttt{artifact} +% MC-chunk or (in pdf 2.0) tagged as an \texttt{Artifact} structure, +% or they are meaningful and then they should be tagged as a \texttt{Figure}. +% Such a graphic is a simple box and no other content can interfere so adding the +% structure commands shouldn't pose much problems. +% +% But things are actually not so easy. +% +% At first there are two ways to add a graphic +% to a structure: similar to text as a marked content item (by surrounding +% it with \cs{tagmcbegin} and \cs{tagmcend}) or by referencing the XObject +% with an OBJR object (similar to a link annotation). Which method is more sensible +% (and if it actually matters) is unknown but should be tested. +% Currently the first method is used as the second require changes in the backend files. +% +% +% At second---and this is actually a \emph{much} larger problem---a +% \texttt{Figure} structure should have an attribute with an \texttt{BBox} entry. +% The value of a \texttt{BBox} is an array of four numbers that gives the +% coordinates of the left, bottom, right, and top edges +% of the structure element’s bounding box. That is the rectangle that completely encloses +% its \emph{visible} content so not necessarly the TeX bounding box: +% if \texttt{viewport} or \texttt{trim} is used and the +% graphic is not clipped, the visible content can be larger. +% +% Getting the \texttt{BBox} is quite straightforward for a graphic that is +% used once as is. But graphics can be trimmed, scaled, reflected, rotated and reused +% in various ways. This transformations typically involve a mix of \TeX{} commands +% like shifting a box or changing the bounding box and backend commands like +% inserting a pdfliteral with a transformation matrix and +% and not in all cases getting the \texttt{BBox} is possible +% without rewriting large parts of the graphics/x packages. Problematic are +% \begin{itemize} +% \item manipulations through external box commands +% (\cs{rotatebox}, \cs{reflectbox}, \cs{scalebox}). The current implementation +% in the graphics/x packages do not pass the transformation matrix in way +% that allows to track the changes for the \texttt{BBox} +% of an included graphic: sometimes +% the values are set to late (after the box is already stored), and often the +% values are not grouped and can leak out from earlier uses of the commands. +% +% \item some combination of keys in the optional argument of \cs{includegraphics}. +% Examples are \texttt{origin} and multiple calls to \texttt{scale} +% and \texttt{angle}) as they internally call the box commands. +% Examples of failing combinations can be found in the test file +% \texttt{graphic-faults}. +% +% \item graphics that are stored in a box and reused: to get the \texttt{BBox} +% one has to set a label that stores the position with \cs{pdfsavepos}, +% and if a box is reused one gets multiply defined labels. +% One possible solution here is to make +% use of the new delayed \cs{pdfliteral}. It allows to change the label names +% in the shipout, but this requires careful tracking the box usages +% and so various kernel changes. +% \end{itemize} +% +% +% +% \section{Restrictions and Todos} +% Correct tagging is currently +% implemented only for simple \cs{includegraphics} and the keys +% \texttt{viewport}, \texttt{trim}, +% \texttt{scale} and \texttt{angle} (used at most once). +% +% Not supported +% \begin{itemize} +% \item graphics inside \cs{rotatebox}, \cs{reflectbox}, \cs{scalebox}. +% +% TODO: A new implementation with \texttt{l3graphics} and \texttt{l3box} is +% probably needed here. +% +% \item multiple uses of the \texttt{scale} and \texttt{angle} keys +% +% \item multiple use of graphics stored in boxes. For such graphics automated tagging +% should be probably deactivated when storing the content +% and tagging should be added around the \cs{usebox}. (How to +% proceed when content is saved in boxes needs generally more testing). +% \end{itemize} +% +% +% \section{Additional keys} +% The code defines additional keys for \cs{includegraphics}: +% +% \begin{description} +% \item[\texttt{tag}] with the values +% \begin{description} +% \item[\texttt{artifact}] When used the graphic will be tagged as artifact. This doesn't +% require a \texttt{BBox} and so works also in some of the not yet supported cases described +% above. +% \item[\texttt{false}] When used tagging will be stopped completly. It is then the +% responsability of the surrounding code to add appropriate tagging commands. +% \item[\meta{name}] Other values will be used as tag names in the structure. If the tag is not +% known as a structure tag you will get an warning from tagpdf. The default name is currently +% \texttt{Figure} +% \end{description} +% \item[\texttt{actualtext}] This allows to add an /ActualText to the structure. +% This is useful for small graphics that represent single chars or a short word like a +% logo. If \texttt{actualtext} is used, the graphics is not enclosed in \texttt{Figure} +% structure but in a \texttt{Span} structure and no \texttt{/BBox} attribute is added. +% This in accordance with (the draft of) PDF/UA-2 but violates perhaps PDF/UA-1. +% \item[\texttt{correct-BBox}] If the calculated \texttt{/BBox} values are wrong +% they can be correct with this key. It expects four dimensions that are added to the +% \texttt{/BBox} values. +% \item[\texttt{debug}] The value \texttt{BBox} will show the calculated \texttt{/BBox} +% as a half transparent red rectangle. +% \end{description} +% +% The code also redefines the \texttt{alt} key to actually add its values +% as an alternative text. If no \texttt{alt} value is given, a warning is issued +% and the file name of the graphic is used. +% +% \begin{macrocode} +%<@@=tag> +%<*package> +% \end{macrocode} +% \end{documentation} +% \begin{implementation} +% \section{Implementation} +% \begin{macrocode} +\ProvidesExplPackage {latex-lab-testphase-graphic} {2023-04-07} {0.8} + {Code related to the tagging of graphics} +% \end{macrocode} +% We load l3opacity for the debug code +% \begin{macrocode} +\RequirePackage{l3opacity} +% \end{macrocode} +% +%\subsection{Saving the position} +% We need a replacement for zref-savepos. This uses l3ref which loaded +% by the pdfmanagement/tagpdf. +% +% TODO: this is perhaps needed in other places too and should be moved to +% l3ref!! +% \begin{macrocode} +\ref_attribute_gset:nnnn{xpos}{0}{shipout}{\int_use:N\tex_lastxpos:D} +\ref_attribute_gset:nnnn{ypos}{0}{shipout}{\int_use:N\tex_lastypos:D} +% \end{macrocode} + +% \begin{macro}{\@@_graphic_savepos:n} +% this is the command which stores the position. It uses +% two savepos in case bidi needs it (see zref-savepos). +% \begin{macrocode} +\cs_new_protected:Npn\@@_graphic_savepos:n #1 + { + \tex_savepos:D + \ref_label:nn{#1}{xpos,ypos,abspage} + \tex_savepos:D + } +\cs_generate_variant:Nn \@@_graphic_savepos:n {e} +% \end{macrocode} +% \end{macro} +% +% \subsection{Variables} +% \begin{variable}{\l_@@_graphic_debug_bool} +% A boolean for debug code +% \begin{macrocode} +\bool_new:N \l_@@_graphic_debug_bool +\keys_define:nn { document / metadata } + { + debug / BBox .code:n = { \bool_set_true:N \l_@@_graphic_debug_bool } + } +% \end{macrocode} +% \end{variable} +% \begin{variable}{\g_@@_graphic_int} +% This is used to get unique labels in the savepos code. +% \begin{macrocode} +\int_new:N\g_@@_graphic_int +% \end{macrocode} +% \end{variable} + +% \begin{variable} +% { +% \g_@@_graphic_lx_tl, +% \g_@@_graphic_ly_tl, +% \g_@@_graphic_ux_tl, +% \g_@@_graphic_uy_tl, +% \l_@@_graphic_bboxcorr_seq +% \l_@@_graphic_bboxcorr_bool +% } +% This commands will hold the calculated BBox values. Local variables +% would probably work too, but global variables can be easier retrieved +% in tests and debugging code ... +% \begin{macrocode} +\tl_new:N \g_@@_graphic_lx_tl +\tl_new:N \g_@@_graphic_ly_tl +\tl_new:N \g_@@_graphic_ux_tl +\tl_new:N \g_@@_graphic_uy_tl +\seq_new:N\l_@@_graphic_bboxcorr_seq +\bool_new:N\l_@@_graphic_bboxcorr_bool +% \end{macrocode} +% \end{variable} +% \begin{variable}{\l_@@_graphic_currentlabel_tl} +% This holds the label name of the savepos. +% \begin{macrocode} +\tl_new:N \l_@@_graphic_currentlabel_tl +% \end{macrocode} +% \end{variable} + +% \begin{variable} +% { +% \l_@@_graphic_alt_tl, +% \l_@@_graphic_alt_dft_tl, +% \l_@@_graphic_actual_tl, +% \l_@@_graphic_struct_tl, +% \l_@@_graphic_artifact_bool, +% \l_@@_graphic_BBox_bool +% } +% Variables for the alt text, the actualtext and the structure tag. +% \begin{macrocode} +\tl_new:N \l_@@_graphic_alt_tl +\tl_new:N \l_@@_graphic_alt_dflt_tl +\tl_set:Nn \l_@@_graphic_alt_dflt_tl {\Gin@base\Gin@ext} +\tl_new:N \l_@@_graphic_actual_tl +\tl_new:N \l_@@_graphic_struct_tl +\tl_set:Nn\l_@@_graphic_struct_tl {Figure} +\bool_new:N\l_@@_graphic_artifact_bool +\bool_new:N\l_@@_graphic_BBox_bool +\bool_set_true:N\l_@@_graphic_BBox_bool +% \end{macrocode} +% \end{variable} + +% \begin{variable} +% { +% \l_@@_graphic_sin_fp +% ,\l_@@_graphic_cos_fp +% ,\l_@@_graphic_scale_fp +% ,\l_@@_graphic_lxly_fp +% ,\l_@@_graphic_lxuy_fp +% ,\l_@@_graphic_uxly_fp +% ,\l_@@_graphic_uxuy_fp +% ,\l_@@_graphic_ux_fp +% ,\l_@@_graphic_ly_fp +% ,\l_@@_graphic_lx_fp +% ,\l_@@_graphic_uy_fp +% ,\l_@@_graphic_trim_ux_fp +% ,\l_@@_graphic_trim_ly_fp +% ,\l_@@_graphic_trim_lx_fp +% ,\l_@@_graphic_trim_uy_fp +% } +% A bunch of fp-variables (we don't use tl-vars, +% to avoid to have to take care about minus signs everwhere) +% \begin{macrocode} +\fp_new:N\l_@@_graphic_sin_fp +\fp_new:N\l_@@_graphic_cos_fp +\fp_new:N\l_@@_graphic_lxly_fp +\fp_new:N\l_@@_graphic_lxuy_fp +\fp_new:N\l_@@_graphic_uxly_fp +\fp_new:N\l_@@_graphic_uxuy_fp +\fp_new:N\l_@@_graphic_ux_fp +\fp_new:N\l_@@_graphic_ly_fp +\fp_new:N\l_@@_graphic_lx_fp +\fp_new:N\l_@@_graphic_uy_fp +% \end{macrocode} +% this holds the scale value. Currently this only the one from +% \cs{Gin@scalex} +% \begin{macrocode} +\fp_new:N\l_@@_graphic_scale_fp +% \end{macrocode} +% the follow variables hold the four trim values (or the equivalent calculated +% values if viewport is used. +% \begin{macrocode} +\fp_new:N\l_@@_graphic_trim_ux_fp +\fp_new:N\l_@@_graphic_trim_ly_fp +\fp_new:N\l_@@_graphic_trim_lx_fp +\fp_new:N\l_@@_graphic_trim_uy_fp +% \end{macrocode} +% \end{variable} +% +%\subsection{Tagging commands} +% +% \begin{macro}{\Gin@tag@struct@begin} +% The command to start the tagging. +% \begin{macrocode} +\msg_new:nnn {tag}{alt-text-missing} + { + Alternative~text~for~graphic~is~missing.\\ + Using~'#1'~instead + } +\cs_new_protected:Npn\Gin@tag@struct@begin + { + \tag_if_active:T + { + \tag_mc_end_push: +% \end{macrocode} +% we don't open a structure for artifacts to make it easier to use +% graphics in saveboxes. +% \begin{macrocode} + \bool_if:NTF\l_@@_graphic_artifact_bool + { + \tag_mc_begin:n{artifact} + } + { + \tl_if_empty:NTF\l_@@_graphic_actual_tl + { + \tl_if_empty:NT\l_@@_graphic_alt_tl + { + \msg_warning:nnx{tag}{alt-text-missing}{\l_@@_graphic_alt_dflt_tl} + \tl_set:Nx\l_@@_graphic_alt_tl {\l_@@_graphic_alt_dflt_tl} + } + \tag_struct_begin:n + { + tag=\l_@@_graphic_struct_tl, + alt=\l_@@_graphic_alt_tl, + } + } + { + \tag_struct_begin:n + { + tag=Span, + actualtext=\l_@@_graphic_actual_tl, + } + \bool_set_false:N\l_@@_graphic_BBox_bool + } + \tag_mc_begin:n{} + } + } + } +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\Gin@tag@struct@end} +% \begin{macrocode} +\cs_new_protected:Npn\Gin@tag@struct@end + { + \tag_if_active:T + { + \tag_mc_end: + \bool_if:NF\l_@@_graphic_artifact_bool + { + \tag_struct_end: + } + \tag_mc_begin_pop:n{} + } + } +% \end{macrocode} +% \end{macro} +% +% \subsection{Patching graphics commands} +% All changes are currently done in \cs{Gin@setfile}. +% \begin{macrocode} +\AddToHook{package/graphics/after} + { + \def\Gin@setfile#1#2#3{% + \ifx\\#2\\\Gread@false\fi + \ifGin@bbox\else + \ifGread@ + \csname Gread@% + \expandafter\ifx\csname Gread@#1\endcsname\relax + eps% + \else + #1% + \fi + \endcsname{\Gin@base#2}% + \else + \Gin@nosize{#3}% + \fi + \fi + \Gin@viewport@code + \Gin@nat@height\Gin@ury bp% + \advance\Gin@nat@height-\Gin@lly bp% + \Gin@nat@width\Gin@urx bp% + \advance\Gin@nat@width-\Gin@llx bp% + \Gin@req@sizes + \expandafter\ifx\csname Ginclude@#1\endcsname\relax + \Gin@drafttrue + \expandafter\ifx\csname Gread@#1\endcsname\relax + \@latex@error{Can not include graphics of type: #1}\@ehc + \global\expandafter\let\csname Gread@#1\endcsname\@empty + \fi + \fi + \leavevmode +% \end{macrocode} +% Here the tagging begins. We want to catch also the draft box, +% and for luatex tagging must be started before the \cs{setbox}. +% \begin{macrocode} + \Gin@tag@struct@begin %NEW + \ifGin@draft + \hb@xt@\Gin@req@width{% + \vrule\hss + \vbox to \Gin@req@height{% + \hrule \@width \Gin@req@width + \vss + \edef\@tempa{#3}% + \rlap{ \ttfamily\expandafter\strip@prefix\meaning\@tempa}% + \vss + \hrule}% + \hss\vrule}% + \else + \@addtofilelist{#3}% + \ProvidesFile{#3}[Graphic file (type #1)]% + \setbox\z@\hbox{\csname Ginclude@#1\endcsname{#3}}% + \dp\z@\z@ + \ht\z@\Gin@req@height + \wd\z@\Gin@req@width +% \end{macrocode} +% This the main command to calculate the BBox values. +% \begin{macrocode} + \Gin@tag@bbox@attribute %new + \box\z@ +% \end{macrocode} +% and here the tagging stops. +% \begin{macrocode} + \Gin@tag@struct@end %new + \fi} + } +% \end{macrocode} +% +% \subsection{Additional keys for the graphics command} +% TODO: this is a bit temporary and will perhaps need more refinement. +% we also ensure that graphicx is loaded for the keyval support. +% \begin{macrocode} +\AddToHook{package/graphicx/after}[latex-lab] + { + \define@key{Gin}{alt} {\tl_set:Nx\l_@@_graphic_alt_tl{\text_purify:n{#1}}} + \define@key{Gin}{artifact}[] + { + \bool_set_true:N \l_@@_graphic_artifact_bool + \bool_set_false:N \l_@@_graphic_BBox_bool + } + \define@key{Gin}{actualtext} + { + \tl_set:Nx\l_@@_graphic_actual_tl{\text_purify:n{#1}} + \bool_set_false:N \l_@@_graphic_BBox_bool + } + \define@key{Gin}{correct-BBox} + { + \bool_set_true:N \l_@@_graphic_bboxcorr_bool + \seq_set_split:Nnn\l_@@_graphic_bboxcorr_seq{~}{#1~0pt~0pt~0pt~0pt} + } + \define@key{Gin}{tag} + { + \str_case:nnF {#1} + { + {artifact} + { + \bool_set_true:N \l_@@_graphic_artifact_bool + \bool_set_false:N \l_@@_graphic_BBox_bool + } + {false}{\tag_stop:} + } + {\tl_set:Nn\l_@@_graphic_struct_tl{#1}} + } + } +\AddToHook{package/graphics/after}[latex-lab] + {\RequirePackage{graphicx}} +% \end{macrocode} +% For picture and other environments we need a similar set of keys. +% TODO: redefine \cs{includegraphics} to make use of these here?? +% \begin{macrocode} +\keys_define:nn{tag/picture} + { + ,alt .code:n = + {\tl_set:Nx\l_@@_graphic_alt_tl{\text_purify:n{#1}}} + ,artifact .code:n = + { + \bool_set_true:N \l_@@_graphic_artifact_bool + \bool_set_false:N \l_@@_graphic_BBox_bool + } + ,actualtext .code:n = + { + \tl_set:Nx\l_@@_graphic_actual_tl{\text_purify:n{#1}} + \bool_set_false:N \l_@@_graphic_BBox_bool + } + ,correct-BBox .code:n = + { + \bool_set_true:N \l_@@_graphic_bboxcorr_bool + \seq_set_split:Nnn\l_@@_graphic_bboxcorr_seq{~}{#1~0pt~0pt~0pt~0pt} + } + ,tag .code:n = + { + \str_case:nnF {#1} + { + {artifact} + { + \bool_set_true:N \l_@@_graphic_artifact_bool + \bool_set_false:N \l_@@_graphic_BBox_bool + } + {false}{\tag_stop:} + } + {\tl_set:Nn\l_@@_graphic_struct_tl{#1}} + } + } +% \end{macrocode} +% +% \subsection{Calculating the BBox} +% +% \begin{macro}{\@@_graphic_get_trim:} +% Graphics can be trimmed with the trim and the viewport key. +% If the graphic is not clipped the values must be taken into +% account when rotating. +% If viewport is used we have to calculate the trim. +% +% \begin{macrocode} +\cs_new_protected:Npn \@@_graphic_get_trim: + { + \legacy_if:nTF {Gin@clip} +% \end{macrocode} +% Setting to 0 is not strictly needed but looks cleaner. +% \begin{macrocode} + { + \fp_zero:N\l_@@_graphic_trim_lx_fp + \fp_zero:N\l_@@_graphic_trim_ly_fp + \fp_zero:N\l_@@_graphic_trim_ux_fp + \fp_zero:N\l_@@_graphic_trim_uy_fp + } + { + \fp_set:Nn \l_@@_graphic_trim_lx_fp {\l_@@_graphic_scale_fp*\Gin@vllx} + \fp_set:Nn \l_@@_graphic_trim_ly_fp {\l_@@_graphic_scale_fp*\Gin@vlly} + \fp_set:Nn \l_@@_graphic_trim_ux_fp {\l_@@_graphic_scale_fp*\Gin@vurx} + \fp_set:Nn \l_@@_graphic_trim_uy_fp {\l_@@_graphic_scale_fp*\Gin@vury} + \cs_if_exist:NT \Gin@ollx + { + \fp_set:Nn \l_@@_graphic_trim_ux_fp {\l_@@_graphic_scale_fp* (\Gin@ourx-(\Gin@urx)) } + \fp_set:Nn \l_@@_graphic_trim_uy_fp {\l_@@_graphic_scale_fp* (\Gin@oury-(\Gin@ury)) } + } + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_graphic_get_scale:} +% \begin{macrocode} +\cs_new_protected:Npn \@@_graphic_get_scale: + { + \fp_set:Nn \l_@@_graphic_scale_fp { \Gin@scalex } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_graphic_applyangle:nnnn} +% This takes the current BBox and rotates it according to the use angle. +% This is the most laborious code, as we have to take also the trim values into +% account. We have to compare the values after the rotation to find the right corners +% for the BBox. Not sure, if this is the most effective code, +% the l3draw package has similar code to calculate a rotation, +% this can perhaps be reused ... +% \begin{macrocode} +\cs_new_protected:Npn \@@_graphic_applyangle:nnnn #1#2#3#4 %lx,ly,ux,uy + { + \bool_lazy_and:nnT + {\cs_if_exist_p:N \Grot@angle } + {! \int_compare_p:nNn { \Grot@angle }={0}} + { + \fp_set:Nn \l_@@_graphic_sin_fp { sind(\Grot@angle) } + \fp_set:Nn \l_@@_graphic_cos_fp { cosd(\Grot@angle) } + \fp_set:Nn \l_@@_graphic_lx_fp {#1} + \fp_set:Nn \l_@@_graphic_ly_fp {#2} + \fp_set:Nn \l_@@_graphic_ux_fp {#3} + \fp_set:Nn \l_@@_graphic_uy_fp {#4} +% \end{macrocode} +% get the x coordinates (cos,-sin) +% \begin{macrocode} + \fp_set:Nn\l_@@_graphic_lxly_fp + { + -\l_@@_graphic_trim_lx_fp * \l_@@_graphic_cos_fp + +\l_@@_graphic_trim_ly_fp * \l_@@_graphic_sin_fp + } + \fp_set:Nn\l_@@_graphic_lxuy_fp + { + (-\l_@@_graphic_trim_lx_fp) * \l_@@_graphic_cos_fp + + + (\l_@@_graphic_uy_fp-\l_@@_graphic_ly_fp-\l_@@_graphic_trim_ly_fp) + * (-\l_@@_graphic_sin_fp) + } + \fp_set:Nn\l_@@_graphic_uxly_fp + { + (\l_@@_graphic_ux_fp-\l_@@_graphic_lx_fp-\l_@@_graphic_trim_lx_fp) + * \l_@@_graphic_cos_fp + + + (\l_@@_graphic_trim_ly_fp) * (\l_@@_graphic_sin_fp) + } + \fp_set:Nn\l_@@_graphic_uxuy_fp + { + (\l_@@_graphic_ux_fp-\l_@@_graphic_lx_fp-\l_@@_graphic_trim_lx_fp) + * \l_@@_graphic_cos_fp + + + (\l_@@_graphic_uy_fp-\l_@@_graphic_ly_fp-\l_@@_graphic_trim_ly_fp) + * (-\l_@@_graphic_sin_fp) + } + \tl_gset:Nx\g_@@_graphic_lx_tl + { + \fp_eval:n + { + min + ( + \l_@@_graphic_lxly_fp, + \l_@@_graphic_lxuy_fp, + \l_@@_graphic_uxly_fp, + \l_@@_graphic_uxuy_fp, + ) + +\l_@@_graphic_lx_fp + +\l_@@_graphic_trim_lx_fp + } + } + \tl_gset:Nx\g_@@_graphic_ux_tl + { + \fp_eval:n + { + max + ( + \l_@@_graphic_lxly_fp, + \l_@@_graphic_lxuy_fp, + \l_@@_graphic_uxly_fp, + \l_@@_graphic_uxuy_fp + ) + +\l_@@_graphic_lx_fp + +\l_@@_graphic_trim_lx_fp + } + } +% \end{macrocode} +% get the y coordinates (sin,cos) +% \begin{macrocode} + \fp_set:Nn\l_@@_graphic_lxly_fp + { + -\l_@@_graphic_trim_lx_fp * \l_@@_graphic_sin_fp + -\l_@@_graphic_trim_ly_fp * \l_@@_graphic_cos_fp + } + \fp_set:Nn\l_@@_graphic_lxuy_fp + { + - \l_@@_graphic_trim_lx_fp * \l_@@_graphic_sin_fp + + + (\l_@@_graphic_uy_fp-\l_@@_graphic_ly_fp-\l_@@_graphic_trim_ly_fp) + * \l_@@_graphic_cos_fp + } + \fp_set:Nn\l_@@_graphic_uxly_fp + { + (\l_@@_graphic_ux_fp-\l_@@_graphic_lx_fp-\l_@@_graphic_trim_lx_fp) + * \l_@@_graphic_sin_fp + - \l_@@_graphic_trim_ly_fp * \l_@@_graphic_cos_fp + } + \fp_set:Nn\l_@@_graphic_uxuy_fp + { + (\l_@@_graphic_ux_fp-\l_@@_graphic_lx_fp-\l_@@_graphic_trim_lx_fp) + * \l_@@_graphic_sin_fp + + + (\l_@@_graphic_uy_fp-\l_@@_graphic_ly_fp-\l_@@_graphic_trim_ly_fp) + * \l_@@_graphic_cos_fp + } + \tl_gset:Nx\g_@@_graphic_ly_tl + { + \fp_eval:n + { + min + ( + \l_@@_graphic_lxly_fp, + \l_@@_graphic_lxuy_fp, + \l_@@_graphic_uxly_fp, + \l_@@_graphic_uxuy_fp + ) + + \l_@@_graphic_ly_fp + \l_@@_graphic_trim_ly_fp + } + } + \tl_gset:Nx\g_@@_graphic_uy_tl + { + \fp_eval:n + { + max + ( + \l_@@_graphic_lxly_fp, + \l_@@_graphic_lxuy_fp, + \l_@@_graphic_uxly_fp, + \l_@@_graphic_uxuy_fp, + ) + + \l_@@_graphic_ly_fp + \l_@@_graphic_trim_ly_fp + } + } + } + } +\cs_generate_variant:Nn\@@_graphic_applyangle:nnnn {VVVV} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\@@_graphic_applycorr:NNNN} +% This command is used to add at the end the correction values. Quite dump ... +% \begin{macrocode} +\cs_new_protected:Npn \@@_graphic_applycorr:NNNN #1 #2 #3 #4 + { + \bool_if:NT\l_@@_graphic_bboxcorr_bool + { + \tl_set:Nx #1 + { + \fp_eval:n + { + #1 + + + \dim_to_decimal_in_bp:n {\seq_item:Nn \l_@@_graphic_bboxcorr_seq {1} } + } + } + \tl_set:Nx #2 + { + \fp_eval:n + { + #2 + + + \dim_to_decimal_in_bp:n {\seq_item:Nn \l_@@_graphic_bboxcorr_seq {2} } + } + } + \tl_set:Nx #3 + { + \fp_eval:n + { + #3 + + + \dim_to_decimal_in_bp:n {\seq_item:Nn \l_@@_graphic_bboxcorr_seq {3} } + } + } + \tl_set:Nx #4 + { + \fp_eval:n + { + #4 + + + \dim_to_decimal_in_bp:n {\seq_item:Nn \l_@@_graphic_bboxcorr_seq {4} } + } + } + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Gin@tag@bbox@attribute} +% This is the main command to calculate and set the Bbox attribute +% \begin{macrocode} +\cs_new_protected:Npn \Gin@tag@bbox@attribute + { +% \end{macrocode} +% the attribute is only needed if tagging is active and there is not artifact. +% \begin{macrocode} + \bool_lazy_all:nT + { + {\tag_if_active_p:} + {!\l_@@_graphic_artifact_bool} + {\l_@@_graphic_BBox_bool} + } + { + \fp_set:Nn \l_@@_graphic_scale_fp { \Gin@scalex } + \@@_graphic_get_trim: + \int_gincr:N\g_@@_graphic_int + \tl_set:Nx\l_@@_graphic_currentlabel_tl {_@@_graphic_\int_use:N \g_@@_graphic_int} + \@@_graphic_savepos:e { \l_@@_graphic_currentlabel_tl } + \tl_gset:Nx\g_@@_graphic_lx_tl + { + \dim_to_decimal_in_bp:n + { \@@_ref_value:enn {\l_@@_graphic_currentlabel_tl}{xpos}{0}sp } + } + \tl_gset:Nx\g_@@_graphic_ly_tl + { + \dim_to_decimal_in_bp:n + { \@@_ref_value:enn {\l_@@_graphic_currentlabel_tl}{ypos}{0}sp } + } + \tl_gset:Nx\g_@@_graphic_ux_tl + { + \fp_eval:n + { + \g_@@_graphic_lx_tl + + + \dim_to_decimal_in_bp:n { \Gin@req@width } + } + } + \tl_gset:Nx\g_@@_graphic_uy_tl + { + \fp_eval:n + { + \g_@@_graphic_ly_tl + + + \dim_to_decimal_in_bp:n { \Gin@req@height } + } + } +% \end{macrocode} +% If the graphics is not clipped we must add the trim values. +% \begin{macrocode} + \legacy_if:nF {Gin@clip} + { + \tl_gset:Nx\g_@@_graphic_ux_tl + { + \fp_eval:n + { + \g_@@_graphic_ux_tl + + + \l_@@_graphic_trim_ux_fp + } + } + \tl_gset:Nx\g_@@_graphic_lx_tl + { + \fp_eval:n + { + \g_@@_graphic_lx_tl + - + \l_@@_graphic_trim_lx_fp + } + } + \tl_gset:Nx\g_@@_graphic_uy_tl + { + \fp_eval:n + { + \g_@@_graphic_uy_tl + + + \l_@@_graphic_trim_uy_fp + } + } + \tl_gset:Nx\g_@@_graphic_ly_tl + { + \fp_eval:n + { + \g_@@_graphic_ly_tl + - + \l_@@_graphic_trim_ly_fp + } + } + } +% \end{macrocode} +% If there is an angle we now rotate the values. +% \begin{macrocode} + \@@_graphic_applyangle:VVVV + \g_@@_graphic_lx_tl + \g_@@_graphic_ly_tl + \g_@@_graphic_ux_tl + \g_@@_graphic_uy_tl +% \end{macrocode} +% At last we have to add the correction values +% \begin{macrocode} + \@@_graphic_applycorr:NNNN + \g_@@_graphic_lx_tl + \g_@@_graphic_ly_tl + \g_@@_graphic_ux_tl + \g_@@_graphic_uy_tl +% \end{macrocode} +% \begin{macrocode} + \bool_if:NT\l_@@_graphic_debug_bool + { + \@@_graphic_show_bbox:VVVVne + \g_@@_graphic_lx_tl + \g_@@_graphic_ly_tl + \g_@@_graphic_ux_tl + \g_@@_graphic_uy_tl + {red} + {\int_use:N\g_@@_graphic_int} + } +% \end{macrocode} +% Now we add the attribute. We do it manually as it had to be delayed until now. +% The structure and the mc must be open earlier, before the \cs{setbox} (at least +% for luatex it has to). TODO: think about interface if more attributes are needed. +% \begin{macrocode} + \@@_prop_gput:cnx + { g_@@_struct_\int_eval:n {\c@g_@@_struct_abs_int}_prop } + { A } + { + << + /O /Layout /BBox~ + [ + \g_@@_graphic_lx_tl\c_space_tl + \g_@@_graphic_ly_tl\c_space_tl + \g_@@_graphic_ux_tl\c_space_tl + \g_@@_graphic_uy_tl + ] + >> + } + } + } +% \end{macrocode} +% \end{macro} +% \subsection{Support for the picture environment} +% +% \begin{macro}{\picture@tag@bbox@attribute} +% Picture needs a similar command to calculate the bbox. But here we stay simple +% and use simply the size of the picbox. +% +% \begin{macrocode} +\newcommand\picture@tag@bbox@attribute + { + \bool_lazy_all:nT + { + {\tag_if_active_p:} + {!\l_@@_graphic_artifact_bool} + {\l_@@_graphic_BBox_bool} + } + { + \int_gincr:N\g_@@_graphic_int + \tl_set:Nx\l_@@_graphic_currentlabel_tl {_@@_graphic_\int_use:N \g_@@_graphic_int} + \@@_graphic_savepos:e { \l_@@_graphic_currentlabel_tl } + \tl_gset:Nx \g_@@_graphic_lx_tl + { + \dim_to_decimal_in_bp:n + { \@@_ref_value:enn {\l_@@_graphic_currentlabel_tl}{xpos}{0}sp } + } + \tl_gset:Nx \g_@@_graphic_ly_tl + { + \dim_to_decimal_in_bp:n + { \@@_ref_value:enn {\l_@@_graphic_currentlabel_tl}{ypos}{0}sp - \dp\@picbox } + } + \tl_gset:Nx \g_@@_graphic_ux_tl + { + \dim_to_decimal_in_bp:n + { + \g_@@_graphic_lx_tl bp + \wd\@picbox + } + } + \tl_gset:Nx \g_@@_graphic_uy_tl + { + \dim_to_decimal_in_bp:n + { + \g_@@_graphic_ly_tl bp + \ht\@picbox + \dp\@picbox + } + } + \@@_graphic_applycorr:NNNN + \g_@@_graphic_lx_tl + \g_@@_graphic_ly_tl + \g_@@_graphic_ux_tl + \g_@@_graphic_uy_tl + \bool_if:NT\l_@@_graphic_debug_bool + { + \@@_graphic_show_bbox:VVVVne + \g_@@_graphic_lx_tl + \g_@@_graphic_ly_tl + \g_@@_graphic_ux_tl + \g_@@_graphic_uy_tl + {red} + {\int_use:N\g_@@_graphic_int} + } + \@@_prop_gput:cnx + { g_@@_struct_\int_eval:n {\c@g_@@_struct_abs_int}_prop } + { A } + { + << + /O /Layout /BBox~ + [ + \g_@@_graphic_lx_tl\c_space_tl + \g_@@_graphic_ly_tl\c_space_tl + \g_@@_graphic_ux_tl\c_space_tl + \g_@@_graphic_uy_tl + ] + >> + } + } + } + +% \end{macrocode} +% \end{macro} +% We redefine \cs{picture} to accept an optional argument and +% change the default alt text. We also ensure that we are in +% hmode, so that stopping tagging doesn't confuse the paratags. +% \begin{macrocode} +\RenewDocumentCommand\picture{O{}m} + { + \leavevmode + \keys_set:nn{tag/picture}{#1} % + \tl_set:Nn\l_@@_graphic_alt_dflt_tl {picture~environment} + \pictur@#2 + } +% \end{macrocode} +% inside the picture box we stop tagging. +% \begin{macrocode} +\def\@picture(#1,#2)(#3,#4){% + \@defaultunitsset\@picht{#2}\unitlength + \@defaultunitsset\@tempdimc{#1}\unitlength + \Gin@tag@struct@begin + \setbox\@picbox\hb@xt@\@tempdimc\bgroup + \tag_stop: %do not tag inside the picture box + \@defaultunitsset\@tempdimc{#3}\unitlength + \hskip -\@tempdimc + \@defaultunitsset\@tempdimc{#4}\unitlength + \lower\@tempdimc\hbox\bgroup + \ignorespaces} +% \end{macrocode} +% +% \begin{macrocode} +\def\endpicture{% + \egroup\hss\egroup + \ht\@picbox\@picht\dp\@picbox\z@ + \picture@tag@bbox@attribute + \mbox{\box\@picbox} + \Gin@tag@struct@end} +% \end{macrocode} +% +% \subsection{Debugging code} +% +% \begin{macro}{\@@_graphic_show_bbox:nnnnnn} +% \begin{macrocode} +\cs_new_protected:Npn \@@_graphic_show_bbox:nnnnnn #1#2#3#4#5#6%#5 color, #6 graphic + { + \iow_log:n {tag/graphic~debug:~BBox~of~graphics~#6~is~#1~#2~#3~#4} + \hook_gput_code:nnn + {shipout/foreground} + {tag/graphic} + { + \int_compare:nNnT + {\g_shipout_readonly_int} + = + {\@@_ref_value:enn{_@@_graphic_#6}{abspage}{0}} + { + \put + (#1 bp,\dim_eval:n{-\paperheight + \dim_eval:n{#2 bp}}) + { + \opacity_select:n{0.5}\color_select:n{#5} + \rule + {\dim_eval:n {#3 bp-\dim_eval:n{#1 bp}}} + {\dim_eval:n {#4 bp-\dim_eval:n{#2 bp}}} + } + } + } + } + \cs_generate_variant:Nn \@@_graphic_show_bbox:nnnnnn {VVVVne} +% \end{macrocode} +% \end{macro} + +% \begin{macrocode} +%</package> +% \end{macrocode} + +% \begin{macrocode} +%<*latex-lab> +\ProvidesFile{graphic-latex-lab-testphase.ltx} + [2023-04-07 v0.8 code related to the tagging included graphics] +\RequirePackage{latex-lab-testphase-graphic} +%</latex-lab> +% \end{macrocode} +% \end{implementation} diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-mathtagging.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-mathtagging.dtx index 61818bde15e..923001f5596 100644 --- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-mathtagging.dtx +++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-mathtagging.dtx @@ -770,11 +770,14 @@ % \typeout{==>~math~begin} % needs different handling if we support nesting \tl_gset:Nx\tmpmathcontent - {\exp_not:N\begin{\g__math_grabbed_env_tl} + { + LaTeX~ formula~ starts~ + \exp_not:N\begin{\g__math_grabbed_env_tl} \space \exp_not:V\g__math_grabbed_math_tl \space \exp_not:N\end{\g__math_grabbed_env_tl} + \space LaTeX~ formula~ ends~ } \tagstructbegin{tag=Formula, AFinline-o=\tmpmathcontent, diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-minipage.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-minipage.dtx new file mode 100644 index 00000000000..00b1d649a14 --- /dev/null +++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-minipage.dtx @@ -0,0 +1,202 @@ +% \iffalse meta-comment +% +%% File: latex-lab-minipage.dtx (C) Copyright 2023 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-minipage.dtx} +\end{document} +%</driver> +% +% \fi +% + +\def\ltlistsversion{v0.81} +\def\ltlistsdate{2023/05/10} + +% +% \title{The \textsf{latex-lab-minipage} package\\ +% Changes related to the tagging of minipage and parbox} +% \author{\LaTeX{} Project\thanks{Initial implementation done by Ulrike Fischer}} +% \date{\ltlistsversion\ \ltlistsdate} +% +% \maketitle +% +% \newcommand{\xt}[1]{\textsl{\textsf{#1}}} +% \newcommand{\TODO}[1]{\textbf{[TODO:} #1\textbf{]}} +% \newcommand{\docclass}{document class \marginpar{\raggedright document class +% customizations}} +% +% \providecommand\hook[1]{\texttt{#1}} +% +% \begin{abstract} +% \end{abstract} +% +% \section{Introduction} +% +% How to tag minipages and parboxes is still under discussion. +% But as they start and contain paragraphs it is clear that +% hooks are needed to interrupt and restart the tagging. +% +% The tagging added is currently quite simple minded. See the todo-testfiles and the +% code comments for some open points. +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% \section{Implementation} +% \begin{macrocode} +\ProvidesExplPackage {latex-lab-testphase-minipage} {2023-05-10} {0.81} + {Code related to the tagging of minipages and parboxes} +% \end{macrocode} +% + +% \subsection{Provide the kernel hooks} +% [kernel?] +% We need to check/set the status before the +% initial \cs{leavevmode} to decide how to handle the structure. +% Perhaps the same command will work for both? +% \begin{macrocode} +\def\@kernel@init@minipage{} +\def\@kernel@init@parbox{} +% \end{macrocode} +% We need a few hooks. +% \begin{macrocode} +\def\@kernel@before@minipage{} +\def\@kernel@after@minipage{} +\def\@kernel@before@parbox{} +\def\@kernel@after@parbox{} +% \end{macrocode} +% +% \subsection{Patch minipage} +% [kernel?] +% The begin hook is inserted in \cs{@iiiminipage} +% \begin{macrocode} +\def\@iiiminipage#1#2[#3]#4{% +% \end{macrocode} +% Before switching to hmode we insert a hook. It is currently unused +% but could for example check if we are in vmode and change the following +% paragraph tag. +% \begin{macrocode} + \@kernel@init@minipage + \leavevmode + \@pboxswfalse + \setlength\@tempdima{#4}% + \def\@mpargs{{#1}{#2}[#3]{#4}}% +% \end{macrocode} +% insert the hook +% \begin{macrocode} + \@kernel@before@minipage% new + \setbox\@tempboxa\vbox\bgroup + \color@begingroup + \hsize\@tempdima + \textwidth\hsize \columnwidth\hsize + \@parboxrestore + \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@ + \let\@footnotetext\@mpfootnotetext + \let\@listdepth\@mplistdepth \@mplistdepth\z@ + \@minipagerestore + \@setminipage} +% \end{macrocode} +% And a hook at the end +% \begin{macrocode} +\def\endminipage{% + \par + \unskip + \ifvoid\@mpfootins\else + \vskip\skip\@mpfootins + \normalcolor + \footnoterule + \unvbox\@mpfootins + \fi + \@minipagefalse %% added 24 May 89 + \color@endgroup + \egroup +% \end{macrocode} +% as the parbox command is called, we must prevent that it adds its additional +% tagging commands: +% \begin{macrocode} + \tag_stop:n{minipage} + \expandafter\@iiiparbox\@mpargs{\unvbox\@tempboxa}% + \tag_start:n{minipage} + \@kernel@after@minipage%new end ... + } +% \end{macrocode} +% +% And similar for \cs{parbox} +% \begin{macrocode} +\long\def\@iiiparbox#1#2[#3]#4#5{% + \@kernel@init@parbox + \leavevmode + \@pboxswfalse + \setlength\@tempdima{#4}% + \@kernel@before@parbox% new + \@begin@tempboxa\vbox{\hsize\@tempdima\@parboxrestore#5\@@par}% + \ifx\relax#2\else + \setlength\@tempdimb{#2}% + \edef\@parboxto{to\the\@tempdimb}% + \fi + \if#1b\vbox + \else\if #1t\vtop + \else\ifmmode\vcenter + \else\@pboxswtrue $\vcenter + \fi\fi\fi + \@parboxto{\let\hss\vss\let\unhbox\unvbox + \csname bm@#3\endcsname}% + \if@pboxsw \m@th$\fi + \@end@tempboxa% + \@kernel@after@parbox%new end + } +% \end{macrocode} +% +% \subsection{Tagging commands} +% +% \begin{macrocode} +\tl_new:N \l__ltboxes_tag_tl +\tl_set:Nn \l__ltboxes_tag_tl {Div} +\cs_set_protected:Npn\@kernel@before@minipage + { +% \end{macrocode} +% As there was a \cs{leavevmode} before that is a P/text open that we have to close. +% \begin{macrocode} + \tag_mc_end_push:\tag_struct_end: +% \end{macrocode} +% TODO: the P can be further up, we need a proper method to test and handle this. +% \begin{macrocode} + \tag_struct_begin:n{tag=\l__ltboxes_tag_tl}} +\cs_set_protected:Npn\@kernel@after@minipage + {\tag_struct_end:\tag_struct_begin:n{tag=\l__tag_para_tag_tl}\tag_mc_begin_pop:n{}} +\cs_set_protected:Npn\@kernel@before@parbox + {\tag_mc_end_push:\tag_struct_end:\tag_struct_begin:n{tag=\l__ltboxes_tag_tl}} +\cs_set_protected:Npn\@kernel@after@parbox + {\tag_struct_end:\tag_struct_begin:n{tag=\l__tag_para_tag_tl}\tag_mc_begin_pop:n{}} +% \end{macrocode} +% \begin{macrocode} +%</package> +% \end{macrocode} + +% \begin{macrocode} +%<*latex-lab> +\ProvidesFile{minipage-latex-lab-testphase.ltx} + [2022-10-26 v0.8 code related to the tagging of sectioning commands] +\RequirePackage{latex-lab-testphase-minipage} +%</latex-lab> +% \end{macrocode} diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-new-or-1.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-new-or-1.dtx index b3e763ffddc..ef799e813c4 100644 --- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-new-or-1.dtx +++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-new-or-1.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: latex-lab-new-or-1.dtx (C) Copyright 2020-2022 Frank Mittelbach +%% File: latex-lab-new-or-1.dtx (C) Copyright 2020-2023 Frank Mittelbach % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -128,9 +128,9 @@ % % \begin{macrocode} \patchcmd\page@sofar - {\setbox\z@\hbox{p}\global\dimen\tw@\dp\z@}% + {\global\dimen\tw@\dp\z@}% {% - \setbox\z@\hbox{p}\global\dimen\tw@\dp\z@ + \global\dimen\tw@\dp\z@ \@mult@ptagging@hook }% {\typeout{Patching \string\page@sofar\space for tagging}}{\PATCHerror}% diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-sec-tagging.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-sec.dtx index dc90c76e996..62a8d4c9bf5 100644 --- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-sec-tagging.dtx +++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-sec.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: sec-tagging.dtx (C) Copyright 2022-2023 LaTeX Project +%% File: latex-lab-sec.dtx (C) Copyright 2022-2023 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 @@ -21,17 +21,17 @@ \EnableCrossrefs \CodelineIndex \begin{document} - \DocInput{latex-lab-sec-tagging.dtx} + \DocInput{latex-lab-sec.dtx} \end{document} %</driver> % % \fi % % -% \title{The \textsf{sec-tagging} package\\ +% \title{The \textsf{latex-lab-sec} package\\ % Changes related to the tagging of sectioning commands} % \author{\LaTeX{} Project\thanks{Initial implementation done by Ulrike Fischer}} -% \date{v0.81 2023-02-12} +% \date{v0.82 2023-05-20} % % \maketitle % @@ -147,7 +147,7 @@ % % \section{Implementation} % \begin{macrocode} -\ProvidesExplPackage {latex-lab-testphase-sec-tagging} {2022-10-25} {0.8} +\ProvidesExplPackage {latex-lab-testphase-sec} {2023-05-20} {0.81} {Code related to the tagging of sectioning commands} % \end{macrocode} % @@ -181,7 +181,9 @@ \protected\def\pdfglyphtounicode {\pdfextension glyphtounicode } \input{glyphtounicode} \fi +\ifdefined\pdfglyphtounicode \input{glyphtounicode-cmex} +\fi %</kernelchange> % \end{macrocode} % @@ -205,8 +207,14 @@ \smash{}% \spacefactor\@savsf \fi - \int_gincr:N\g__kernel_target_int - \tl_gset:Nx \@currentHref {target*.\int_use:N\g__kernel_target_int} + \IfBooleanTF {#1} + { + \tl_gset:Nx \@currentHref {#3} + } + { + \int_gincr:N\g__kernel_target_int + \tl_gset:Nx \@currentHref {target*.\int_use:N\g__kernel_target_int} + } } \ExplSyntaxOff %</kernelchange> @@ -247,7 +255,7 @@ tag= {\int_compare:nNnTF {#1}={-1}{Part}{Sect}} ,#2 } - \seq_gpush:Nx \g__tag_sec_stack_seq {{\g__tag_struct_tag_tl}{#1}} + \seq_gpush:Nx \g__tag_sec_stack_seq {{\g__tag_struct_tag_tl}{\int_eval:n{#1}}} } % \end{macrocode} % \end{macro} @@ -281,7 +289,7 @@ { \exp_last_unbraced:NV\use_i:nn \l__tag_tmpb_tl } } } - } + } % \end{macrocode} % \end{macro} @@ -392,8 +400,8 @@ { \bool_if:NT\l__tag_sec_Sect_bool { - \__tag_sec_end:n {\use:c{toclevel@#1}+0} - \__tag_sec_begin:nn {\use:c{toclevel@#1}+0}{tag=Sect} + \__tag_sec_end:n {\cs_if_exist_use:c{toclevel@#1}+0} + \__tag_sec_begin:nn {\cs_if_exist_use:c{toclevel@#1}+0}{tag=Sect} } \tl_set:Nn\l__tag_para_tag_tl{#1} } @@ -402,7 +410,7 @@ ,restore-para .code:n = {\__tag_setup_restore_para_default:} ,sec-stop .code:n = { - \par\__tag_sec_end:n {\use:c{toclevel@#1}+0} + \par\__tag_sec_end:n {\cs_if_exist_use:c{toclevel@#1}+0} } ,sec-stop .value_required:n = true ,sec-add-grouping .bool_set:N = \l__tag_sec_Sect_bool @@ -804,7 +812,7 @@ % \begin{macrocode} %<*latex-lab> \ProvidesFile{sec-tagging-latex-lab-testphase.ltx} - [2023-02-12 v0.81 code related to the tagging of sectioning commands] -\RequirePackage{latex-lab-testphase-sec-tagging} + [2023-05-20 v0.82 code related to the tagging of sectioning commands] +\RequirePackage{latex-lab-testphase-sec} %</latex-lab> % \end{macrocode} diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-testphase.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-testphase.dtx index 217605d189b..a2fb65ef4a2 100644 --- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-testphase.dtx +++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-testphase.dtx @@ -84,8 +84,11 @@ [2023-03-06 v0.1a latex-lab wrapper phase-III] \input{phase-II-latex-lab-testphase.ltx} \RequirePackage{latex-lab-testphase-block-tagging} -\RequirePackage{latex-lab-testphase-sec-tagging} -\RequirePackage{latex-lab-testphase-toc-tagging} +\RequirePackage{latex-lab-testphase-sec} +\RequirePackage{latex-lab-testphase-toc} +\RequirePackage{latex-lab-testphase-minipage} +\RequirePackage{latex-lab-testphase-graphic} +\RequirePackage{latex-lab-testphase-float} %</phase-III> % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-hyperref-changes.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-hyperref-changes.dtx index ea39e3a6a58..0b532c6a9bb 100644 --- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-hyperref-changes.dtx +++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-hyperref-changes.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: toc-hyperref-changes.dtx (C) Copyright 2022-2023 LaTeX Project +%% File: latex-lab-toc-hyperref-changes.dtx (C) Copyright 2022-2023 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 @@ -26,10 +26,10 @@ %</driver> % % \fi -% \title{The \textsf{toc-hyperref-changes} package\\ +% \title{The \textsf{latex-lab-toc-hyperref-changes} package\\ % Changes and additions to hyperref related to toc entries} % \author{\LaTeX{} Project\thanks{Initial implementation done by Ulrike Fischer}} -% \date{Version 0.81 2023-02-10} +% \date{Version 0.82 2023-05-20} % % \maketitle % diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-kernel-changes.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-kernel-changes.dtx index 7485b2c2106..3a46b453e5e 100644 --- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-kernel-changes.dtx +++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-kernel-changes.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: toc-kernel-functions.dtx (C) Copyright 2022-2023 LaTeX Project +%% File: latex-lab-toc-kernel-functions.dtx (C) Copyright 2022-2023 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 @@ -27,10 +27,10 @@ % % \fi % -% \title{The \textsf{toc-kernel-changes} package\\ +% \title{The \textsf{latex-lab-toc-kernel-changes} package\\ % Changes and additions to the kernel related to tagging and links in toc entries} % \author{\LaTeX{} Project\thanks{Initial implementation done by Ulrike Fischer}} -% \date{Version 0.81 2023-02-10} +% \date{Version 0.82 2023-05-20} % % \maketitle % @@ -132,6 +132,7 @@ % once that heading stuff is turned into template % instances the template should set that number. % \begin{macrocode} +\def\toclevel@document{-10} \def\toclevel@part{-1} \def\toclevel@chapter{0} \def\toclevel@section{1} @@ -435,9 +436,9 @@ % \begin{macrocode} %<*latex-lab> \ProvidesFile{toc-tagging-latex-lab-testphase.ltx} - [2022-10-26 v0.8 code related to the tagging of toc and similar lists] + [2023-05-20 v0.81 code related to the tagging of toc and similar lists] -\RequirePackage{latex-lab-testphase-toc-tagging} +\RequirePackage{latex-lab-testphase-toc} %</latex-lab> % \end{macrocode} diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-tagging-functions.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-tagging-functions.dtx index 179e5a868e6..a39ace44e5b 100644 --- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-tagging-functions.dtx +++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-tagging-functions.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: toc-tagging-functions.dtx (C) Copyright 2022-2023 LaTeX Project +%% File: latex-lab-toc-tagging-functions.dtx (C) Copyright 2022-2023 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 @@ -28,10 +28,10 @@ % \fi % % -% \title{The \textsf{toc-tagging-functions} package\\ +% \title{The \textsf{latex-lab-toc-tagging-functions} package\\ % Tagpdf functions related to the tagging of toc and similar lists} % \author{\LaTeX{} Project\thanks{Initial implementation done by Ulrike Fischer}} -% \date{Version 0.81 2023-02-10} +% \date{Version 0.82 2023-05-20} % % \maketitle % @@ -48,7 +48,7 @@ % Header for the testphase package % \begin{macrocode} %<*header> -\ProvidesExplPackage {latex-lab-testphase-toc-tagging} {2023-02-10} {0.81} +\ProvidesExplPackage {latex-lab-testphase-toc} {2023-05-20} {0.82} { commands related to the tagging of toc-like lists} %</header> % \end{macrocode} @@ -356,7 +356,7 @@ % % \begin{macrocode} \def\@dottedtocline@cfgpoint@leaders#1{% - \tag_mc_begin:n{artifact}\nobreak#1\nobreak\tag_mc_end:} + \tag_mc_begin:n{artifact}\tag_stop:n{leaders}\nobreak#1\nobreak\tag_start:n{leaders}\tag_mc_end:} % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab.ins b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab.ins index ab77bbb846a..e2ca6049e54 100644 --- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab.ins +++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab.ins @@ -90,11 +90,11 @@ where one can also log issues in case there are any. \generate{\file{latex-lab-mathtools.ltx}{\from{latex-lab-mathtools.dtx}{kernel}}} \generate{\file{latex-lab-mathpkg.ltx}{\from{latex-lab-mathpkg.dtx}{kernel}}} -\generate{\file{latex-lab-testphase-sec-tagging.sty}{\from{latex-lab-sec-tagging.dtx}{package}}} -\generate{\file{sec-tagging-latex-lab-testphase.ltx}{\from{latex-lab-sec-tagging.dtx}{latex-lab}}} +\generate{\file{latex-lab-testphase-sec.sty}{\from{latex-lab-sec.dtx}{package}}} +\generate{\file{sec-tagging-latex-lab-testphase.ltx}{\from{latex-lab-sec.dtx}{latex-lab}}} -\generate{\file{latex-lab-testphase-toc-tagging.sty}{% +\generate{\file{latex-lab-testphase-toc.sty}{% \from{latex-lab-toc-tagging-functions.dtx}{header} \from{latex-lab-toc-kernel-changes.dtx}{package} \from{latex-lab-toc-tagging-functions.dtx}{package} @@ -105,11 +105,37 @@ where one can also log issues in case there are any. \generate{\file{latex-lab-kernel-changes.sty} {\from{latex-lab-toc-kernel-changes.dtx}{kernelchange} - \from{latex-lab-sec-tagging.dtx}{kernelchange} + \from{latex-lab-sec.dtx}{kernelchange} }} +\generate{\file{latex-lab-testphase-graphic.sty}{% + \from{latex-lab-graphic.dtx}{package}}} + +\generate{\file{graphic-latex-lab-testphase.ltx}{% + \from{latex-lab-graphic.dtx}{latex-lab}}} + \generate{\file{latex-lab-testphase-block-tagging.sty}{\from{latex-lab-block-tagging.dtx}{package}}} \generate{\file{block-tagging-latex-lab-testphase.ltx}{\from{latex-lab-block-tagging.dtx}{latex-lab}}} +\generate{\file{latex-lab-testphase-minipage.sty}{% + \from{latex-lab-minipage.dtx}{package}}} + +\generate{\file{minipage-latex-lab-testphase.ltx}{% + \from{latex-lab-minipage.dtx}{latex-lab}}} + + \generate{\file{latex-lab-testphase-float.sty}{% + \from{latex-lab-float.dtx}{package}}} + +\generate{\file{float-latex-lab-testphase.ltx}{% + \from{latex-lab-float.dtx}{latex-lab}}} + +\generate{\file{latex-lab-testphase-bib.sty}{% + \from{latex-lab-bib.dtx}{package}}} + +\generate{\file{bib-latex-lab-testphase.ltx}{% + \from{latex-lab-bib.dtx}{latex-lab}}} + + + \endbatchfile diff --git a/Master/texmf-dist/tex/latex-dev/latex-lab/bib-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex-dev/latex-lab/bib-latex-lab-testphase.ltx new file mode 100644 index 00000000000..1b8ca3cb7ad --- /dev/null +++ b/Master/texmf-dist/tex/latex-dev/latex-lab/bib-latex-lab-testphase.ltx @@ -0,0 +1,43 @@ +%% +%% This is file `bib-latex-lab-testphase.ltx', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% latex-lab-bib.dtx (with options: `latex-lab') +%% +%% This is a generated file. +%% +%% Copyright 2021-2023 LaTeX Project +%% +%% This file was generated from file(s) of the `LaTeX-lab Bundle'. +%% ------------------------------------------------------------------------------------ +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2008 or later. +%% +%% This file may only be distributed together with a copy of the LaTeX +%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle' +%% without such generated files. +%% +%% The newest sources can be found below +%% +%% https://github.com/latex3/latex2e/required/latex-lab +%% +%% where one can also log issues in case there are any. +%% +%% +%% File: latex-lab-bib.dtx (C) Copyright 2023 LaTeX Project +\ProvidesFile{bib-latex-lab-testphase.ltx} + [2023-05-18 v0.8 code related to the tagging of bib and citations] + +\RequirePackage{latex-lab-testphase-bib} + +\endinput +%% +%% End of file `bib-latex-lab-testphase.ltx'. diff --git a/Master/texmf-dist/tex/latex-dev/latex-lab/block-tagging-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex-dev/latex-lab/block-tagging-latex-lab-testphase.ltx index 45b0c372886..ccb5fda2b02 100644 --- a/Master/texmf-dist/tex/latex-dev/latex-lab/block-tagging-latex-lab-testphase.ltx +++ b/Master/texmf-dist/tex/latex-dev/latex-lab/block-tagging-latex-lab-testphase.ltx @@ -34,8 +34,8 @@ %% %% File: latex-lab-block-tagging.dtx (C) Copyright 2021-2023 LaTeX Project -\def\ltblocksversion{v0.8a} -\def\ltblocksdate{2023/03/08} +\def\ltblocksversion{v0.8c} +\def\ltblocksdate{2023/05/16} \ProvidesFile{block-tagging-latex-lab-testphase.ltx} [\ltblocksdate\space \ltblocksversion\space diff --git a/Master/texmf-dist/tex/latex-dev/latex-lab/float-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex-dev/latex-lab/float-latex-lab-testphase.ltx new file mode 100644 index 00000000000..29a76c4ed93 --- /dev/null +++ b/Master/texmf-dist/tex/latex-dev/latex-lab/float-latex-lab-testphase.ltx @@ -0,0 +1,42 @@ +%% +%% This is file `float-latex-lab-testphase.ltx', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% latex-lab-float.dtx (with options: `latex-lab') +%% +%% This is a generated file. +%% +%% Copyright 2021-2023 LaTeX Project +%% +%% This file was generated from file(s) of the `LaTeX-lab Bundle'. +%% ------------------------------------------------------------------------------------ +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2008 or later. +%% +%% This file may only be distributed together with a copy of the LaTeX +%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle' +%% without such generated files. +%% +%% The newest sources can be found below +%% +%% https://github.com/latex3/latex2e/required/latex-lab +%% +%% where one can also log issues in case there are any. +%% +%% +%% File: latex-lab-float.dtx (C) Copyright 2023 LaTeX Project + +\ProvidesFile{float-latex-lab-testphase.ltx} + [2023-04-30 v0.8 code related to the tagging of floats] +\RequirePackage{latex-lab-testphase-float} +\endinput +%% +%% End of file `float-latex-lab-testphase.ltx'. diff --git a/Master/texmf-dist/tex/latex-dev/latex-lab/graphic-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex-dev/latex-lab/graphic-latex-lab-testphase.ltx new file mode 100644 index 00000000000..12fd17f5d2c --- /dev/null +++ b/Master/texmf-dist/tex/latex-dev/latex-lab/graphic-latex-lab-testphase.ltx @@ -0,0 +1,42 @@ +%% +%% This is file `graphic-latex-lab-testphase.ltx', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% latex-lab-graphic.dtx (with options: `latex-lab') +%% +%% This is a generated file. +%% +%% Copyright 2021-2023 LaTeX Project +%% +%% This file was generated from file(s) of the `LaTeX-lab Bundle'. +%% ------------------------------------------------------------------------------------ +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2008 or later. +%% +%% This file may only be distributed together with a copy of the LaTeX +%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle' +%% without such generated files. +%% +%% The newest sources can be found below +%% +%% https://github.com/latex3/latex2e/required/latex-lab +%% +%% where one can also log issues in case there are any. +%% +%% +%% File: latex-lab-graphic.dtx (C) Copyright 2022-2023 LaTeX Project + +\ProvidesFile{graphic-latex-lab-testphase.ltx} + [2023-04-07 v0.8 code related to the tagging included graphics] +\RequirePackage{latex-lab-testphase-graphic} +\endinput +%% +%% End of file `graphic-latex-lab-testphase.ltx'. diff --git a/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-footnotes.ltx b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-footnotes.ltx index 1c78ab74b2b..4a3a046a21d 100644 --- a/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-footnotes.ltx +++ b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-footnotes.ltx @@ -271,12 +271,12 @@ } } -\DeclareDocumentCommand\footnotetext {om} +\DeclareDocumentCommand\footnotetext {o+m} { \fnote_set_fnmark:nn {#1} \@mpfn \@footnotetext {#2} } -\DeclareDocumentCommand\footnote {om} +\DeclareDocumentCommand\footnote {o+m} { \fnote_step_fnmark:nn {#1} \@mpfn \cs_set_eq:NN \__fnote_footnotemark_finish: \prg_do_nothing: diff --git a/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-kernel-changes.sty b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-kernel-changes.sty index 9dcd5b0b472..4394aab2da8 100644 --- a/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-kernel-changes.sty +++ b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-kernel-changes.sty @@ -5,7 +5,7 @@ %% The original source files were: %% %% latex-lab-toc-kernel-changes.dtx (with options: `kernelchange') -%% latex-lab-sec-tagging.dtx (with options: `kernelchange') +%% latex-lab-sec.dtx (with options: `kernelchange') %% %% This is a generated file. %% @@ -33,7 +33,7 @@ %% where one can also log issues in case there are any. %% %% -%% File: toc-kernel-functions.dtx (C) Copyright 2022-2023 LaTeX Project +%% File: latex-lab-toc-kernel-functions.dtx (C) Copyright 2022-2023 LaTeX Project \def\hyper@nopatch@counter{} \def\@definecounter#1{\expandafter\newcount\csname c@#1\endcsname \setcounter{#1}\z@ @@ -62,6 +62,7 @@ {\csname p@#1\expandafter\endcsname\csname the#1\endcsname}% } \let\@kernel@refstepcounter\refstepcounter +\def\toclevel@document{-10} \def\toclevel@part{-1} \def\toclevel@chapter{0} \def\toclevel@section{1} @@ -72,13 +73,15 @@ \def\toclevel@figure{1} \def\toclevel@table{1} -%% File: sec-tagging.dtx (C) Copyright 2022-2023 LaTeX Project +%% File: latex-lab-sec.dtx (C) Copyright 2022-2023 LaTeX Project \ifdefined\directlua \pdfvariable gentounicode =1 \protected\def\pdfglyphtounicode {\pdfextension glyphtounicode } \input{glyphtounicode} \fi +\ifdefined\pdfglyphtounicode \input{glyphtounicode-cmex} +\fi \ExplSyntaxOn \int_new:N\g__kernel_target_int \RenewDocumentCommand\MakeLinkTarget{sO{}m} @@ -90,8 +93,14 @@ \smash{}% \spacefactor\@savsf \fi - \int_gincr:N\g__kernel_target_int - \tl_gset:Nx \@currentHref {target*.\int_use:N\g__kernel_target_int} + \IfBooleanTF {#1} + { + \tl_gset:Nx \@currentHref {#3} + } + { + \int_gincr:N\g__kernel_target_int + \tl_gset:Nx \@currentHref {target*.\int_use:N\g__kernel_target_int} + } } \ExplSyntaxOff diff --git a/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-mathtagging.ltx b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-mathtagging.ltx index 3d5a38eb106..d333b5ca9a3 100644 --- a/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-mathtagging.ltx +++ b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-mathtagging.ltx @@ -318,11 +318,14 @@ \def\@kernel@math@begin { \tl_gset:Nx\tmpmathcontent - {\exp_not:N\begin{\g__math_grabbed_env_tl} + { + LaTeX~ formula~ starts~ + \exp_not:N\begin{\g__math_grabbed_env_tl} \space \exp_not:V\g__math_grabbed_math_tl \space \exp_not:N\end{\g__math_grabbed_env_tl} + \space LaTeX~ formula~ ends~ } \tagstructbegin{tag=Formula, AFinline-o=\tmpmathcontent, diff --git a/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-bib.sty b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-bib.sty new file mode 100644 index 00000000000..855513e3e63 --- /dev/null +++ b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-bib.sty @@ -0,0 +1,187 @@ +%% +%% This is file `latex-lab-testphase-bib.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% latex-lab-bib.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% Copyright 2021-2023 LaTeX Project +%% +%% This file was generated from file(s) of the `LaTeX-lab Bundle'. +%% ------------------------------------------------------------------------------------ +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2008 or later. +%% +%% This file may only be distributed together with a copy of the LaTeX +%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle' +%% without such generated files. +%% +%% The newest sources can be found below +%% +%% https://github.com/latex3/latex2e/required/latex-lab +%% +%% where one can also log issues in case there are any. +%% +%% +%% File: latex-lab-bib.dtx (C) Copyright 2023 LaTeX Project +\ProvidesExplPackage {latex-lab-testphase-bib} {2023-05-18} {0.8} + {Code related to the tagging of bibliography and cite command} +\RequirePackage{latex-lab-testphase-block-tagging} +\def\hyper@nopatch@bib{} + +\providecommand*\@extra@binfo{}% +\providecommand\@extra@b@citeb{} +\tl_new:N\l__tag_bib_target_tl + +\def\@lbibitem[#1]#2{% + \tl_set:Nx\l__tag_bib_target_tl{cite.#2\@extra@b@citeb} + \AddToHookNext{para/begin}{\makebox[0pt][r]{\MakeLinkTarget*{\l__tag_bib_target_tl}\hspace{\leftmargin}}} + \item[\@biblabel{#1}\hfill]\if@filesw + {\let\protect\noexpand + \immediate + \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces} +\let\@kernel@copy@lbibitem\@lbibitem +\def\@bibitem#1{ + \tl_set:Nx\l__tag_bib_target_tl{cite.#1\@extra@b@citeb}% + \AddToHookNext{para/begin}{\makebox[0pt][r]{\MakeLinkTarget*{\l__tag_bib_target_tl}\hspace{\leftmargin}}} + \item\if@filesw \immediate\write\@auxout + {\string\bibcite{#1}{\the\value{\@listctr}}}\fi\ignorespaces} +\let\@kernel@copy@bibitem\@bibitem +\AddToHook{env/thebibliography/begin} + {\cs_set:Npn \__block_list_item_begin: + { \tagstructbegin{tag=\LItag,label=\l__tag_bib_target_tl}} + } +\NewMirroredHookPairWithArguments{bibcite/before}{bibcite/after}{2} +\def\bibcite#1#2{% + \@newl@bel{b}{#1\@extra@binfo}{% + \UseHookWithArguments{bibcite/before}{2}{#1}{#2} + #2 + \UseHookWithArguments{bibcite/after}{2}{#1}{#2} + }% + }% +\let\@kernel@copy@bibcite\bibcite +\AddToHookWithArguments{bibcite/before} + { + \tag_mc_end_push: + \exp_args:Nx\tagstructbegin{tag=Reference,ref=cite.#1\@extra@b@citeb} + \tagmcbegin{} + } +\AddToHookWithArguments{bibcite/after}[tag] + { + \tag_mc_end: + \tagstructend + \tag_mc_begin_pop:n{} + } +\AddToHook{package/hyperref/after} + { + \@ifpackagelater{hyperref}{2023-05-01}{} + { + \@ifpackageloaded{natbib}{} + {\let\@lbibitem\@kernel@copy@lbibitem + \let\@bibitem\@kernel@copy@bibitem + \let\bibcite\@kernel@copy@bibcite} + } + \AddToHookWithArguments{bibcite/before}{\hyper@linkstart{cite}{cite.#1\@extra@b@citeb}} + \AddToHookWithArguments{bibcite/after}{\hyper@linkend} + } +\AddToHook{package/natbib/after} + { + \def\hyper@natanchorstart#1{\MakeLinkTarget*{#1}} + \def\@lbibitem[#1]#2{% + \tl_set:Nx\l__tag_bib_target_tl{cite.#2\@extra@b@citeb} + \if\relax\@extra@b@citeb\relax\else + \@ifundefined{br@#2\@extra@b@citeb}{}{% + \@namedef{br@#2}{\@nameuse{br@#2\@extra@b@citeb}}% + }% + \fi + \@ifundefined{b@#2\@extra@b@citeb}{% + \def\NAT@num{}% + }{% + \NAT@parse{#2}% + }% + \def\NAT@tmp{#1}% + \expandafter\let\expandafter\bibitemOpen\csname NAT@b@open@#2\endcsname + \expandafter\let\expandafter\bibitemShut\csname NAT@b@shut@#2\endcsname + \@ifnum{\NAT@merge>\@ne}{% + \NAT@bibitem@first@sw{% + \@firstoftwo + }{% + \@ifundefined{NAT@b*@#2}{% + \@firstoftwo + }{% + \expandafter\def\expandafter\NAT@num\expandafter{\the\c@NAT@ctr}% + \@secondoftwo + }% + }% + }{% + \@firstoftwo + }% + {% + \global\advance\c@NAT@ctr\@ne + \@ifx{\NAT@tmp\@empty}{\@firstoftwo}{% + \@secondoftwo + }% + {% + \expandafter\def\expandafter\NAT@num\expandafter{\the\c@NAT@ctr}% + \global\NAT@stdbsttrue + }{}% + \bibitem@fin + \item[\hfil\NAT@anchor{#2}{\NAT@num}]% + \global\let\NAT@bibitem@first@sw\@secondoftwo + \NAT@bibitem@init + }% + {% + \NAT@anchor{#2}{}% + \NAT@bibitem@cont + \bibitem@fin + }% + \@ifx{\NAT@tmp\@empty}{% + \NAT@wrout{\the\c@NAT@ctr}{}{}{}{#2}% + }{% + \expandafter\NAT@ifcmd\NAT@tmp(@)(@)\@nil{#2}% + }% + }% + \NewMirroredHookPairWithArguments{natbib/linkstart}{natbib/linkend}{1} + \renewcommand\hyper@natlinkstart[1]{\UseHookWithArguments{natbib/linkstart}{1}{#1}} + \renewcommand\hyper@natlinkend{\UseHookWithArguments{natbib/linkend}{1}{}} + \AddToHookWithArguments{natbib/linkstart} + { + \leavevmode + \tag_mc_end_push: + \exp_args:Nx\tagstructbegin{tag=Reference,ref=cite.#1\@extra@b@citeb} + \tagmcbegin{} + } + \AddToHook{natbib/linkend} + { + \tag_mc_end: + \tagstructend + \tag_mc_begin_pop:n{} + } + } +\AddToHook{package/hyperref/after} + { + \renewcommand\hyper@natlinkstart[1]{\UseHookWithArguments{natbib/linkstart}{1}{#1}} + \renewcommand\hyper@natlinkend{\UseHookWithArguments{natbib/linkend}{1}{}} + \AddToHookWithArguments{natbib/linkstart} + { + \Hy@backout{#1}% + \hyper@linkstart{cite}{cite.#1}% + \def\hyper@nat@current{#1} + } + \AddToHook{natbib/linkend} + { + \hyper@linkend + } + } +\endinput +%% +%% End of file `latex-lab-testphase-bib.sty'. diff --git a/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-block-tagging.sty b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-block-tagging.sty index dd4bf37ce16..a60940f76f8 100644 --- a/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-block-tagging.sty +++ b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-block-tagging.sty @@ -34,8 +34,8 @@ %% %% File: latex-lab-block-tagging.dtx (C) Copyright 2021-2023 LaTeX Project -\def\ltblocksversion{v0.8a} -\def\ltblocksdate{2023/03/08} +\def\ltblocksversion{v0.8c} +\def\ltblocksdate{2023/05/16} \ProvidesPackage {latex-lab-testphase-block-tagging} [\ltblocksdate\space \ltblocksversion\space @@ -198,6 +198,7 @@ \AddToHook{begindocument/before}{ \RenewDocumentEnvironment{verbatim}{ !O{} } { \UseInstance{blockenv}{verbatim} {#1} + \@setupverbinvisiblespace\frenchspacing\@vobeyspaces \@xverbatim } { \endblockenv } @@ -213,18 +214,16 @@ \@tempswafalse \def\par{% \if@tempswa - \leavevmode \null \@@par\penalty\interlinepenalty + \leavevmode \null {\@@par}\penalty\interlinepenalty \else \@tempswatrue - \ifhmode\@@par\penalty\interlinepenalty\fi + \ifhmode{\@@par}\penalty\interlinepenalty\fi \fi}% \let\do\@makeother \dospecials \obeylines \verbatim@font \@noligs \everypar \expandafter{\the\everypar \unpenalty}% \tl_set:Nn \l__tag_para_main_tag_tl {codeline} \tagtool{paratag=Code}% oder faster: \tl_set:Nn\l__tag_para_tag_tl{Code} - \@setupverbinvisiblespace - \frenchspacing \@vobeyspaces } \newcommand\@setupverbinvisiblespace{} \tag_if_active:T { @@ -283,13 +282,88 @@ } { \endblockenv } } -\tag_if_active:T { - \tagpdfsetup{add-new-tag={tag=theorem-like,role=L}} +\RenewDocumentCommand \newtheorem { m O{#1} m o } +{ + \expandafter\@ifdefinable\csname #1\endcsname + { + \str_if_eq:nnTF{#1}{#2} + { + \@definecounter {#2} + \IfNoValueTF {#4} + { % @ynthm + \tl_gset:cx { the #2 } + { + \@thmcounter{#2} + } + } + { % @xnthm + \@newctr{#1}[#4] + \tl_gset:cx { the #2 } + { + \expandafter\noexpand\csname the#4\endcsname + \@thmcountersep + \@thmcounter{#2} + } + } + } + { % @othm + \@ifundefined{c@#2} + { \@nocounterr{#2} } + { + \tl_gset:cn { the #1 } + { \UseName { the #2 } } + } + } + \global\@namedef{#1} { \@thm{#2}{#3} } + \global\@namedef{end#1}{ \@endtheorem } + } +} +\def\@begintheorem#1#2{ + \UseInstance{blockenv}{theorem}{} + \tagpdfparaOff + \textbf{ + \tag_struct_begin:n{tag=Caption} + \tag_mc_begin:n {} + #1\ + \tag_mc_end: + \tag_struct_begin:n{tag=Lbl} + \tag_mc_begin:n {} + #2 + \tag_mc_end: + \tag_struct_end: + \tag_struct_end: + } + \tagpdfparaOn + \__block_start_para_structure_unconditionally:n { \PARALABEL } + \itshape + \hskip\labelsep + \ignorespaces +} +\def\@opargbegintheorem#1#2#3{ + \UseInstance{blockenv}{theorem}{} + \tagpdfparaOff + \textbf{ + \tag_struct_begin:n{tag=Caption} + \tag_mc_begin:n {} + #1\ + \tag_mc_end: + \tag_struct_begin:n{tag=Lbl} + \tag_mc_begin:n {} + #2 + \tag_mc_end: + \tag_struct_end: + \tag_mc_begin:n {} + \ (#3) + \tag_mc_end: + \tag_struct_end: + } + \tagpdfparaOn + \__block_start_para_structure_unconditionally:n { \PARALABEL } + \itshape + \hskip\labelsep + \ignorespaces } -\def\@begintheorem#1#2{\trivlist[tag-name=theorem-like]% - \item[\hskip \labelsep{\bfseries #1\ #2}]\itshape} -\def\@opargbegintheorem#1#2#3{\trivlist[tag-name=theorem-like] - \item[\hskip \labelsep{\bfseries #1\ #2\ (#3)}]\itshape} +\def\@endtheorem{\endblockenv} \cs_new:Npn \g_block_nesting_depth_int { \@listdepth } % a fake int % for now \DeclareTemplateCode{blockenv}{display}{1} @@ -400,11 +474,16 @@ \addpenalty \@endparpenalty \addvspace \l__block_topsepadd_skip } - \legacy_if_gset_true:n { @endpe } + % \begin{macrocode} + \bool_if:NTF \l__block_standalone_bool + { \legacy_if_gset_false:n { @endpe } } + { \legacy_if_gset_true:n { @endpe } } } \cs_new:Npn \__kernel_displayblock_end: { \__block_debug_typeout:n{\detokenize{__kernel_displayblock_end:}} } +\bool_new:N \l__block_standalone_bool +\bool_set_false:N \l__block_standalone_bool \DeclareTemplateCode{para}{std}{1} { indent-width = \parindent , @@ -746,6 +825,18 @@ \let \__kernel_displayblock_begin: \prg_do_nothing: \let \__kernel_displayblock_end: \prg_do_nothing: } +\cs_new:Npn \__block_recipe_standalone: { + \cs_set_eq:NN \__kernel_displayblock_beginpar_hmode:w + \prg_do_nothing: + \cs_set_eq:NN \__kernel_displayblock_beginpar_vmode: + \prg_do_nothing: + \cs_set_eq:NN \__kernel_displayblock_begin: \__block_inner_begin: + \cs_set_eq:NN \__kernel_displayblock_end: \__block_inner_end: + \bool_set_true:N \l__block_standalone_bool + \tl_if_empty:NTF \l__block_tag_name_tl + { \tl_set:Nn \l__block_tag_inner_tag_tl {Sect} } + { \tl_set_eq:NN \l__block_tag_inner_tag_tl \l__block_tag_name_tl } +} \cs_new:Npn \__block_recipe_standard: { \cs_set_eq:NN \__kernel_displayblock_beginpar_hmode:w @@ -872,6 +963,21 @@ block-instance = quoteblock , inner-instance = , } + +\DeclareInstance{blockenv}{theorem}{display} +{ + env-name = theorem-like, + tag-name = theorem-like, + tag-class = , + tagging-recipe = standalone, + inner-level-counter = , + level-increase = false, + setup-code = , + block-instance = displayblock , +} +\tag_if_active:T { + \tagpdfsetup{add-new-tag={tag=theorem-like,role=Sect}} +} \tag_if_active:T { \tagpdfsetup{add-new-tag={tag=verbatim,role=P}} \tagpdfsetup{add-new-tag={tag=codeline,role=Sub}} @@ -885,7 +991,7 @@ inner-level-counter = , level-increase = false, setup-code = , - block-instance = displayblock , + block-instance = verbatimblock , inner-instance = , final-code = \legacyverbatimsetup , } @@ -952,6 +1058,18 @@ \DeclareInstanceCopy{block}{displayblock-4}{displayblock-0} \DeclareInstanceCopy{block}{displayblock-5}{displayblock-0} \DeclareInstanceCopy{block}{displayblock-6}{displayblock-0} +\DeclareInstance{block}{verbatimblock-0}{display} + { + leftmargin = 0pt , + parindent = 0pt , + par-skip = 0pt , + } +\DeclareInstanceCopy{block}{verbatimblock-1}{verbatimblock-0} +\DeclareInstanceCopy{block}{verbatimblock-2}{verbatimblock-0} +\DeclareInstanceCopy{block}{verbatimblock-3}{verbatimblock-0} +\DeclareInstanceCopy{block}{verbatimblock-4}{verbatimblock-0} +\DeclareInstanceCopy{block}{verbatimblock-5}{verbatimblock-0} +\DeclareInstanceCopy{block}{verbatimblock-6}{verbatimblock-0} \DeclareInstance{block}{quoteblock-1}{display} { rightmargin = \KeyValue{leftmargin} } \DeclareInstanceCopy{block}{quoteblock-2}{quoteblock-1} @@ -1099,7 +1217,7 @@ \bool_if:NF \l__tag_para_flattened_bool { \__block_debug_typeout:n{Structure-end~ - \l__tag_para_main_tag_tl\space after~ list \on@line } + \l__tag_para_main_tag_tl\space after~ displayblock \on@line } \int_gincr:N \g__tag_para_main_end_int \tag_struct_end: %text-unit } @@ -1111,29 +1229,48 @@ \bool_if:NT \l__tag_para_bool { \legacy_if:nF { @inlabel } { - \__block_debug_typeout:n - { @endpe = \legacy_if:nTF { @endpe }{true}{false} - \on@line } - \legacy_if:nF { @endpe } - { - \bool_if:NF \l__tag_para_flattened_bool - { - \int_gincr:N \g__tag_para_main_begin_int - \tag_struct_begin:n{tag=\l__tag_para_main_tag_tl} - } - } - \int_gincr:N \g__tag_para_begin_int - \__block_debug_typeout:n{increment~ P \on@line } - \tag_struct_begin:n - { - tag=\l__tag_para_tag_tl - ,attribute-class=\l_tag_para_attr_class_tl - } - \__tag_check_para_begin_show:nn {green}{\PARALABEL} - \tag_mc_begin:n {} + \__block_start_para_structure:n { \PARALABEL } } } } +\cs_new_protected:Npn \__block_start_para_structure:n #1 { + \__block_debug_typeout:n + { @endpe = \legacy_if:nTF { @endpe }{true}{false} + \on@line } + \legacy_if:nF { @endpe } + { + \bool_if:NF \l__tag_para_flattened_bool + { + \int_gincr:N \g__tag_para_main_begin_int + \tag_struct_begin:n{tag=\l__tag_para_main_tag_tl} + } + } + \int_gincr:N \g__tag_para_begin_int + \__block_debug_typeout:n{increment~ P \on@line } + \tag_struct_begin:n + { + tag=\l__tag_para_tag_tl + ,attribute-class=\l_tag_para_attr_class_tl + } + \__tag_check_para_begin_show:nn {green}{#1} + \tag_mc_begin:n {} +} +\cs_new_protected:Npn \__block_start_para_structure_unconditionally:n #1 { + \bool_if:NF \l__tag_para_flattened_bool + { + \int_gincr:N \g__tag_para_main_begin_int + \tag_struct_begin:n{tag=\l__tag_para_main_tag_tl} + } + \int_gincr:N \g__tag_para_begin_int + \__block_debug_typeout:n{increment~ P \on@line } + \tag_struct_begin:n + { + tag=\l__tag_para_tag_tl + ,attribute-class=\l_tag_para_attr_class_tl + } + \__tag_check_para_begin_show:nn {green}{#1} + \tag_mc_begin:n {} +} \tag_if_active:T { } \RemoveFromHook{para/end}[tagpdf] @@ -1208,24 +1345,7 @@ \cs_set:Npn \__kernel_list_label_after: { \bool_if:NT \l__tag_para_bool { - \bool_if:NF \l__tag_para_flattened_bool - { - \int_gincr:N \g__tag_para_main_begin_int - \tag_struct_begin:n{tag=\l__tag_para_main_tag_tl} - } - \int_gincr:N \g__tag_para_begin_int - \__block_debug_typeout:n{increment~ P \on@line } - \tag_struct_begin:n { - tag=\l__tag_para_tag_tl - ,attribute-class=\l_tag_para_attr_class_tl - } - \bool_if:NT \l__tag_para_show_bool - { - \tag_mc_begin:n {artifact} - \llap {\color_select:n {blue}\tiny Li-\int_use:N \g__tag_para_begin_int \ } - \tag_mc_end: - } - \tag_mc_begin:n {tag=P} + \__block_start_para_structure_unconditionally:n { LI- } } } \cs_new:Npn \__block_inner_begin: { diff --git a/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-float.sty b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-float.sty new file mode 100644 index 00000000000..0a4bd2c72ed --- /dev/null +++ b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-float.sty @@ -0,0 +1,264 @@ +%% +%% This is file `latex-lab-testphase-float.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% latex-lab-float.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% Copyright 2021-2023 LaTeX Project +%% +%% This file was generated from file(s) of the `LaTeX-lab Bundle'. +%% ------------------------------------------------------------------------------------ +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2008 or later. +%% +%% This file may only be distributed together with a copy of the LaTeX +%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle' +%% without such generated files. +%% +%% The newest sources can be found below +%% +%% https://github.com/latex3/latex2e/required/latex-lab +%% +%% where one can also log issues in case there are any. +%% +%% +%% File: latex-lab-float.dtx (C) Copyright 2023 LaTeX Project +\ProvidesExplPackage {latex-lab-testphase-float} {2023-04-28} {0.8} + {Code related to the tagging of floats} +\tagpdfsetup{add-new-tag=float/Aside} +\tagpdfsetup{add-new-tag=figures/Sect} +\tagpdfsetup{add-new-tag=tables/Sect} +\prop_new:N \g__tag_float_sect_prop +\seq_new:N \g__tag_float_types_seq +\seq_gput_right:Nn \g__tag_float_types_seq {figure} +\seq_gput_right:Nn \g__tag_float_types_seq {table} +\bool_new:N \g__tag_float_sect_bool +\bool_gset_true:N \g__tag_float_sect_bool +\cs_new_protected:Npn\__tag_float_init_collect: + { + \bool_if:NT\g__tag_float_sect_bool + { + \seq_map_inline:Nn\g__tag_float_types_seq + { + \tag_struct_begin:n{tag=##1s,stash} + \prop_gput:Nnx\g__tag_float_sect_prop {##1-struct}{\int_use:N\c@g__tag_struct_abs_int} + \tag_struct_end: + } + } + } +\cs_new_protected:Npn \__tag_float_stop_sect: + { + \bool_if:NT\g__tag_float_sect_bool + { + \seq_map_inline:Nn\g__tag_float_types_seq + { + \prop_get:NnNT\g__tag_float_sect_prop{##1-used}\l__tag_tmpa_tl + { + \exp_args:Ne + \tag_struct_use_num:n{\prop_item:Nn\g__tag_float_sect_prop{##1-struct}} + \prop_gremove:Nn \g__tag_float_sect_prop{##1-used} + } + } + } + } + +\keys_define:nn { tag / tool} + { + flush-floats .code:n = + { + \keys_set:nn {tag / tool} {sec-stop=#1} + \__tag_float_stop_sect: + \__tag_float_init_collect: + }, + flush-float .default:n = Document + } +\AddToHook{begindocument/end}[latex-lab/float] + {\__tag_float_init_collect:} +\AddToHook{tagpdf/finish/before}[latex-lab/float] + {\par\__tag_sec_end:n{-10}\__tag_float_stop_sect:} +\DeclareHookRule{tagpdf/finish/before}{latex-lab/float}{before}{tagpdf} +\keys_define:nn { tag / tool} + { + split-float .code:n = + { + \__tag_float_end: + \__tag_float_begin: + \MakeLinkTarget[tagstructure]{g__tag_struct_abs_int} + } + } + +\cs_new_protected:Npn \__tag_float_stop_par: + { + \tag_mc_end: + \bool_if:NF \g__tag_float_sect_bool + { + \tag_struct_end: + } + } +\cs_new_protected:Npn \__tag_float_start_par: + { + \bool_if:NF \g__tag_float_sect_bool + { + \tag_struct_begin:n{tag=text}% + } + \tag_mc_begin:n{tag=P} + } + +\cs_new_protected:Npn \__tag_float_begin: + {% + \bool_if:NTF\g__tag_float_sect_bool + { + \exp_args:Ne + \tag_struct_begin:n{tag=float,parent=0\prop_item:No\g__tag_float_sect_prop{\@captype-struct}}% + \prop_gput:Nxx \g__tag_float_sect_prop {\@captype-used}{true} + } + { + \tag_struct_begin:n{tag=float} + } + \tl_set:Nx\@current@float@struct{\tag_get:n{struct_num}}% + \typeout{Float structure: \@current@float@struct} + } + +\cs_new_protected:Npn\__tag_float_end:{\tag_struct_end:} %end Aside + +\ExplSyntaxOff +\def\@xfloat #1[#2]{% + \@nodocument + \def \@captype {#1}% + \def \@fps {#2}% + \@onelevel@sanitize \@fps + \def \reserved@b {!}% + \ifx \reserved@b \@fps + \@fpsadddefault + \else + \ifx \@fps \@empty + \@fpsadddefault + \fi + \fi + \ifhmode + \@bsphack + \@nameuse{__tag_float_stoppar:} %<---end P + \@floatpenalty -\@Mii + \else + \@floatpenalty-\@Miii + \fi + \ifinner + \@parmoderr\@floatpenalty\z@ + \else + \@next\@currbox\@freelist + {% + \@tempcnta \sixt@@n + \expandafter \@tfor \expandafter \reserved@a + \expandafter :\expandafter =\@fps + \do + {% + \if \reserved@a h% + \ifodd \@tempcnta + \else + \advance \@tempcnta \@ne + \fi + \else\if \reserved@a t% + \@setfpsbit \tw@ + \else\if \reserved@a b% + \@setfpsbit 4% + \else\if \reserved@a p% + \@setfpsbit 8% + \else\if \reserved@a !% + \ifnum \@tempcnta>15 + \advance\@tempcnta -\sixt@@n\relax + \fi + \else + \@latex@error{Unknown float option `\reserved@a'}% + {Option `\reserved@a' ignored and `p' used.}% + \@setfpsbit 8% + \fi\fi\fi\fi\fi + }% + \@tempcntb \csname ftype@\@captype \endcsname + \multiply \@tempcntb \@xxxii + \advance \@tempcnta \@tempcntb + \global \count\@currbox \@tempcnta + }% + \@fltovf + \fi + \@nameuse{__tag_float_begin:}% + \global \setbox\@currbox + \color@vbox + \normalcolor + \vbox \bgroup + \hsize\columnwidth + \@parboxrestore + \@floatboxreset + \MakeLinkTarget[tagstructure]{g__tag_struct_abs_int}% +}% +\def\end@float{% + \@endfloatbox + \@nameuse{__tag_float_end:}% + \ifnum\@floatpenalty <\z@ + \@largefloatcheck + \@cons\@currlist\@currbox + \ifnum\@floatpenalty <-\@Mii + \penalty -\@Miv + \@tempdima\prevdepth + \vbox{}% + \prevdepth\@tempdima + \penalty\@floatpenalty + \else + \vadjust{\penalty -\@Miv \vbox{}\penalty\@floatpenalty}\@Esphack + \@nameuse{__tag_float_start_par:} %restart P safe here?? + \fi + \fi +} +\ExplSyntaxOn +\def\hyper@nopatch@caption{} +\providecommand\theHg__tag_struct_abs_int{\int_use:N\c@g__tag_struct_abs_int} + +\AddToHook{begindocument} + { + \long\def\@makecaption#1#2{% + \vskip\abovecaptionskip + \xdef\@currentHref{tagstructure.\@current@float@struct}% + \tag_stop:n{caption} + \sbox\@tempboxa{#1:~#2}% + \tag_start:n{caption} + \tagtool{para=false} + \tag_struct_begin:n{tag=Caption,parent=\@current@float@struct} + \seq_gpop_right:cN {g__tag_struct_kids_\@current@float@struct _seq}\l__tag_tmpa_tl + \seq_gput_left:cV {g__tag_struct_kids_\@current@float@struct _seq}\l__tag_tmpa_tl + \ifdim \wd\@tempboxa >\hsize + \tag_struct_begin:n{tag=Lbl} + \tag_mc_begin:n{} + #1:~ + \tag_mc_end: + \tag_struct_end: + \tag_mc_begin:n{} + #2\par + \tag_mc_end: + \else + \global \@minipagefalse + \hb@xt@\hsize{\hfil + \tag_struct_begin:n{tag=Lbl} + \tag_mc_begin:n{} + #1:~ + \tag_mc_end: + \tag_struct_end: + \tag_mc_begin:n{} + #2\par + \tag_mc_end:\hfil}% + \fi + \tag_struct_end: %caption + \vskip\belowcaptionskip} + } + +\endinput +%% +%% End of file `latex-lab-testphase-float.sty'. diff --git a/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-graphic.sty b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-graphic.sty new file mode 100644 index 00000000000..afe5a4625e5 --- /dev/null +++ b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-graphic.sty @@ -0,0 +1,694 @@ +%% +%% This is file `latex-lab-testphase-graphic.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% latex-lab-graphic.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% Copyright 2021-2023 LaTeX Project +%% +%% This file was generated from file(s) of the `LaTeX-lab Bundle'. +%% ------------------------------------------------------------------------------------ +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2008 or later. +%% +%% This file may only be distributed together with a copy of the LaTeX +%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle' +%% without such generated files. +%% +%% The newest sources can be found below +%% +%% https://github.com/latex3/latex2e/required/latex-lab +%% +%% where one can also log issues in case there are any. +%% +%% +%% File: latex-lab-graphic.dtx (C) Copyright 2022-2023 LaTeX Project +\ProvidesExplPackage {latex-lab-testphase-graphic} {2023-04-07} {0.8} + {Code related to the tagging of graphics} +\RequirePackage{l3opacity} +\ref_attribute_gset:nnnn{xpos}{0}{shipout}{\int_use:N\tex_lastxpos:D} +\ref_attribute_gset:nnnn{ypos}{0}{shipout}{\int_use:N\tex_lastypos:D} + +\cs_new_protected:Npn\__tag_graphic_savepos:n #1 + { + \tex_savepos:D + \ref_label:nn{#1}{xpos,ypos,abspage} + \tex_savepos:D + } +\cs_generate_variant:Nn \__tag_graphic_savepos:n {e} +\bool_new:N \l__tag_graphic_debug_bool +\keys_define:nn { document / metadata } + { + debug / BBox .code:n = { \bool_set_true:N \l__tag_graphic_debug_bool } + } +\int_new:N\g__tag_graphic_int + +\tl_new:N \g__tag_graphic_lx_tl +\tl_new:N \g__tag_graphic_ly_tl +\tl_new:N \g__tag_graphic_ux_tl +\tl_new:N \g__tag_graphic_uy_tl +\seq_new:N\l__tag_graphic_bboxcorr_seq +\bool_new:N\l__tag_graphic_bboxcorr_bool +\tl_new:N \l__tag_graphic_currentlabel_tl + +\tl_new:N \l__tag_graphic_alt_tl +\tl_new:N \l__tag_graphic_alt_dflt_tl +\tl_set:Nn \l__tag_graphic_alt_dflt_tl {\Gin@base\Gin@ext} +\tl_new:N \l__tag_graphic_actual_tl +\tl_new:N \l__tag_graphic_struct_tl +\tl_set:Nn\l__tag_graphic_struct_tl {Figure} +\bool_new:N\l__tag_graphic_artifact_bool +\bool_new:N\l__tag_graphic_BBox_bool +\bool_set_true:N\l__tag_graphic_BBox_bool + +\fp_new:N\l__tag_graphic_sin_fp +\fp_new:N\l__tag_graphic_cos_fp +\fp_new:N\l__tag_graphic_lxly_fp +\fp_new:N\l__tag_graphic_lxuy_fp +\fp_new:N\l__tag_graphic_uxly_fp +\fp_new:N\l__tag_graphic_uxuy_fp +\fp_new:N\l__tag_graphic_ux_fp +\fp_new:N\l__tag_graphic_ly_fp +\fp_new:N\l__tag_graphic_lx_fp +\fp_new:N\l__tag_graphic_uy_fp +\fp_new:N\l__tag_graphic_scale_fp +\fp_new:N\l__tag_graphic_trim_ux_fp +\fp_new:N\l__tag_graphic_trim_ly_fp +\fp_new:N\l__tag_graphic_trim_lx_fp +\fp_new:N\l__tag_graphic_trim_uy_fp +\msg_new:nnn {tag}{alt-text-missing} + { + Alternative~text~for~graphic~is~missing.\\ + Using~'#1'~instead + } +\cs_new_protected:Npn\Gin@tag@struct@begin + { + \tag_if_active:T + { + \tag_mc_end_push: + \bool_if:NTF\l__tag_graphic_artifact_bool + { + \tag_mc_begin:n{artifact} + } + { + \tl_if_empty:NTF\l__tag_graphic_actual_tl + { + \tl_if_empty:NT\l__tag_graphic_alt_tl + { + \msg_warning:nnx{tag}{alt-text-missing}{\l__tag_graphic_alt_dflt_tl} + \tl_set:Nx\l__tag_graphic_alt_tl {\l__tag_graphic_alt_dflt_tl} + } + \tag_struct_begin:n + { + tag=\l__tag_graphic_struct_tl, + alt=\l__tag_graphic_alt_tl, + } + } + { + \tag_struct_begin:n + { + tag=Span, + actualtext=\l__tag_graphic_actual_tl, + } + \bool_set_false:N\l__tag_graphic_BBox_bool + } + \tag_mc_begin:n{} + } + } + } + +\cs_new_protected:Npn\Gin@tag@struct@end + { + \tag_if_active:T + { + \tag_mc_end: + \bool_if:NF\l__tag_graphic_artifact_bool + { + \tag_struct_end: + } + \tag_mc_begin_pop:n{} + } + } +\AddToHook{package/graphics/after} + { + \def\Gin@setfile#1#2#3{% + \ifx\\#2\\\Gread@false\fi + \ifGin@bbox\else + \ifGread@ + \csname Gread@% + \expandafter\ifx\csname Gread@#1\endcsname\relax + eps% + \else + #1% + \fi + \endcsname{\Gin@base#2}% + \else + \Gin@nosize{#3}% + \fi + \fi + \Gin@viewport@code + \Gin@nat@height\Gin@ury bp% + \advance\Gin@nat@height-\Gin@lly bp% + \Gin@nat@width\Gin@urx bp% + \advance\Gin@nat@width-\Gin@llx bp% + \Gin@req@sizes + \expandafter\ifx\csname Ginclude@#1\endcsname\relax + \Gin@drafttrue + \expandafter\ifx\csname Gread@#1\endcsname\relax + \@latex@error{Can not include graphics of type: #1}\@ehc + \global\expandafter\let\csname Gread@#1\endcsname\@empty + \fi + \fi + \leavevmode + \Gin@tag@struct@begin %NEW + \ifGin@draft + \hb@xt@\Gin@req@width{% + \vrule\hss + \vbox to \Gin@req@height{% + \hrule \@width \Gin@req@width + \vss + \edef\@tempa{#3}% + \rlap{ \ttfamily\expandafter\strip@prefix\meaning\@tempa}% + \vss + \hrule}% + \hss\vrule}% + \else + \@addtofilelist{#3}% + \ProvidesFile{#3}[Graphic file (type #1)]% + \setbox\z@\hbox{\csname Ginclude@#1\endcsname{#3}}% + \dp\z@\z@ + \ht\z@\Gin@req@height + \wd\z@\Gin@req@width + \Gin@tag@bbox@attribute %new + \box\z@ + \Gin@tag@struct@end %new + \fi} + } +\AddToHook{package/graphicx/after}[latex-lab] + { + \define@key{Gin}{alt} {\tl_set:Nx\l__tag_graphic_alt_tl{\text_purify:n{#1}}} + \define@key{Gin}{artifact}[] + { + \bool_set_true:N \l__tag_graphic_artifact_bool + \bool_set_false:N \l__tag_graphic_BBox_bool + } + \define@key{Gin}{actualtext} + { + \tl_set:Nx\l__tag_graphic_actual_tl{\text_purify:n{#1}} + \bool_set_false:N \l__tag_graphic_BBox_bool + } + \define@key{Gin}{correct-BBox} + { + \bool_set_true:N \l__tag_graphic_bboxcorr_bool + \seq_set_split:Nnn\l__tag_graphic_bboxcorr_seq{~}{#1~0pt~0pt~0pt~0pt} + } + \define@key{Gin}{tag} + { + \str_case:nnF {#1} + { + {artifact} + { + \bool_set_true:N \l__tag_graphic_artifact_bool + \bool_set_false:N \l__tag_graphic_BBox_bool + } + {false}{\tag_stop:} + } + {\tl_set:Nn\l__tag_graphic_struct_tl{#1}} + } + } +\AddToHook{package/graphics/after}[latex-lab] + {\RequirePackage{graphicx}} +\keys_define:nn{tag/picture} + { + ,alt .code:n = + {\tl_set:Nx\l__tag_graphic_alt_tl{\text_purify:n{#1}}} + ,artifact .code:n = + { + \bool_set_true:N \l__tag_graphic_artifact_bool + \bool_set_false:N \l__tag_graphic_BBox_bool + } + ,actualtext .code:n = + { + \tl_set:Nx\l__tag_graphic_actual_tl{\text_purify:n{#1}} + \bool_set_false:N \l__tag_graphic_BBox_bool + } + ,correct-BBox .code:n = + { + \bool_set_true:N \l__tag_graphic_bboxcorr_bool + \seq_set_split:Nnn\l__tag_graphic_bboxcorr_seq{~}{#1~0pt~0pt~0pt~0pt} + } + ,tag .code:n = + { + \str_case:nnF {#1} + { + {artifact} + { + \bool_set_true:N \l__tag_graphic_artifact_bool + \bool_set_false:N \l__tag_graphic_BBox_bool + } + {false}{\tag_stop:} + } + {\tl_set:Nn\l__tag_graphic_struct_tl{#1}} + } + } +\cs_new_protected:Npn \__tag_graphic_get_trim: + { + \legacy_if:nTF {Gin@clip} + { + \fp_zero:N\l__tag_graphic_trim_lx_fp + \fp_zero:N\l__tag_graphic_trim_ly_fp + \fp_zero:N\l__tag_graphic_trim_ux_fp + \fp_zero:N\l__tag_graphic_trim_uy_fp + } + { + \fp_set:Nn \l__tag_graphic_trim_lx_fp {\l__tag_graphic_scale_fp*\Gin@vllx} + \fp_set:Nn \l__tag_graphic_trim_ly_fp {\l__tag_graphic_scale_fp*\Gin@vlly} + \fp_set:Nn \l__tag_graphic_trim_ux_fp {\l__tag_graphic_scale_fp*\Gin@vurx} + \fp_set:Nn \l__tag_graphic_trim_uy_fp {\l__tag_graphic_scale_fp*\Gin@vury} + \cs_if_exist:NT \Gin@ollx + { + \fp_set:Nn \l__tag_graphic_trim_ux_fp {\l__tag_graphic_scale_fp* (\Gin@ourx-(\Gin@urx)) } + \fp_set:Nn \l__tag_graphic_trim_uy_fp {\l__tag_graphic_scale_fp* (\Gin@oury-(\Gin@ury)) } + } + } + } +\cs_new_protected:Npn \__tag_graphic_get_scale: + { + \fp_set:Nn \l__tag_graphic_scale_fp { \Gin@scalex } + } +\cs_new_protected:Npn \__tag_graphic_applyangle:nnnn #1#2#3#4 %lx,ly,ux,uy + { + \bool_lazy_and:nnT + {\cs_if_exist_p:N \Grot@angle } + {! \int_compare_p:nNn { \Grot@angle }={0}} + { + \fp_set:Nn \l__tag_graphic_sin_fp { sind(\Grot@angle) } + \fp_set:Nn \l__tag_graphic_cos_fp { cosd(\Grot@angle) } + \fp_set:Nn \l__tag_graphic_lx_fp {#1} + \fp_set:Nn \l__tag_graphic_ly_fp {#2} + \fp_set:Nn \l__tag_graphic_ux_fp {#3} + \fp_set:Nn \l__tag_graphic_uy_fp {#4} + \fp_set:Nn\l__tag_graphic_lxly_fp + { + -\l__tag_graphic_trim_lx_fp * \l__tag_graphic_cos_fp + +\l__tag_graphic_trim_ly_fp * \l__tag_graphic_sin_fp + } + \fp_set:Nn\l__tag_graphic_lxuy_fp + { + (-\l__tag_graphic_trim_lx_fp) * \l__tag_graphic_cos_fp + + + (\l__tag_graphic_uy_fp-\l__tag_graphic_ly_fp-\l__tag_graphic_trim_ly_fp) + * (-\l__tag_graphic_sin_fp) + } + \fp_set:Nn\l__tag_graphic_uxly_fp + { + (\l__tag_graphic_ux_fp-\l__tag_graphic_lx_fp-\l__tag_graphic_trim_lx_fp) + * \l__tag_graphic_cos_fp + + + (\l__tag_graphic_trim_ly_fp) * (\l__tag_graphic_sin_fp) + } + \fp_set:Nn\l__tag_graphic_uxuy_fp + { + (\l__tag_graphic_ux_fp-\l__tag_graphic_lx_fp-\l__tag_graphic_trim_lx_fp) + * \l__tag_graphic_cos_fp + + + (\l__tag_graphic_uy_fp-\l__tag_graphic_ly_fp-\l__tag_graphic_trim_ly_fp) + * (-\l__tag_graphic_sin_fp) + } + \tl_gset:Nx\g__tag_graphic_lx_tl + { + \fp_eval:n + { + min + ( + \l__tag_graphic_lxly_fp, + \l__tag_graphic_lxuy_fp, + \l__tag_graphic_uxly_fp, + \l__tag_graphic_uxuy_fp, + ) + +\l__tag_graphic_lx_fp + +\l__tag_graphic_trim_lx_fp + } + } + \tl_gset:Nx\g__tag_graphic_ux_tl + { + \fp_eval:n + { + max + ( + \l__tag_graphic_lxly_fp, + \l__tag_graphic_lxuy_fp, + \l__tag_graphic_uxly_fp, + \l__tag_graphic_uxuy_fp + ) + +\l__tag_graphic_lx_fp + +\l__tag_graphic_trim_lx_fp + } + } + \fp_set:Nn\l__tag_graphic_lxly_fp + { + -\l__tag_graphic_trim_lx_fp * \l__tag_graphic_sin_fp + -\l__tag_graphic_trim_ly_fp * \l__tag_graphic_cos_fp + } + \fp_set:Nn\l__tag_graphic_lxuy_fp + { + - \l__tag_graphic_trim_lx_fp * \l__tag_graphic_sin_fp + + + (\l__tag_graphic_uy_fp-\l__tag_graphic_ly_fp-\l__tag_graphic_trim_ly_fp) + * \l__tag_graphic_cos_fp + } + \fp_set:Nn\l__tag_graphic_uxly_fp + { + (\l__tag_graphic_ux_fp-\l__tag_graphic_lx_fp-\l__tag_graphic_trim_lx_fp) + * \l__tag_graphic_sin_fp + - \l__tag_graphic_trim_ly_fp * \l__tag_graphic_cos_fp + } + \fp_set:Nn\l__tag_graphic_uxuy_fp + { + (\l__tag_graphic_ux_fp-\l__tag_graphic_lx_fp-\l__tag_graphic_trim_lx_fp) + * \l__tag_graphic_sin_fp + + + (\l__tag_graphic_uy_fp-\l__tag_graphic_ly_fp-\l__tag_graphic_trim_ly_fp) + * \l__tag_graphic_cos_fp + } + \tl_gset:Nx\g__tag_graphic_ly_tl + { + \fp_eval:n + { + min + ( + \l__tag_graphic_lxly_fp, + \l__tag_graphic_lxuy_fp, + \l__tag_graphic_uxly_fp, + \l__tag_graphic_uxuy_fp + ) + + \l__tag_graphic_ly_fp + \l__tag_graphic_trim_ly_fp + } + } + \tl_gset:Nx\g__tag_graphic_uy_tl + { + \fp_eval:n + { + max + ( + \l__tag_graphic_lxly_fp, + \l__tag_graphic_lxuy_fp, + \l__tag_graphic_uxly_fp, + \l__tag_graphic_uxuy_fp, + ) + + \l__tag_graphic_ly_fp + \l__tag_graphic_trim_ly_fp + } + } + } + } +\cs_generate_variant:Nn\__tag_graphic_applyangle:nnnn {VVVV} +\cs_new_protected:Npn \__tag_graphic_applycorr:NNNN #1 #2 #3 #4 + { + \bool_if:NT\l__tag_graphic_bboxcorr_bool + { + \tl_set:Nx #1 + { + \fp_eval:n + { + #1 + + + \dim_to_decimal_in_bp:n {\seq_item:Nn \l__tag_graphic_bboxcorr_seq {1} } + } + } + \tl_set:Nx #2 + { + \fp_eval:n + { + #2 + + + \dim_to_decimal_in_bp:n {\seq_item:Nn \l__tag_graphic_bboxcorr_seq {2} } + } + } + \tl_set:Nx #3 + { + \fp_eval:n + { + #3 + + + \dim_to_decimal_in_bp:n {\seq_item:Nn \l__tag_graphic_bboxcorr_seq {3} } + } + } + \tl_set:Nx #4 + { + \fp_eval:n + { + #4 + + + \dim_to_decimal_in_bp:n {\seq_item:Nn \l__tag_graphic_bboxcorr_seq {4} } + } + } + } + } +\cs_new_protected:Npn \Gin@tag@bbox@attribute + { + \bool_lazy_all:nT + { + {\tag_if_active_p:} + {!\l__tag_graphic_artifact_bool} + {\l__tag_graphic_BBox_bool} + } + { + \fp_set:Nn \l__tag_graphic_scale_fp { \Gin@scalex } + \__tag_graphic_get_trim: + \int_gincr:N\g__tag_graphic_int + \tl_set:Nx\l__tag_graphic_currentlabel_tl {__tag_graphic_\int_use:N \g__tag_graphic_int} + \__tag_graphic_savepos:e { \l__tag_graphic_currentlabel_tl } + \tl_gset:Nx\g__tag_graphic_lx_tl + { + \dim_to_decimal_in_bp:n + { \__tag_ref_value:enn {\l__tag_graphic_currentlabel_tl}{xpos}{0}sp } + } + \tl_gset:Nx\g__tag_graphic_ly_tl + { + \dim_to_decimal_in_bp:n + { \__tag_ref_value:enn {\l__tag_graphic_currentlabel_tl}{ypos}{0}sp } + } + \tl_gset:Nx\g__tag_graphic_ux_tl + { + \fp_eval:n + { + \g__tag_graphic_lx_tl + + + \dim_to_decimal_in_bp:n { \Gin@req@width } + } + } + \tl_gset:Nx\g__tag_graphic_uy_tl + { + \fp_eval:n + { + \g__tag_graphic_ly_tl + + + \dim_to_decimal_in_bp:n { \Gin@req@height } + } + } + \legacy_if:nF {Gin@clip} + { + \tl_gset:Nx\g__tag_graphic_ux_tl + { + \fp_eval:n + { + \g__tag_graphic_ux_tl + + + \l__tag_graphic_trim_ux_fp + } + } + \tl_gset:Nx\g__tag_graphic_lx_tl + { + \fp_eval:n + { + \g__tag_graphic_lx_tl + - + \l__tag_graphic_trim_lx_fp + } + } + \tl_gset:Nx\g__tag_graphic_uy_tl + { + \fp_eval:n + { + \g__tag_graphic_uy_tl + + + \l__tag_graphic_trim_uy_fp + } + } + \tl_gset:Nx\g__tag_graphic_ly_tl + { + \fp_eval:n + { + \g__tag_graphic_ly_tl + - + \l__tag_graphic_trim_ly_fp + } + } + } + \__tag_graphic_applyangle:VVVV + \g__tag_graphic_lx_tl + \g__tag_graphic_ly_tl + \g__tag_graphic_ux_tl + \g__tag_graphic_uy_tl + \__tag_graphic_applycorr:NNNN + \g__tag_graphic_lx_tl + \g__tag_graphic_ly_tl + \g__tag_graphic_ux_tl + \g__tag_graphic_uy_tl + \bool_if:NT\l__tag_graphic_debug_bool + { + \__tag_graphic_show_bbox:VVVVne + \g__tag_graphic_lx_tl + \g__tag_graphic_ly_tl + \g__tag_graphic_ux_tl + \g__tag_graphic_uy_tl + {red} + {\int_use:N\g__tag_graphic_int} + } + \__tag_prop_gput:cnx + { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_prop } + { A } + { + << + /O /Layout /BBox~ + [ + \g__tag_graphic_lx_tl\c_space_tl + \g__tag_graphic_ly_tl\c_space_tl + \g__tag_graphic_ux_tl\c_space_tl + \g__tag_graphic_uy_tl + ] + >> + } + } + } +\newcommand\picture@tag@bbox@attribute + { + \bool_lazy_all:nT + { + {\tag_if_active_p:} + {!\l__tag_graphic_artifact_bool} + {\l__tag_graphic_BBox_bool} + } + { + \int_gincr:N\g__tag_graphic_int + \tl_set:Nx\l__tag_graphic_currentlabel_tl {__tag_graphic_\int_use:N \g__tag_graphic_int} + \__tag_graphic_savepos:e { \l__tag_graphic_currentlabel_tl } + \tl_gset:Nx \g__tag_graphic_lx_tl + { + \dim_to_decimal_in_bp:n + { \__tag_ref_value:enn {\l__tag_graphic_currentlabel_tl}{xpos}{0}sp } + } + \tl_gset:Nx \g__tag_graphic_ly_tl + { + \dim_to_decimal_in_bp:n + { \__tag_ref_value:enn {\l__tag_graphic_currentlabel_tl}{ypos}{0}sp - \dp\@picbox } + } + \tl_gset:Nx \g__tag_graphic_ux_tl + { + \dim_to_decimal_in_bp:n + { + \g__tag_graphic_lx_tl bp + \wd\@picbox + } + } + \tl_gset:Nx \g__tag_graphic_uy_tl + { + \dim_to_decimal_in_bp:n + { + \g__tag_graphic_ly_tl bp + \ht\@picbox + \dp\@picbox + } + } + \__tag_graphic_applycorr:NNNN + \g__tag_graphic_lx_tl + \g__tag_graphic_ly_tl + \g__tag_graphic_ux_tl + \g__tag_graphic_uy_tl + \bool_if:NT\l__tag_graphic_debug_bool + { + \__tag_graphic_show_bbox:VVVVne + \g__tag_graphic_lx_tl + \g__tag_graphic_ly_tl + \g__tag_graphic_ux_tl + \g__tag_graphic_uy_tl + {red} + {\int_use:N\g__tag_graphic_int} + } + \__tag_prop_gput:cnx + { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_prop } + { A } + { + << + /O /Layout /BBox~ + [ + \g__tag_graphic_lx_tl\c_space_tl + \g__tag_graphic_ly_tl\c_space_tl + \g__tag_graphic_ux_tl\c_space_tl + \g__tag_graphic_uy_tl + ] + >> + } + } + } + +\RenewDocumentCommand\picture{O{}m} + { + \leavevmode + \keys_set:nn{tag/picture}{#1} % + \tl_set:Nn\l__tag_graphic_alt_dflt_tl {picture~environment} + \pictur@#2 + } +\def\@picture(#1,#2)(#3,#4){% + \@defaultunitsset\@picht{#2}\unitlength + \@defaultunitsset\@tempdimc{#1}\unitlength + \Gin@tag@struct@begin + \setbox\@picbox\hb@xt@\@tempdimc\bgroup + \tag_stop: %do not tag inside the picture box + \@defaultunitsset\@tempdimc{#3}\unitlength + \hskip -\@tempdimc + \@defaultunitsset\@tempdimc{#4}\unitlength + \lower\@tempdimc\hbox\bgroup + \ignorespaces} +\def\endpicture{% + \egroup\hss\egroup + \ht\@picbox\@picht\dp\@picbox\z@ + \picture@tag@bbox@attribute + \mbox{\box\@picbox} + \Gin@tag@struct@end} +\cs_new_protected:Npn \__tag_graphic_show_bbox:nnnnnn #1#2#3#4#5#6%#5 color, #6 graphic + { + \iow_log:n {tag/graphic~debug:~BBox~of~graphics~#6~is~#1~#2~#3~#4} + \hook_gput_code:nnn + {shipout/foreground} + {tag/graphic} + { + \int_compare:nNnT + {\g_shipout_readonly_int} + = + {\__tag_ref_value:enn{__tag_graphic_#6}{abspage}{0}} + { + \put + (#1 bp,\dim_eval:n{-\paperheight + \dim_eval:n{#2 bp}}) + { + \opacity_select:n{0.5}\color_select:n{#5} + \rule + {\dim_eval:n {#3 bp-\dim_eval:n{#1 bp}}} + {\dim_eval:n {#4 bp-\dim_eval:n{#2 bp}}} + } + } + } + } + \cs_generate_variant:Nn \__tag_graphic_show_bbox:nnnnnn {VVVVne} + + +\endinput +%% +%% End of file `latex-lab-testphase-graphic.sty'. diff --git a/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-minipage.sty b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-minipage.sty new file mode 100644 index 00000000000..b6f6fe4357a --- /dev/null +++ b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-minipage.sty @@ -0,0 +1,120 @@ +%% +%% This is file `latex-lab-testphase-minipage.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% latex-lab-minipage.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% Copyright 2021-2023 LaTeX Project +%% +%% This file was generated from file(s) of the `LaTeX-lab Bundle'. +%% ------------------------------------------------------------------------------------ +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2008 or later. +%% +%% This file may only be distributed together with a copy of the LaTeX +%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle' +%% without such generated files. +%% +%% The newest sources can be found below +%% +%% https://github.com/latex3/latex2e/required/latex-lab +%% +%% where one can also log issues in case there are any. +%% +%% +%% File: latex-lab-minipage.dtx (C) Copyright 2023 LaTeX Project + +\def\ltlistsversion{v0.81} +\def\ltlistsdate{2023/05/10} + +\ProvidesExplPackage {latex-lab-testphase-minipage} {2023-05-10} {0.81} + {Code related to the tagging of minipages and parboxes} + +\def\@kernel@init@minipage{} +\def\@kernel@init@parbox{} +\def\@kernel@before@minipage{} +\def\@kernel@after@minipage{} +\def\@kernel@before@parbox{} +\def\@kernel@after@parbox{} +\def\@iiiminipage#1#2[#3]#4{% + \@kernel@init@minipage + \leavevmode + \@pboxswfalse + \setlength\@tempdima{#4}% + \def\@mpargs{{#1}{#2}[#3]{#4}}% + \@kernel@before@minipage% new + \setbox\@tempboxa\vbox\bgroup + \color@begingroup + \hsize\@tempdima + \textwidth\hsize \columnwidth\hsize + \@parboxrestore + \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@ + \let\@footnotetext\@mpfootnotetext + \let\@listdepth\@mplistdepth \@mplistdepth\z@ + \@minipagerestore + \@setminipage} +\def\endminipage{% + \par + \unskip + \ifvoid\@mpfootins\else + \vskip\skip\@mpfootins + \normalcolor + \footnoterule + \unvbox\@mpfootins + \fi + \@minipagefalse %% added 24 May 89 + \color@endgroup + \egroup + \tag_stop:n{minipage} + \expandafter\@iiiparbox\@mpargs{\unvbox\@tempboxa}% + \tag_start:n{minipage} + \@kernel@after@minipage%new end ... + } +\long\def\@iiiparbox#1#2[#3]#4#5{% + \@kernel@init@parbox + \leavevmode + \@pboxswfalse + \setlength\@tempdima{#4}% + \@kernel@before@parbox% new + \@begin@tempboxa\vbox{\hsize\@tempdima\@parboxrestore#5\@@par}% + \ifx\relax#2\else + \setlength\@tempdimb{#2}% + \edef\@parboxto{to\the\@tempdimb}% + \fi + \if#1b\vbox + \else\if #1t\vtop + \else\ifmmode\vcenter + \else\@pboxswtrue $\vcenter + \fi\fi\fi + \@parboxto{\let\hss\vss\let\unhbox\unvbox + \csname bm@#3\endcsname}% + \if@pboxsw \m@th$\fi + \@end@tempboxa% + \@kernel@after@parbox%new end + } +\tl_new:N \l__ltboxes_tag_tl +\tl_set:Nn \l__ltboxes_tag_tl {Div} +\cs_set_protected:Npn\@kernel@before@minipage + { + \tag_mc_end_push:\tag_struct_end: + \tag_struct_begin:n{tag=\l__ltboxes_tag_tl}} +\cs_set_protected:Npn\@kernel@after@minipage + {\tag_struct_end:\tag_struct_begin:n{tag=\l__tag_para_tag_tl}\tag_mc_begin_pop:n{}} +\cs_set_protected:Npn\@kernel@before@parbox + {\tag_mc_end_push:\tag_struct_end:\tag_struct_begin:n{tag=\l__ltboxes_tag_tl}} +\cs_set_protected:Npn\@kernel@after@parbox + {\tag_struct_end:\tag_struct_begin:n{tag=\l__tag_para_tag_tl}\tag_mc_begin_pop:n{}} + +\endinput +%% +%% End of file `latex-lab-testphase-minipage.sty'. diff --git a/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-new-or-1.sty b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-new-or-1.sty index 879aee38f3a..a0c12a56ee0 100644 --- a/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-new-or-1.sty +++ b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-new-or-1.sty @@ -32,7 +32,7 @@ %% where one can also log issues in case there are any. %% %% -%% File: latex-lab-new-or-1.dtx (C) Copyright 2020-2022 Frank Mittelbach +%% File: latex-lab-new-or-1.dtx (C) Copyright 2020-2023 Frank Mittelbach \ProvidesPackage{latex-lab-testphase-new-or-1} [2022-11-94 v0.1a Temporary output patches for tagging and better link support] \RequirePackage{etoolbox} @@ -65,9 +65,9 @@ \AddToHook{package/multicol/after} {% multicol needs later loading \patchcmd\page@sofar - {\setbox\z@\hbox{p}\global\dimen\tw@\dp\z@}% + {\global\dimen\tw@\dp\z@}% {% - \setbox\z@\hbox{p}\global\dimen\tw@\dp\z@ + \global\dimen\tw@\dp\z@ \@mult@ptagging@hook }% {\typeout{Patching \string\page@sofar\space for tagging}}{\PATCHerror}% diff --git a/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-sec-tagging.sty b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-sec.sty index dc5b0170dd0..37d260300ad 100644 --- a/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-sec-tagging.sty +++ b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-sec.sty @@ -1,10 +1,10 @@ %% -%% This is file `latex-lab-testphase-sec-tagging.sty', +%% This is file `latex-lab-testphase-sec.sty', %% generated with the docstrip utility. %% %% The original source files were: %% -%% latex-lab-sec-tagging.dtx (with options: `package') +%% latex-lab-sec.dtx (with options: `package') %% %% This is a generated file. %% @@ -32,8 +32,8 @@ %% where one can also log issues in case there are any. %% %% -%% File: sec-tagging.dtx (C) Copyright 2022-2023 LaTeX Project -\ProvidesExplPackage {latex-lab-testphase-sec-tagging} {2022-10-25} {0.8} +%% File: latex-lab-sec.dtx (C) Copyright 2022-2023 LaTeX Project +\ProvidesExplPackage {latex-lab-testphase-sec} {2023-05-20} {0.81} {Code related to the tagging of sectioning commands} \RequirePackage{latex-lab-kernel-changes} \seq_new:N \g__tag_sec_stack_seq @@ -48,7 +48,7 @@ tag= {\int_compare:nNnTF {#1}={-1}{Part}{Sect}} ,#2 } - \seq_gpush:Nx \g__tag_sec_stack_seq {{\g__tag_struct_tag_tl}{#1}} + \seq_gpush:Nx \g__tag_sec_stack_seq {{\g__tag_struct_tag_tl}{\int_eval:n{#1}}} } \msg_new:nnn { tag } {wrong-sect-nesting} { @@ -142,8 +142,8 @@ { \bool_if:NT\l__tag_sec_Sect_bool { - \__tag_sec_end:n {\use:c{toclevel@#1}+0} - \__tag_sec_begin:nn {\use:c{toclevel@#1}+0}{tag=Sect} + \__tag_sec_end:n {\cs_if_exist_use:c{toclevel@#1}+0} + \__tag_sec_begin:nn {\cs_if_exist_use:c{toclevel@#1}+0}{tag=Sect} } \tl_set:Nn\l__tag_para_tag_tl{#1} } @@ -152,7 +152,7 @@ ,restore-para .code:n = {\__tag_setup_restore_para_default:} ,sec-stop .code:n = { - \par\__tag_sec_end:n {\use:c{toclevel@#1}+0} + \par\__tag_sec_end:n {\cs_if_exist_use:c{toclevel@#1}+0} } ,sec-stop .value_required:n = true ,sec-add-grouping .bool_set:N = \l__tag_sec_Sect_bool @@ -409,4 +409,4 @@ \endinput %% -%% End of file `latex-lab-testphase-sec-tagging.sty'. +%% End of file `latex-lab-testphase-sec.sty'. diff --git a/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-toc-tagging.sty b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-toc.sty index 5bb2735075f..46306b33c87 100644 --- a/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-toc-tagging.sty +++ b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-toc.sty @@ -1,5 +1,5 @@ %% -%% This is file `latex-lab-testphase-toc-tagging.sty', +%% This is file `latex-lab-testphase-toc.sty', %% generated with the docstrip utility. %% %% The original source files were: @@ -35,10 +35,10 @@ %% where one can also log issues in case there are any. %% %% -%% File: toc-tagging-functions.dtx (C) Copyright 2022-2023 LaTeX Project -\ProvidesExplPackage {latex-lab-testphase-toc-tagging} {2023-02-10} {0.81} +%% File: latex-lab-toc-tagging-functions.dtx (C) Copyright 2022-2023 LaTeX Project +\ProvidesExplPackage {latex-lab-testphase-toc} {2023-05-20} {0.82} { commands related to the tagging of toc-like lists} -%% File: toc-kernel-functions.dtx (C) Copyright 2022-2023 LaTeX Project +%% File: latex-lab-toc-kernel-functions.dtx (C) Copyright 2022-2023 LaTeX Project \RequirePackage{latex-lab-kernel-changes} \def\@contentsline@cfgpoint@before#1#2#3#4{} \def\@contentsline@cfgpoint@after#1#2#3#4{} @@ -261,7 +261,7 @@ \fi} } -%% File: toc-tagging-functions.dtx (C) Copyright 2022-2023 LaTeX Project +%% File: latex-lab-toc-tagging-functions.dtx (C) Copyright 2022-2023 LaTeX Project \tl_new:N \l__tag_toc_tmpa_tl \AddToHook{cmd/refstepcounter/after} { @@ -426,9 +426,9 @@ \tag_struct_end: \tag_mc_begin:n{tag=Reference}} \def\@dottedtocline@cfgpoint@leaders#1{% - \tag_mc_begin:n{artifact}\nobreak#1\nobreak\tag_mc_end:} + \tag_mc_begin:n{artifact}\tag_stop:n{leaders}\nobreak#1\nobreak\tag_start:n{leaders}\tag_mc_end:} -%% File: toc-hyperref-changes.dtx (C) Copyright 2022-2023 LaTeX Project +%% File: latex-lab-toc-hyperref-changes.dtx (C) Copyright 2022-2023 LaTeX Project \def\hyper@nopatch@toc{} \AddToHook{package/hyperref/after} { @@ -562,4 +562,4 @@ } \endinput %% -%% End of file `latex-lab-testphase-toc-tagging.sty'. +%% End of file `latex-lab-testphase-toc.sty'. diff --git a/Master/texmf-dist/tex/latex-dev/latex-lab/minipage-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex-dev/latex-lab/minipage-latex-lab-testphase.ltx new file mode 100644 index 00000000000..9c0a803cb68 --- /dev/null +++ b/Master/texmf-dist/tex/latex-dev/latex-lab/minipage-latex-lab-testphase.ltx @@ -0,0 +1,46 @@ +%% +%% This is file `minipage-latex-lab-testphase.ltx', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% latex-lab-minipage.dtx (with options: `latex-lab') +%% +%% This is a generated file. +%% +%% Copyright 2021-2023 LaTeX Project +%% +%% This file was generated from file(s) of the `LaTeX-lab Bundle'. +%% ------------------------------------------------------------------------------------ +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2008 or later. +%% +%% This file may only be distributed together with a copy of the LaTeX +%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle' +%% without such generated files. +%% +%% The newest sources can be found below +%% +%% https://github.com/latex3/latex2e/required/latex-lab +%% +%% where one can also log issues in case there are any. +%% +%% +%% File: latex-lab-minipage.dtx (C) Copyright 2023 LaTeX Project + +\def\ltlistsversion{v0.81} +\def\ltlistsdate{2023/05/10} + + +\ProvidesFile{minipage-latex-lab-testphase.ltx} + [2022-10-26 v0.8 code related to the tagging of sectioning commands] +\RequirePackage{latex-lab-testphase-minipage} +\endinput +%% +%% End of file `minipage-latex-lab-testphase.ltx'. diff --git a/Master/texmf-dist/tex/latex-dev/latex-lab/phase-III-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex-dev/latex-lab/phase-III-latex-lab-testphase.ltx index 88daa669247..40218fe24c2 100644 --- a/Master/texmf-dist/tex/latex-dev/latex-lab/phase-III-latex-lab-testphase.ltx +++ b/Master/texmf-dist/tex/latex-dev/latex-lab/phase-III-latex-lab-testphase.ltx @@ -38,8 +38,11 @@ [2023-03-06 v0.1a latex-lab wrapper phase-III] \input{phase-II-latex-lab-testphase.ltx} \RequirePackage{latex-lab-testphase-block-tagging} -\RequirePackage{latex-lab-testphase-sec-tagging} -\RequirePackage{latex-lab-testphase-toc-tagging} +\RequirePackage{latex-lab-testphase-sec} +\RequirePackage{latex-lab-testphase-toc} +\RequirePackage{latex-lab-testphase-minipage} +\RequirePackage{latex-lab-testphase-graphic} +\RequirePackage{latex-lab-testphase-float} \endinput %% %% End of file `phase-III-latex-lab-testphase.ltx'. diff --git a/Master/texmf-dist/tex/latex-dev/latex-lab/sec-tagging-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex-dev/latex-lab/sec-tagging-latex-lab-testphase.ltx index 9156d40e10b..cf6557fa41e 100644 --- a/Master/texmf-dist/tex/latex-dev/latex-lab/sec-tagging-latex-lab-testphase.ltx +++ b/Master/texmf-dist/tex/latex-dev/latex-lab/sec-tagging-latex-lab-testphase.ltx @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% latex-lab-sec-tagging.dtx (with options: `latex-lab') +%% latex-lab-sec.dtx (with options: `latex-lab') %% %% This is a generated file. %% @@ -32,11 +32,11 @@ %% where one can also log issues in case there are any. %% %% -%% File: sec-tagging.dtx (C) Copyright 2022-2023 LaTeX Project +%% File: latex-lab-sec.dtx (C) Copyright 2022-2023 LaTeX Project \ProvidesFile{sec-tagging-latex-lab-testphase.ltx} - [2023-02-12 v0.81 code related to the tagging of sectioning commands] -\RequirePackage{latex-lab-testphase-sec-tagging} + [2023-05-20 v0.82 code related to the tagging of sectioning commands] +\RequirePackage{latex-lab-testphase-sec} \endinput %% %% End of file `sec-tagging-latex-lab-testphase.ltx'. diff --git a/Master/texmf-dist/tex/latex-dev/latex-lab/toc-tagging-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex-dev/latex-lab/toc-tagging-latex-lab-testphase.ltx index e5365378026..2ec61214410 100644 --- a/Master/texmf-dist/tex/latex-dev/latex-lab/toc-tagging-latex-lab-testphase.ltx +++ b/Master/texmf-dist/tex/latex-dev/latex-lab/toc-tagging-latex-lab-testphase.ltx @@ -32,12 +32,12 @@ %% where one can also log issues in case there are any. %% %% -%% File: toc-kernel-functions.dtx (C) Copyright 2022-2023 LaTeX Project +%% File: latex-lab-toc-kernel-functions.dtx (C) Copyright 2022-2023 LaTeX Project \ProvidesFile{toc-tagging-latex-lab-testphase.ltx} - [2022-10-26 v0.8 code related to the tagging of toc and similar lists] + [2023-05-20 v0.81 code related to the tagging of toc and similar lists] -\RequirePackage{latex-lab-testphase-toc-tagging} +\RequirePackage{latex-lab-testphase-toc} \endinput %% |