diff options
author | Norbert Preining <norbert@preining.info> | 2023-08-08 03:00:52 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-08-08 03:00:52 +0000 |
commit | 313a3ccce8935aa26c29f2e430042cffee435454 (patch) | |
tree | 4538a4d48be5143222aea6ad75a473938e243c55 /macros/latex/contrib/tagpdf/ex-patch-list.tex | |
parent | aebf6a3b57eda6e22a8e5fb93958edbf6ad1b551 (diff) |
CTAN sync 202308080300
Diffstat (limited to 'macros/latex/contrib/tagpdf/ex-patch-list.tex')
-rw-r--r-- | macros/latex/contrib/tagpdf/ex-patch-list.tex | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/macros/latex/contrib/tagpdf/ex-patch-list.tex b/macros/latex/contrib/tagpdf/ex-patch-list.tex deleted file mode 100644 index 30448c6a80..0000000000 --- a/macros/latex/contrib/tagpdf/ex-patch-list.tex +++ /dev/null @@ -1,101 +0,0 @@ -% !Mode:: "TeX:DE:UTF-8:Main" - -% This example shows how one can patch lists command -% it is based on enumitem - -% Pay attention to casing. Li/LI, Lbody/Lbody are different. - -% It doesn't test nesting! - -% We are using \DocumentMetadata -% This requires a new pdfmanagement and/or latex-dev! -% Older systems should use \DeclareDocumentMetadata -\IfFormatAtLeastTF{2022-06-01}{} - {\RequirePackage{pdfmanagement-testphase}} -\DocumentMetadata{pdfversion=1.7,uncompress,testphase=tagpdf} - - -\documentclass{scrbook} -\usepackage[english]{babel} - -\usepackage{iftex} -\ifluatex - \usepackage{fontspec} - \usepackage{luacode} -\else - \usepackage[T1]{fontenc} -\fi - - - -\tagpdfsetup - { - tabsorder=structure, - } - -\usepackage{lipsum}%\textheight3cm - -\usepackage{enumitem,xpatch} - -% At first we add to the begin/end hooks the structure commands. -% To avoid problems with nested paragraphs we force a new paragraph for now. -% Real code should avoid that! -\AddToHook{env/itemize/begin}{\par\tagstructbegin{tag=L}}%\par is needed to close the paragraph before. -\AddToHook{env/itemize/end}{\par\tagstructend\tagstructend\tagstructend}%LBody,LI,L -\AddToHook{env/enumerate/begin}{\par\tagstructbegin{tag=L}} -\AddToHook{env/enumerate/end}{\par\tagstructend\tagstructend\tagstructend}%LBody,LI,L -\AddToHook{env/description/begin}{\par\tagstructbegin{tag=L}} -\AddToHook{env/description/end}{\par\tagstructend\tagstructend\tagstructend}%LBody,LI,L - -\makeatletter -\ExplSyntaxOn -%We detect is this is the first or a follow up item where we have to end a structure first: -\newcommand\tag@enit@format@preset[1]{% - \str_if_eq:eeTF { \prop_item:cn { g__tag_struct_\g__tag_struct_stack_current_tl _prop }{S} }{/L} - { - %\typeout{BEGIN~OF~LIST} - } - {%\typeout{NEXT ITEM} - \tagstructend\tagstructend} % for the LBody/LI - \tagstructbegin{tag=LI} - \tagstructbegin{tag=Lbl} - \tagmcbegin{tag=Lbl} - #1 - \tagmcend - \tagstructend - \tagstructbegin{tag=LBody} - } - -\ExplSyntaxOff - -\xpatchcmd\enit@preset{\@firstofone}{\tag@enit@format@preset}{}{\fail} -%close mc from paratagging and reopen ... -\xpatchcmd\@item{\box\@labels}{\tagmcend \box\@labels \tagmcbegin{tag=P}}{}{\fail} - -\makeatother - - - -\begin{document} -%I don't want to handle pagestyles, so set everything to empty: -\pagestyle{empty}\renewcommand\chapterpagestyle{empty} - - - -\begin{itemize} -\item Ducks say quack -\item Marmots say something Parmotlike -\end{itemize} - -\begin{enumerate} -\item The highest pass is the Col de l'Iseran. -\item The second highest pass is the Passo dello Stelvio. -\end{enumerate} - -\begin{description} -\item[ducks] yellow -\item[marmots] brown -\end{description} - - -\end{document}
\ No newline at end of file |