| 1 |
% \iffalse meta-comment |
| 2 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3 |
% memoize-ext.dtx |
| 4 |
% Additions and changes Copyright (C) 2024-2026 Clea F. Rees. |
| 5 |
% Code from skeleton.dtx Copyright (C) 2015-2024 Scott Pakin (see below). |
| 6 |
% |
| 7 |
% This work may be distributed and/or modified under the |
| 8 |
% conditions of the LaTeX Project Public License, either version 1.3c |
| 9 |
% of this license or (at your option) any later version. |
| 10 |
% The latest version of this license is in |
| 11 |
% https://www.latex-project.org/lppl.txt |
| 12 |
% and version 1.3c or later is part of all distributions of LaTeX |
| 13 |
% version 2008-05-04 or later. |
| 14 |
% |
| 15 |
% This work has the LPPL maintenance status 'muaintained'. |
| 16 |
% |
| 17 |
% The Current Maintainer of this work is Clea F. Rees. |
| 18 |
% |
| 19 |
% This work consists of all files listed in manifest.txt. |
| 20 |
% |
| 21 |
% The file memoize-ext.dtx is a derived work under the terms of the |
| 22 |
% LPPL. It is based on version 2.4 of skeleton.dtx which is part of |
| 23 |
% dtxtut by Scott Pakin. A copy of dtxtut, including the |
| 24 |
% unmodified version of skeleton.dtx is available from |
| 25 |
% https://www.ctan.org/pkg/dtxtut and released under the LPPL. |
| 26 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 27 |
% \fi |
| 28 |
% |
| 29 |
% \iffalse |
| 30 |
%<*driver> |
| 31 |
% ^^A ref. ateb Max Chernoff: https://tex.stackexchange.com/a/723294/ |
| 32 |
\def\MyMakePrivateLetters{\makeatletter\ExplSyntaxOn\endlinechar13} |
| 33 |
\GetIdInfo $Id: memoize-ext.dtx 11815 2026-03-25 19:50:49Z cfrees $ {Extensions for Memoize} |
| 34 |
\ProvidesExplFile{\ExplFileName}{\ExplFileDate}{v0.3.5 \ExplFileVersion}{\ExplFileDescription} |
| 35 |
\ExplSyntaxOff |
| 36 |
\documentclass[11pt,british]{ltxdoc} |
| 37 |
\usepackage{memoize-ext} |
| 38 |
\def\memoizeextdocbase{memoize-ext} |
| 39 |
\EnableCrossrefs |
| 40 |
\CodelineIndex |
| 41 |
\RecordChanges |
| 42 |
% ^^A \OnlyDescription |
| 43 |
\DoNotIndex{\verb,} |
| 44 |
\usepackage{babel} |
| 45 |
\usepackage{fancyhdr} |
| 46 |
\usepackage[plain]{fancyref} |
| 47 |
% ^^A \usepackage{fixfoot} |
| 48 |
% ^^A \usepackage{array,tabularx} |
| 49 |
% ^^A \usepackage{longtable} |
| 50 |
% ^^A \usepackage{enumitem} |
| 51 |
% ^^A \usepackage[referable]{threeparttablex} |
| 52 |
% ^^A \makeatletter |
| 53 |
% ^^A \def\TPT@measurement{% ateb David Carlisle: https://tex.stackexchange.com/a/370691/ |
| 54 |
% ^^A \ifdim\wd\@tempboxb<\TPTminimum |
| 55 |
% ^^A \hsize \TPTminimum |
| 56 |
% ^^A \else |
| 57 |
% ^^A \hsize\wd\@tempboxb |
| 58 |
% ^^A \fi |
| 59 |
% ^^A \xdef\TPT@hsize{\hsize\the\hsize \noexpand\@parboxrestore}\TPT@hsize |
| 60 |
% ^^A \ifx\TPT@docapt\@undefined\else |
| 61 |
% ^^A \TPT@docapt \vskip.2\baselineskip |
| 62 |
% ^^A \fi \par |
| 63 |
% ^^A \dimen@\dp\@tempboxb % new |
| 64 |
% ^^A \box\@tempboxb |
| 65 |
% ^^A \ifvmode \prevdepth\dimen@ \fi% was \z@ not \dimen@ |
| 66 |
% ^^A } |
| 67 |
% ^^A \renewlist{tablenotes}{enumerate}{1} |
| 68 |
% ^^A \setlist[tablenotes]{label=\tnote{\alph*},ref=\alph*,itemsep=\z@,topsep=\z@skip,partopsep=\z@skip,parsep=\z@,itemindent=\z@,labelindent=\tabcolsep,labelsep=.2em,leftmargin=*,align=left,before={\unskip\medskip\footnotesize}} |
| 69 |
% ^^A \makeatother |
| 70 |
% ^^A \usepackage{booktabs} |
| 71 |
% ^^A \usepackage{multirow} |
| 72 |
\usepackage{xcolor} |
| 73 |
\usepackage{xurl} |
| 74 |
% ^^A \urlstyle{tt} |
| 75 |
\urlstyle{sf} |
| 76 |
\usepackage[tt={mono,lining,tabular},sf={lining,prop},rm={oldstyle,prop}]{cfr-lm} |
| 77 |
\usepackage{microtype} |
| 78 |
\usepackage[a4paper,headheight=14pt,marginparwidth=45mm,hmarginratio=4:1,vscale=.8,hscale=.7,verbose]{geometry} % use 14pt for 11pt text, 15pt for 12pt text |
| 79 |
% ^^A addaswyd o forest-ext.dtx |
| 80 |
\newlength\tewadjust |
| 81 |
\newlength\doctemplgth |
| 82 |
\AddToHook {begindocument/end}[.] |
| 83 |
{% |
| 84 |
\setlength\tewadjust{% |
| 85 |
\dimeval{% |
| 86 |
\marginparwidth+\marginparsep-\paperwidth+\textwidth+\oddsidemargin+1in |
| 87 |
}% |
| 88 |
}% |
| 89 |
\setlength\doctemplgth{0pt}% |
| 90 |
\newgeometry{% |
| 91 |
headheight=14pt,scale=.8,marginparwidth=0pt,marginparsep=0pt, |
| 92 |
}% |
| 93 |
\savegeometry{safonol}% |
| 94 |
\fancyheadoffset[lh]{0pt}% ^^A REQUIRED - do NOT remove this line!! |
| 95 |
\pagenumbering{arabic}% |
| 96 |
} |
| 97 |
\newcommand \twmarg {% |
| 98 |
\restoregeometry |
| 99 |
\fancyheadoffset[lh]{\tewadjust}% |
| 100 |
} |
| 101 |
\newcommand \twreg {% |
| 102 |
\loadgeometry{safonol}% |
| 103 |
\fancyheadoffset[lh]{0pt}% ^^A REQUIRED - do NOT remove this line!! |
| 104 |
} |
| 105 |
\usepackage{csquotes} |
| 106 |
\MakeAutoQuote{‘}{’} |
| 107 |
\MakeAutoQuote*{“}{”} |
| 108 |
% ^^A copïwyd o forest-ext.dtx |
| 109 |
\usepackage[citestyle=authoryear-comp,bibstyle=authoryear,mergedate=basic,isbn=false,url=true,sortcites=true,backend=biber,mincrossrefs=6]{biblatex} |
| 110 |
\DeclareFieldFormat{eprint:ctan}{% |
| 111 |
\mkbibacro{CTAN}\addcolon\space |
| 112 |
\ifhyperref |
| 113 |
{\href{https://www.ctan.org/pkg/#1}{\nolinkurl{#1}}} |
| 114 |
{\nolinkurl{#1}}% |
| 115 |
} |
| 116 |
\DeclareFieldAlias{eprint:CTAN}{eprint:ctan} |
| 117 |
% ^^A \bibliography{abbrv, authors, journals-series, pub, lleoedd, ref} |
| 118 |
\bibliography{memoize-ext_biber}% ^^A generate for upload (gweler uchod) |
| 119 |
% ^^A \usepackage{minted} |
| 120 |
\usepackage{hypdoc}% ateb Ulrike Fischer: https://tex.stackexchange.com/a/695555/ |
| 121 |
\usepackage{bookmark} |
| 122 |
\hypersetup{% |
| 123 |
colorlinks=true, |
| 124 |
citecolor={moss}, |
| 125 |
extension=pdf, |
| 126 |
linkcolor={strawberry}, |
| 127 |
linktocpage=true, |
| 128 |
pdfcreator={TeX}, |
| 129 |
pdfproducer={pdfeTeX}, |
| 130 |
urlcolor={blueberry}% |
| 131 |
} |
| 132 |
\makeatletter |
| 133 |
\setcounter{IndexColumns}{2} |
| 134 |
\IndexMin=\dimexpr 0.3\textheight\relax |
| 135 |
\defbibheading{bibliography}[\refname]{%^^A |
| 136 |
\section*{#1}%^^A |
| 137 |
\markboth{#1}{}} |
| 138 |
\newcommand\orig@xobey@sp{} |
| 139 |
\newcommand\permissivelines{% |
| 140 |
\def\@xobeysp{\leavevmode\penalty100\ }% |
| 141 |
} |
| 142 |
\newcommand\strictlines{% |
| 143 |
\let\@xobey@sp\orig@xobey@sp |
| 144 |
} |
| 145 |
\AddToHook{begindocument}[memoizeextdoc]{% |
| 146 |
\let\orig@xobey@sp\@xobey@sp |
| 147 |
\addtocontents{toc}{% |
| 148 |
\tlstyle |
| 149 |
}% |
| 150 |
} |
| 151 |
\def\section{% |
| 152 |
\@startsection{section}{1}{\z@} |
| 153 |
{-3.5ex\@plus -1ex\@minus -.2ex} |
| 154 |
{2.3ex\@plus .2ex}{\normalfont\sffamily\Large}% |
| 155 |
} |
| 156 |
\renewcommand*\l@section[2]{% |
| 157 |
\ifnum \c@tocdepth >\z@ |
| 158 |
\addpenalty\@secpenalty |
| 159 |
\addvspace{1.0em \@plus\p@}% |
| 160 |
\setlength\@tempdima{1.5em}% |
| 161 |
\begingroup |
| 162 |
\leftskip 1.5em\relax |
| 163 |
\parindent 1.5em\relax |
| 164 |
\@afterindenttrue |
| 165 |
\rightskip \@pnumwidth |
| 166 |
\parfillskip -\@pnumwidth |
| 167 |
\leavevmode |
| 168 |
\advance\leftskip\@tempdima |
| 169 |
\hskip -\leftskip |
| 170 |
{#1}\nobreak |
| 171 |
\leaders\hbox{% |
| 172 |
$\m@th |
| 173 |
\mkern \@dotsep mu\hbox{.}\mkern \@dotsep |
| 174 |
mu$% |
| 175 |
}\hfill |
| 176 |
\nobreak\hb@xt@\@pnumwidth{\hss #2% |
| 177 |
\kern-\p@\kern\p@}\par |
| 178 |
\endgroup |
| 179 |
\fi |
| 180 |
} |
| 181 |
\renewcommand*\l@subsection{\@dottedtocline{2}{3.8em}{3.2em}} |
| 182 |
\renewcommand*\l@subsubsection{\@dottedtocline{3}{7em}{4.1em}} |
| 183 |
\makeatother |
| 184 |
\NewDocElement[% |
| 185 |
macrolike, |
| 186 |
idxtype=fn., |
| 187 |
idxgroup=expl3 functions, |
| 188 |
printtype=\textit{fn.}, |
| 189 |
]{Fn}{fn} |
| 190 |
\NewDocElement[% |
| 191 |
idxtype=key, |
| 192 |
idxgroup=expl3 keys, |
| 193 |
printtype=\textit{expl3 key}, |
| 194 |
]{Key}{key} |
| 195 |
\NewDocElement[% |
| 196 |
printtype=\textdagger, |
| 197 |
idxtype=, |
| 198 |
idxgroup=, |
| 199 |
macrolike, |
| 200 |
]{DMacro}{dmacro} |
| 201 |
\NewDocElement[% |
| 202 |
idxtype=opt., |
| 203 |
idxgroup=options, |
| 204 |
printtype=\textit{opt.}, |
| 205 |
]{Opt}{option} |
| 206 |
\NewDocElement[% |
| 207 |
idxtype=pgfkey, |
| 208 |
idxgroup=pgfkeys, |
| 209 |
printtype=\textit{pgfkey}, |
| 210 |
]{Pgfkey}{pgfkey} |
| 211 |
\NewDocElement[% |
| 212 |
idxtype=pkg., |
| 213 |
idxgroup=, |
| 214 |
printtype=\textit{pkg.}, |
| 215 |
]{Pkg}{package} |
| 216 |
\NewDocElement[% |
| 217 |
idxtype=plug, |
| 218 |
idxgroup=plugs, |
| 219 |
printtype=\textit{plug}, |
| 220 |
]{SPlug}{plug} |
| 221 |
\NewDocElement[% |
| 222 |
idxtype=socket, |
| 223 |
idxgroup=sockets, |
| 224 |
printtype=\textit{socket}, |
| 225 |
]{Sock}{socket} |
| 226 |
\NewDocElement[% |
| 227 |
macrolike, |
| 228 |
idxtype=toks, |
| 229 |
idxgroup=token registers, |
| 230 |
printtype=\textit{toks}, |
| 231 |
]{Toks}{toksr} |
| 232 |
\NewDocElement[% |
| 233 |
macrolike, |
| 234 |
idxtype=var, |
| 235 |
idxgroup=expl3 variables, |
| 236 |
printtype=\textit{var.}, |
| 237 |
]{Var}{var} |
| 238 |
\NewDocumentCommand \val { m } |
| 239 |
{% |
| 240 |
{\ttfamily =\,\meta{#1}}% |
| 241 |
} |
| 242 |
\ExplSyntaxOn |
| 243 |
\NewDocumentCommand \vals { m } |
| 244 |
{ |
| 245 |
{ |
| 246 |
\ttfamily = \, |
| 247 |
\clist_use:nn { #1 } { \textbar } |
| 248 |
} |
| 249 |
} |
| 250 |
\keys_define:nn { memoize-ext / doc } |
| 251 |
{ |
| 252 |
unknown .code:n = { |
| 253 |
\cs_if_free:cT { \l_keys_key_str } |
| 254 |
{ |
| 255 |
\tl_gset:cn { \l_keys_key_str } { #1 } |
| 256 |
} |
| 257 |
}, |
| 258 |
} |
| 259 |
\NewDocumentCommand \memoizeextdocset { +m } |
| 260 |
{ |
| 261 |
\keys_set:nn { memoize-ext / doc } { #1 } |
| 262 |
} |
| 263 |
\cs_new_eq:NN \__memoizeextdoc_cs_orig:n \cs |
| 264 |
\cs_new_protected:Npn \__memoizeextdoc_cs_expl:n #1 |
| 265 |
{ |
| 266 |
\exp_args:Ne \__memoizeextdoc_cs_orig:n {\tl_to_str:n {#1}} |
| 267 |
} |
| 268 |
\cs_new_eq:NN \ecs \__memoizeextdoc_cs_expl:n |
| 269 |
\ExplSyntaxOff |
| 270 |
\memoizeextdocset{% |
| 271 |
bug={\href{https://codeberg.org/cfr/memoize-ext/issues}{\textsc{bugtracker}}}, |
| 272 |
codeberg={\href{https://codeberg.org/cfr/memoize-ext}{\textsc{codeberg}}}, |
| 273 |
github={\href{https://github.com/cfr42/memoize-ext}{\textsc{github}}}, |
| 274 |
ctan={\href{https://ctan.org/}{\textsc{ctan}}}, |
| 275 |
} |
| 276 |
% \usepackage{cleveref} |
| 277 |
\newcommand*{\lpack}[1]{\textsf{#1}} |
| 278 |
\newcommand*{\fgroup}[1]{\textsf{#1}} |
| 279 |
\newcommand*{\fname}[1]{\textsf{#1}} |
| 280 |
\newcommand*{\file}[1]{\texttt{#1}} |
| 281 |
\newcommand*{\env}[1]{\texttt{#1}} |
| 282 |
\newcommand*\TikZ{Ti\emph{k}Z} |
| 283 |
\newcommand*\pgf{\textsc{pgf}} |
| 284 |
\newcommand*\pgftikz{\pgf/\TikZ} |
| 285 |
\NewDocumentCommand\texse{om}{% |
| 286 |
\href{https://tex.stackexchange.com/#2}{\TeX{} \textsc{se}\IfValueT{#1}{: #1}}% |
| 287 |
} |
| 288 |
\NewDocumentCommand\texseans{O{Based on \texse{} answer:} m o}{% |
| 289 |
#1 \href{https://tex.stackexchange.com/a/#2}{#2}% |
| 290 |
\IfValueT{#3}{ by #3}.% |
| 291 |
} |
| 292 |
\NewDocumentCommand\githubref{O{See} m O{#2}}{% |
| 293 |
#1 \textsc{GitHub} \href{https://github.com/#2}{#3}.% |
| 294 |
} |
| 295 |
% \NewDocumentCommand\texseqn{O{Based on \texse{} question} m o}{% |
| 296 |
% #1 \href{https://tex.stackexchange.com/q/#2}{#2}% |
| 297 |
% \IfValueT{#3}{ by #3}.% |
| 298 |
% } |
| 299 |
\title{\pkg{\ExplFileName}: Extensions for \pkg{memoize}} |
| 300 |
\author{Clea F. Rees\thanks{% |
| 301 |
Bug tracker: |
| 302 |
\href{https://codeberg.org/cfr/memoize-ext/issues}{\url{codeberg.org/cfr/memoize-ext/issues}} |
| 303 |
\textbar{} Code: |
| 304 |
\href{https://codeberg.org/cfr/memoize-ext}{\url{codeberg.org/cfr/memoize-ext}} |
| 305 |
\textbar{} Mirror: |
| 306 |
\href{https://github.com/cfr42/memoize-ext}{\url{github.com/cfr42/memoize-ext}}% |
| 307 |
}} |
| 308 |
\date{\ExplFileVersion~\ExplFileDate} |
| 309 |
\pagestyle{fancy} |
| 310 |
\fancyhf{} |
| 311 |
\fancyhf[lh]{\itshape\ExplFileName} |
| 312 |
\fancyhf[rh]{\itshape\ExplFileVersion} |
| 313 |
\fancyhf[cf]{\itshape--- \thepage~/~\lastpage{} ---} |
| 314 |
\ExplSyntaxOn |
| 315 |
\hook_gput_code:nnn {shipout/lastpage} {.} |
| 316 |
{ |
| 317 |
\property_record:nn {t:lastpage}{abspage,page,pagenum} |
| 318 |
} |
| 319 |
\cs_new_protected_nopar:Npn \lastpage |
| 320 |
{ |
| 321 |
\property_ref:nn {t:lastpage}{page} |
| 322 |
} |
| 323 |
\cs_new_eq:NN \OrigMakePrivateLetters \MakePrivateLetters |
| 324 |
\hook_gput_code:nnn {begindocument/end} {.} |
| 325 |
{ |
| 326 |
\cs_set_eq:NN \MakePrivateLetters \MyMakePrivateLetters |
| 327 |
% \ShowCommand \OrigMakePrivateLetters |
| 328 |
% \ShowCommand \MyMakePrivateLetters |
| 329 |
% \ShowCommand \MakePrivateLetters |
| 330 |
} |
| 331 |
\ExplSyntaxOff |
| 332 |
\definecolor{strawberry}{rgb}{1.000,0.000,0.502} |
| 333 |
\definecolor{blueberry}{rgb}{0.000,0.000,1.000} |
| 334 |
\definecolor{moss}{rgb}{0.000,0.502,0.251} |
| 335 |
% ^^A \setminted{style=sas,breaklines=true,breakafter={\,},} |
| 336 |
% ^^A \newminted {latex}{frame=single,rulecolor=darkgray,} |
| 337 |
% ^^A \newminted {xml}{frame=single,rulecolor=darkgray,} |
| 338 |
|
| 339 |
\begin{document} |
| 340 |
% ^^A \let\MakePrivateLetters\MyMakePrivateLetters |
| 341 |
\DocInput{\ExplFileName.dtx} |
| 342 |
\end{document} |
| 343 |
%</driver> |
| 344 |
% \fi |
| 345 |
% |
| 346 |
% ^^A \changes{v1.0}{???}{First public release.} |
| 347 |
% ^^A lua will replace v0.0 and 0000/00/00 when tagging |
| 348 |
% ^^A \changes{v0.1}{2026-02-21}{} |
| 349 |
% |
| 350 |
% \maketitle\thispagestyle{empty} |
| 351 |
% \pdfinfo{% |
| 352 |
% /Creator (TeX) |
| 353 |
% /Producer (pdfTeX) |
| 354 |
% /Author (Clea F. Rees) |
| 355 |
% /Title (memoize-ext) |
| 356 |
% /Subject (TeX) |
| 357 |
% /Keywords (TeX,LaTeX,Clea,Rees)} |
| 358 |
% \setlength{\parindent}{0pt} |
| 359 |
% \setlength{\parskip}{0.5em} |
| 360 |
% |
| 361 |
% |
| 362 |
% \begin{abstract} |
| 363 |
% \noindent\lpack{memoize-ext} provides extensions for \citeauthor{saso-memoize}'s package \pkg{memoize} \autocite*{saso-memoize}. |
| 364 |
% In particular, it supports the memoization of content in tagged \textsc{pdf}s and presentations produced with \citeauthor{joseph-talk}'s \pkg{ltx-talk} \autocite*{joseph-talk}. |
| 365 |
% \end{abstract} |
| 366 |
% |
| 367 |
% \tableofcontents |
| 368 |
% |
| 369 |
% \twmarg |
| 370 |
% \part{Usage} |
| 371 |
% |
| 372 |
% \section{Basics}\label{sec:basics} |
| 373 |
% ^^A sec:basics <<< |
| 374 |
% \changes{v0.3}{2026-03-02}{Correct and update usage details for \pkg{ltx-talk}.} |
| 375 |
% |
| 376 |
% Usage is simple. |
| 377 |
% {\obeylines\MacroFont |
| 378 |
% \cs{documentclass}\marg{class} |
| 379 |
% \cs{usepackage}\{memoize-ext\} |
| 380 |
% } |
| 381 |
% |
| 382 |
% The package will automatically load \pkg{memoize} and pass any unrecognised options onto that package. |
| 383 |
% |
| 384 |
% Note that to create a tagged presentation with \pkg{ltx-talk}, the package should be loaded \emph{after} the class\footnote{% |
| 385 |
% Note that \pkg{ltx-talk} diverges from \pkg{beamer} here, a point to which I was oblivious when I wrote the initial version of this documentation.% |
| 386 |
% }. |
| 387 |
% \iffalse |
| 388 |
%<*verb> |
| 389 |
% \fi |
| 390 |
% \begin{verbatim} |
| 391 |
% \DocumentMetadata{tagging=on,lang=en-GB,pdfversion=2.0,pdfstandard=UA-2,} |
| 392 |
% \documentclass{ltx-talk} |
| 393 |
% \usepackage{memoize-ext} |
| 394 |
% \end{verbatim} |
| 395 |
% \iffalse |
| 396 |
%</verb> |
| 397 |
% \fi |
| 398 |
% If for any reason it is necessary to load the package \emph{prior} to the class in a tagged \textsc{pdf}, then tagging must be explicitly requested. |
| 399 |
% For example, |
| 400 |
% \iffalse |
| 401 |
%<*verb> |
| 402 |
% \fi |
| 403 |
% \begin{verbatim} |
| 404 |
% \DocumentMetadata{tagging=on,lang=cy,pdfversion=2.0,pdfstandard=ua-2,} |
| 405 |
% \RequirePackage[tag]{memoize-ext} |
| 406 |
% \documentclass{book} |
| 407 |
% \end{verbatim} |
| 408 |
% \iffalse |
| 409 |
%</verb> |
| 410 |
% \fi |
| 411 |
% |
| 412 |
% If necessary, a small number of package options are available to customise which code is loaded. |
| 413 |
% |
| 414 |
% \DescribeOpt{expl3}\vals{true,false} |
| 415 |
% |
| 416 |
% Loads code supporting \pkg{expl3} syntax. |
| 417 |
% |
| 418 |
% Default is \texttt{true}. |
| 419 |
% Initially \texttt{false}. |
| 420 |
% |
| 421 |
% \DescribeOpt{l3draw}\vals{true,false} |
| 422 |
% |
| 423 |
% Loads code supporting \pkg{l3draw}, if the package is loaded. |
| 424 |
% |
| 425 |
% Default is \texttt{true}. |
| 426 |
% Initially \texttt{true}. |
| 427 |
% |
| 428 |
% \DescribeOpt{tag}\vals{true,false} |
| 429 |
% |
| 430 |
% Loads code supporting tagged \textsc{pdf}, if \LaTeX's tagging code is activated when the package is loaded. |
| 431 |
% Note that this is \emph{not} true prior to \cs{documentclass}. |
| 432 |
% |
| 433 |
% Default is \texttt{true}. |
| 434 |
% Initially \texttt{true} if tagging is activated; \texttt{false} otherwise. |
| 435 |
% |
| 436 |
% \DescribeOpt{talk}\vals{true,false} |
| 437 |
% |
| 438 |
% Loads code supporting \cls{ltx-talk}, if the class is loaded. |
| 439 |
% |
| 440 |
% Default is \texttt{true}. |
| 441 |
% Initially \texttt{true}. |
| 442 |
% |
| 443 |
% Note that the additional code is not loaded if a different class is used, regardless of this setting. |
| 444 |
% The option is provided in case it is necessary to disable support for the class, without disabling other parts of \pkg{memoize-ext}. |
| 445 |
% |
| 446 |
% \section{\pkg{expl3}}\label{sec:expl3} |
| 447 |
% ^^A sec:expl3 <<< |
| 448 |
% \DescribePgfkey{replicate~expl~fn} Sets up advice to ‘replicate’ an \pkg{expl3} function. |
| 449 |
% |
| 450 |
% This works similarly to the builtin support for commands created with \cs{NewDocumentCommand} etc\@. |
| 451 |
% This means that it is not necessary to specify \texttt{args}. |
| 452 |
% |
| 453 |
% \textbf{Functions with \texttt{w}-type arguments are NOT supported.} |
| 454 |
% Attempting to use this key with such a function will result in an error. |
| 455 |
% Such cases require custom handling and can be configured using the standard \pkg{memoize} keys. |
| 456 |
% |
| 457 |
% \file{memoize-ext-l3draw.sty} demonstrates use of \texttt{replicate expl fn}: |
| 458 |
% \iffalse |
| 459 |
%<*verb> |
| 460 |
% \fi |
| 461 |
% \begin{verbatim} |
| 462 |
% \mmzset{% |
| 463 |
% auto~csname={draw_begin:}{memoize,collector=\AdviceCollectDrawArguments,}, |
| 464 |
% auto~csname={__draw_record_origin:}{run~if~memoizing,replicate~expl~fn,}, |
| 465 |
% } |
| 466 |
% \end{verbatim} |
| 467 |
% \iffalse |
| 468 |
%</verb> |
| 469 |
% \fi |
| 470 |
% This code sets up a custom ‘collector’ and installs ‘advice’ which memoizes \ecs{draw_begin:}. |
| 471 |
% It further advises \ecs{__draw_record_origin:} so that if this function is found during memoization, it will be replicated in the \texttt{ccmemo}. |
| 472 |
% This ensures that the origin is recorded correctly when the memoized picture is utilised, since we do not want to record its position when memoized. |
| 473 |
% |
| 474 |
% The net result of this is that auto-memoization of \pkg{l3draw} pictures should (hopefully) ‘just work’. |
| 475 |
% |
| 476 |
% ^^A >>> sec:expl3 |
| 477 |
% |
| 478 |
% \section{\pkg{l3draw}}\label{sec:draw} |
| 479 |
% sec:draw <<< |
| 480 |
% \pkg{l3draw} pictures are auto-memoized by default. |
| 481 |
% \file{memoize-ext-l3draw.sty} mostly exists to demonstrate use of \texttt{replicate expl fn}. |
| 482 |
% >>> sec:draw |
| 483 |
% |
| 484 |
% \section{\pkg{ltx-talk}}\label{sec:talk} |
| 485 |
% ^^A sec:talk <<< |
| 486 |
% |
| 487 |
% The code is based on that provided by \pkg{memoize} for \pkg{beamer} and supports the same options, except that ‘\texttt{talk}’ is substituted for ‘\texttt{bemaer}’. |
| 488 |
% |
| 489 |
% \DescribePgfkey{per~overlay} Equivalent to the \pkg{beamer} option of the same name. |
| 490 |
% |
| 491 |
% \DescribePgfkey{talk~mode~to~prefix} Equivalent to \pkg{beamer mode to prefix}. |
| 492 |
% |
| 493 |
% The code uses and/or changes internal code from both \cls{ltx-talk} and \pkg{memoize}. |
| 494 |
% While the public interface for \pkg{memoize} is fairly stable, the internals may not be, and \pkg{ltx-talk} is highly experimental. |
| 495 |
% The latter also uses a large number of experimental packages and makes extensive use of experimental \LaTeX{} features. |
| 496 |
% |
| 497 |
% The justification for publishing this part of \pkg{memoize-ext} is essentially that anybody using \cls{ltx-talk} and \pkg{memoize} is already playing with fire, so it is better to have an unreliable extinguisher to hand than none at all. |
| 498 |
% |
| 499 |
% A few things you should know, even if you do not want to: |
| 500 |
% \begin{itemize} |
| 501 |
% \item the code uses an internal \pkg{ltx-talk} boolean to drive extern creation and utilisation; |
| 502 |
% \item \texttt{talk mode to prefix} relies on an internal \pkg{ltx-talk} string; |
| 503 |
% \item to workaround incompatibilities between \pkg{memoize} and \pkg{pdfmanagement}, the code redefines an internal \pkg{memoize} macro\footnote{% |
| 504 |
% The redefinition injects code into the box \pkg{memoize} ships out which resets opacity before and after the memoized code is executed. |
| 505 |
% This is required because \pkg{memoize} relies on primitive shipout, whereas the implementation of opacity in \pkg{pdfmanagement} relies on \LaTeX's shipout routine.% |
| 506 |
% }. |
| 507 |
% \end{itemize} |
| 508 |
% ^^A >>> sec:talk |
| 509 |
% |
| 510 |
% \section{Tagged \textsc{pdf}}\label{sec:tag} |
| 511 |
% ^^A <<< sec:tag |
| 512 |
% |
| 513 |
% If using the package to produce tagged \textsc{pdf}, note that the tagging support |
| 514 |
% \begin{itemize} |
| 515 |
% \item redefines the internal macro \cs{mmzIncludeExtern} during utilisation; |
| 516 |
% \item relies on an internal string variable in \pkg{ltsockets}. |
| 517 |
% \end{itemize} |
| 518 |
% |
| 519 |
% \textbf{Correct tagging \emph{requires} that unmemoizable code be marked as such, either manually or automatically.} |
| 520 |
% The package does this automatically for \env{tikzpicture}s which use an unsupported tagging plug, but does nothing in any other case. |
| 521 |
% So if your picture uses \texttt{remember picture}, for example, you \emph{must} mark the code as unmemoizable or disable tagging for the affected code. |
| 522 |
% The package will warn you about this, but that is all it does. |
| 523 |
% |
| 524 |
% \subsection{\TikZ{} pictures} |
| 525 |
% |
| 526 |
% If the content you wish to memoize is a \TikZ{} picture, you probably do not need to do anything special, but note that the default \pkg{latex-lab} plug is \emph{not} supported. |
| 527 |
% You must use one of \texttt{alt}, \texttt{actualtext} or \texttt{artifact}. |
| 528 |
% |
| 529 |
% If you use \textt{alt} or \texttt{actualtext} in the optional argument to \env{tikzpicture}, the value will be recorded in the \emph{ccmemo} for use during utilisation. |
| 530 |
% If you set the value outside the \env{tikzpicture}, this is not necessary. |
| 531 |
% In the latter case, the \emph{extern} will not depend on the value given (unless you request that specifically). |
| 532 |
% |
| 533 |
% Note that if you change the selected plug \emph{and} you set this \emph{outside} the picture, you must manually tell \pkg{memoize} it should recompile the picture, since the plug is recorded in the ccmemo, but the hash will not have changed. |
| 534 |
% |
| 535 |
% Note that tagging is disabled during memoization and additionally \emph{disabled for content which has just been memoizsed}. |
| 536 |
% So when a run produces an extern, the memoized code will not be tagged at all. |
| 537 |
% |
| 538 |
% \textbf{Note that this package does \emph{not} support \pkg{forest}.} |
| 539 |
% If your document uses \pkg{forest} \autocite{saso-forest}, you should either disable memoization for these pictures or load \pkg{forest-ext}\footnote{% |
| 540 |
% This is not necessary if you use \pkg{prooftrees}, which will load the package automatically if required.% |
| 541 |
% } \autocite{cfr-forest-ext}. |
| 542 |
% |
| 543 |
% The \TikZ{} support is implemented by replacing plugs provided by \pkg{latex-lab} with versions designed for memoized content \autocite{latex-project-latex-lab-tikz}. |
| 544 |
% Code is also installed into the same hooks \pkg{latex-lab} uses with rules to ensure this package's has priority. |
| 545 |
% |
| 546 |
% \DescribeSPlug{mmzx} |
| 547 |
% Plug for \texttt{tagsupport/tikz/picture/init} |
| 548 |
% |
| 549 |
% If memoization is not active, the plug executes the \pkg{latex-lab} \texttt{default} plug. |
| 550 |
% |
| 551 |
% If some option for this package is specifically configured, it is used. |
| 552 |
% Otherwise, the code initialisation code at the start of the picture attempts to find a match for any configured \pkg{latex-lab} plug. |
| 553 |
% In effect, this means that you should not need to change anything in your document if you use one of the three supported plugs. |
| 554 |
% |
| 555 |
% If memoization is enabled but no suitable plug is found, a warning is issued and memoization aborted. |
| 556 |
% Otherwise, code is inserted into the ccmemo to emulate the appropriate \pkg{latex-lab} plug. |
| 557 |
% In most cases, this code simply calls the relevant \pkg{latex-lab} plugs. |
| 558 |
% |
| 559 |
% |
| 560 |
% Plugs for \texttt{tagsupport/tikz/picture/begin} and \texttt{tagsupport/tikz/picture/end}: |
| 561 |
% |
| 562 |
% \DescribeSPlug{mmzx/actualtext} |
| 563 |
% Sets up the ccmemo to use the \pkg{latex-lab} \texttt{actualtext} plugs. |
| 564 |
% |
| 565 |
% \DescribeSPlug{mmzx/artifact} |
| 566 |
% Sets up the ccmemo to use the \pkg{latex-lab} \texttt{artifact} plugs. |
| 567 |
% |
| 568 |
% \DescribeSPlug{mmzx/alt} |
| 569 |
% This pair of plugs is the exception. |
| 570 |
% Rather than writing a ccmemo which will invoke the \pkg{latex-lab} \texttt{alt} plugs, these plugs write a ccmemo which uses an alternative implementation of those plugs. |
| 571 |
% The reimplementation uses \emph{properties} (provided by the \LaTeX{} format) rather than \emph{rememberpicture} (provided by \pgftikz)\footnote{% |
| 572 |
% I considered using the support provided for \cs{includegraphic}, but this would require more intrusive changes to the internals of \pkg{memoize} and would essentially duplicate bounding box calculations already completed during memoization.% |
| 573 |
% }. |
| 574 |
% |
| 575 |
% \emph{If everything looks OK, tagging is disabled for the current picture.} |
| 576 |
% This is efficient if memoization is successful, but may be problematic if memoization is aborted or fails. |
| 577 |
% In this case, it may be necessary to mark the content as unmemoizable or to disable memoization for particular pictures, in order to ensure content is tagged correctly\footnote{% |
| 578 |
% It would be possible to disable tagging only if memoization succeeds, but I am not sure whether the structure will be right in this case?% |
| 579 |
% }. |
| 580 |
% |
| 581 |
% \subsection{Other content} |
| 582 |
% |
| 583 |
% If the content you wish to memoize is \emph{not} a \TikZ{} picture, you may need to read the remainder of this section. |
| 584 |
% |
| 585 |
% Generic support is provided in the form of two sockets which are used directly before and directly after an extern is included during utilisation. |
| 586 |
% By default, the sockets do nothing, but they may be used to inject code which wraps the included extern in a suitable tagging structure. |
| 587 |
% |
| 588 |
% Plugs may be assigned to the sockets either by writing suitable code to the ccmemo or in the document itself. |
| 589 |
% The \TikZ{} support, for example, writes commands to the ccmemo which assign plugs analogous to the \pkg{latex-lab} plugs available for non-memoized pictures. |
| 590 |
% |
| 591 |
% More precisely, the \TikZ{} support now uses one of the wrapper functions the package provides to assist users for the most common cases. |
| 592 |
% |
| 593 |
% \DescribeSock{tagsupport/memoize/include/extern/before} |
| 594 |
% |
| 595 |
% This socket receives three arguments during extern utilisation: the width, height and depth of the memoized content. |
| 596 |
% The \texttt{alt} plug for \TikZ{}, for example, uses these values to calculate the bounding box required to create a \texttt{Figure} structure with \texttt{alt} text. |
| 597 |
% |
| 598 |
% This socket is used just before the extern is included in the document. |
| 599 |
% |
| 600 |
% \DescribeSock{tagsupport/memoize/include/extern/after} |
| 601 |
% |
| 602 |
% This socket absorbs no arguments. |
| 603 |
% During extern utilisation, it is used immediately after inclusion of an extern. |
| 604 |
% |
| 605 |
% \subsubsection{\pkg{expl3} functions} |
| 606 |
% |
| 607 |
% Three functions are provided to help setup code for these sockets when an extern is utilised. |
| 608 |
% They should be used either during memoization or to configure defaults for use during memoization. |
| 609 |
% |
| 610 |
% In pseudo-code, all three write the equivalent of the following to the \emph{ccmemo} for execution during utilisation. |
| 611 |
% \begin{verbatim} |
| 612 |
% \mmzxtagtoks={<expansion of \the\mmzxtagtoks>}% |
| 613 |
% \AssignSocketPlug{tagsupport/memoize/include/extern/before}{<plug for before>}% |
| 614 |
% \AssignSocketPlug{tagsupport/memoize/include/extern/after}{<plug for after>}% |
| 615 |
% \end{verbatim} |
| 616 |
% The effect is that the specified plugs will be used before and after the \emph{extern} is utilised and these may use the \emph{toks} register \cs{mmzxtagtoks}, if appropriate. |
| 617 |
% If \pkg{expl3} syntax is preferred, \ecs{mmzx_tag_get_recorded:N} may be used instead. |
| 618 |
% |
| 619 |
% \DescribeFn{mmzx_tag_socket_plug_record:nnn} \hspace*{10mm}\marg{plug for before} \marg{plug for after} \marg{tokens} |
| 620 |
% |
| 621 |
% Write code to the \emph{ccmemo} which assigns |
| 622 |
% \begin{itemize} |
| 623 |
% \item \meta{plug for before} to the socket \texttt{tagsupport/memoize/include/extern/before}, |
| 624 |
% \item \meta{plug for after} to the socket \texttt{tagsupport/memoize/include/extern/after} |
| 625 |
% \item and \meta{tokens} to the toks register \cs{mmzxtagtoks} |
| 626 |
% \end{itemize} |
| 627 |
% \emph{during utilisation}. |
| 628 |
% |
| 629 |
% \DescribeFn{mmzx_tag_socket_plug_record:nn} \hspace*{10mm}\marg{plug for before} \marg{plug for after} |
| 630 |
% |
| 631 |
% Write code to the \emph{ccmemo} which assigns |
| 632 |
% \begin{itemize} |
| 633 |
% \item \meta{plug for before} to the socket \texttt{tagsupport/memoize/include/extern/before}, |
| 634 |
% \item \meta{plug for after} to the socket \texttt{tagsupport/memoize/include/extern/after} |
| 635 |
% \item and the current contents of \cs{mmzxtagtoks} to the toks register \cs{mmzxtagtoks} |
| 636 |
% \end{itemize} |
| 637 |
% \emph{during utilisation}. |
| 638 |
% |
| 639 |
% \DescribeFn{mmzx_tag_socket_plug_record:} \mbox{ } |
| 640 |
% |
| 641 |
% Write code to the \emph{ccmemo} which assigns |
| 642 |
% \begin{itemize} |
| 643 |
% \item the plug currently installed in the socket \texttt{tagsupport/memoize/include/extern/before} to the socket \texttt{tagsupport/memoize/include/extern/before}, |
| 644 |
% \item the plug currently installed in the socket \texttt{tagsupport/memoize/include/extern/after} to the socket \texttt{tagsupport/memoize/include/extern/after} |
| 645 |
% \item and the current contents of \cs{mmzxtagtoks} to the toks register \cs{mmzxtagtoks} |
| 646 |
% \end{itemize} |
| 647 |
% \emph{during utilisation}. |
| 648 |
% |
| 649 |
% A fourth function is provided to access the contents of the toks register \cs{mmzxtagtoks}, in case \pkg{expl3} syntax is preferred. |
| 650 |
% |
| 651 |
% \DescribeFn{\mmzx_tag_get_recorded:N} \meta{token list} |
| 652 |
% |
| 653 |
% Recovers the value from the toks register for the current extern during utilisation and stores it in the specified (local) token list variable. |
| 654 |
% May be used in the definitions of plugs, as explained above for \cs{mmzxtagtoks}. |
| 655 |
% |
| 656 |
% ^^A >>> end sec:tag |
| 657 |
% |
| 658 |
% ^^A sec:basics >>> |
| 659 |
% |
| 660 |
% \MaybeStop{% |
| 661 |
% \def\glossaryname{Changes}% |
| 662 |
% \printbibliography |
| 663 |
% \PrintChanges |
| 664 |
% \PrintIndex |
| 665 |
% } |
| 666 |
% |
| 667 |
% \part{Implementation} |
| 668 |
% |
| 669 |
% A double underscore (\texttt{\_\_}) \emph{or} an ‘at’ (\texttt{@}) indicates an internal macro or key. |
| 670 |
% These are liable to change without notice and should not be used elsewhere. |
| 671 |
% Some additional macros are categorised in the same way, but are named differently to simplify use in memos\footnote{% |
| 672 |
% This follows \pkg{memoize}'s own practice.% |
| 673 |
% }. |
| 674 |
% |
| 675 |
% \makeatletter |
| 676 |
% \let\origmaketitle\maketitle |
| 677 |
% \NewDocumentCommand \pkginput {O{#2}m}{% |
| 678 |
% \begingroup |
| 679 |
% \def\maketitle{% |
| 680 |
% \expandafter\ifx\expandafter\ExplFileName\@title |
| 681 |
% \def\@title{\pkg{\ExplFileName-#1}}% |
| 682 |
% \fi |
| 683 |
% \ifx\@author\@empty |
| 684 |
% \def\@author{Clea F. Rees}% |
| 685 |
% \fi |
| 686 |
% \ifx\@date\@empty |
| 687 |
% \def\@date{\ExplFileVersion: \ExplFileDate}% |
| 688 |
% \fi |
| 689 |
% \let\saved@title\@title |
| 690 |
% \origmaketitle |
| 691 |
% \phantomsection |
| 692 |
% \addcontentsline{toc}{section}{\mdseries\pkg{\saved@title}}% |
| 693 |
% \fancyhf[lh]{\itshape memoize-ext-#1}% |
| 694 |
% }% |
| 695 |
% \let\Finale\relax |
| 696 |
% \let\PrintIndex\relax |
| 697 |
% \let\PrintChanges\relax |
| 698 |
% \input{\memoizeextdocbase -#2.dtx}% |
| 699 |
% \endgroup |
| 700 |
% } |
| 701 |
% \makeatother |
| 702 |
% |
| 703 |
% \section*{\pkg{\ExplFileName}} |
| 704 |
% \addcontentsline{toc}{section}{\mdseries\pkg{\ExplFileName}} |
| 705 |
% |
| 706 |
%<*sty> |
| 707 |
%<@@=mmzx> |
| 708 |
% ^^A <<< |
| 709 |
% \begin{macrocode} |
| 710 |
\NeedsTeXFormat{LaTeX2e}[2021-11-15]% ^^A should be later |
| 711 |
% \end{macrocode} |
| 712 |
% copied verbatim, excepting format from Joseph Wright's \path{siunitx.sty} under LPPL |
| 713 |
% \begin{macrocode} |
| 714 |
\@ifundefined{ExplLoaderFileDate}{% |
| 715 |
\RequirePackage{expl3}% |
| 716 |
}{} |
| 717 |
% \end{macrocode} |
| 718 |
% almost verbatim from \path{siunitx.sty} |
| 719 |
% |
| 720 |
% should check date requirement (copied from chronos) |
| 721 |
% \begin{macrocode} |
| 722 |
\@ifl@t@r\ExplLoaderFileDate{2022-02-24}{% |
| 723 |
}{% |
| 724 |
\PackageError{memoize-ext}{Support package expl3 too old} |
| 725 |
{% |
| 726 |
You need to update your installation of the bundles 'l3kernel' and |
| 727 |
'l3packages'.\MessageBreak |
| 728 |
Loading memoize-ext will abort!% |
| 729 |
}% |
| 730 |
\endinput |
| 731 |
}% |
| 732 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 733 |
\GetIdInfo $Id: memoize-ext.dtx 11815 2026-03-25 19:50:49Z cfrees $ {Extensions for Memoize} |
| 734 |
%<!debug> \ProvidesExplPackage{\ExplFileName}{\ExplFileDate} |
| 735 |
%<!debug> {v0.3.5 \ExplFileVersion}{\ExplFileDescription} |
| 736 |
%<debug> \ProvidesExplPackage{\ExplFileName-debug} |
| 737 |
%<debug> {\ExplFileDate}{v0.3.5 \ExplFileVersion}{\ExplFileDescription} |
| 738 |
% |
| 739 |
\str_new:N \g_@@_name_str |
| 740 |
\str_gset:NV \g_@@_name_str \ExplFileName |
| 741 |
% |
| 742 |
%<!debug> \disable@package@load {memoize-ext-debug} |
| 743 |
%<debug> \disable@package@load {memoize-ext} |
| 744 |
{ |
| 745 |
Only~one~of~memoize-ext~and~memoize-ext-debug~should~be~loaded.~ |
| 746 |
Since~ |
| 747 |
%<!debug> memoize-ext |
| 748 |
%<debug> memoize-ext-debug |
| 749 |
~had~been~loaded,~I~will~ignore~your~request~for~ |
| 750 |
%<debug> memoize-ext |
| 751 |
%<!debug> memoize-ext-debug |
| 752 |
.} |
| 753 |
\SetDefaultHookLabel{memoize-ext} |
| 754 |
% \end{macrocode} |
| 755 |
% \begin{var}{\l_@@_opt_tag_bool} |
| 756 |
% Set according to activation status by default. |
| 757 |
% \begin{macrocode} |
| 758 |
\bool_new:N \l_@@_opt_tag_bool |
| 759 |
\tag_if_active:TF |
| 760 |
{ \bool_set_true:N \l_@@_opt_tag_bool } |
| 761 |
{ \bool_set_false:N \l_@@_opt_tag_bool } |
| 762 |
% \end{macrocode} |
| 763 |
% \end{var} |
| 764 |
% \begin{var}{\l_@@_opt_draw_bool,\l_@@_opt_expl_bool} |
| 765 |
% Other bools. |
| 766 |
% \begin{macrocode} |
| 767 |
\keys_define:nn {memoize-ext} |
| 768 |
{ |
| 769 |
%<*!debug> |
| 770 |
debug .code:n = { |
| 771 |
\PackageWarning{memoize-ext}{ |
| 772 |
To~load~the~debugging~code,~use~memoize-ext-debug~instead~of~this~package. |
| 773 |
} |
| 774 |
}, |
| 775 |
%</!debug> |
| 776 |
expl3 .bool_set:N = \l_@@_opt_expl_bool, |
| 777 |
expl3 .default:n = true, |
| 778 |
expl3 .initial:n = false, |
| 779 |
l3draw .bool_set:N = \l_@@_opt_draw_bool, |
| 780 |
l3draw .default:n = true, |
| 781 |
l3draw .initial:n = true, |
| 782 |
tag .bool_set:N = \l_@@_opt_tag_bool, |
| 783 |
tag .default:n = true, |
| 784 |
talk .bool_set:N = \l_@@_opt_talk_bool, |
| 785 |
talk .default:n = true, |
| 786 |
talk .initial:n = true, |
| 787 |
} |
| 788 |
\DeclareUnknownKeyHandler{ |
| 789 |
\PassOptionsToPackage{\CurrentOption}{memoize} |
| 790 |
} |
| 791 |
% \end{macrocode} |
| 792 |
% \end{var} |
| 793 |
% \begin{macro}{\IfFormatAtLeastTF}%^^A <<< |
| 794 |
% Joseph Wright: from \path{siunitx.sty} ; \url{https://chat.stackexchange.com/transcript/message/64327823#64327823} |
| 795 |
% \begin{macrocode} |
| 796 |
\providecommand \IfFormatAtLeastTF { \@ifl@t@r \fmtversion } |
| 797 |
% \end{macrocode} |
| 798 |
% \end{macro}%^^A >>> |
| 799 |
% \begin{macrocode} |
| 800 |
\IfFormatAtLeastTF { 2022-06-01 } |
| 801 |
{ |
| 802 |
\ProcessKeyOptions [ memoize-ext ] |
| 803 |
}{ |
| 804 |
\RequirePackage { l3keys2e } |
| 805 |
\ProcessKeysOptions { memoize-ext } |
| 806 |
} |
| 807 |
% \end{macrocode} |
| 808 |
%^^A if we require 2022-02-24 expl3 above what is this for? |
| 809 |
%^^A is it even possible to use that expl3 with somehow an older format? |
| 810 |
%^^A (wasn't expl3 in the format by then?) |
| 811 |
% \begin{macrocode} |
| 812 |
\IfFormatAtLeastTF { 2020-10-01 }{ |
| 813 |
}{ |
| 814 |
\RequirePackage { xparse } |
| 815 |
\providecommand \ExpandArgs [1] |
| 816 |
{ \cs_if_exist_use:c { exp_args:N #1 } } |
| 817 |
} |
| 818 |
% \end{macrocode} |
| 819 |
% Should specify next version here, most probably. |
| 820 |
% Or conditionalise input switch for ccmemos? |
| 821 |
% \begin{macrocode} |
| 822 |
\RequirePackage{memoize} |
| 823 |
%<debug> \mmzset{ |
| 824 |
%<debug> trace, |
| 825 |
%<debug> include~context~in~ccmemo, |
| 826 |
%<debug> } |
| 827 |
% \end{macrocode} |
| 828 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 829 |
% Fix for \cs{toksapp} and friends courtesy of Max Chernoff |
| 830 |
% \url{https://github.com/sasozivanovic/memoize/pull/57/commits}. |
| 831 |
% \changes{v0.3.2}{2026-03-14}{Fix \cs{toksapp} and friends courtesy Max Chernoff. } |
| 832 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 833 |
% \begin{macrocode} |
| 834 |
\sys_if_engine_luatex:F |
| 835 |
{ |
| 836 |
\clist_map_inline:nn {\toksapp,\etoksapp,\gtoksapp,\xtoksapp} |
| 837 |
{ |
| 838 |
\tl_if_head_eq_meaning:VNF #1 \protected |
| 839 |
{ |
| 840 |
\expandafter\protected\expandafter\def\expandafter#1\expandafter{#1} |
| 841 |
} |
| 842 |
} |
| 843 |
} |
| 844 |
% \end{macrocode} |
| 845 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 846 |
% bug fix: Ulrike Fischer: \url{https://chat.stackexchange.com/transcript/41?m=68852988#68852988} |
| 847 |
% \changes{v0.3.4}{2026-03-24}{\githubref[Fix for]{sasozivanovic/memoize/issues/60}{issue \#60}} |
| 848 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 849 |
% \begin{macrocode} |
| 850 |
\FirstAidNeededT{memoize}{sty}{2024/12/02~v1.4.1~Fast~and~flexible~externalization}{ |
| 851 |
\hook_gput_code:nnn {begindocument/after} {.} |
| 852 |
{ |
| 853 |
\IfDocumentMetadataT{ |
| 854 |
\hook_gput_code:nnn {cmd/mmz@shipout@extern/before} {.} |
| 855 |
{ |
| 856 |
\g__kernel_pdfmanagement_thispage_shipout_code_tl |
| 857 |
} |
| 858 |
} |
| 859 |
} |
| 860 |
} |
| 861 |
% \end{macrocode} |
| 862 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 863 |
% temporary variables, quarks |
| 864 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 865 |
% \begin{macrocode} |
| 866 |
\bool_new:N \l_@@_tmpa_bool |
| 867 |
\fp_new:N \l_@@_tmpa_fp |
| 868 |
\int_new:N \l_@@_tmpa_int |
| 869 |
\quark_new:N \q_@@_stop |
| 870 |
\tl_new:N \l_@@_tmpa_tl |
| 871 |
\tl_new:N \l_@@_tmpb_tl |
| 872 |
\tl_new:N \l_@@_tmpc_tl |
| 873 |
\seq_new:N \l_@@_tmpa_seq |
| 874 |
\str_new:N \l_@@_tmpa_str |
| 875 |
\str_new:N \l_@@_tmpb_str |
| 876 |
%<*debug> |
| 877 |
\cs_new_protected:Npn \@@_debug:n #1 |
| 878 |
{ |
| 879 |
\iow_log:n {[mmzx~debug]::~#1} |
| 880 |
} |
| 881 |
\cs_generate_variant:Nn \@@_debug:n {e} |
| 882 |
\cs_new_protected:Npn \@@_debug:N #1 |
| 883 |
{ |
| 884 |
\@@_debug:e {\cs_to_str:N #1:~\exp_args:NV \exp_not:n #1} |
| 885 |
} |
| 886 |
%</debug> |
| 887 |
% \end{macrocode} |
| 888 |
% \begin{macro}{\@@_noop:,\@@_noop:n} |
| 889 |
% \changes{v0.3.3}{2026-03-15}{Need this defined earlier. |
| 890 |
% I'm starting to understand why libraries are a thing.} |
| 891 |
% Do nothing successfully. |
| 892 |
% \begin{macrocode} |
| 893 |
\cs_new:Npn \@@_noop: {} |
| 894 |
\cs_new:Npn \@@_noop:n {} |
| 895 |
% \end{macrocode} |
| 896 |
% \end{macro} |
| 897 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 898 |
% \pkg{tag}, \pkg{expl}, \pkg{l3draw}, \pkg{talk} loaded conditionally |
| 899 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 900 |
% \begin{macrocode} |
| 901 |
\bool_if:NT \l_@@_opt_tag_bool |
| 902 |
{ |
| 903 |
%<!debug> \RequirePackage{\g_@@_name_str -tag} |
| 904 |
%<debug> \RequirePackage{\g_@@_name_str -tag-debug} |
| 905 |
\hook_gput_code:nnn {package/forest/after}{.} |
| 906 |
{ |
| 907 |
\hook_gput_code:nnn {begindocument/before}{.} |
| 908 |
{ |
| 909 |
\IfPackageLoadedF {forest-lib-ext.tagging} |
| 910 |
{ |
| 911 |
\IfPackageLoadedF {forest-lib-ext.tagging-debug} |
| 912 |
{ |
| 913 |
\msg_warning:nnnnnn {memoize-ext}{unsupported}{forest} |
| 914 |
{forest-lib-ext.tagging.sty}{forest-ext} |
| 915 |
{forest~trees~will~not~be~correctly~tagged~and~may~cause~fatal~ |
| 916 |
compilation~errors.} |
| 917 |
} |
| 918 |
} |
| 919 |
} |
| 920 |
} |
| 921 |
} |
| 922 |
% \end{macrocode} |
| 923 |
% \pkg{memoize-ext-expl3}[\pkg{-debug}] |
| 924 |
% \begin{macrocode} |
| 925 |
\bool_if:NT \l_@@_opt_expl_bool |
| 926 |
{ |
| 927 |
%<!debug> \RequirePackage{\g_@@_name_str -expl3} |
| 928 |
%<debug> \RequirePackage{\g_@@_name_str -expl3-debug} |
| 929 |
} |
| 930 |
% \end{macrocode} |
| 931 |
% \pkg{memoize-ext-l3draw}[\pkg{-debug}] |
| 932 |
% \begin{macrocode} |
| 933 |
\hook_gput_code:nnn {package/l3draw/after}{.} |
| 934 |
{ |
| 935 |
\bool_if:NT \l_@@_opt_draw_bool |
| 936 |
{ |
| 937 |
%<!debug> \RequirePackage {\g_@@_name_str -l3draw} |
| 938 |
%<debug> \@@_debug:n {Loading~memoize-ext-l3draw-debug.} |
| 939 |
%<debug> \RequirePackage {\g_@@_name_str -l3draw-debug} |
| 940 |
} |
| 941 |
} |
| 942 |
% \end{macrocode} |
| 943 |
% \pkg{memoize-ext-talk}[\pkg{-debug}] |
| 944 |
% \begin{macrocode} |
| 945 |
\hook_gput_code:nnn {class/ltx-talk/after} {.} |
| 946 |
{ |
| 947 |
\bool_if:NT \l_@@_opt_talk_bool |
| 948 |
{ |
| 949 |
%<!debug> \RequirePackage{memoize-ext-talk} |
| 950 |
%<debug> \@@_debug:n {Loading~memoize-ext-talk-debug.} |
| 951 |
%<debug> \RequirePackage{memoize-ext-talk-debug} |
| 952 |
} |
| 953 |
} |
| 954 |
% \end{macrocode} |
| 955 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 956 |
% NaCl \textbar{} halen \textbar{} salt |
| 957 |
% \changes{v0.3}{2026-03-05}{Add tagging status to salt.} |
| 958 |
% \begin{macrocode} |
| 959 |
\toksapp\mmzSalt{ |
| 960 |
Tagging~status:~\tag_if_active_p: |
| 961 |
} |
| 962 |
% \end{macrocode} |
| 963 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 964 |
% messages |
| 965 |
% \begin{macrocode} |
| 966 |
\msg_new:nnnn {memoize-ext}{unsupported} |
| 967 |
{ |
| 968 |
\msg_warning_text:n {memoize-ext}:~ |
| 969 |
Non-existent~or~inappropriate~version~of~#2~from~#3~\msg_line_context:.~ |
| 970 |
#4 |
| 971 |
} { |
| 972 |
memoize-ext#1~requires~an~appropriate~version~of~#2~from~#3. |
| 973 |
} |
| 974 |
% \end{macrocode} |
| 975 |
% ^^A >>> |
| 976 |
%</sty> |
| 977 |
% |
| 978 |
% \pkginput{expl3} |
| 979 |
% \pkginput{l3draw} |
| 980 |
% ^^A \pkginput{properties} |
| 981 |
% \pkginput{sockets} |
| 982 |
% \pkginput{tag} |
| 983 |
% ^^A \pkginput{tagging-tikz} |
| 984 |
% \pkginput{talk} |
| 985 |
% |
| 986 |
% \twreg |
| 987 |
% \printbibliography |
| 988 |
%\Finale |
| 989 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 990 |
%^^A vim: et:tw=0:sw=2:ts=2:foldmethod=marker:fmr=<<<,>>>: |