From 93fb03ea65cbfc0770b6b22d07b1a2d8098b23aa Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Fri, 23 Sep 2022 03:02:24 +0000 Subject: CTAN sync 202209230302 --- macros/latex/contrib/abspos/LICENSE | 21 + macros/latex/contrib/abspos/README.md | 10 + macros/latex/contrib/abspos/abspos.dtx | 598 +++++++++++ macros/latex/contrib/abspos/abspos.pdf | Bin 0 -> 452109 bytes macros/latex/contrib/abspos/demo.tex | 67 ++ macros/latex/contrib/blowup/blowup-ex1.pdf | Bin 33365 -> 33365 bytes macros/latex/contrib/blowup/blowup-ex2.pdf | Bin 33377 -> 33377 bytes macros/latex/contrib/blowup/blowup-ex3.pdf | Bin 34010 -> 34010 bytes macros/latex/contrib/blowup/blowup-ex4.pdf | Bin 12537 -> 12537 bytes macros/latex/contrib/blowup/blowup-ex5.pdf | Bin 20246 -> 20246 bytes macros/latex/contrib/blowup/blowup-ex6.pdf | Bin 0 -> 33734 bytes macros/latex/contrib/blowup/blowup-ex6.tex | 59 ++ macros/latex/contrib/blowup/blowup.dtx | 51 +- macros/latex/contrib/blowup/blowup.pdf | Bin 196888 -> 199133 bytes macros/latex/contrib/colorframed/README.md | 55 + .../latex/contrib/colorframed/colorframed-doc.pdf | Bin 0 -> 17300 bytes .../latex/contrib/colorframed/colorframed-doc.tex | 238 +++++ macros/latex/contrib/colorframed/colorframed.sty | 156 +++ macros/latex/contrib/hyperref/README.md | 2 +- macros/latex/contrib/hyperref/doc/backref.pdf | Bin 206288 -> 205447 bytes .../latex/contrib/hyperref/doc/hyperref-doc.html | 4 +- macros/latex/contrib/hyperref/doc/hyperref-doc.pdf | Bin 318190 -> 318245 bytes macros/latex/contrib/hyperref/doc/hyperref-doc.tex | 22 +- .../contrib/hyperref/doc/hyperref-linktarget.pdf | Bin 404106 -> 443137 bytes macros/latex/contrib/hyperref/doc/hyperref.pdf | Bin 2368225 -> 2367878 bytes macros/latex/contrib/hyperref/doc/nameref.pdf | Bin 180063 -> 180076 bytes macros/latex/contrib/hyperref/hluatex.dtx | 28 +- .../latex/contrib/hyperref/hyperref-linktarget.dtx | 2 +- macros/latex/contrib/hyperref/hyperref-patches.dtx | 2 +- macros/latex/contrib/hyperref/hyperref.dtx | 160 +-- macros/latex/contrib/hyperref/xr-hyper.sty | 2 +- macros/latex/contrib/oberdiek/README.md | 6 +- macros/latex/contrib/oberdiek/aliascnt.pdf | Bin 321516 -> 321657 bytes macros/latex/contrib/oberdiek/bmpsize.pdf | Bin 527470 -> 525985 bytes macros/latex/contrib/oberdiek/centernot.pdf | Bin 304615 -> 304534 bytes macros/latex/contrib/oberdiek/chemarr.pdf | Bin 318401 -> 318493 bytes macros/latex/contrib/oberdiek/classlist.pdf | Bin 298535 -> 298078 bytes macros/latex/contrib/oberdiek/colonequals.pdf | Bin 312343 -> 311534 bytes macros/latex/contrib/oberdiek/dvipscol.pdf | Bin 297204 -> 297228 bytes macros/latex/contrib/oberdiek/engord.pdf | Bin 348190 -> 347366 bytes macros/latex/contrib/oberdiek/enparen.pdf | Bin 332722 -> 332202 bytes macros/latex/contrib/oberdiek/eolgrab.pdf | Bin 347153 -> 346537 bytes macros/latex/contrib/oberdiek/fibnum.pdf | Bin 387720 -> 387260 bytes macros/latex/contrib/oberdiek/flags.pdf | Bin 311494 -> 311396 bytes macros/latex/contrib/oberdiek/holtxdoc.pdf | Bin 333938 -> 333755 bytes macros/latex/contrib/oberdiek/hypbmsec.pdf | Bin 317700 -> 317468 bytes macros/latex/contrib/oberdiek/hypcap.pdf | Bin 311506 -> 310807 bytes macros/latex/contrib/oberdiek/hypgotoe.pdf | Bin 313547 -> 313704 bytes macros/latex/contrib/oberdiek/hyphsubst.pdf | Bin 328581 -> 328769 bytes macros/latex/contrib/oberdiek/ifdraft.pdf | Bin 292584 -> 292649 bytes macros/latex/contrib/oberdiek/iflang.pdf | Bin 343995 -> 344764 bytes macros/latex/contrib/oberdiek/oberdiek-bundle.bib | 14 - macros/latex/contrib/oberdiek/oberdiek.ins | 2 - macros/latex/contrib/oberdiek/oberdiek.pdf | Bin 287792 -> 283212 bytes macros/latex/contrib/oberdiek/oberdiek.tex | 26 +- macros/latex/contrib/oberdiek/pagegrid.dtx | 955 ----------------- macros/latex/contrib/oberdiek/pagegrid.pdf | Bin 339405 -> 0 bytes macros/latex/contrib/oberdiek/pdfcol.dtx | 939 ----------------- macros/latex/contrib/oberdiek/pdfcol.pdf | Bin 330483 -> 0 bytes macros/latex/contrib/oberdiek/pdfcolfoot.pdf | Bin 322874 -> 322160 bytes macros/latex/contrib/oberdiek/pdfcolparallel.pdf | Bin 348875 -> 348845 bytes macros/latex/contrib/oberdiek/pdfcolparcolumns.pdf | Bin 336532 -> 336519 bytes macros/latex/contrib/oberdiek/pdfcrypt.pdf | Bin 338513 -> 337856 bytes macros/latex/contrib/oberdiek/pdfrender.pdf | Bin 413812 -> 413780 bytes macros/latex/contrib/oberdiek/protecteddef.pdf | Bin 337274 -> 336484 bytes macros/latex/contrib/oberdiek/resizegather.pdf | Bin 544212 -> 543577 bytes macros/latex/contrib/oberdiek/rotchiffre.pdf | Bin 346420 -> 345334 bytes macros/latex/contrib/oberdiek/scrindex.pdf | Bin 310490 -> 309280 bytes macros/latex/contrib/oberdiek/setouterhbox.pdf | Bin 358759 -> 358526 bytes macros/latex/contrib/oberdiek/settobox.pdf | Bin 321296 -> 321364 bytes macros/latex/contrib/oberdiek/stackrel.pdf | Bin 310478 -> 310389 bytes macros/latex/contrib/oberdiek/stampinclude.pdf | Bin 304678 -> 304747 bytes macros/latex/contrib/oberdiek/tabularht.pdf | Bin 359643 -> 359286 bytes macros/latex/contrib/oberdiek/tabularkv.pdf | Bin 281059 -> 280511 bytes macros/latex/contrib/oberdiek/telprint.pdf | Bin 331215 -> 331191 bytes macros/latex/contrib/oberdiek/thepdfnumber.pdf | Bin 378179 -> 377480 bytes macros/latex/contrib/oberdiek/twoopt.pdf | Bin 301605 -> 301492 bytes macros/latex/contrib/pagegrid/README.md | 12 + macros/latex/contrib/pagegrid/pagegrid.dtx | 942 +++++++++++++++++ macros/latex/contrib/pagegrid/pagegrid.pdf | Bin 0 -> 337475 bytes macros/latex/contrib/pdfcol/README.md | 18 + macros/latex/contrib/pdfcol/pdfcol.dtx | 882 ++++++++++++++++ macros/latex/contrib/pdfcol/pdfcol.pdf | Bin 0 -> 326142 bytes .../latex/contrib/proflycee/doc/ProfLycee-doc.pdf | Bin 816736 -> 834268 bytes .../latex/contrib/proflycee/doc/ProfLycee-doc.tex | 165 ++- macros/latex/contrib/proflycee/tex/ProfLycee.sty | 132 ++- macros/latex/contrib/semantex/semantex.pdf | Bin 385165 -> 389783 bytes macros/latex/contrib/semantex/semantex.sty | 1095 +++----------------- macros/latex/contrib/semantex/semantex.tex | 206 ++-- macros/latex/contrib/semantex/stripsemantex.lua | 34 +- macros/latex/contrib/semantex/stripsemantex.sty | 18 +- 91 files changed, 3844 insertions(+), 3079 deletions(-) create mode 100644 macros/latex/contrib/abspos/LICENSE create mode 100644 macros/latex/contrib/abspos/README.md create mode 100644 macros/latex/contrib/abspos/abspos.dtx create mode 100644 macros/latex/contrib/abspos/abspos.pdf create mode 100644 macros/latex/contrib/abspos/demo.tex create mode 100644 macros/latex/contrib/blowup/blowup-ex6.pdf create mode 100644 macros/latex/contrib/blowup/blowup-ex6.tex create mode 100644 macros/latex/contrib/colorframed/README.md create mode 100644 macros/latex/contrib/colorframed/colorframed-doc.pdf create mode 100644 macros/latex/contrib/colorframed/colorframed-doc.tex create mode 100644 macros/latex/contrib/colorframed/colorframed.sty delete mode 100644 macros/latex/contrib/oberdiek/pagegrid.dtx delete mode 100644 macros/latex/contrib/oberdiek/pagegrid.pdf delete mode 100644 macros/latex/contrib/oberdiek/pdfcol.dtx delete mode 100644 macros/latex/contrib/oberdiek/pdfcol.pdf create mode 100644 macros/latex/contrib/pagegrid/README.md create mode 100644 macros/latex/contrib/pagegrid/pagegrid.dtx create mode 100644 macros/latex/contrib/pagegrid/pagegrid.pdf create mode 100644 macros/latex/contrib/pdfcol/README.md create mode 100644 macros/latex/contrib/pdfcol/pdfcol.dtx create mode 100644 macros/latex/contrib/pdfcol/pdfcol.pdf (limited to 'macros/latex') diff --git a/macros/latex/contrib/abspos/LICENSE b/macros/latex/contrib/abspos/LICENSE new file mode 100644 index 0000000000..70e7d55dd6 --- /dev/null +++ b/macros/latex/contrib/abspos/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021–2022 Magnus Lie Hetland + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/macros/latex/contrib/abspos/README.md b/macros/latex/contrib/abspos/README.md new file mode 100644 index 0000000000..419cf0bf4a --- /dev/null +++ b/macros/latex/contrib/abspos/README.md @@ -0,0 +1,10 @@ +The **abspos** package lets you place contents at an absolute position, anchored +at some specified part of the content, similar to how **tikz** nodes work, +though without using the two-pass strategy of **tikz**. It also avoids messing +with the order of **beamer** overlays, which is what happens when one uses the +**textpos** package with the **overlay** option. The solution used is quite +straightforward, combining *coffins* (using **l3coffins**) with the placement +mechanisms of **atbegshi**. + +The package is written by [Magnus Lie Hetland](mailto:mlh@ntnu.no) and released +under the [MIT license](LICENSE). diff --git a/macros/latex/contrib/abspos/abspos.dtx b/macros/latex/contrib/abspos/abspos.dtx new file mode 100644 index 0000000000..58cb1b820a --- /dev/null +++ b/macros/latex/contrib/abspos/abspos.dtx @@ -0,0 +1,598 @@ +% \iffalse +%<*driver> +\def\nameofplainTeX{plain} +\ifx\fmtname\nameofplainTeX\else + \expandafter\begingroup +\fi +\input docstrip % +\askforoverwritefalse +\preamble + +MIT License + +Copyright (c) 2021-2022 Magnus Lie Hetland + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +\endpreamble +% stop docstrip adding \endinput +\postamble +\endpostamble +\generate{\file{abspos.sty}{\from{abspos.dtx}{package}}} +\ifx\fmtname\nameofplainTeX + \expandafter\endbatchfile +\else + \expandafter\endgroup +\fi +% +% +%<*driver|package> +\RequirePackage{expl3} +% +% +%<*driver> +\documentclass[full]{l3doc} +\usepackage{graphicx} +\usepackage[export]{adjustbox} +\usepackage{tcolorbox} +\tcbuselibrary{listings,skins} +\usepackage{xcoffins} +\usepackage{abspos} + +\lstdefinestyle{tcblatex}{language={[LaTeX]TeX}, + columns=fullflexible, + keepspaces=true, + breaklines=true, + breakatwhitespace=true, + basicstyle=\ttfamily\small\color{black!80}, + extendedchars=true, + nolol, + inputencoding=\kvtcb@listingencoding, + literate={~}{\textcolor{gray}{\raisebox{-.75ex}{\textasciitilde}}}{1}, + commentstyle=\color{gray}, +} + +\DeclareTCBInputListing \Example { m } { + listing only, + listing file=demo#1, + tile, + finish={ + \draw (frame.north west) + (-\marginparsep,0pt) + node[line width=0pt, inner sep=0pt, anchor=north east] + {\includegraphics[page=#1, frame, width=\marginparwidth]{demo}} + ; + } +} + +\ExplSyntaxOn +\cs_set:Npn \__codedoc_macro_end_style:n #1 {} +\ExplSyntaxOff + +\begin{document} + \DocInput{\jobname.dtx} +\end{document} +% +% +%<*package> +\ProvidesExplPackage {abspos} {2022-09-22} {0.1} + {Absolute placement with coffins} +% +% \fi +% +% \title{The \pkg{abspos} package\\ Absolute placement with coffins} +% \author{Magnus Lie Hetland} +% +% \maketitle +% +% \begin{documentation} +% +% \noindent +% The \pkg{abspos} package lets you place contents at an absolute position, +% anchored at some specified part of the content, similar to how \pkg{tikz} +% nodes work, though without using the two-pass strategy of \pkg{tikz}. It also +% avoids messing with the order of \pkg{beamer} overlays, which is what happens +% when one uses the \pkg{textpos} package with the \pkg{overlay} +% option.\footnote{Another possible solution is to use the \pkg{pst-abspos} +% package, which relies on \pkg{pstricks}.} The solution used is quite +% straightforward, combining \emph{coffins} (using \pkg{l3coffins}) with the +% placement mechanisms of \pkg{atbegshi}. +% +% The main command of the package is |\absput|, which is somewhat similar to the +% |\put| command of the \LaTeX\@ |picture| environment. +% By default, it places its contents in the middle of the page, so +% |\absput{Hello}| will put the word ``Hello'' front and center. Variations +% are then possible using an optional argument consisting of keys and key--value +% pairs, as shown in the following. +% +% \Example{1} +% +% \noindent +% Supplying a |width| creates a vertical box. If the surrounding text is set, +% for example, using \cs{raggedright} (as is common in \pkg{beamer}), the +% contents of the \cs{absput} command will be, too. So if you want your text +% justified, you can use something like the \cs{justifying} command from +% \pkg{ragged2e}. +% +% \Example{2} +% +% \noindent +% The options can also be set globally (or within a group) using +% \cs{absposset}. For example, if you with to scale everything you place by a +% certain amount, you could do that as in the following. +% +% \Example{3} +% +% \noindent +% By default, the contents are placed \emph{in front} of the current page, but +% this can be modified by supplying your own ``page coffin'' (an \pkg{l3coffins} +% or \pkg{xcoffins} coffin) and typesetting that with, e.g., \pkg{atbegshi}. If, +% for example, you wish to place something in the background of every slide of a +% \pkg{beamer} presentation, you could do that by adding the following to the +% preamble.\footnote{Note that because it will end up behind even the slide +% itself, you need to remove the background color, by setting |bg| to nothing, +% as in the example code. If you want it behind the content, but still have a +% background color, you would need to add that yourself, with a colored box or +% filled \pkg{tikz} rectangle, possibly also using the \cs{absput} command.} +% +% ^^A Can't use tcblisting, because it uses \lstinputlisting, which doesn't +% ^^A respect `gobble` +% \begin{tcolorbox}[tile] +% \begin{lstlisting}[gobble=2, style=tcblatex] +% \setbeamercolor{background canvas}{bg=} % So the coffin isn't obscured +% +% \NewCoffin \MyPageCoffin +% \AtBeginShipout{ +% \AtBeginShipoutUpperLeft{ +% \TypesetCoffin \MyPageCoffin [t,l] (0pt,0pt) +% } +% } +% \end{lstlisting} +% \end{tcolorbox} +% +% \noindent +% Now simply add a \cs{absput} command at the beginning of the document, before +% your first |frame| (after |\begin{document}|), using |pg=\MyPageCoffin| to +% specify which coffin to use for rendering and positioning contents. This gives +% you a coordinate system starting at the top left corner of the page. If you +% wish to anchor your positioned elements elsewhere, you'll need to resize your +% page coffin (see p.~\pageref{p:reset}). +% +% \section*{Reference} +% +% \begin{function}{\absposset} +% \begin{syntax} +% \cs{absposset} \marg{options} +% \end{syntax} +% Sets the options, as described under \cs{absput}, to the value they should +% have within the current group (or globally, if not inside a group). +% \end{function} +% +% \begin{function}{\absput} +% \begin{syntax} +% \cs{absput} \oarg{options} \marg{contents} +% \end{syntax} +% Places \meta{contents} at some position (possibly scaled or rotated) as +% dictated by the optional \meta{options}, supplied as keys and key--value +% pairs. The \emph{defaults} are used as values if only the keys are given, and +% the \emph{initial values} are used if the options are not specified. The +% available options are as follows. +% \end{function} +% \begin{itemize} +% +% \item |angle=|\meta{angle}: The angle to which the coffin is rotated +% before being positioned. +% +% No default. Initial value |0|. +% +% \item |h=|\meta{h-anchor}: The horizontal anchor to use for positioning. +% This corresponds to a \pkg{l3coffins} (or \pkg{xcoffins}) \emph{pole}. The +% available anchors are |l| for left, |hc| for center and |r| for right. +% These are also available as separate valueless keys, so if you supply +% \cs{absput} with the key |l|, that is equivalent to using |h=l|, etc. +% +% There are also two-letter shortcuts defined for setting the horizontal and +% vertical anchors simultaneously, with the vertical one first. For example, +% |tl| is equivalent to |v=t,h=l|. In these double shortcuts, the prefixes +% |h| and |v| have been stripped from the center anchors, so that bottom +% center is |bc|, for example, and not |bhc|. +% +% No default. Initial value |hc|, which centers the coffin horizontally at +% \meta{x-coord}. +% +% \item |pg=|\meta{page-coffin}: Supplies the coffin to use as the +% page, or ``canvas,'' for placing the contents. +% +% No default. The initial value is an internal canvas that is rendered in +% front of the current page (on shipout), and then cleared. +% +% \item |pg-h|=\meta{page-h-anchor}: Similar to |h|, except that it applies +% to the canvas (set by |pg|). Shortcuts (like |pg-l| for |pg-h=l|) are +% defined for the default anchors (|l|, |hc|, |r|). +% +% Double shortcuts are defined for |pg-h| and |pg-v| in a similar manner to +% those defined for |h| and |v|, so that |pg-tl| is equivalent to +% |pg-v=t,pg-h=l|. +% +% No default. Initial value |hc|. +% +% \item |pg-v|=\meta{page-v-anchor}: Similar to |v|, except that it applies +% to the canvas (set by |pg|). Shortcuts (like |pg-t| for |pg-v=t|) are +% defined for the default anchors (|t|, |vc|, |b|, |T|, |B|, |H|). +% +% Combined shortcuts such as |pg-tl| and |pg-br|, etc., are also defined. +% See the descriptions of |h| and |pg-h| for more. +% +% No default. Initial value |vc|. +% +% \item |scale=|\meta{scale}: The factor by which the coffin is scaled. +% +% No default. If |scale| is not used, no scaling is performed. +% +% \item |v=|\meta{v-anchor}: The vertical anchor to use for positioning (see +% |h|). The available anchors are |t| for top, |vc| for center, |b| for +% bottom and |H| for baseline. These are also available as separate +% valueless keys, so if you supply \cs{absput} with the key |t|, that is +% equivalent to using |v=t|, etc. +% +% Note that if the |width| key is set, a vertial coffin is used, which makes +% the additional anchors (or poles) |T| (baseline of the first line, or +% other material at the top) and |B| (baseline for the last line, or other +% material at the bottom). +% +% Combined shortcuts such as |tl| and |br|, etc., are also defined. See the +% description of |h| for more. +% +% No default. Initial value |vc|, which centers the coffin vertically at +% \meta{y-coord}. +% +% \item |width=|\meta{width}: Set the width constraining the contents, +% before scaling. If this is set, the contents are set in vertical mode; +% otherwise, they are set in horizontal mode. +% +% No default and no initial value. +% +% \item |x=|\meta{x-coord}: The $x$ coordinate, measured from the current +% horizontal page anchor, set by |pg-h|. +% +% No default. Initial value |0pt|. +% +% \item |y=|\meta{y-coord}: The $y$ coordinate, measured from the current +% vertical page anchor, set by |pg-v|. +% +% No default. Initial value |0pt|. +% \end{itemize} +% +% \begin{function}{\absputcoffin} +% \begin{syntax} +% \cs{absputcoffin} \oarg{options} \meta{coffin} +% \end{syntax} +% Places \meta{coffin} at some position (possibly scaled or rotated), just like +% \cs{absput}. The difference is that a coffin is provided directly, rather than +% constructed by typesetting some supplied contents. This means that the |width| +% key is not used, though it is permitted for consistency (and ease of reusing +% option lists). +% \end{function} +% +% \end{documentation} +% +% \begin{implementation} +% +% \section*{Implementation} +% +% \begin{macrocode} +%<*package> +%<@@=apos> +% \end{macrocode} +% +% \noindent +% First, we need to import the necessary packages. We're using \pkg{expl3} to +% set up the package, so we get \pkg{l3coffins} for free (and cannot import it +% directly, anyway). If \pkg{abspos} is used with \pkg{beamer}, then +% \pkg{atbegshi} is already included. Elsewhere, though, it will not be, so we +% require it here. +% +% \begin{macrocode} +\RequirePackage{atbegshi} +% \end{macrocode} +% +% \noindent +% We make sure we have the variants we need of some existing commands: +% +% \begin{macrocode} +\cs_generate_variant:Nn \tl_if_novalue:nTF { VTF } +\cs_generate_variant:Nn \tl_if_novalue:nF { VF } +\cs_generate_variant:Nn \coffin_gattach:NnnNnnnn { NooNoonn } +% \end{macrocode} +% +% \begin{variable}{\g_apos_shipout_coffin} +% +% This variable is normally used to store the contents to be placed on the +% current page. It accumulates the contents from every call to \cs{absput} until +% the page is about to be typeset (shipped out), at which point +% \cs{g_apos_shipout_coffin} is typeset in front. +% +% \begin{macrocode} +\coffin_new:N \g_apos_shipout_coffin +% \end{macrocode} +% \end{variable} +% +% \begin{macro}{\apos_reset_shipout_coffin:}\label{p:reset} +% Used to initialize, and later reinitialize, the shipout coffin, to simply be +% an empty coffin with the width and height of the current page. +% \begin{macrocode} +\cs_new:Npn \apos_reset_shipout_coffin: { + \hcoffin_gset:Nn \g_apos_shipout_coffin { + \phantom{\rule{\paperwidth}{\paperheight}} + } +} +% \end{macrocode} +% \end{macro} +% +% \noindent +% The following hook ensures that that \cs{g_apos_shipout_coffin} is typeset in +% front of the page as it is being shipped out (anchored top left), and then +% cleared, ready to accumulate contents for the next page. The \pkg{atbegshi} +% command used wraps its contents in a |picture| environment, which we don't +% really need, but it seems to be more trouble than it's worth to get rid of it. +% +% \begin{macrocode} +\apos_reset_shipout_coffin: +\AtBeginShipout{ + \AtBeginShipoutUpperLeftForeground{ + \coffin_typeset:Nnnnn \g_apos_shipout_coffin {t} {l} {0pt} {0pt} + \apos_reset_shipout_coffin: + } +} +% \end{macrocode} +% +% \begin{variable}{\g_apos_canvas_coffin} +% +% This variable is used as part of the |pg| key, and is initially set equal to +% \cs{g_apos_shipout_coffin}, so that whatever is rendered to the canvas (i.e., +% \cs{g_apos_canvas_coffin}) is placed on top of the page contents on shipout, +% and then cleared. If a different behavior is desired, another coffin can can +% be supplied instead. Rather than constructing a coffin, we just set up a token +% list, which initially will be aliased to the actual coffin +% \cs{g_apos_shipout_coffin} as part of the key handling. +% \begin{macrocode} +\tl_new:N \g_apos_canvas_coffin +% \end{macrocode} +% \end{variable} +% \begin{macro}{\apos_reset_overlay:} +% This is a utility to reset \pkg{beamer} overlay specifications at the end of +% our coffin contents. The idea is that if we use, say, \cs{pause} inside +% \cs{absput}, then everything after the \cs{pause} command will be paused, +% including material \emph{outside} \cs{absput}. To restrict such commands to the +% contents provided to \cs{absput}, we use \cs{onslide<1->} after typesetting the +% contents in our coffin. This is only useful (or possible) when using +% \pkg{beamer}, so otherwise, we just alias \cs{ap_reset_overlay:} to +% \cs{relax}, i.e., don't do anything. +% \begin{macrocode} +\tl_new:N \apos_reset_overlay: +\@ifclassloaded{beamer} + { \tl_gset:Nn \apos_reset_overlay: { \onslide<1-> } } + { \tl_gset_eq:NN \apos_reset_overlay: \relax } +% \end{macrocode} +% \end{macro} +% +% \noindent +% We now define the various keys used to configure \cs{absput}, as described +% in the reference. +% +% \begin{macrocode} +\keys_define:nn { abspos } { + + angle .tl_set:N = \l_apos_angle_tl, + angle .initial:V = \c_novalue_tl, + angle .value_required:n = true, + + h .tl_set:N = \l_apos_hanchor_tl, + h .initial:n = hc, + h .value_required:n = true, + + pg .code:n = { \tl_set_eq:NN \g_apos_canvas_coffin #1 }, + pg .initial:n = \g_apos_shipout_coffin, + pg .value_required:n = true, + + pg-h .tl_set:N = \l_apos_on_hanchor_tl, + pg-h .initial:n = hc, + pg-h .value_required:n = true, + + pg-v .tl_set:N = \l_apos_on_vanchor_tl, + pg-v .initial:n = vc, + pg-v .value_required:n = true, + + scale .tl_set:N = \l_apos_scale_tl, + scale .initial:V = \c_novalue_tl, + scale .value_required:n = true, + + v .tl_set:N = \l_apos_vanchor_tl, + v .initial:n = vc, + v .value_required:n = true, + + width .tl_set:N = \l_apos_width_tl, + width .initial:V = \c_novalue_tl, + width .value_required:n = true, + + x .tl_set:N = \l_apos_x_tl, + x .initial:n = { 0pt }, + x .value_required:n = true, + + y .tl_set:N = \l_apos_y_tl, + y .initial:n = { 0pt }, + y .value_required:n = true, + +} + +\clist_const:Nn \@@_hanchors_clist {l,hc,r} +\clist_const:Nn \@@_vanchors_clist {t,vc,b,H,T,B} + +\cs_new:Npn \@@_define_shortcuts:nnn #1 #2 #3 { + \keys_define:nn { abspos } { + + #1 .meta:n = { #2 }, + #1 .value_forbidden:n = true, + + pg-#1 .meta:n = { #3 }, + pg-#1 .value_forbidden:n = true, + + } +} + +\cs_generate_variant:Nn \@@_define_shortcuts:nnn { Vnn } + +\clist_map_inline:Nn \@@_hanchors_clist { + + \@@_define_shortcuts:nnn { #1 } { h = #1 } { pg-h = #1 } + +} + +\clist_map_inline:Nn \@@_vanchors_clist { + + \@@_define_shortcuts:nnn { #1 } { v = #1 } { pg-v = #1 } + +} + +\clist_map_inline:Nn \@@_vanchors_clist { + \clist_map_inline:Nn \@@_hanchors_clist { + + \tl_clear:N \g_tmpa_tl + + \tl_if_eq:nnTF { #1 } { vc } + { \tl_put_right:Nn \g_tmpa_tl { c } } + { \tl_put_right:Nn \g_tmpa_tl { #1 } } + + \tl_if_eq:nnTF { ##1 } { hc } + { \tl_put_right:Nn \g_tmpa_tl { c } } + { \tl_put_right:Nn \g_tmpa_tl { ##1 } } + + \@@_define_shortcuts:Vnn + \g_tmpa_tl { v = #1, h = ##1 } { pg-v = #1, pg-h = ##1 } + + } +} +% \end{macrocode} +% In order to let the user set options outside the actual use of \cs{absput} and +% \cs{absputcoffin}, we introduce a wrapper: +% \begin{macrocode} +\NewDocumentCommand \absposset { +m } { + \keys_set:nn { abspos } { #1 } +} +% \end{macrocode} +% +% \begin{macro}{\absput} +% This is the main command of the package. It takes a key--value list as its +% first optional argument, followed by the contents that are to be placed. +% \begin{macrocode} +\NewDocumentCommand \absput { +O{ } +m } { + \group_begin: +% \end{macrocode} +% First we handle the keys, updating variables holding coordinates, etc. +% \begin{macrocode} + \keys_set:nn { abspos } { #1 } +% \end{macrocode} +% Then the contents are typeset, with some additions, into a temporary coffin. +% The additions are that whitespace is stripped around the contents, and that we +% reset any overlay counters (in case they are modified by \cs{onslide} or +% \cs{pause}, or the like). If we're not using \pkg{beamer}, this last part is a +% no-op. +% +% If |width| has been set, the contents is set in vertical mode (using the given +% width); otherwise, it is set in horizontal mode. +% \begin{macrocode} + \tl_set:Nn \l_tmpa_tl { + \ignorespaces #2 \unskip + \apos_reset_overlay: + } + \tl_if_novalue:VTF \l_apos_width_tl { + \hcoffin_set:Nn \l_tmpa_coffin \l_tmpa_tl + } { + \vcoffin_set:Nnn \l_tmpa_coffin \l_apos_width_tl \l_tmpa_tl + } +% \end{macrocode} +% Finally, actually place the typeset coffin on the canvas coffin. +% \begin{macrocode} + \@@_absput_coffin:N \l_tmpa_coffin + \group_end: +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\absputcoffin} +% A thin wrapper around the internal \cs{@@_absput_coffin:N}. The only extra +% work done here is setting the keys. +% \begin{macrocode} +\NewDocumentCommand \absputcoffin { +O{ } m } { + \group_begin: + \keys_set:nn { abspos } { #1 } + \@@_absput_coffin:N #2 + \group_end: +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_absput_coffin:N} +% An internal macro for placing a given coffin, using the options currently in +% effect (i.e., as configured by \cs{keys_set:nn} in some outer group). Used by +% \cs{absput} and \cs{absputcoffin}. +% \begin{macrocode} +\cs_new:Npn \@@_absput_coffin:N #1 { +% \end{macrocode} +% If a scale has been provided, we scale the temporary coffin (with the same +% factor in both directions). +% \begin{macrocode} + \tl_if_novalue:VF \l_apos_scale_tl { + \coffin_scale:Nnn #1 \l_apos_scale_tl \l_apos_scale_tl + } +% \end{macrocode} +% If an angle has been provided, we rotate the temporary coffin. +% \begin{macrocode} + \tl_if_novalue:VF \l_apos_angle_tl { + \coffin_rotate:Nn #1 \l_apos_angle_tl + } +% \end{macrocode} +% We now join the temporary coffin to our canvas coffin, so it will be rendered +% at the correct position at shipout. +% \begin{macrocode} + \coffin_gattach:NooNoonn + \g_apos_canvas_coffin + {\l_apos_on_hanchor_tl} {\l_apos_on_vanchor_tl} + #1 + {\l_apos_hanchor_tl} {\l_apos_vanchor_tl} + {\l_apos_x_tl} {\l_apos_y_tl} +% \end{macrocode} +% +% \noindent +% Ideally, what we just did should have been enough. However, until +% October~2021, the \cs{coffin_gattach:} command was not actually +% global,\footnote{\url{https://tex.stackexchange.com/questions/618198}} so +% to have our modification take effect outside the current group also for older +% versions of \pkg{l3coffins}, we perform a final (normally redundant) global +% self-assignment before ending the \cs{absput} command. +% +% \begin{macrocode} + \coffin_gset_eq:NN \g_apos_canvas_coffin \g_apos_canvas_coffin +} +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +% +% \end{macrocode} +% +% \end{implementation} diff --git a/macros/latex/contrib/abspos/abspos.pdf b/macros/latex/contrib/abspos/abspos.pdf new file mode 100644 index 0000000000..a6514d8370 Binary files /dev/null and b/macros/latex/contrib/abspos/abspos.pdf differ diff --git a/macros/latex/contrib/abspos/demo.tex b/macros/latex/contrib/abspos/demo.tex new file mode 100644 index 0000000000..ba2b7ab867 --- /dev/null +++ b/macros/latex/contrib/abspos/demo.tex @@ -0,0 +1,67 @@ +\documentclass{beamer} +\usefonttheme{serif} +\beamertemplatenavigationsymbolsempty + +\usepackage{xcoffins} +\usepackage{abspos} +\usepackage{ragged2e} +\usepackage{lipsum} +\usepackage{tikz} +\usepackage{newfile} + +\newoutputstream{io} + +\ExplSyntaxOn + +\cs_generate_variant:Nn \tl_replace_all:Nnn { Nxx } + +\NewDocumentCommand \ExampleFrame { m +v } { + + \tl_set:Nn \l_tmpa_tl {#2} + \tl_replace_all:Nxx \l_tmpa_tl { \iow_char:N \^^M } { \iow_char:N \^^J } + \regex_replace_once:nnN { ^\v* } { } \l_tmpa_tl + + \openoutputfile{demo#1.tex}{io} + \addtostream{io}{\l_tmpa_tl} + \closeoutputstream{io} + + \frame{\input{demo#1}} + +} + +\ExplSyntaxOff + +\begin{document} + +\ExampleFrame{1}{ +% In preamble: +% \usepackage{tikz} +\absput{\tikz{ + \draw[line width=8pt, lightgray] circle[radius=3.25]; +}} +\absput[angle=10, scale=5]{Hello!} +\absput[pg-b, y=.5cm]{\thepage} +} + +\ExampleFrame{2}{ +% In preamble: +% \usepackage{ragged2e} +% \usepackage{lipsum} +\absput[width=8cm]{ + \justifying + \lipsum[1][1-5] % Example text +} +} + +\ExampleFrame{3}{ +\absposset{scale=5} +\absput{Scaled!} +} + +\begin{frame} +\NewCoffin \MyCoffin +\SetHorizontalCoffin \MyCoffin {My Coffin} +\absputcoffin[scale=2] \MyCoffin +\end{frame} + +\end{document} diff --git a/macros/latex/contrib/blowup/blowup-ex1.pdf b/macros/latex/contrib/blowup/blowup-ex1.pdf index d67653e490..6f1af02858 100644 Binary files a/macros/latex/contrib/blowup/blowup-ex1.pdf and b/macros/latex/contrib/blowup/blowup-ex1.pdf differ diff --git a/macros/latex/contrib/blowup/blowup-ex2.pdf b/macros/latex/contrib/blowup/blowup-ex2.pdf index 5ee25768e0..88ca3eeef6 100644 Binary files a/macros/latex/contrib/blowup/blowup-ex2.pdf and b/macros/latex/contrib/blowup/blowup-ex2.pdf differ diff --git a/macros/latex/contrib/blowup/blowup-ex3.pdf b/macros/latex/contrib/blowup/blowup-ex3.pdf index 53404b97d9..d8bae71cf9 100644 Binary files a/macros/latex/contrib/blowup/blowup-ex3.pdf and b/macros/latex/contrib/blowup/blowup-ex3.pdf differ diff --git a/macros/latex/contrib/blowup/blowup-ex4.pdf b/macros/latex/contrib/blowup/blowup-ex4.pdf index 5d0816e9a4..fd00e54ac1 100644 Binary files a/macros/latex/contrib/blowup/blowup-ex4.pdf and b/macros/latex/contrib/blowup/blowup-ex4.pdf differ diff --git a/macros/latex/contrib/blowup/blowup-ex5.pdf b/macros/latex/contrib/blowup/blowup-ex5.pdf index f41f2eb1d2..f95c24b056 100644 Binary files a/macros/latex/contrib/blowup/blowup-ex5.pdf and b/macros/latex/contrib/blowup/blowup-ex5.pdf differ diff --git a/macros/latex/contrib/blowup/blowup-ex6.pdf b/macros/latex/contrib/blowup/blowup-ex6.pdf new file mode 100644 index 0000000000..e03fb322a5 Binary files /dev/null and b/macros/latex/contrib/blowup/blowup-ex6.pdf differ diff --git a/macros/latex/contrib/blowup/blowup-ex6.tex b/macros/latex/contrib/blowup/blowup-ex6.tex new file mode 100644 index 0000000000..4128a48b36 --- /dev/null +++ b/macros/latex/contrib/blowup/blowup-ex6.tex @@ -0,0 +1,59 @@ +% Rolf Niepraschk, 2020-09-19 +% +% Translate to pdf with any TeX compiler and check the page size with +% +% pdfinfo filename.pdf +% +% or via the properties menu of the pdf viewer +% +\listfiles +\documentclass[a4paper,twoside]{article} +\usepackage{array,xcolor} + +% Just to show the page size of the source. +\usepackage{xcolor,atbegshi} +\AtBeginShipout{% + \AtBeginShipoutUpperLeft{% + \textcolor{green!30}{\rule[-\paperheight]{\paperwidth}{\paperheight}}% + }% +} + +\renewcommand\familydefault{\sfdefault} +\setlength\parindent{0pt} +\pagestyle{empty} + +\usepackage{blowup} +\blowUp{h-mirroring,v-mirroring}% vertical and horizontal mirrored + +\begin{document} + +\null\vfill + +\huge\centering + +A4-sized document not resized, mirrored vertically and horizontally + +\vfill + +\setlength\extrarowheight{.5ex} +\begin{tabular}{|>{\bfseries}l<{:}r<{\,mm}!{$\times$}r<{\,mm}|} \hline + letter & 216 & 279 \\ + legal & 216 & 356 \\ + executive & 184 & 267 \\ + A8 & 52 & 74 \\ + A7 & 74 & 105 \\ + A6 & 105 & 148 \\ + A5 & 148 & 210 \\ + A4 & 210 & 297 \\ + A3 & 297 & 420 \\ + A2 & 420 & 594 \\ + A1 & 594 & 841 \\ + A0 & 841 & 1189 \\ \hline +\end{tabular} + +\vfill + +\newpage\null 2nd page\dots + +\end{document} +%--------------------------- diff --git a/macros/latex/contrib/blowup/blowup.dtx b/macros/latex/contrib/blowup/blowup.dtx index 374f2878de..3385861926 100644 --- a/macros/latex/contrib/blowup/blowup.dtx +++ b/macros/latex/contrib/blowup/blowup.dtx @@ -24,7 +24,7 @@ \ProvidesFile{blowup.dtx} % %\NeedsTeXFormat{LaTeX2e}[2020/10/01] -%\ProvidesPackage{blowup}[2022/09/19 2.0.0 Page scaling (RN)] +%\ProvidesPackage{blowup}[2022/09/22 2.1.0 Page scaling (RN)] % %<*driver> \documentclass{ltxdoc} @@ -43,7 +43,7 @@ % % \fi % -% \CheckSum{510} +% \CheckSum{546} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -105,20 +105,26 @@ % (e.\,g., |a8|, |c7|,..., |b1|, |a0|) or a pair of dimensions % in curly brackets (e.\,g., |target={925mm,1225mm}|) or the % letter `x' followed by a scaling factor -% (e.\,g., |target=x1.414213|). \tabularnewline[.4\baselineskip] +% (e.\,g., |target=x1.414213|). \tabularnewline[.75ex] % origin & Scaled size of the source document: \tabularnewline % & |letter|, |legal|, |executive| or a paper size from the % ISO/DIN paper series A, B, C, D % (e.\,g., |a8|, |c7|,..., |b1|, |a0|) or a pair of dimensions % in curly brackets (e.\,g., |origin={925mm,1225mm}|) or the % letter `x' followed by a scaling factor -% (e.\,g., |origin=x1.414213|). \tabularnewline[.4\baselineskip] +% (e.\,g., |origin=x1.414213|). \tabularnewline[.75ex] +% h-mirroring & horizontally mirroring of the final pages \tabularnewline +% & |true| (the same as no value) or |false| (default: |false|). +% \tabularnewline[.75ex] +% v-mirroring & vertically mirroring of the final pages \tabularnewline +% & |true| (the same as no value) or |false| (default: |false|). +% \tabularnewline[.75ex] % landscape & Exchanges paperwidth and paperheight: \tabularnewline -% & |true| (the same as no value) or |false|. -% \tabularnewline[.4\baselineskip] +% & |true| (the same as no value) or |false| (default: |false|). +% \tabularnewline[.75ex] % noscale & No scaling of the original paper size: \tabularnewline -% & |true| (the same as no value) or |false|. -% \tabularnewline[.4\baselineskip] +% & |true| (the same as no value) or |false| (default: |false|). +% \tabularnewline[.75ex] % pos & Position of the page on the paper: \tabularnewline % & |left| or |right|, |inside| or |outside|, |top| or |bottom| % (only the first letter is significant; default is @@ -126,10 +132,12 @@ % a pair of dimensions in curly brackets which means the offset % from the lower left or lower outside corner of the final paper. % Only meaningful for |noscale=true| and up-scaled paper -% size. \tabularnewline[.4\baselineskip] -% onepage & Suppresses the second page and all following pages: \tabularnewline -% & |true| (the same as no value) or |false|. \tabularnewline -% & Useful for creating a one-side paper like a poster. +% size. \tabularnewline[.75ex] +% onepage & Suppresses the second page and all following pages: +% \tabularnewline +% & |true| (the same as no value) or |false| (default: |false|). +% \tabularnewline +% & Useful for creating a one-page document like a poster. % \end{longtable} % \vspace{0\baselineskip} % See also the example documents |blowup-ex?.tex|. @@ -216,6 +224,7 @@ % \begin{macro}{\BL@scalePage} % The whole scaling process of the the shipout box to the dimension of the % new paper size. +% \changes{2.1.0}{2022/09/22}{New options `h-mirroring' and `v-mirroring' (RN)} % \begin{macrocode} \newcommand*\BL@scalePage{% % \end{macrocode} @@ -244,6 +253,9 @@ \hb@xt@\tPaperWidth{\BL@l\BL@resize{\box\AtBeginShipoutBox}\BL@r}% \BL@b\kern\z@ }% + \ifBL@mirroring + \setbox\@tempboxa=\hbox{\scalebox{\BL@h}[\BL@v]{\box\@tempboxa}}% + \fi % \end{macrocode} % Denormalize the shipout box % \begin{macrocode} @@ -355,11 +367,20 @@ % % \begin{macrocode} \newif\ifBL@noscale \BL@noscalefalse +\newif\ifBL@mirroring \BL@mirroringfalse % \end{macrocode} % % \begin{macrocode} \define@key{BL@}{noscale}[true]{% - \csname BL@noscale#1\endcsname + \global\csname BL@noscale#1\endcsname +} +\define@key{BL@}{h-mirroring}[true]{% + \global\csname BL@mirroring#1\endcsname + \gdef\BL@h{-1}% +} +\define@key{BL@}{v-mirroring}[true]{% + \global\csname BL@mirroring#1\endcsname + \gdef\BL@v{-1}% } % \end{macrocode} % @@ -370,6 +391,8 @@ \newcommand*\BL@o{} \newcommand*\BL@t{} \newcommand*\BL@b{} +\newcommand*\BL@h{1} +\newcommand*\BL@v{1} % \end{macrocode} % % @@ -446,6 +469,8 @@ % The only user-level macro. % \begin{macrocode} \newcommand*\blowUp[1]{% + \global\tPaperWidth=\paperwidth + \global\tPaperHeight=\paperheight \setkeys{BL@}{#1}% \ifBL@landscape \@tempdima=\tPaperWidth diff --git a/macros/latex/contrib/blowup/blowup.pdf b/macros/latex/contrib/blowup/blowup.pdf index 03efefbc9c..38b26ab049 100644 Binary files a/macros/latex/contrib/blowup/blowup.pdf and b/macros/latex/contrib/blowup/blowup.pdf differ diff --git a/macros/latex/contrib/colorframed/README.md b/macros/latex/contrib/colorframed/README.md new file mode 100644 index 0000000000..59bc8c094b --- /dev/null +++ b/macros/latex/contrib/colorframed/README.md @@ -0,0 +1,55 @@ +% colorframed 0.9 +% Jean-François Burnol +% 2022/09/22 + +## Usage + +This is a LaTeX package. Use it with `\usepackage{colorframed}`. + +For reporting issues, use the +[repository](https://github.com/jfbu/colorframed) issue tracker. + +## Purpose + +The initial release `0.9` of `2022/09/22` fixes colour leak issues +which one encounters with the environments provided by the +[framed](https://ctan.org/pkg/framed) package. + +It is planned to extend `colorframed` with one more environment, +based upon [pict2e](https://ctan.org/pkg/pict2e), which will +provide breakable boxes with possibly rounded corners, optional +background colour, external or inset shadow, separate +customizability of the padding separations and border widths in +the four directions, ... + +## Copyright and License + +Copyright (c) 2022 Jean-François Burnol + +The colorframed [CTAN package](https://ctan.org/pkg/colorframed) +is distributed under the +[LPPL 1.3c](https://ctan.org/license/lppl1.3c). + +This Work may be distributed and/or modified under the conditions +of the LaTeX Project Public License version 1.3c. This version of +this license is in + +> + +and version 1.3 or later is part of all distributions of LaTeX +version 2005/12/01 or later. + +This Work has the LPPL maintenance status author-maintained. + +The Author of this Work is Jean-François Burnol + +This Work consists of the package files `colorframed.sty`, the +documentation source `colorframed-doc.tex` and its conversion +`colorframed-doc.pdf`, as well as this `README.md`. + + diff --git a/macros/latex/contrib/colorframed/colorframed-doc.pdf b/macros/latex/contrib/colorframed/colorframed-doc.pdf new file mode 100644 index 0000000000..16ee21cf33 Binary files /dev/null and b/macros/latex/contrib/colorframed/colorframed-doc.pdf differ diff --git a/macros/latex/contrib/colorframed/colorframed-doc.tex b/macros/latex/contrib/colorframed/colorframed-doc.tex new file mode 100644 index 0000000000..cc2b6fca39 --- /dev/null +++ b/macros/latex/contrib/colorframed/colorframed-doc.tex @@ -0,0 +1,238 @@ +\documentclass[a4paper,dvipdfmx,11pt]{article} +\usepackage[T1]{fontenc} +\usepackage{geometry} +\usepackage[straightquotes,ttzdefault]{newtxtt} +\usepackage{framed} +\usepackage[dvipsnames]{xcolor} +\usepackage{colorframed} +% we put this here but it does not have to be in preamble of +% course +% titled-frame +\colorlet{TFFrameColor}{teal!20} +\colorlet{TFTitleColor}{orange} +\def\colorframedTFconlabcolorcommand{\color{red}} +% shaded +\colorlet{shadecolor}{orange!20} +% framed +\FrameRule5pt\relax +\FrameSep9pt\relax +\def\colorframedbordercolorcommand{\color{red!20}} + +\title{The \colorframed package% +\vadjust{\vtop to 0pt{\hbox + to\linewidth{\strut\footnotesize Release 0.9 of + 2022/09/22\hss report issues at \url{https://github.com/jfbu/colorframed}}\vss}}% +} +\author{Jean-François Burnol} +\date{} +\usepackage{shortvrb}\MakeShortVerb\| +%\usepackage{url}\urlstyle{same} +\usepackage{hyperref} +\def\ctanpackage#1{\href{https://ctan.org/pkg/#1}{#1}} + +\usepackage{amssymb} + +\usepackage{parskip} +\usepackage{xspace} + +\definecolor{joli}{RGB}{225,95,0} +\definecolor{JOLI}{RGB}{225,95,0} +\newcommand\colorframed{% + \texorpdfstring{{\color{joli}\bfseries colorframed}}{colorframed}\xspace} + + +{\makeatletter\sbox0{\color{RawSienna}\xdef\foo{\current@color}}} + \edef\verbatimpushcolor{\special{color push \foo}} + \def\verbatimpopcolor{\special{color pop}} +\AddToHook{env/verbatim/before}{\verbatimpushcolor} +\AddToHook{env/verbatim/end}{\verbatimpopcolor} +\begin{document} +\maketitle + +\section{Description} + +This package fixes various colour leaks one encounters with +the environments from Donald Arseneau's package +\ctanpackage{framed}. Typically, colour leaks occur if using +|\color| inside the environments, or more subtly also when +using |\textcolor| with an argument ending up being split at a +page break. + +This latter type of colour leak (or colour disappearance) is the +more challenging one as the fix requires modifications or +replacements not only of some of the \ctanpackage{framed}.sty +macros (such as its |\CustomFBox|) but also to some \LaTeX2e +internals, as some environments of \ctanpackage{framed}.sty +rely on usage of |\fbox| or |\colorbox|. + +However, rather than overwriting such internal \LaTeX2e macros +as |\@frameb@x| or |\color@b@x|, the \ctanpackage{framed}.sty +environments are modified by \colorframed to make use of +custom replacements to |\fbox|, |\colorbox|, and +|\CustomFBox|. + +I am aware \ctanpackage{tcolorbox} package documentation explains at +least one colour issue which looks similar to those fixed +here in \ctanpackage{framed} context, and that the fix overthere uses +an extra colour stack, hence is not xelatex compatible +currently. + +The problems are solved here without involving an extra +colour stack, hence the fixes work also with xelatex. + +% The analysis and original workarounds for using framed.sty +% with colours were developed by me in some contributions I made +% to the Sphinx project (\url{https://github.com/sphinx-doc/sphinx}) +% and I am transferring here the general idea. + +% The key thing is that the boxes handled by framed.sty may +% contain isolated colour push or colour pop. We must make +% sure an isolated colour push, if followed by colour changes, +% is always followed by paired ones, and never by a colour pop +% from a colour command originated "prior". + +% TODO: transfer also the breakable box environment based on pict2e +% and allowing rounded corners and shadows developped overthere. + +\section{The environments from \ctanpackage{framed}} + +\begin{titled-frame}{A list of the environments from package \ctanpackage{framed}} + This indicates the boxing macros they are + based upon originally, and what this package does as replacement: + \begin{description} + \item[framed] (|\fbox|) The \colorframed variant uses own |\CustomFBox| rather. + + \item[oframed] (|\CustomFBox|) \colorframed replaces it with own version. + + \item[titled-frame] (|\CustomFbox|) Replaced by own version. + + \item[shaded] (|\colorbox|) Replaced by |\colorframedcolorbox|. + + \item[shaded*] (|\colorbox|) Idem. + + \item[snugshade] (|\colorbox|) Idem. + + \item[snugshade*] (|\colorbox|) Idem. + + \item[leftbar] This one does not use any boxing macro. + \end{description} +\end{titled-frame} + +\begin{shaded*} + We refer the reader to \ctanpackage{framed} documentation + and provide here only a few additional details, particularly + regarding the `titled-frame' environment as it is described + in \ctanpackage{framed} documentation more as being a + template than a user-level finalized environment. The above + box gives an example of its use. It is an environment with + one mandatory argument which provides the title of the + frame, which is repeated after a page break with |(cont)| + appended. The colours |TFFrameColor| and + |TFTitleColor| must be defined by user. To customize + further one will need to renew the environment definition, + which is left untouched by \colorframed (which modifies + rather |\TitleBarFrame| and |\CustomFBox|). Here is + how this environment is defined: +\begin{verbatim} +% A particular type of titled frame with continuation marks. +% Parameter #1 is the title, repeated on each page. +\newenvironment{titled-frame}[1]{% + \def\FrameCommand{\fboxsep8pt\fboxrule2pt + \TitleBarFrame{\textbf{#1}}}% + \def\FirstFrameCommand{\fboxsep8pt\fboxrule2pt + \TitleBarFrame[$\blacktriangleright$]{\textbf{#1}}}% + \def\MidFrameCommand{\fboxsep8pt\fboxrule2pt + \TitleBarFrame[$\blacktriangleright$]{\textbf{#1\ (cont)}}}% + \def\LastFrameCommand{\fboxsep8pt\fboxrule2pt + \TitleBarFrame{\textbf{#1\ (cont)}}}% + \MakeFramed{\advance\hsize-20pt \FrameRestore}}% +% note: 8 + 2 + 8 + 2 = 20. Don't use \width because the frame title +% could interfere with the width measurement. + {\endMakeFramed} +\end{verbatim} +% pas de \footnote dans les environnements de framed... +\begin{footnotesize}\normalcolor +As a side note, this `titled-frame' environment was partly +broken in recent \LaTeX\ which has modified how |\smash| +behaves; \colorframed fixes it in passing.\par +\end{footnotesize} +\end{shaded*} +% jeudi 22 septembre 2022 à 14:37:08 +% Il se passe des choses très bizarres avec snugshade* ou +% framed en premier après un \item qui me semblent être des +% bugs de framed. Dans Sphinx, je n'ai pas eu ces problèmes, +% au contraire je suis sûr que ça fonctionne avec les +% environnements que j'y ai définis reposant sur framed (et un +% \trivlist en général), j'ai testé plusieurs fois. +% Ce n'est pas induit par colorframed j'ai vérifié sans lui. +%\begin{enumerate} +%\item\relax% {\footnotesize Now testing the `snugshade*' environment.} +\begin{snugshade*}\textcolor{ForestGreen}{% using textcolor to + % avoid extra vspace from \color + One does not need to dive into the details of the macros + used above to understand intuitively how they are supposed + to influence the final output. To modify this output, + simply redefine this environment with suitable changes. + Notice in particular that \expandafter|\string\blacktriangleright| requires to + the best of my knowledge loading of \ctanpackage{amssymb} or + other math symbols package and it is up to user to do it, if + its usage is kept.} +%\end{snugshade*} +%\item\relax% {\footnotesize It appears to have a bug of not being +% usable directly after |\item|.\par} +%\begin{snugshade*} + +The original environment gives to the continuation label at +bottom right of the first part of a broken box the same colour +as the frame. The \colorframed variant adds the possibility +to customize this colour via suitably defining a macro, in the +example above we did: +\begin{verbatim} +\renewcommand\colorframedTFconlabcolorcommand{\color{red}} +\end{verbatim} +\end{snugshade*} +%\end{enumerate} + +\begin{framed} + This is an example of usage of the environment `framed'. + + This environment allows customization of the border width + and of the separation with contents, via |\FrameRule| and + |\FrameSep|, but not of the colour of the border. The + \colorframed version adds this possibility: it is simply a + matter of redefining the |\colorframedbordercolorcommand| + macro, which defaults to |\normalcolor|. + +\color{blue} + So the current frame was configured using: +\begin{verbatim} +\setlength{\FrameRule}{5pt} +\setlength{\FrameSep}{9pt} +\renewcommand\colorframedbordercolorcommand{\color{red!20}} +\end{verbatim} + The text colour induced from a |\color{blue}| + will not leak out to the frame or to the text following this + environment, even in case of a pagebreak. +\end{framed} + +As indicated the aim of \colorframed is not to modify the +existing environments of \ctanpackage{framed}.sty into +acquiring more capabilities and customizability, and we have +indicated already the two sole customization additions. The aim +was strictly to fix the colour leak issues. + +\section{TODO} + +The author has developed based upon usage of +\ctanpackage{pict2e} breakable boxes with round corners, +background colour, optional shadow, and other goodies and is +planning on incorporating this environment into the package. + +Of course, it will remain limited in comparison to the fully +customizable boxes provided by package \ctanpackage{tcolorbox} +but our testing showed significant speed-up in build time, which +may matter for long documents. + +Hopefully this addition will be done when time will permit. + +\end{document} \ No newline at end of file diff --git a/macros/latex/contrib/colorframed/colorframed.sty b/macros/latex/contrib/colorframed/colorframed.sty new file mode 100644 index 0000000000..db6a5d5e2f --- /dev/null +++ b/macros/latex/contrib/colorframed/colorframed.sty @@ -0,0 +1,156 @@ +% colorframed.sty v0.9 2022/09/22 +% Copyright (c) 2022 Jean-François Burnol +% Distributed under the terms of the LPPL 1.3c, see README.md +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{colorframed} + [2022/09/22 v0.9 fix `framed' breakable boxes colour leaks (JFB)] +\RequirePackage{framed} +\RequirePackage{color} +% First we must make \MakeFramed/\endMakeFramed colour safe. +\expandafter\def\expandafter\MakeFramed\expandafter#\expandafter1\expandafter + {\MakeFramed{#1}\color@begingroup} +\expandafter\def\expandafter\endMakeFramed\expandafter + {\expandafter\color@endgroup\endMakeFramed} +% +% `framed' +\def\FrameCommand{% + \setlength\fboxrule{\FrameRule}\setlength\fboxsep{\FrameSep}% + \CustomFBox{}{}\fboxrule\fboxrule\fboxrule\fboxrule % replaces \fbox +} +% The frame colour can be set via modifying this macro. +\def\colorframedbordercolorcommand{\normalcolor} +% +% `shaded', `shaded*', `snugshade', `snugshade*' +% The \colorbox in \FrameCommand is replaced by \colorframedcolorbox +\renewenvironment{shaded}{% + \def\FrameCommand{\fboxsep=\FrameSep + \colorframedcolorbox{shadecolor}}%<<<< MODIFIED + \MakeFramed {\FrameRestore}}% + {\endMakeFramed} +\renewenvironment{shaded*}{% + \def\FrameCommand{\fboxsep=\FrameSep + \colorframedcolorbox{shadecolor}}%<<<< MODIFIED + \MakeFramed {\advance\hsize-\width \FrameRestore}}% + {\endMakeFramed} +\renewenvironment{snugshade}{% + \def\FrameCommand##1{\hskip\@totalleftmargin \hskip-\fboxsep + \colorframedcolorbox{shadecolor}{##1}%<<<< MODIFIED + \hskip-\fboxsep + % There is no \@totalrightmargin, so: + \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}% + \MakeFramed {\advance\hsize-\width + \@totalleftmargin\z@ \linewidth\hsize + \@setminipage}% + }{\par\unskip\@minipagefalse\endMakeFramed} +\renewenvironment{snugshade*}{% + \def\FrameCommand##1{\hskip\@totalleftmargin + \colorframedcolorbox{shadecolor}{##1}%<<<< MODIFIED + % There is no \@totalrightmargin, so: + \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}% + \MakeFramed {\advance\hsize-\width + \@totalleftmargin\z@ \linewidth\hsize + \advance\labelsep\fboxsep + \@setminipage}% + }{\par\unskip\@minipagefalse\endMakeFramed} +% The \colorframedcolorbox was obtained via a process of trimming from some +% far more capable box, hence some possibly strange looking or sub-optimal +% code; but we did not want to keep extra capabilities and have to provide +% interface for that... +\def\colorframedcolorbox#1#2{% + % #1 is in our usage always "shadecolor" (which has to be defined by user) + % #2 is in our usage always a box or rule + \leavevmode% this is not needed in our usage + \hbox{% + \setbox\@tempboxa\hbox{\kern\fboxsep{#2}\kern\fboxsep}% + \ht\@tempboxa + \dimexpr\ht\@tempboxa+\fboxsep\relax + \dp\@tempboxa + \dimexpr\dp\@tempboxa+\fboxsep\relax + % BACKGROUND + % draw background and move back to reference point + {\color{#1}% + \vrule\@height\ht\@tempboxa + \@depth\dp\@tempboxa + \@width\wd\@tempboxa + \kern-\wd\@tempboxa + }% + % CONTENTS + \box\@tempboxa + }% +} +% +% `oframed' and `titled-frame' +% The \CustomFBox redefinition. +% Refer to framed.sty for significance of the parameters. +% We have not wrapped #3, #4, #5, #6 thicknesses in \dimexpr. +% Generally speaking, no attempt here to make this macro more +% versatile than is the original. +% Our version tries to let #1 and #2 have same effect as in original +% (where they are only used for titled-frame environment, and +% it thus seems to be sort of a convention that #2 has no height.) +\long\def\CustomFBox#1#2#3#4#5#6#7{% + \leavevmode\begingroup + \setbox\@tempboxa\hbox{% + \color@begingroup + \kern\fboxsep{#7}\kern\fboxsep + \color@endgroup}% + \hbox{% + \ht\@tempboxa + \dimexpr\ht\@tempboxa+\fboxsep+#3\relax % cf "overlap" remark below + \dp\@tempboxa + \dimexpr\dp\@tempboxa+\fboxsep+#4\relax + \setbox\z@\hbox + {\vrule\@width#5\relax + \kern\wd\@tempboxa + \vrule\@width#6\relax + }% + \ht\z@\ht\@tempboxa + \dp\z@\dp\@tempboxa + \vbox{% + \colorframedbordercolorcommand % defaults to \normalcolor + \hrule\@height#3\relax + \kern-#3\relax + #1% + \copy\z@ % deliberate overlap hrules+vrules to avoid anti-aliasing artefacts + \kern-#4\relax + #2% + \hrule\@height#4\relax + \kern-\dp\@tempboxa + }% + \kern-\wd\z@ + \kern#5\relax + \box\@tempboxa + \kern#6\relax + }% + \endgroup +} +% The titled-frame environment depends in part on this macro, +% whose original in framed.sty has various colour problems. +% We have indicated the modifications, additionally to using +% our modified \CustomFBox. +% Original let the continuation label use same colour as frame. +% Let make this customizable. +\let\colorframedTFconlabcolorcommand\empty +\renewcommand\TitleBarFrame[3][]{\begingroup + \ifx\delimiter#1\delimiter + \let\TF@conlab\@empty + \else + \def\TF@conlab{% + \nointerlineskip + \hbox{%<<<< ADDED (needed due to \smash doing \leavevmode nowadays) + \colorframedTFconlabcolorcommand%<<<< ADDED + \smash{\rlap{\kern\wd\@tempboxa\kern\fboxrule\kern\fboxsep #1}}}% + }%<<<< ADDED + \fi + %\let\TF@savecolor\current@color%<<<< REMOVED + %\textcolor{TFFrameColor}{% <<<< REMOVED + \def\colorframedbordercolorcommand{\color{TFFrameColor}}%<<<< ADDED + \CustomFBox + {\TF@Title{#2}}{\TF@conlab}% + \fboxrule\fboxrule\fboxrule\fboxrule + {%\let\current@color\TF@savecolor\set@color%<<<< REMOVED + #3}% + %}% <<<< REMOVED + \endgroup +} +\endinput diff --git a/macros/latex/contrib/hyperref/README.md b/macros/latex/contrib/hyperref/README.md index 7efd675aba..71ecefab3e 100644 --- a/macros/latex/contrib/hyperref/README.md +++ b/macros/latex/contrib/hyperref/README.md @@ -1,6 +1,6 @@ # README for hyperref bundle -Version 2022-06-20 v7.00s +Version 2022-09-22 v7.00t ## INTRODUCTION diff --git a/macros/latex/contrib/hyperref/doc/backref.pdf b/macros/latex/contrib/hyperref/doc/backref.pdf index f6d933dc98..0f2ad5cc10 100644 Binary files a/macros/latex/contrib/hyperref/doc/backref.pdf and b/macros/latex/contrib/hyperref/doc/backref.pdf differ diff --git a/macros/latex/contrib/hyperref/doc/hyperref-doc.html b/macros/latex/contrib/hyperref/doc/hyperref-doc.html index fe11247a9f..aee3f8ddd2 100644 --- a/macros/latex/contrib/hyperref/doc/hyperref-doc.html +++ b/macros/latex/contrib/hyperref/doc/hyperref-doc.html @@ -25,7 +25,7 @@ href="https://github.com/latex3/hyperref/issues" class="url" >https://github.com/latex3/hyperref/issues)
2022-06-20 v7.00s
+class="ec-lmr-12">2022-09-22 v7.00t

Contents

@@ -4111,7 +4111,7 @@ class="ec-lmvtt-10">}

The text is made a hyperlink to the URL; this must be a full URL (relative to the base URL, if that is -defined). The special characters # and ˜ do not need to be escaped in any way (unless the command is used in the argument of another command).

The optional argument -%% 2022-06-20 v7.00s +%% 2022-09-22 v7.00t %% force unicode encoding, see issue #101 %% code mostly copied from hxetex.def \HyPsd@LoadUnicode @@ -751,10 +751,26 @@ \fi }{% \ifdim\stockwidth>\z@ - \setlength{\pagewidth}{\stockwidth}% - \fi - \ifdim\stockheight>\z@ - \setlength{\pageheight}{\stockheight}% + \ifdim\stockheight>\z@ + \setlength{\pagewidth}{\stockwidth}% + \setlength{\pageheight}{\stockheight}% + \else + \ifdim\paperwidth>\z@ + \ifdim\paperheight>\z@ + \setlength{\pagewidth}{\paperwidth}% + \setlength{\pageheight}{\paperheight}% + \fi + \fi + \fi + \else + \ifdim\stockwidth=\z@ + \ifdim\paperwidth>\z@ + \ifdim\paperheight>\z@ + \setlength{\pagewidth}{\paperwidth}% + \setlength{\pageheight}{\paperheight}% + \fi + \fi + \fi \fi }% }% diff --git a/macros/latex/contrib/hyperref/hyperref-linktarget.dtx b/macros/latex/contrib/hyperref/hyperref-linktarget.dtx index cd0557bcdb..d31a2009e2 100644 --- a/macros/latex/contrib/hyperref/hyperref-linktarget.dtx +++ b/macros/latex/contrib/hyperref/hyperref-linktarget.dtx @@ -53,7 +53,7 @@ % }^^A % } % -% \date{Version v7.00s, released 2022-06-20} +% \date{Version 2022-09-22 v7.00t} % % \maketitle % \begin{documentation} diff --git a/macros/latex/contrib/hyperref/hyperref-patches.dtx b/macros/latex/contrib/hyperref/hyperref-patches.dtx index 446493224c..ebe25f7f62 100644 --- a/macros/latex/contrib/hyperref/hyperref-patches.dtx +++ b/macros/latex/contrib/hyperref/hyperref-patches.dtx @@ -55,7 +55,7 @@ % }^^A % } % -% \date{Version 0.9, released 2021-06-29} +% \date{Version 2022-09-22 v7.00t} % % \maketitle % \begin{documentation} diff --git a/macros/latex/contrib/hyperref/hyperref.dtx b/macros/latex/contrib/hyperref/hyperref.dtx index 6baf1e5480..fb6aefd9b2 100644 --- a/macros/latex/contrib/hyperref/hyperref.dtx +++ b/macros/latex/contrib/hyperref/hyperref.dtx @@ -52,7 +52,7 @@ %\ProvidesFile{puvnenc.def} %\ProvidesFile{puarenc.def} %\ProvidesFile{psdextra.def} -% [2022-06-20 v7.00s % +% [2022-09-22 v7.00t % % Hypertext links for LaTeX] % Dummy hyperref (SR)] % Hyperref documentation driver file] @@ -6696,7 +6696,7 @@ \def\HyperDestNameFilter#1{#1} \Hy@AtBeginDocument{% \begingroup - \edef\x{\@ifundefined{stockheight}\paperheight\stockheight}% + \edef\x{\ifdim\stockheight>\z@ \stockheight\else\paperheight\fi}% \dimen@=\x\relax \ifdim\dimen@>\z@ \else @@ -6985,6 +6985,11 @@ % \end{macrocode} % % \subsubsection{Driver loading} +% Ensure that |\stockwidth| and |\stockheight| are defined +% \begin{macrocode} +\@ifundefined{stockwidth}{\newdimen\stockwidth}{} +\@ifundefined{stockheight}{\newdimen\stockheight}{} +% \end{macrocode} % % \begin{macrocode} \Hy@AtEndOfPackage{% @@ -8235,9 +8240,10 @@ % Provide a dummy default definition of \cs{hyper@newdestlabel} % inside the .aux files. % \begin{macrocode} -\AddLineBeginAux{% - \string\providecommand\string\hyper@newdestlabel[2]{}% -} +\AddToHook{include/before} + {\immediate\write\@partaux{\string\providecommand\string\hyper@newdestlabel[2]{}}} +\AddToHook{begindocument} + {\immediate\write\@mainaux{\string\providecommand\string\hyper@newdestlabel[2]{}}} % \end{macrocode} % % \section{Forms creation} @@ -12704,15 +12710,7 @@ \fi \fi } -\@ifpackageloaded{showkeys}{% - \HyRef@ShowKeysInit -}{% - \Hy@AtBeginDocument{% - \@ifpackageloaded{showkeys}{% - \HyRef@ShowKeysInit - }{}% - }% -} +\AddToHook{package/showkeys/after}{\HyRef@ShowKeysInit} % \end{macrocode} % \end{macro} % @@ -13529,21 +13527,28 @@ \fi \fi }{% - \ltx@IfUndefined{stockwidth}{% - \ifdim\paperwidth>\z@ - \setlength{\pdfpagewidth}{\paperwidth}% - \fi - \ifdim\paperheight>\z@ - \setlength{\pdfpageheight}{\paperheight}% - \fi - }{% - \ifdim\stockwidth>\z@ - \setlength{\pdfpagewidth}{\stockwidth}% - \fi + \ifdim\stockwidth>\z@ \ifdim\stockheight>\z@ - \setlength{\pdfpageheight}{\stockheight}% + \setlength{\pdfpagewidth}{\stockwidth}% + \setlength{\pdfpageheight}{\stockheight}% + \else + \ifdim\paperwidth>\z@ + \ifdim\paperheight>\z@ + \setlength{\pdfpagewidth}{\paperwidth}% + \setlength{\pdfpageheight}{\paperheight}% + \fi + \fi \fi - }% + \else + \ifdim\stockwidth=\z@ + \ifdim\paperwidth>\z@ + \ifdim\paperheight>\z@ + \setlength{\pdfpagewidth}{\paperwidth}% + \setlength{\pdfpageheight}{\paperheight}% + \fi + \fi + \fi + \fi }% }% \Hy@DisableOption{setpagesize}% @@ -14595,19 +14600,25 @@ \AtBeginShipoutFirst{% \ifHy@setpagesize \begingroup - \@ifundefined{stockwidth}{% - \ifdim\paperwidth>\z@ - \ifdim\paperheight>\z@ - \special{papersize=\the\paperwidth,\the\paperheight}% + \ifdim\stockwidth>\z@ + \ifdim\stockheight>\z@ + \special{papersize=\the\stockwidth,\the\stockheight}% + \else + \ifdim\paperwidth>\z@ + \ifdim\paperheight>\z@ + \special{papersize=\the\paperwidth,\the\paperheight}% + \fi \fi \fi - }{% - \ifdim\stockwidth>\z@ - \ifdim\stockheight>\z@ - \special{papersize=\the\stockwidth,\the\stockheight}% + \else + \ifdim\stockwidth=\z@ + \ifdim\paperwidth>\z@ + \ifdim\paperheight>\z@ + \special{papersize=\the\paperwidth,\the\paperheight}% + \fi \fi \fi - }% + \fi \endgroup \fi \Hy@DisableOption{setpagesize}% @@ -14743,32 +14754,35 @@ % it avoids the definition and the hash table entry of a % previous undefined macro. % \begin{macrocode} -\ifx\mediaheight\@undefined -\else - \ifx\mediaheight\relax - \else - \ifHy@setpagesize - \providecommand*{\VTeXInitMediaSize}{% - \ltx@IfUndefined{stockwidth}{% - \ifdim\paperheight>0pt % - \setlength\mediaheight\paperheight - \fi - \ifdim\paperheight>0pt % - \setlength\mediawidth\paperwidth - \fi - }{% - \ifdim\stockheight>0pt % - \setlength\mediaheight\stockheight - \fi - \ifdim\stockwidth>0pt % - \setlength\mediawidth\stockwidth - \fi - }% - }% - \Hy@AtBeginDocument{\VTeXInitMediaSize}% - \fi - \Hy@DisableOption{setpagesize}% +\ifcsname mediaheight\endcsname + \ifHy@setpagesize + \providecommand*{\VTeXInitMediaSize}{% + \ifdim\stockwidth>\z@ + \ifdim\stockheight>\z@ + \setlength\mediaheight\stockheight + \setlength\mediawidth\stockwidth + \else + \ifdim\paperwidth>\z@ + \ifdim\paperheight>\z@ + \setlength\mediaheight\paperheight + \setlength\mediawidth\paperwidth + \fi + \fi + \fi + \else + \ifdim\stockwidth=\z@ + \ifdim\paperwidth>\z@ + \ifdim\paperheight>\z@ + \setlength\mediaheight\paperheight + \setlength\mediawidth\paperwidth + \fi + \fi + \fi + \fi + }% + \Hy@AtBeginDocument{\VTeXInitMediaSize}% \fi + \Hy@DisableOption{setpagesize}% \fi % \end{macrocode} % Older versions of VTeX require |xyz| in lower case. @@ -16395,19 +16409,25 @@ \AtBeginShipoutFirst{% \ifHy@setpagesize \begingroup - \@ifundefined{stockwidth}{% - \ifdim\paperwidth>\z@ - \ifdim\paperheight>\z@ - \special{papersize=\the\paperwidth,\the\paperheight}% + \ifdim\stockwidth>\z@ + \ifdim\stockheight>\z@ + \special{papersize=\the\stockwidth,\the\stockheight}% + \else + \ifdim\paperwidth>\z@ + \ifdim\paperheight>\z@ + \special{papersize=\the\paperwidth,\the\paperheight}% + \fi \fi \fi - }{% - \ifdim\stockwidth>\z@ - \ifdim\stockheight>\z@ - \special{papersize=\the\stockwidth,\the\stockheight}% + \else + \ifdim\stockwidth=\z@ + \ifdim\paperwidth>\z@ + \ifdim\paperheight>\z@ + \special{papersize=\the\paperwidth,\the\paperheight}% + \fi \fi \fi - }% + \fi \endgroup \fi \Hy@DisableOption{setpagesize}% diff --git a/macros/latex/contrib/hyperref/xr-hyper.sty b/macros/latex/contrib/hyperref/xr-hyper.sty index fecbdeca12..9472448b3a 100644 --- a/macros/latex/contrib/hyperref/xr-hyper.sty +++ b/macros/latex/contrib/hyperref/xr-hyper.sty @@ -61,7 +61,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{xr-hyper} - [2022-06-20 v7.00s eXternal References (DPC)] + [2022-09-22 v7.00t eXternal References (DPC)] \def\externaldocument{\@testopt\XR@cite{}} \let\externalcitedocument\externaldocument diff --git a/macros/latex/contrib/oberdiek/README.md b/macros/latex/contrib/oberdiek/README.md index 682184dc81..b38e432684 100644 --- a/macros/latex/contrib/oberdiek/README.md +++ b/macros/latex/contrib/oberdiek/README.md @@ -1,6 +1,6 @@ # Oberdiek bundle -Version: 2021-11-15 +Version: 2022-09-21 This file describes the directory CTAN:macros/latex/contrib/oberdiek/ @@ -11,7 +11,7 @@ It contains several packages: ## Copyright (C) * 2007, 2009-2011 Heiko Oberdiek -* 2016-2020 Oberdiek Package Support Group +* 2016-2022 Oberdiek Package Support Group ## License LATEX Project Public License, version 1.3c or later. @@ -53,9 +53,7 @@ Other files in the CTAN directory: * hyphsubst: substitute hyphenation patterns; * ifdraft: switch for option draft; * iflang: provides expandable checks for the current language; -* pagegrid: prints a page grid in the background; * pdfcolfoot: using pdfTeX’s color stack for footnotes; -* pdfcol: macros for setting and maintaining new color stacks; * pdfcolparallel: fixes colour problems in package parallel; * pdfcolparcolumns: fixes colour problems in package parcolumns; * pdfcrypt: setting PDF encryption; diff --git a/macros/latex/contrib/oberdiek/aliascnt.pdf b/macros/latex/contrib/oberdiek/aliascnt.pdf index 3d37bde0a6..8b606cc806 100644 Binary files a/macros/latex/contrib/oberdiek/aliascnt.pdf and b/macros/latex/contrib/oberdiek/aliascnt.pdf differ diff --git a/macros/latex/contrib/oberdiek/bmpsize.pdf b/macros/latex/contrib/oberdiek/bmpsize.pdf index f551dcd1d6..12c25efac6 100644 Binary files a/macros/latex/contrib/oberdiek/bmpsize.pdf and b/macros/latex/contrib/oberdiek/bmpsize.pdf differ diff --git a/macros/latex/contrib/oberdiek/centernot.pdf b/macros/latex/contrib/oberdiek/centernot.pdf index 1c365a0a29..62f2d9da69 100644 Binary files a/macros/latex/contrib/oberdiek/centernot.pdf and b/macros/latex/contrib/oberdiek/centernot.pdf differ diff --git a/macros/latex/contrib/oberdiek/chemarr.pdf b/macros/latex/contrib/oberdiek/chemarr.pdf index 3be586e5ed..a0491c8dcc 100644 Binary files a/macros/latex/contrib/oberdiek/chemarr.pdf and b/macros/latex/contrib/oberdiek/chemarr.pdf differ diff --git a/macros/latex/contrib/oberdiek/classlist.pdf b/macros/latex/contrib/oberdiek/classlist.pdf index 8ff7733158..f7489d1bd4 100644 Binary files a/macros/latex/contrib/oberdiek/classlist.pdf and b/macros/latex/contrib/oberdiek/classlist.pdf differ diff --git a/macros/latex/contrib/oberdiek/colonequals.pdf b/macros/latex/contrib/oberdiek/colonequals.pdf index 8668c34d3d..5c3cb08f41 100644 Binary files a/macros/latex/contrib/oberdiek/colonequals.pdf and b/macros/latex/contrib/oberdiek/colonequals.pdf differ diff --git a/macros/latex/contrib/oberdiek/dvipscol.pdf b/macros/latex/contrib/oberdiek/dvipscol.pdf index cf0e002b7d..8cb994eacc 100644 Binary files a/macros/latex/contrib/oberdiek/dvipscol.pdf and b/macros/latex/contrib/oberdiek/dvipscol.pdf differ diff --git a/macros/latex/contrib/oberdiek/engord.pdf b/macros/latex/contrib/oberdiek/engord.pdf index 067fbca25b..3e45bede84 100644 Binary files a/macros/latex/contrib/oberdiek/engord.pdf and b/macros/latex/contrib/oberdiek/engord.pdf differ diff --git a/macros/latex/contrib/oberdiek/enparen.pdf b/macros/latex/contrib/oberdiek/enparen.pdf index e085b3062e..c84e418b5f 100644 Binary files a/macros/latex/contrib/oberdiek/enparen.pdf and b/macros/latex/contrib/oberdiek/enparen.pdf differ diff --git a/macros/latex/contrib/oberdiek/eolgrab.pdf b/macros/latex/contrib/oberdiek/eolgrab.pdf index c1b38c591e..23422c71bd 100644 Binary files a/macros/latex/contrib/oberdiek/eolgrab.pdf and b/macros/latex/contrib/oberdiek/eolgrab.pdf differ diff --git a/macros/latex/contrib/oberdiek/fibnum.pdf b/macros/latex/contrib/oberdiek/fibnum.pdf index b471eb5ef9..838c7866a1 100644 Binary files a/macros/latex/contrib/oberdiek/fibnum.pdf and b/macros/latex/contrib/oberdiek/fibnum.pdf differ diff --git a/macros/latex/contrib/oberdiek/flags.pdf b/macros/latex/contrib/oberdiek/flags.pdf index 4f476fc931..38cfdfce4e 100644 Binary files a/macros/latex/contrib/oberdiek/flags.pdf and b/macros/latex/contrib/oberdiek/flags.pdf differ diff --git a/macros/latex/contrib/oberdiek/holtxdoc.pdf b/macros/latex/contrib/oberdiek/holtxdoc.pdf index 72f5ebe9bd..4defa8d604 100644 Binary files a/macros/latex/contrib/oberdiek/holtxdoc.pdf and b/macros/latex/contrib/oberdiek/holtxdoc.pdf differ diff --git a/macros/latex/contrib/oberdiek/hypbmsec.pdf b/macros/latex/contrib/oberdiek/hypbmsec.pdf index e0aa81018e..29f5c45d4a 100644 Binary files a/macros/latex/contrib/oberdiek/hypbmsec.pdf and b/macros/latex/contrib/oberdiek/hypbmsec.pdf differ diff --git a/macros/latex/contrib/oberdiek/hypcap.pdf b/macros/latex/contrib/oberdiek/hypcap.pdf index 0417e6f54f..302590434b 100644 Binary files a/macros/latex/contrib/oberdiek/hypcap.pdf and b/macros/latex/contrib/oberdiek/hypcap.pdf differ diff --git a/macros/latex/contrib/oberdiek/hypgotoe.pdf b/macros/latex/contrib/oberdiek/hypgotoe.pdf index cfbc9e8f11..4237695b37 100644 Binary files a/macros/latex/contrib/oberdiek/hypgotoe.pdf and b/macros/latex/contrib/oberdiek/hypgotoe.pdf differ diff --git a/macros/latex/contrib/oberdiek/hyphsubst.pdf b/macros/latex/contrib/oberdiek/hyphsubst.pdf index 318eb95edc..bebccb7585 100644 Binary files a/macros/latex/contrib/oberdiek/hyphsubst.pdf and b/macros/latex/contrib/oberdiek/hyphsubst.pdf differ diff --git a/macros/latex/contrib/oberdiek/ifdraft.pdf b/macros/latex/contrib/oberdiek/ifdraft.pdf index 799e8b9c25..4745dadca8 100644 Binary files a/macros/latex/contrib/oberdiek/ifdraft.pdf and b/macros/latex/contrib/oberdiek/ifdraft.pdf differ diff --git a/macros/latex/contrib/oberdiek/iflang.pdf b/macros/latex/contrib/oberdiek/iflang.pdf index b7f3a56530..de5fa254fe 100644 Binary files a/macros/latex/contrib/oberdiek/iflang.pdf and b/macros/latex/contrib/oberdiek/iflang.pdf differ diff --git a/macros/latex/contrib/oberdiek/oberdiek-bundle.bib b/macros/latex/contrib/oberdiek/oberdiek-bundle.bib index 5639fc952c..1a584cc3e9 100644 --- a/macros/latex/contrib/oberdiek/oberdiek-bundle.bib +++ b/macros/latex/contrib/oberdiek/oberdiek-bundle.bib @@ -131,20 +131,6 @@ version={1.7}, url={https://ctan.org/pkg/iflang}, } -@manual{oberdiek:pagegrid, - title={The pagegrid package}, - author={Heiko Oberdiek}, - date={2016-05-16}, - version={1.5}, - url={https://ctan.org/pkg/pagegrid}, -} -@manual{oberdiek:pdfcol, - title={The pdfcol package}, - author={Heiko Oberdiek}, - date={2018-11-01}, - version={1.5}, - url={https://ctan.org/pkg/pdfcol}, -} @manual{oberdiek:pdfcolfoot, title={The pdfcolfoot package}, author={Heiko Oberdiek}, diff --git a/macros/latex/contrib/oberdiek/oberdiek.ins b/macros/latex/contrib/oberdiek/oberdiek.ins index 81ee3c264b..ecf6df13a6 100644 --- a/macros/latex/contrib/oberdiek/oberdiek.ins +++ b/macros/latex/contrib/oberdiek/oberdiek.ins @@ -45,8 +45,6 @@ \batchinput{hyphsubst.dtx} \batchinput{ifdraft.dtx} \batchinput{iflang.dtx} -\batchinput{pagegrid.dtx} -\batchinput{pdfcol.dtx} \batchinput{pdfcolfoot.dtx} \batchinput{pdfcolparallel.dtx} \batchinput{pdfcolparcolumns.dtx} diff --git a/macros/latex/contrib/oberdiek/oberdiek.pdf b/macros/latex/contrib/oberdiek/oberdiek.pdf index ae33dcf68a..1ee28ae509 100644 Binary files a/macros/latex/contrib/oberdiek/oberdiek.pdf and b/macros/latex/contrib/oberdiek/oberdiek.pdf differ diff --git a/macros/latex/contrib/oberdiek/oberdiek.tex b/macros/latex/contrib/oberdiek/oberdiek.tex index 83bbce0aba..c8a2ae588b 100644 --- a/macros/latex/contrib/oberdiek/oberdiek.tex +++ b/macros/latex/contrib/oberdiek/oberdiek.tex @@ -10,7 +10,7 @@ \newcommand*{\Author}{Heiko Oberdiek} \newcommand*{\Email}{ho-tex at tug.org} -\newcommand*{\Date}{2021/11/15} +\newcommand*{\Date}{2022/09/21} % Copyright (C) 2006-2016 by % Heiko Oberdiek @@ -212,10 +212,6 @@ [\entrysep] \entry{iflang}{Checks for the current language}% [\entrysep] -\entry{pagegrid}{Print page grid in background}% -[\entrysep] -\entry{pdfcol}{Handle new color stacks for \hologo{pdfTeX}}% -[\entrysep] \entry{pdfcolfoot}{Color stack for footnotes with \hologo{pdfTeX}}% [\entrysep] \entry{pdfcolparallel}{Color stacks support for parallel}% @@ -449,26 +445,6 @@ based on macro \cs{languagename} or hyphenation patterns. \end{abstract} \tocinclude{iflang} -\newpage -\subsection{\pkgsectformat{pagegrid}} -\label{pagegrid} -\begin{abstract} -The \LaTeX\ package prints a page grid in the background. -\end{abstract} -\tocinclude{pagegrid} - -\newpage -\subsection{\pkgsectformat{pdfcol}} -\label{pdfcol} -\begin{abstract} -Since version 1.40 \pdfTeX\ supports color stacks. -The driver file \xfile{pdftex.def} for package \xpackage{color} -defines and uses a main color stack since version v0.04b. -Package \xpackage{pdfcol} is intended for package writers. -It defines macros for setting and maintaining new color stacks. -\end{abstract} -\tocinclude{pdfcol} - \newpage \subsection{\pkgsectformat{pdfcolfoot}} \label{pdfcolfoot} diff --git a/macros/latex/contrib/oberdiek/pagegrid.dtx b/macros/latex/contrib/oberdiek/pagegrid.dtx deleted file mode 100644 index 60c0794247..0000000000 --- a/macros/latex/contrib/oberdiek/pagegrid.dtx +++ /dev/null @@ -1,955 +0,0 @@ -% \iffalse meta-comment -% -% File: pagegrid.dtx -% Version: 2016/05/16 v1.5 -% Info: Print page grid in background -% -% Copyright (C) -% 2009 Heiko Oberdiek -% 2016-2019 Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% This work 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. This version of this license is in -% https://www.latex-project.org/lppl/lppl-1-3c.txt -% and the latest version of this license is in -% https://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of -% LaTeX version 2005/12/01 or later. -% -% This work has the LPPL maintenance status "maintained". -% -% The Current Maintainers of this work are -% Heiko Oberdiek and the Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% This work consists of the main source file pagegrid.dtx -% and the derived files -% pagegrid.sty, pagegrid.pdf, pagegrid.ins, pagegrid.drv, -% pagegrid-test1.tex. -% -% Distribution: -% CTAN:macros/latex/contrib/oberdiek/pagegrid.dtx -% CTAN:macros/latex/contrib/oberdiek/pagegrid.pdf -% -% Unpacking: -% (a) If pagegrid.ins is present: -% tex pagegrid.ins -% (b) Without pagegrid.ins: -% tex pagegrid.dtx -% (c) If you insist on using LaTeX -% latex \let\install=y\input{pagegrid.dtx} -% (quote the arguments according to the demands of your shell) -% -% Documentation: -% (a) If pagegrid.drv is present: -% latex pagegrid.drv -% (b) Without pagegrid.drv: -% latex pagegrid.dtx; ... -% The class ltxdoc loads the configuration file ltxdoc.cfg -% if available. Here you can specify further options, e.g. -% use A4 as paper format: -% \PassOptionsToClass{a4paper}{article} -% -% Programm calls to get the documentation (example): -% pdflatex pagegrid.dtx -% makeindex -s gind.ist pagegrid.idx -% pdflatex pagegrid.dtx -% makeindex -s gind.ist pagegrid.idx -% pdflatex pagegrid.dtx -% -% Installation: -% TDS:tex/latex/oberdiek/pagegrid.sty -% TDS:doc/latex/oberdiek/pagegrid.pdf -% TDS:source/latex/oberdiek/pagegrid.dtx -% -%<*ignore> -\begingroup - \catcode123=1 % - \catcode125=2 % - \def\x{LaTeX2e}% -\expandafter\endgroup -\ifcase 0\ifx\install y1\fi\expandafter - \ifx\csname processbatchFile\endcsname\relax\else1\fi - \ifx\fmtname\x\else 1\fi\relax -\else\csname fi\endcsname -% -%<*install> -\input docstrip.tex -\Msg{************************************************************************} -\Msg{* Installation} -\Msg{* Package: pagegrid 2016/05/16 v1.5 Print page grid in background (HO)} -\Msg{************************************************************************} - -\keepsilent -\askforoverwritefalse - -\let\MetaPrefix\relax -\preamble - -This is a generated file. - -Project: pagegrid -Version: 2016/05/16 v1.5 - -Copyright (C) - 2009 Heiko Oberdiek - 2016-2019 Oberdiek Package Support Group - -This work 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. This version of this license is in - https://www.latex-project.org/lppl/lppl-1-3c.txt -and the latest version of this license is in - https://www.latex-project.org/lppl.txt -and version 1.3 or later is part of all distributions of -LaTeX version 2005/12/01 or later. - -This work has the LPPL maintenance status "maintained". - -The Current Maintainers of this work are -Heiko Oberdiek and the Oberdiek Package Support Group -https://github.com/ho-tex/oberdiek/issues - - -This work consists of the main source file pagegrid.dtx -and the derived files - pagegrid.sty, pagegrid.pdf, pagegrid.ins, pagegrid.drv, - pagegrid-test1.tex. - -\endpreamble -\let\MetaPrefix\DoubleperCent - -\generate{% - \file{pagegrid.ins}{\from{pagegrid.dtx}{install}}% - \file{pagegrid.drv}{\from{pagegrid.dtx}{driver}}% - \usedir{tex/latex/oberdiek}% - \file{pagegrid.sty}{\from{pagegrid.dtx}{package}}% -% \usedir{doc/latex/oberdiek/test}% -% \file{pagegrid-test1.tex}{\from{pagegrid.dtx}{test1}}% -} - -\catcode32=13\relax% active space -\let =\space% -\Msg{************************************************************************} -\Msg{*} -\Msg{* To finish the installation you have to move the following} -\Msg{* file into a directory searched by TeX:} -\Msg{*} -\Msg{* pagegrid.sty} -\Msg{*} -\Msg{* To produce the documentation run the file `pagegrid.drv'} -\Msg{* through LaTeX.} -\Msg{*} -\Msg{* Happy TeXing!} -\Msg{*} -\Msg{************************************************************************} - -\endbatchfile -% -%<*ignore> -\fi -% -%<*driver> -\NeedsTeXFormat{LaTeX2e} -\ProvidesFile{pagegrid.drv}% - [2016/05/16 v1.5 Print page grid in background (HO)]% -\documentclass{ltxdoc} -\usepackage{holtxdoc}[2011/11/22] -\begin{document} - \DocInput{pagegrid.dtx}% -\end{document} -% -% \fi -% -% -% -% \GetFileInfo{pagegrid.drv} -% -% \title{The \xpackage{pagegrid} package} -% \date{2016/05/16 v1.5} -% \author{Heiko Oberdiek\thanks -% {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}} -% -% \maketitle -% -% \begin{abstract} -% The \LaTeX\ package prints a page grid in the background. -% \end{abstract} -% -% \tableofcontents -% -% \section{Documentation} -% -% The package puts a grid on the paper. It was written for -% developers of a class or package -% who have to put elements on definite locations on a page -% (e.g. letter class). The grid allows a faster optical check, -% whether the positions are correct. If the previewer already -% offers features for measuring, the package might be obsolete. -% Otherwise it saves the developer from printing the page and -% measuring by hand. -% -% \subsection{Options} -% -% Options are evaluated in the following order: -% \begin{enumerate} -% \item -% Configuration file \xfile{pagegrid.cfg} using \cs{pagegridsetup} -% if the file exists. -% \item -% Package options given for \cs{usepackage}. -% \item -% Later calls of \cs{pagegridsetup}. -% \end{enumerate} -% \begin{declcs}{pagegridsetup}\M{option list} -% \end{declcs} -% The options are key value options. Boolean options are enabled by -% default (without value) or by using the explicit value \texttt{true}. -% Value \texttt{false} disable the option. -% -% \subsubsection{Options \xoption{enable}, \xoption{disable}} -% -% \begin{description} -% \item[\xoption{enable}:] This boolean option controls whether the page grid -% is drawn. As default the page grid drawing is activated. -% \item[\xoption{disable}:] It is the opposite -% of option \xoption{enable}. It was added for convenience and -% allows the abbreviation \texttt{disable} for \texttt{enable=false}. -% \end{description} -% -% \subsubsection{Grid origins} -% -% The package supports up to two grids on a page allowing -% measurement from opposite directions. As default two grids are drawn, -% the first from bottom left to top right. The origin of the second -% grid is at the opposite top right corner. -% The origins are controlled by the following options. -% The number of grids (one or two) depend on the number of these options -% in one call of \cs{pagegridsetup}. -% The following frame shows a paper and in its corners are the -% corresponding options. At the left and right side alias names -% are given for the options inside the paper. -% \begin{quote} -% \begin{tabular}{@{}r|@{\,}l@{\qquad}r@{\,}|l@{}} -% \cline{2-3} -% \xoption{left-top}, \xoption{lt}, \xoption{top-left} -% & \vphantom{\"U}\xoption{tl} & \xoption{tr} -% & \xoption{top-right}, \xoption{rt}, \xoption{right-top}\\ -% &&&\\ -% \xoption{left-bottom}, \xoption{lb}, \xoption{bottom-left} -% & \xoption{bl} & \xoption{br} -% & \xoption{bottom-right}, \xoption{rb}, \xoption{right-bottom}\\ -% \cline{2-3} -% \end{tabular} -% \end{quote} -% Examples: -% \begin{quote} -% |\pagegridsetup{bl,tr}| -% \end{quote} -% This is the default setting with two grids as described previously. -% The following setups one grid only. Its origin is the upper left -% corner: -% \begin{quote} -% |\pagegridsetup{top-left}| -% \end{quote} -% -% \subsubsection{Grid unit} -% -% \begin{description} -% \item[\xoption{step}] This option takes a length and -% setups the unit for the grid. The page width and page height -% should be multiples of this unit. -% Currently the default is \texttt{1mm}. But this might change -% later by a heuristic based on the paper size. -% \end{description} -% -% \subsubsection{Color options} -% -% The basic grid lines are drawn as ultra thin help lines and is only -% drawn for the first grid. -% Each tenth and fiftyth line of the basic net is drawn thicker in a special -% color for the two grids. -% \begin{description} -% \item[\xoption{firstcolor}:] Color for the thicker lines and the arrows -% of the first grid. Default value is \texttt{red}. -% \item[\xoption{secondcolor}:] Color for the thicker lines and the arrows -% of the second grid. Default value is \texttt{blue}. -% \end{description} -% Use a color specification that package \xpackage{tikz} understands. -% (The grid is drawn with \xpackage{pgf}/\xpackage{tikz}.) -% -% \subsubsection{Arrow options} -% -% Arrows are put at the origin at the grid to show the grid start -% and the direction of the grid. -% \begin{description} -% \item[\xoption{arrows}:] This boolean option turns the arrows on or off. -% As default arrows are enabled. -% \item[\xoption{arrowlength}:] The length given as value is the -% length of the edge of a square at the origin within the -% arrow is put as diagonal. Default is 10 times the grid unit (10\,mm). -% The real arrow length is this length multiplied by $\sqrt2$. -% \end{description} -% -% \subsubsection{Miscellaneous options} -% -% \begin{description} -% \item[\xoption{double}:] The output page is doubled, one without page -% grid and the other with page grid. Possible values are shown in the -% following table: -% \begin{quote} -% \begin{tabular}{ll} -% Option & Meaning\\ -% \hline -% |false| & Turns option off.\\ -% |first| & Grid page comes first.\\ -% |last| & Grid page comes after the page without grid.\\ -% |true| & Same as |last|.\\ -% \meta{no value} & Same as |true|.\\ -% \end{tabular} -% \end{quote} -% \textbf{Note:} -% The double output of the page has side effects. -% All whatits are executed twice, for example: file writing -% and anchor setting. Some unwanted actions are catched such -% as multiple \cs{label} definitions, duplicate entries in -% the table of contents. For bookmarks, use package \xpackage{bookmarks}. -% \item[\xoption{foreground}:] Boolean option, default is \texttt{false}. -% Sometimes there might be elements on the page (e.g. large images) -% that hide the grid. Then option \xoption{foreground} puts the grids -% over the current output page. -% \end{description} -% -% \StopEventually{ -% } -% -% \section{Implementation} -% \begin{macrocode} -%<*package> -% \end{macrocode} -% Reload check, especially if the package is not used with \LaTeX. -% \begin{macrocode} -\begingroup\catcode61\catcode48\catcode32=10\relax% - \catcode13=5 % ^^M - \endlinechar=13 % - \catcode35=6 % # - \catcode39=12 % ' - \catcode44=12 % , - \catcode45=12 % - - \catcode46=12 % . - \catcode58=12 % : - \catcode64=11 % @ - \catcode123=1 % { - \catcode125=2 % } - \expandafter\let\expandafter\x\csname ver@pagegrid.sty\endcsname - \ifx\x\relax % plain-TeX, first loading - \else - \def\empty{}% - \ifx\x\empty % LaTeX, first loading, - % variable is initialized, but \ProvidesPackage not yet seen - \else - \expandafter\ifx\csname PackageInfo\endcsname\relax - \def\x#1#2{% - \immediate\write-1{Package #1 Info: #2.}% - }% - \else - \def\x#1#2{\PackageInfo{#1}{#2, stopped}}% - \fi - \x{pagegrid}{The package is already loaded}% - \aftergroup\endinput - \fi - \fi -\endgroup% -% \end{macrocode} -% Package identification: -% \begin{macrocode} -\begingroup\catcode61\catcode48\catcode32=10\relax% - \catcode13=5 % ^^M - \endlinechar=13 % - \catcode35=6 % # - \catcode39=12 % ' - \catcode40=12 % ( - \catcode41=12 % ) - \catcode44=12 % , - \catcode45=12 % - - \catcode46=12 % . - \catcode47=12 % / - \catcode58=12 % : - \catcode64=11 % @ - \catcode91=12 % [ - \catcode93=12 % ] - \catcode123=1 % { - \catcode125=2 % } - \expandafter\ifx\csname ProvidesPackage\endcsname\relax - \def\x#1#2#3[#4]{\endgroup - \immediate\write-1{Package: #3 #4}% - \xdef#1{#4}% - }% - \else - \def\x#1#2[#3]{\endgroup - #2[{#3}]% - \ifx#1\@undefined - \xdef#1{#3}% - \fi - \ifx#1\relax - \xdef#1{#3}% - \fi - }% - \fi -\expandafter\x\csname ver@pagegrid.sty\endcsname -\ProvidesPackage{pagegrid}% - [2016/05/16 v1.5 Print page grid in background (HO)]% -% \end{macrocode} -% -% \begin{macrocode} -\begingroup\catcode61\catcode48\catcode32=10\relax% - \catcode13=5 % ^^M - \endlinechar=13 % - \catcode123=1 % { - \catcode125=2 % } - \catcode64=11 % @ - \def\x{\endgroup - \expandafter\edef\csname pagegrid@AtEnd\endcsname{% - \endlinechar=\the\endlinechar\relax - \catcode13=\the\catcode13\relax - \catcode32=\the\catcode32\relax - \catcode35=\the\catcode35\relax - \catcode61=\the\catcode61\relax - \catcode64=\the\catcode64\relax - \catcode123=\the\catcode123\relax - \catcode125=\the\catcode125\relax - }% - }% -\x\catcode61\catcode48\catcode32=10\relax% -\catcode13=5 % ^^M -\endlinechar=13 % -\catcode35=6 % # -\catcode64=11 % @ -\catcode123=1 % { -\catcode125=2 % } -\def\TMP@EnsureCode#1#2{% - \edef\pagegrid@AtEnd{% - \pagegrid@AtEnd - \catcode#1=\the\catcode#1\relax - }% - \catcode#1=#2\relax -} -\TMP@EnsureCode{9}{10}% (tab) -\TMP@EnsureCode{10}{12}% ^^J -\TMP@EnsureCode{33}{12}% ! -\TMP@EnsureCode{34}{12}% " -\TMP@EnsureCode{36}{3}% $ -\TMP@EnsureCode{38}{4}% & -\TMP@EnsureCode{39}{12}% ' -\TMP@EnsureCode{40}{12}% ( -\TMP@EnsureCode{41}{12}% ) -\TMP@EnsureCode{42}{12}% * -\TMP@EnsureCode{43}{12}% + -\TMP@EnsureCode{44}{12}% , -\TMP@EnsureCode{45}{12}% - -\TMP@EnsureCode{46}{12}% . -\TMP@EnsureCode{47}{12}% / -\TMP@EnsureCode{58}{12}% : -\TMP@EnsureCode{59}{12}% ; -\TMP@EnsureCode{60}{12}% < -\TMP@EnsureCode{62}{12}% > -\TMP@EnsureCode{63}{12}% ? -\TMP@EnsureCode{91}{12}% [ -\TMP@EnsureCode{93}{12}% ] -\TMP@EnsureCode{94}{7}% ^ (superscript) -\TMP@EnsureCode{95}{8}% _ (subscript) -\TMP@EnsureCode{96}{12}% ` -\TMP@EnsureCode{124}{12}% | -\edef\pagegrid@AtEnd{\pagegrid@AtEnd\noexpand\endinput} -% \end{macrocode} -% -% \begin{macrocode} -\RequirePackage{tikz} -\RequirePackage{atbegshi}[2009/12/02] -\RequirePackage{kvoptions}[2009/07/17] -% \end{macrocode} -% \begin{macrocode} -\begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname stockwidth\endcsname\relax - \def\pagegrid@width{\paperwidth}% - \def\pagegrid@height{\paperheight}% -\else - \def\pagegrid@width{\stockwidth}% - \def\pagegrid@height{\stockheight}% -\fi -% \end{macrocode} -% -% \begin{macrocode} -\SetupKeyvalOptions{% - family=pagegrid,% - prefix=pagegrid@,% -} -\def\pagegrid@init{% - \let\pagegrid@origin@a\@empty - \let\pagegrid@origin@b\@empty - \let\pagegrid@init\relax -} -\let\pagegrid@@init\pagegrid@init -\def\pagegrid@origin@a{bl} -\def\pagegrid@origin@b{tr} -\def\pagegrid@SetOrigin#1{% - \pagegrid@init - \ifx\pagegrid@origin@a\@empty - \def\pagegrid@origin@a{#1}% - \else - \ifx\pagegrid@origin@b\@empty - \else - \let\pagegrid@origin@a\pagegrid@origin@b - \fi - \def\pagegrid@origin@b{#1}% - \fi -} -\def\pagegrid@temp#1{% - \DeclareVoidOption{#1}{\pagegrid@SetOrigin{#1}}% - \@namedef{pagegrid@N@#1}{#1}% -} -\pagegrid@temp{bl} -\pagegrid@temp{br} -\pagegrid@temp{tl} -\pagegrid@temp{tr} -\def\pagegrid@temp#1#2{% - \DeclareVoidOption{#2}{\pagegrid@SetOrigin{#1}}% -}% -\pagegrid@temp{bl}{lb} -\pagegrid@temp{br}{rb} -\pagegrid@temp{tl}{lt} -\pagegrid@temp{tr}{rt} -\pagegrid@temp{bl}{bottom-left} -\pagegrid@temp{br}{bottom-right} -\pagegrid@temp{tl}{top-left} -\pagegrid@temp{tr}{top-right} -\pagegrid@temp{bl}{left-bottom} -\pagegrid@temp{br}{right-bottom} -\pagegrid@temp{tl}{left-top} -\pagegrid@temp{tr}{right-top} -% \end{macrocode} -% \begin{macrocode} -\DeclareBoolOption[true]{enable} -\DeclareComplementaryOption{disable}{enable} -% \end{macrocode} -% \begin{macrocode} -\DeclareBoolOption{foreground} -% \end{macrocode} -% \begin{macrocode} -\newlength{\pagegrid@step} -\define@key{pagegrid}{step}{% - \setlength{\pagegrid@step}{#1}% -} -% \end{macrocode} -% \begin{macrocode} -\DeclareStringOption[red]{firstcolor} -\DeclareStringOption[blue]{secondcolor} -% \end{macrocode} -% \begin{macrocode} -\DeclareBoolOption[true]{arrows} -\newlength\pagegrid@arrowlength -\pagegrid@arrowlength=\z@ -\define@key{pagegrid}{arrowlength}{% - \setlength{\pagegrid@arrowlength}{#1}% -} -% \end{macrocode} -% \begin{macrocode} -\define@key{pagegrid}{double}[true]{% - \@ifundefined{pagegrid@double@#1}{% - \PackageWarning{pagegrid}{% - Unsupported value `#1' for option `double'.\MessageBreak - Known values are:\MessageBreak - `false', `first', `last', `true'.\MessageBreak - Now `false' is used% - }% - \chardef\pagegrid@double\z@ - }{% - \chardef\pagegrid@double\csname pagegrid@double@#1\endcsname\relax - }% -} -\@namedef{pagegrid@double@false}{0} -\@namedef{pagegrid@double@first}{1} -\@namedef{pagegrid@double@last}{2} -\@namedef{pagegrid@double@true}{2} -\chardef\pagegrid@double\z@ -% \end{macrocode} -% \begin{macrocode} -\newcommand*{\pagegridsetup}{% - \let\pagegrid@init\pagegrid@@init - \setkeys{pagegrid}% -} -% \end{macrocode} -% \begin{macrocode} -\pagegridsetup{% - step=1mm% -} -\InputIfFileExists{pagegrid.cfg}{}% -\ProcessKeyvalOptions*\relax -\AtBeginDocument{% - \ifdim\pagegrid@arrowlength>\z@ - \else - \pagegrid@arrowlength=10\pagegrid@step - \fi -} -% \end{macrocode} -% -% \begin{macrocode} -\def\pagegridShipoutDoubleBegin{% - \begingroup - \let\newlabel\@gobbletwo - \let\zref@newlabel\@gobbletwo - \let\@writefile\@gobbletwo - \let\select@language\@gobble -} -\def\pagegridShipoutDoubleEnd{% - \endgroup -} -\def\pagegrid@WriteDouble#1#2{% - \immediate\write#1{% - \@backslashchar csname % - pagegridShipoutDouble#2% - \@backslashchar endcsname% - }% -} -\def\pagegrid@ShipoutDouble#1{% - \begingroup - \if@filesw - \pagegrid@WriteDouble\@mainaux{Begin}% - \ifx\@auxout\@partaux - \pagegrid@WriteDouble\@partaux{Begin}% - \def\pagegrid@temp{% - \pagegrid@WriteDouble\@mainaux{End}% - \pagegrid@WriteDouble\@partaux{End}% - }% - \else - \def\pagegrid@temp{% - \pagegrid@WriteDouble\@mainaux{End}% - }% - \fi - \else - \def\pagegrid@temp{}% - \fi - \let\protect\noexpand - \AtBeginShipoutOriginalShipout\copy#1\relax - \pagegrid@temp - \endgroup -} -% \end{macrocode} -% -% \begin{macrocode} -\AtBeginShipout{% - \ifdim\pagegrid@step>\z@ - \else - \pagegrid@enablefalse - \fi - \ifpagegrid@enable - \ifnum\pagegrid@double=\@ne - \pagegrid@ShipoutDouble\AtBeginShipoutBox - \else - \ifnum\pagegrid@double=\tw@ - \@ifundefined{pagegrid@DoubleBox}{% - \newbox\pagegrid@DoubleBox - }{}% - \setbox\pagegrid@DoubleBox=\copy\AtBeginShipoutBox - \fi - \fi - \ifpagegrid@foreground - \expandafter\AtBeginShipoutUpperLeftForeground - \else - \expandafter\AtBeginShipoutUpperLeft - \fi - {% - \put(0,0){% - \makebox(0,0)[lt]{% - \begin{tikzpicture}[% - bl/.style={},% - br/.style={xshift=\pagegrid@width,xscale=-1},% - tl/.style={yshift=\pagegrid@height,yscale=-1},% - tr/.style={xshift=\pagegrid@width,% - yshift=\pagegrid@height,scale=-1}% - ]% - \useasboundingbox - (0mm,\pagegrid@height) rectangle (0mm,\pagegrid@height);% - \draw[% - \pagegrid@origin@a,% - step=\pagegrid@step,% - style=help lines,% - ultra thin% - ] (0mm,0mm) grid (\pagegrid@width,\pagegrid@height);% - \ifx\pagegrid@origin@b\@empty - \else - \draw[% - \pagegrid@origin@b,% - step=10\pagegrid@step,% - {\pagegrid@secondcolor},% - very thin% - ] (0mm,0mm) grid (\pagegrid@width,\pagegrid@height);% - \fi - \draw[% - \pagegrid@origin@a,% - step=10\pagegrid@step,% - {\pagegrid@firstcolor},% - very thin% - ] (0mm,0mm) grid (\pagegrid@width,\pagegrid@height);% - \ifx\pagegrid@origin@b\@empty - \else - \draw[% - \pagegrid@origin@b,% - step=50\pagegrid@step,% - {\pagegrid@secondcolor},% - thick% - ] (0mm,0mm) grid (\pagegrid@width,\pagegrid@height);% - \fi - \draw[% - \pagegrid@origin@a,% - step=50\pagegrid@step,% - {\pagegrid@firstcolor},% - thick% - ] (0mm,0mm) grid (\pagegrid@width,\pagegrid@height);% - \ifpagegrid@arrows - \ifx\pagegrid@origin@b\@empty - \else - \draw[% - \pagegrid@origin@b,% - {\pagegrid@secondcolor},% - stroke,% - line width=1pt,% - line cap=round% - ] (0mm,0mm) % - -- (\pagegrid@arrowlength,\pagegrid@arrowlength) % - (\pagegrid@arrowlength,.5\pagegrid@arrowlength) % - -- (\pagegrid@arrowlength,\pagegrid@arrowlength) % - -- (.5\pagegrid@arrowlength,\pagegrid@arrowlength);% - \fi - \draw[% - \pagegrid@origin@a,% - {\pagegrid@firstcolor},% - stroke,% - line width=1pt,% - line cap=round% - ] (0mm,0mm) % - -- (\pagegrid@arrowlength,\pagegrid@arrowlength) % - (\pagegrid@arrowlength,.5\pagegrid@arrowlength) % - -- (\pagegrid@arrowlength,\pagegrid@arrowlength) % - -- (.5\pagegrid@arrowlength,\pagegrid@arrowlength);% - \fi - \end{tikzpicture}% - }% - }% - }% - \ifnum\pagegrid@double=\tw@ - \pagegrid@ShipoutDouble\pagegrid@DoubleBox - \fi - \fi -} -% \end{macrocode} -% -% \begin{macrocode} -\pagegrid@AtEnd% -% -% \end{macrocode} -%% \section{Installation} -% -% \subsection{Download} -% -% \paragraph{Package.} This package is available on -% CTAN\footnote{\CTANpkg{pagegrid}}: -% \begin{description} -% \item[\CTAN{macros/latex/contrib/oberdiek/pagegrid.dtx}] The source file. -% \item[\CTAN{macros/latex/contrib/oberdiek/pagegrid.pdf}] Documentation. -% \end{description} -% -% -% \paragraph{Bundle.} All the packages of the bundle `oberdiek' -% are also available in a TDS compliant ZIP archive. There -% the packages are already unpacked and the documentation files -% are generated. The files and directories obey the TDS standard. -% \begin{description} -% \item[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}] -% \end{description} -% \emph{TDS} refers to the standard ``A Directory Structure -% for \TeX\ Files'' (\CTANpkg{tds}). Directories -% with \xfile{texmf} in their name are usually organized this way. -% -% \subsection{Bundle installation} -% -% \paragraph{Unpacking.} Unpack the \xfile{oberdiek.tds.zip} in the -% TDS tree (also known as \xfile{texmf} tree) of your choice. -% Example (linux): -% \begin{quote} -% |unzip oberdiek.tds.zip -d ~/texmf| -% \end{quote} -% -% \subsection{Package installation} -% -% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting -% \docstrip\ archive. The files are extracted by running the -% \xfile{.dtx} through \plainTeX: -% \begin{quote} -% \verb|tex pagegrid.dtx| -% \end{quote} -% -% \paragraph{TDS.} Now the different files must be moved into -% the different directories in your installation TDS tree -% (also known as \xfile{texmf} tree): -% \begin{quote} -% \def\t{^^A -% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}} -% pagegrid.sty & tex/latex/oberdiek/pagegrid.sty\\ -% pagegrid.pdf & doc/latex/oberdiek/pagegrid.pdf\\ -% pagegrid.dtx & source/latex/oberdiek/pagegrid.dtx\\ -% \end{tabular}^^A -% }^^A -% \sbox0{\t}^^A -% \ifdim\wd0>\linewidth -% \begingroup -% \advance\linewidth by\leftmargin -% \advance\linewidth by\rightmargin -% \edef\x{\endgroup -% \def\noexpand\lw{\the\linewidth}^^A -% }\x -% \def\lwbox{^^A -% \leavevmode -% \hbox to \linewidth{^^A -% \kern-\leftmargin\relax -% \hss -% \usebox0 -% \hss -% \kern-\rightmargin\relax -% }^^A -% }^^A -% \ifdim\wd0>\lw -% \sbox0{\small\t}^^A -% \ifdim\wd0>\linewidth -% \ifdim\wd0>\lw -% \sbox0{\footnotesize\t}^^A -% \ifdim\wd0>\linewidth -% \ifdim\wd0>\lw -% \sbox0{\scriptsize\t}^^A -% \ifdim\wd0>\linewidth -% \ifdim\wd0>\lw -% \sbox0{\tiny\t}^^A -% \ifdim\wd0>\linewidth -% \lwbox -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \end{quote} -% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's -% TDS installing feature, then some files can already be in the right -% place, see the documentation of \docstrip. -% -% \subsection{Refresh file name databases} -% -% If your \TeX~distribution -% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh -% these. For example, \TeX\,Live\ users run \verb|texhash| or -% \verb|mktexlsr|. -% -% \subsection{Some details for the interested} -% -% \paragraph{Unpacking with \LaTeX.} -% The \xfile{.dtx} chooses its action depending on the format: -% \begin{description} -% \item[\plainTeX:] Run \docstrip\ and extract the files. -% \item[\LaTeX:] Generate the documentation. -% \end{description} -% If you insist on using \LaTeX\ for \docstrip\ (really, -% \docstrip\ does not need \LaTeX), then inform the autodetect routine -% about your intention: -% \begin{quote} -% \verb|latex \let\install=y\input{pagegrid.dtx}| -% \end{quote} -% Do not forget to quote the argument according to the demands -% of your shell. -% -% \paragraph{Generating the documentation.} -% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate -% the documentation. The process can be configured by the -% configuration file \xfile{ltxdoc.cfg}. For instance, put this -% line into this file, if you want to have A4 as paper format: -% \begin{quote} -% \verb|\PassOptionsToClass{a4paper}{article}| -% \end{quote} -% An example follows how to generate the -% documentation with pdf\LaTeX: -% \begin{quote} -%\begin{verbatim} -%pdflatex pagegrid.dtx -%makeindex -s gind.ist pagegrid.idx -%pdflatex pagegrid.dtx -%makeindex -s gind.ist pagegrid.idx -%pdflatex pagegrid.dtx -%\end{verbatim} -% \end{quote} -% -% \section{Acknowledgement} -% -% \begin{description} -% \item[Klaus Braune:] -% He provided the idea and the first \xpackage{tikz} code. -% \end{description} -% -% \begin{History} -% \begin{Version}{2009/11/06 v1.0} -% \item -% The first version. -% \end{Version} -% \begin{Version}{2009/11/06 v1.1} -% \item -% Option \xoption{foreground} added. -% \end{Version} -% \begin{Version}{2009/12/02 v1.2} -% \item -% Color options, arrow options added. -% \item -% Names for origin options changed. -% \end{Version} -% \begin{Version}{2009/12/03 v1.3} -% \item -% Option \xoption{double} added. -% \item -% First CTAN release. -% \end{Version} -% \begin{Version}{2009/12/04 v1.4} -% \item -% Option \xoption{double}: Some unwanted side effects removed. -% \end{Version} -% \begin{Version}{2016/05/16 v1.5} -% \item -% Documentation updates. -% \end{Version} -% \end{History} -% -% \PrintIndex -% -% \Finale -\endinput diff --git a/macros/latex/contrib/oberdiek/pagegrid.pdf b/macros/latex/contrib/oberdiek/pagegrid.pdf deleted file mode 100644 index b5ea088818..0000000000 Binary files a/macros/latex/contrib/oberdiek/pagegrid.pdf and /dev/null differ diff --git a/macros/latex/contrib/oberdiek/pdfcol.dtx b/macros/latex/contrib/oberdiek/pdfcol.dtx deleted file mode 100644 index 8e30a6f451..0000000000 --- a/macros/latex/contrib/oberdiek/pdfcol.dtx +++ /dev/null @@ -1,939 +0,0 @@ -% \iffalse meta-comment -% -% File: pdfcol.dtx -% Version: 2019/12/29 v1.6 -% Info: Handle new color stacks for pdfTeX -% -% Copyright (C) -% 2007 Heiko Oberdiek -% 2016-2019 Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% This work 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. This version of this license is in -% https://www.latex-project.org/lppl/lppl-1-3c.txt -% and the latest version of this license is in -% https://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of -% LaTeX version 2005/12/01 or later. -% -% This work has the LPPL maintenance status "maintained". -% -% The Current Maintainers of this work are -% Heiko Oberdiek and the Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% The Base Interpreter refers to any `TeX-Format', -% because some files are installed in TDS:tex/generic//. -% -% This work consists of the main source file pdfcol.dtx -% and the derived files -% pdfcol.sty, pdfcol.pdf, pdfcol.ins, pdfcol.drv, pdfcol-test1.tex, -% pdfcol-test2.tex, pdfcol-test3.tex, pdfcol-test4.tex. -% -% Distribution: -% CTAN:macros/latex/contrib/oberdiek/pdfcol.dtx -% CTAN:macros/latex/contrib/oberdiek/pdfcol.pdf -% -% Unpacking: -% (a) If pdfcol.ins is present: -% tex pdfcol.ins -% (b) Without pdfcol.ins: -% tex pdfcol.dtx -% (c) If you insist on using LaTeX -% latex \let\install=y\input{pdfcol.dtx} -% (quote the arguments according to the demands of your shell) -% -% Documentation: -% (a) If pdfcol.drv is present: -% latex pdfcol.drv -% (b) Without pdfcol.drv: -% latex pdfcol.dtx; ... -% The class ltxdoc loads the configuration file ltxdoc.cfg -% if available. Here you can specify further options, e.g. -% use A4 as paper format: -% \PassOptionsToClass{a4paper}{article} -% -% Programm calls to get the documentation (example): -% pdflatex pdfcol.dtx -% makeindex -s gind.ist pdfcol.idx -% pdflatex pdfcol.dtx -% makeindex -s gind.ist pdfcol.idx -% pdflatex pdfcol.dtx -% -% Installation: -% TDS:tex/generic/oberdiek/pdfcol.sty -% TDS:doc/latex/oberdiek/pdfcol.pdf -% TDS:source/latex/oberdiek/pdfcol.dtx -% -%<*ignore> -\begingroup - \catcode123=1 % - \catcode125=2 % - \def\x{LaTeX2e}% -\expandafter\endgroup -\ifcase 0\ifx\install y1\fi\expandafter - \ifx\csname processbatchFile\endcsname\relax\else1\fi - \ifx\fmtname\x\else 1\fi\relax -\else\csname fi\endcsname -% -%<*install> -\input docstrip.tex -\Msg{************************************************************************} -\Msg{* Installation} -\Msg{* Package: pdfcol 2019/12/29 v1.6 Handle new color stacks for pdfTeX (HO)} -\Msg{************************************************************************} - -\keepsilent -\askforoverwritefalse - -\let\MetaPrefix\relax -\preamble - -This is a generated file. - -Project: pdfcol -Version: 2019/12/29 v1.6 - -Copyright (C) - 2007 Heiko Oberdiek - 2016-2019 Oberdiek Package Support Group - -This work 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. This version of this license is in - https://www.latex-project.org/lppl/lppl-1-3c.txt -and the latest version of this license is in - https://www.latex-project.org/lppl.txt -and version 1.3 or later is part of all distributions of -LaTeX version 2005/12/01 or later. - -This work has the LPPL maintenance status "maintained". - -The Current Maintainers of this work are -Heiko Oberdiek and the Oberdiek Package Support Group -https://github.com/ho-tex/oberdiek/issues - - -The Base Interpreter refers to any `TeX-Format', -because some files are installed in TDS:tex/generic//. - -This work consists of the main source file pdfcol.dtx -and the derived files - pdfcol.sty, pdfcol.pdf, pdfcol.ins, pdfcol.drv, pdfcol-test1.tex, - pdfcol-test2.tex, pdfcol-test3.tex, pdfcol-test4.tex. - -\endpreamble -\let\MetaPrefix\DoubleperCent - -\generate{% - \file{pdfcol.ins}{\from{pdfcol.dtx}{install}}% - \file{pdfcol.drv}{\from{pdfcol.dtx}{driver}}% - \usedir{tex/generic/oberdiek}% - \file{pdfcol.sty}{\from{pdfcol.dtx}{package}}% -% \usedir{doc/latex/oberdiek/test}% -% \file{pdfcol-test1.tex}{\from{pdfcol.dtx}{test1}}% -% \file{pdfcol-test2.tex}{\from{pdfcol.dtx}{test2}}% -% \file{pdfcol-test3.tex}{\from{pdfcol.dtx}{test3}}% -% \file{pdfcol-test4.tex}{\from{pdfcol.dtx}{test4}}% -} - -\catcode32=13\relax% active space -\let =\space% -\Msg{************************************************************************} -\Msg{*} -\Msg{* To finish the installation you have to move the following} -\Msg{* file into a directory searched by TeX:} -\Msg{*} -\Msg{* pdfcol.sty} -\Msg{*} -\Msg{* To produce the documentation run the file `pdfcol.drv'} -\Msg{* through LaTeX.} -\Msg{*} -\Msg{* Happy TeXing!} -\Msg{*} -\Msg{************************************************************************} - -\endbatchfile -% -%<*ignore> -\fi -% -%<*driver> -\NeedsTeXFormat{LaTeX2e} -\ProvidesFile{pdfcol.drv}% - [2019/12/29 v1.6 Handle new color stacks for pdfTeX (HO)]% -\documentclass{ltxdoc} -\usepackage{holtxdoc}[2011/11/22] -\begin{document} - \DocInput{pdfcol.dtx}% -\end{document} -% -% \fi -% -% -% -% \GetFileInfo{pdfcol.drv} -% -% \title{The \xpackage{pdfcol} package} -% \date{2019/12/29 v1.6} -% \author{Heiko Oberdiek\thanks -% {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}} -% -% \maketitle -% -% \begin{abstract} -% Since version 1.40 \pdfTeX\ supports color stacks. -% The driver file \xfile{pdftex.def} for package \xpackage{color} -% defines and uses a main color stack since version v0.04b. -% Package \xpackage{pdfcol} is intended for package writers. -% It defines macros for setting and maintaining new color stacks. -% \end{abstract} -% -% \tableofcontents -% -% \section{Documentation} -% -% Version 1.40 of \pdfTeX\ adds new primitives \cs{pdfcolorstackinit} -% and \cs{pdfcolorstack}. Now color stacks can be defined and used. -% A main color stack is maintained by the driver file \xfile{pdftex.def} -% similar to dvips or dvipdfm. However the number of color stacks -% is not limited to one in \pdfTeX. Thus further color problems -% can now be solved, such as footnotes across pages or text -% that is set in parallel columns (e.g. packages \xpackage{parallel} -% or \xpackage{parcolumn}). Unlike the main color stack, -% the support by additional color stacks cannot be done in -% a transparent manner. -% -% This package \xpackage{pdfcol} provides an easier interface to -% additional color stacks without the need to use the -% low level primitives. -% -% \subsection{Requirements} -% \label{sec:req} -% -% \begin{itemize} -% \item -% \pdfTeX\ 1.40 or greater. -% \item -% \pdfTeX in PDF mode. (I don't know a DVI driver that -% support several color stacks.) -% \item -% \xfile{pdftex.def} 2007/01/02 v0.04b. -% \end{itemize} -% Package \xpackage{pdfcol} checks the requirements and -% sets switch \cs{ifpdfcolAvailable} accordingly. -% -% \subsection{Interface} -% -% \begin{declcs}{ifpdfcolAvailable} -% \end{declcs} -% If the requirements of section \ref{sec:req} are met the -% switch \cs{ifpdfcolAvailable} behaves as \cs{iftrue}. -% Otherwise the other interface macros in this section will -% be disabled with a message. Also the first use of such a -% macro will print a message. The messages are print to -% the \xext{log} file only if \pdfTeX\ is not used in PDF mode. -% -% \begin{declcs}{pdfcolErrorNoStacks} -% \end{declcs} -% The first call of \cs{pdfcolErrorNoStacks} prints an error -% message, if color stacks are not available. -% -% \begin{declcs}{pdfcolInitStack} \M{name} -% \end{declcs} -% A new color stack is initialized by \cs{pdfcolInitStack}. -% The \meta{name} is used for indentifying the stack. It usually -% consists of letters and digits. (The name must survive a \cs{csname}.) -% -% The intension of the macro is the definition of an additional -% color stack. Thus the stack is not page bounded like the -% main color stack. Black (\texttt{0 g 0 G}) is used as initial -% color value. And colors are written with modifier \texttt{direct} -% that means without setting the current transfer matrix and changing -% the current point (see documentation of \pdfTeX\ for -% |\pdfliteral direct{...}|). -% -% \begin{declcs}{pdfcolIfStackExists} \M{name} \M{then} \M{else} -% \end{declcs} -% Macro \cs{pdfcolIfStackExists} checks whether color stack \meta{name} -% exists. In case of success argument \meta{then} is executed -% and \meta{else} otherwise. -% -% \begin{declcs}{pdfcolSwitchStack} \M{name} -% \end{declcs} -% Macro \cs{pdfcolSwitchStack} switches the color stack. The color macros -% of package \xpackage{color} (or \xpackage{xcolor}) now uses the -% new color stack with name \meta{name}. -% -% \begin{declcs}{pdfcolSetCurrentColor} -% \end{declcs} -% Macro \cs{pdfcolSetCurrentColor} replaces the topmost -% entry of the stack by the current color (\cs{current@color}). -% -% \begin{declcs}{pdfcolSetCurrent} \M{name} -% \end{declcs} -% Macro \cs{pdfcolSetCurrent} sets the color that is read in -% the top-most entry of color stack \meta{name}. If \meta{name} -% is empty, the default color stack is used. -% -% \StopEventually{ -% } -% -% \section{Implementation} -% -% \begin{macrocode} -%<*package> -% \end{macrocode} -% -% \subsection{Reload check and package identification} -% Reload check, especially if the package is not used with \LaTeX. -% \begin{macrocode} -\begingroup\catcode61\catcode48\catcode32=10\relax% - \catcode13=5 % ^^M - \endlinechar=13 % - \catcode35=6 % # - \catcode39=12 % ' - \catcode44=12 % , - \catcode45=12 % - - \catcode46=12 % . - \catcode58=12 % : - \catcode64=11 % @ - \catcode123=1 % { - \catcode125=2 % } - \expandafter\let\expandafter\x\csname ver@pdfcol.sty\endcsname - \ifx\x\relax % plain-TeX, first loading - \else - \def\empty{}% - \ifx\x\empty % LaTeX, first loading, - % variable is initialized, but \ProvidesPackage not yet seen - \else - \expandafter\ifx\csname PackageInfo\endcsname\relax - \def\x#1#2{% - \immediate\write-1{Package #1 Info: #2.}% - }% - \else - \def\x#1#2{\PackageInfo{#1}{#2, stopped}}% - \fi - \x{pdfcol}{The package is already loaded}% - \aftergroup\endinput - \fi - \fi -\endgroup% -% \end{macrocode} -% Package identification: -% \begin{macrocode} -\begingroup\catcode61\catcode48\catcode32=10\relax% - \catcode13=5 % ^^M - \endlinechar=13 % - \catcode35=6 % # - \catcode39=12 % ' - \catcode40=12 % ( - \catcode41=12 % ) - \catcode44=12 % , - \catcode45=12 % - - \catcode46=12 % . - \catcode47=12 % / - \catcode58=12 % : - \catcode64=11 % @ - \catcode91=12 % [ - \catcode93=12 % ] - \catcode123=1 % { - \catcode125=2 % } - \expandafter\ifx\csname ProvidesPackage\endcsname\relax - \def\x#1#2#3[#4]{\endgroup - \immediate\write-1{Package: #3 #4}% - \xdef#1{#4}% - }% - \else - \def\x#1#2[#3]{\endgroup - #2[{#3}]% - \ifx#1\@undefined - \xdef#1{#3}% - \fi - \ifx#1\relax - \xdef#1{#3}% - \fi - }% - \fi -\expandafter\x\csname ver@pdfcol.sty\endcsname -\ProvidesPackage{pdfcol}% - [2019/12/29 v1.6 Handle new color stacks for pdfTeX (HO)]% -% \end{macrocode} -% -% \subsection{Catcodes} -% -% \begin{macrocode} -\begingroup\catcode61\catcode48\catcode32=10\relax% - \catcode13=5 % ^^M - \endlinechar=13 % - \catcode123=1 % { - \catcode125=2 % } - \catcode64=11 % @ - \def\x{\endgroup - \expandafter\edef\csname PDFCOL@AtEnd\endcsname{% - \endlinechar=\the\endlinechar\relax - \catcode13=\the\catcode13\relax - \catcode32=\the\catcode32\relax - \catcode35=\the\catcode35\relax - \catcode61=\the\catcode61\relax - \catcode64=\the\catcode64\relax - \catcode123=\the\catcode123\relax - \catcode125=\the\catcode125\relax - }% - }% -\x\catcode61\catcode48\catcode32=10\relax% -\catcode13=5 % ^^M -\endlinechar=13 % -\catcode35=6 % # -\catcode64=11 % @ -\catcode123=1 % { -\catcode125=2 % } -\def\TMP@EnsureCode#1#2{% - \edef\PDFCOL@AtEnd{% - \PDFCOL@AtEnd - \catcode#1=\the\catcode#1\relax - }% - \catcode#1=#2\relax -} -\TMP@EnsureCode{39}{12}% ' -\TMP@EnsureCode{40}{12}% ( -\TMP@EnsureCode{41}{12}% ) -\TMP@EnsureCode{43}{12}% + -\TMP@EnsureCode{44}{12}% , -\TMP@EnsureCode{46}{12}% . -\TMP@EnsureCode{47}{12}% / -\TMP@EnsureCode{91}{12}% [ -\TMP@EnsureCode{93}{12}% ] -\TMP@EnsureCode{96}{12}% ` -\edef\PDFCOL@AtEnd{\PDFCOL@AtEnd\noexpand\endinput} -% \end{macrocode} -% -% \subsection{Check requirements} -% -% \begin{macro}{\PDFCOL@RequirePackage} -% \begin{macrocode} -\begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname RequirePackage\endcsname\relax - \def\PDFCOL@RequirePackage#1[#2]{\input #1.sty\relax}% -\else - \def\PDFCOL@RequirePackage#1[#2]{% - \RequirePackage{#1}[{#2}]% - }% -\fi -% \end{macrocode} -% \end{macro} -% -% LuaTeX Compatability -% \begin{macrocode} -\ifx\pdfextension\@undefined\else - \def\pdfcolorstackinit {\pdffeedback colorstackinit} - \protected\def\pdfcolorstack {\pdfextension colorstack} -\fi -% \end{macrocode} -% -% \begin{macrocode} -\PDFCOL@RequirePackage{ltxcmds}[2010/03/01] -% \end{macrocode} -% -% \begin{macro}{ifpdfcolAvailable} -% \begin{macrocode} -\ltx@newif\ifpdfcolAvailable -\pdfcolAvailabletrue -% \end{macrocode} -% \end{macro} -% -% \subsubsection{Check package \xpackage{luacolor}} -% -% \begin{macrocode} -\ltx@newif\ifPDFCOL@luacolor -\begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname ver@luacolor.sty\endcsname\relax - \PDFCOL@luacolorfalse -\else - \PDFCOL@luacolortrue -\fi -% \end{macrocode} -% -% \subsubsection{Check PDF mode} -% -% \begin{macrocode} -\PDFCOL@RequirePackage{infwarerr}[2007/09/09] -\PDFCOL@RequirePackage{iftex}[2019/11/07] -\ifcase\ifpdf\ifPDFCOL@luacolor 1\fi\else 1\fi0 % - \def\PDFCOL@Message{% - \@PackageWarningNoLine{pdfcol}% - }% -\else - \pdfcolAvailablefalse - \def\PDFCOL@Message{% - \@PackageInfoNoLine{pdfcol}% - }% - \PDFCOL@Message{% - Interface disabled because of % - \ifPDFCOL@luacolor - package `luacolor'% - \else - missing PDF mode of pdfTeX% - \fi - }% -\fi -% \end{macrocode} -% -% \subsubsection{Check version of \pdfTeX} -% -% \begin{macrocode} -\ifpdfcolAvailable - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname pdfcolorstack\endcsname\relax - \pdfcolAvailablefalse - \PDFCOL@Message{% - Interface disabled because of too old pdfTeX.\MessageBreak - Required is version 1.40+ for \string\pdfcolorstack - }% - \fi -\fi -\ifpdfcolAvailable - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname pdfcolorstack\endcsname\relax - \pdfcolAvailablefalse - \PDFCOL@Message{% - Interface disabled because of too old pdfTeX.\MessageBreak - Required is version 1.40+ for \string\pdfcolorstackinit - }% - \fi -\fi -% \end{macrocode} -% -% \subsubsection{Check \xfile{pdftex.def}} -% -% \begin{macrocode} -\ifpdfcolAvailable - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname @pdfcolorstack\endcsname\relax -% \end{macrocode} -% Try to load package color if it is not yet loaded (\LaTeX\ case). -% \begin{macrocode} - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname ver@color.sty\endcsname\relax - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname documentclass\endcsname\relax - \else - \RequirePackage[pdftex]{color}\relax - \fi - \fi - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname @pdfcolorstack\endcsname\relax - \pdfcolAvailablefalse - \PDFCOL@Message{% - Interface disabled because `pdftex.def'\MessageBreak - is not loaded or it is too old.\MessageBreak - Required is version 0.04b or greater% - }% - \fi - \fi -\fi -% \end{macrocode} -% -% \begin{macrocode} -\let\pdfcolAvailabletrue\relax -\let\pdfcolAvailablefalse\relax -% \end{macrocode} -% -% \subsection{Enabled interface macros} -% -% \begin{macrocode} -\ifpdfcolAvailable -% \end{macrocode} -% -% \begin{macro}{\pdfcolErrorNoStacks} -% \begin{macrocode} - \let\pdfcolErrorNoStacks\relax -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\pdfcol@Value} -% \begin{macrocode} - \expandafter\ifx\csname pdfcol@Value\endcsname\relax - \def\pdfcol@Value{0 g 0 G}% - \fi -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\pdfcol@LiteralModifier} -% \begin{macrocode} - \expandafter\ifx\csname pdfcol@LiteralModifier\endcsname\relax - \def\pdfcol@LiteralModifier{direct}% - \fi -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\pdfcolInitStack} -% \begin{macrocode} - \def\pdfcolInitStack#1{% - \expandafter\ifx\csname pdfcol@Stack@#1\endcsname\relax - \global\expandafter\chardef\csname pdfcol@Stack@#1\endcsname=% - \pdfcolorstackinit\pdfcol@LiteralModifier{\pdfcol@Value}% - \relax - \@PackageInfo{pdfcol}{% - New color stack `#1' = \number\csname pdfcol@Stack@#1\endcsname - }% - \else - \@PackageError{pdfcol}{% - Stack `#1' is already defined% - }\@ehc - \fi - }% -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\pdfcolIfStackExists} -% \begin{macrocode} - \def\pdfcolIfStackExists#1{% - \expandafter\ifx\csname pdfcol@Stack@#1\endcsname\relax - \expandafter\@secondoftwo - \else - \expandafter\@firstoftwo - \fi - }% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\@firstoftwo} -% \begin{macrocode} - \expandafter\ifx\csname @firstoftwo\endcsname\relax - \long\def\@firstoftwo#1#2{#1}% - \fi -% \end{macrocode} -% \end{macro} -% \begin{macro}{\@secondoftwo} -% \begin{macrocode} - \expandafter\ifx\csname @secondoftwo\endcsname\relax - \long\def\@secondoftwo#1#2{#2}% - \fi -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\pdfcolSwitchStack} -% \begin{macrocode} - \def\pdfcolSwitchStack#1{% - \pdfcolIfStackExists{#1}{% - \expandafter\let\expandafter\@pdfcolorstack - \csname pdfcol@Stack@#1\endcsname - }{% - \pdfcol@ErrorNoStack{#1}% - }% - }% -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\pdfcolSetCurrentColor} -% \begin{macrocode} - \def\pdfcolSetCurrentColor{% - \pdfcolorstack\@pdfcolorstack set{\current@color}% - }% -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\pdfcolSetCurrent} -% \begin{macrocode} - \def\pdfcolSetCurrent#1{% - \ifx\\#1\\% - \pdfcolorstack\@pdfcolorstack current\relax - \else - \pdfcolIfStackExists{#1}{% - \pdfcolorstack\csname pdfcol@Stack@#1\endcsname current\relax - }{% - \pdfcol@ErrorNoStack{#1}% - }% - \fi - }% -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\pdfcol@ErrorNoStack} -% \begin{macrocode} - \def\pdfcol@ErrorNoStack#1{% - \@PackageError{pdfcol}{Stack `#1' does not exists}\@ehc - }% -% \end{macrocode} -% \end{macro} -% -% \subsection{Disabled interface macros} -% -% \begin{macrocode} -\else -% \end{macrocode} -% -% \begin{macro}{\pdfcolErrorNoStacks} -% \begin{macrocode} - \def\pdfcolErrorNoStacks{% - \@PackageError{pdfcol}{% - Color stacks are not available% - }{% - Update pdfTeX (1.40) and `pdftex.def' (0.04b) % - if necessary.\MessageBreak - Ensure that `pdftex.def' is loaded % - (package `color' or `xcolor').\MessageBreak - Further messages can be found in TeX's % - protocol file `\jobname.log'.\MessageBreak - \MessageBreak - \@ehc - }% - \global\let\pdfcolErrorNoStacks\relax - }% -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\PDFCOL@Disabled} -% \begin{macrocode} - \def\PDFCOL@Disabled{% - \PDFCOL@Message{% - pdfTeX's color stacks are not available% - }% - \global\let\PDFCOL@Disabled\relax - }% -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\pdfcolInitStack} -% \begin{macrocode} - \def\pdfcolInitStack#1{% - \PDFCOL@Disabled - }% -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\pdfcolIfStackExists} -% \begin{macrocode} - \long\def\pdfcolIfStackExists#1#2#3{#3}% -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\pdfcolSwitchStack} -% \begin{macrocode} - \def\pdfcolSwitchStack#1{% - \PDFCOL@Disabled - }% -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\pdfcolSetCurrentColor} -% \begin{macrocode} - \def\pdfcolSetCurrentColor{% - \PDFCOL@Disabled - }% -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\pdfcolSetCurrent} -% \begin{macrocode} - \def\pdfcolSetCurrent#1{% - \PDFCOL@Disabled - }% -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\fi -% \end{macrocode} -% -% \begin{macrocode} -\PDFCOL@AtEnd% -% -% \end{macrocode} -%% \section{Installation} -% -% \subsection{Download} -% -% \paragraph{Package.} This package is available on -% CTAN\footnote{\CTANpkg{pdfcol}}: -% \begin{description} -% \item[\CTAN{macros/latex/contrib/oberdiek/pdfcol.dtx}] The source file. -% \item[\CTAN{macros/latex/contrib/oberdiek/pdfcol.pdf}] Documentation. -% \end{description} -% -% -% \paragraph{Bundle.} All the packages of the bundle `oberdiek' -% are also available in a TDS compliant ZIP archive. There -% the packages are already unpacked and the documentation files -% are generated. The files and directories obey the TDS standard. -% \begin{description} -% \item[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}] -% \end{description} -% \emph{TDS} refers to the standard ``A Directory Structure -% for \TeX\ Files'' (\CTANpkg{tds}). Directories -% with \xfile{texmf} in their name are usually organized this way. -% -% \subsection{Bundle installation} -% -% \paragraph{Unpacking.} Unpack the \xfile{oberdiek.tds.zip} in the -% TDS tree (also known as \xfile{texmf} tree) of your choice. -% Example (linux): -% \begin{quote} -% |unzip oberdiek.tds.zip -d ~/texmf| -% \end{quote} -% -% \subsection{Package installation} -% -% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting -% \docstrip\ archive. The files are extracted by running the -% \xfile{.dtx} through \plainTeX: -% \begin{quote} -% \verb|tex pdfcol.dtx| -% \end{quote} -% -% \paragraph{TDS.} Now the different files must be moved into -% the different directories in your installation TDS tree -% (also known as \xfile{texmf} tree): -% \begin{quote} -% \def\t{^^A -% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}} -% pdfcol.sty & tex/generic/oberdiek/pdfcol.sty\\ -% pdfcol.pdf & doc/latex/oberdiek/pdfcol.pdf\\ -% pdfcol.dtx & source/latex/oberdiek/pdfcol.dtx\\ -% \end{tabular}^^A -% }^^A -% \sbox0{\t}^^A -% \ifdim\wd0>\linewidth -% \begingroup -% \advance\linewidth by\leftmargin -% \advance\linewidth by\rightmargin -% \edef\x{\endgroup -% \def\noexpand\lw{\the\linewidth}^^A -% }\x -% \def\lwbox{^^A -% \leavevmode -% \hbox to \linewidth{^^A -% \kern-\leftmargin\relax -% \hss -% \usebox0 -% \hss -% \kern-\rightmargin\relax -% }^^A -% }^^A -% \ifdim\wd0>\lw -% \sbox0{\small\t}^^A -% \ifdim\wd0>\linewidth -% \ifdim\wd0>\lw -% \sbox0{\footnotesize\t}^^A -% \ifdim\wd0>\linewidth -% \ifdim\wd0>\lw -% \sbox0{\scriptsize\t}^^A -% \ifdim\wd0>\linewidth -% \ifdim\wd0>\lw -% \sbox0{\tiny\t}^^A -% \ifdim\wd0>\linewidth -% \lwbox -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \end{quote} -% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's -% TDS installing feature, then some files can already be in the right -% place, see the documentation of \docstrip. -% -% \subsection{Refresh file name databases} -% -% If your \TeX~distribution -% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh -% these. For example, \TeX\,Live\ users run \verb|texhash| or -% \verb|mktexlsr|. -% -% \subsection{Some details for the interested} -% -% \paragraph{Unpacking with \LaTeX.} -% The \xfile{.dtx} chooses its action depending on the format: -% \begin{description} -% \item[\plainTeX:] Run \docstrip\ and extract the files. -% \item[\LaTeX:] Generate the documentation. -% \end{description} -% If you insist on using \LaTeX\ for \docstrip\ (really, -% \docstrip\ does not need \LaTeX), then inform the autodetect routine -% about your intention: -% \begin{quote} -% \verb|latex \let\install=y\input{pdfcol.dtx}| -% \end{quote} -% Do not forget to quote the argument according to the demands -% of your shell. -% -% \paragraph{Generating the documentation.} -% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate -% the documentation. The process can be configured by the -% configuration file \xfile{ltxdoc.cfg}. For instance, put this -% line into this file, if you want to have A4 as paper format: -% \begin{quote} -% \verb|\PassOptionsToClass{a4paper}{article}| -% \end{quote} -% An example follows how to generate the -% documentation with pdf\LaTeX: -% \begin{quote} -%\begin{verbatim} -%pdflatex pdfcol.dtx -%makeindex -s gind.ist pdfcol.idx -%pdflatex pdfcol.dtx -%makeindex -s gind.ist pdfcol.idx -%pdflatex pdfcol.dtx -%\end{verbatim} -% \end{quote} -% -% \begin{History} -% \begin{Version}{2007/09/09 v1.0} -% \item -% First version. -% \end{Version} -% \begin{Version}{2007/12/09 v1.1} -% \item -% \cs{pdfcolSetCurrentColor} added. -% \end{Version} -% \begin{Version}{2007/12/12 v1.2} -% \item -% Detection for package \xpackage{luacolor} added. -% \end{Version} -% \begin{Version}{2016/05/16 v1.3} -% \item -% Documentation updates. -% \end{Version} -% \begin{Version}{2016/05/17 v1.4} -% \item -% Use luatex85 package for new luatex compatibility -% \end{Version} -% \begin{Version}{2018/11/01 v1.5} -% \item -% Remove luatex85 dependency -% \end{Version} -% \begin{Version}{2019/12/29 v1.6} -% \item -% \xpackage{iftex} package. -% \end{Version} -% \end{History} -% -% \PrintIndex -% -% \Finale -\endinput diff --git a/macros/latex/contrib/oberdiek/pdfcol.pdf b/macros/latex/contrib/oberdiek/pdfcol.pdf deleted file mode 100644 index cfc5d41d3b..0000000000 Binary files a/macros/latex/contrib/oberdiek/pdfcol.pdf and /dev/null differ diff --git a/macros/latex/contrib/oberdiek/pdfcolfoot.pdf b/macros/latex/contrib/oberdiek/pdfcolfoot.pdf index d611ba65d2..bc2bcfc34f 100644 Binary files a/macros/latex/contrib/oberdiek/pdfcolfoot.pdf and b/macros/latex/contrib/oberdiek/pdfcolfoot.pdf differ diff --git a/macros/latex/contrib/oberdiek/pdfcolparallel.pdf b/macros/latex/contrib/oberdiek/pdfcolparallel.pdf index 51c9014324..5bf37a6dea 100644 Binary files a/macros/latex/contrib/oberdiek/pdfcolparallel.pdf and b/macros/latex/contrib/oberdiek/pdfcolparallel.pdf differ diff --git a/macros/latex/contrib/oberdiek/pdfcolparcolumns.pdf b/macros/latex/contrib/oberdiek/pdfcolparcolumns.pdf index 56a69feb08..9ef22b141b 100644 Binary files a/macros/latex/contrib/oberdiek/pdfcolparcolumns.pdf and b/macros/latex/contrib/oberdiek/pdfcolparcolumns.pdf differ diff --git a/macros/latex/contrib/oberdiek/pdfcrypt.pdf b/macros/latex/contrib/oberdiek/pdfcrypt.pdf index 79740fa651..ebcfef66c0 100644 Binary files a/macros/latex/contrib/oberdiek/pdfcrypt.pdf and b/macros/latex/contrib/oberdiek/pdfcrypt.pdf differ diff --git a/macros/latex/contrib/oberdiek/pdfrender.pdf b/macros/latex/contrib/oberdiek/pdfrender.pdf index ae0d3a5b51..f5d7da9a0f 100644 Binary files a/macros/latex/contrib/oberdiek/pdfrender.pdf and b/macros/latex/contrib/oberdiek/pdfrender.pdf differ diff --git a/macros/latex/contrib/oberdiek/protecteddef.pdf b/macros/latex/contrib/oberdiek/protecteddef.pdf index 52d39ec04c..351db60331 100644 Binary files a/macros/latex/contrib/oberdiek/protecteddef.pdf and b/macros/latex/contrib/oberdiek/protecteddef.pdf differ diff --git a/macros/latex/contrib/oberdiek/resizegather.pdf b/macros/latex/contrib/oberdiek/resizegather.pdf index 97a1ff7f44..7cbdc874d6 100644 Binary files a/macros/latex/contrib/oberdiek/resizegather.pdf and b/macros/latex/contrib/oberdiek/resizegather.pdf differ diff --git a/macros/latex/contrib/oberdiek/rotchiffre.pdf b/macros/latex/contrib/oberdiek/rotchiffre.pdf index 15262166fd..db416d802d 100644 Binary files a/macros/latex/contrib/oberdiek/rotchiffre.pdf and b/macros/latex/contrib/oberdiek/rotchiffre.pdf differ diff --git a/macros/latex/contrib/oberdiek/scrindex.pdf b/macros/latex/contrib/oberdiek/scrindex.pdf index d6a80e564c..0d5b4f9ff6 100644 Binary files a/macros/latex/contrib/oberdiek/scrindex.pdf and b/macros/latex/contrib/oberdiek/scrindex.pdf differ diff --git a/macros/latex/contrib/oberdiek/setouterhbox.pdf b/macros/latex/contrib/oberdiek/setouterhbox.pdf index d63d0f6f4b..4c6388b5fb 100644 Binary files a/macros/latex/contrib/oberdiek/setouterhbox.pdf and b/macros/latex/contrib/oberdiek/setouterhbox.pdf differ diff --git a/macros/latex/contrib/oberdiek/settobox.pdf b/macros/latex/contrib/oberdiek/settobox.pdf index 97e9a8862f..7c534622e3 100644 Binary files a/macros/latex/contrib/oberdiek/settobox.pdf and b/macros/latex/contrib/oberdiek/settobox.pdf differ diff --git a/macros/latex/contrib/oberdiek/stackrel.pdf b/macros/latex/contrib/oberdiek/stackrel.pdf index c28caf4522..8cfb4f6e67 100644 Binary files a/macros/latex/contrib/oberdiek/stackrel.pdf and b/macros/latex/contrib/oberdiek/stackrel.pdf differ diff --git a/macros/latex/contrib/oberdiek/stampinclude.pdf b/macros/latex/contrib/oberdiek/stampinclude.pdf index 1df073bb3a..853e3478c0 100644 Binary files a/macros/latex/contrib/oberdiek/stampinclude.pdf and b/macros/latex/contrib/oberdiek/stampinclude.pdf differ diff --git a/macros/latex/contrib/oberdiek/tabularht.pdf b/macros/latex/contrib/oberdiek/tabularht.pdf index 7ef081099d..af03656d55 100644 Binary files a/macros/latex/contrib/oberdiek/tabularht.pdf and b/macros/latex/contrib/oberdiek/tabularht.pdf differ diff --git a/macros/latex/contrib/oberdiek/tabularkv.pdf b/macros/latex/contrib/oberdiek/tabularkv.pdf index 25560a6b56..dd9bc6df3f 100644 Binary files a/macros/latex/contrib/oberdiek/tabularkv.pdf and b/macros/latex/contrib/oberdiek/tabularkv.pdf differ diff --git a/macros/latex/contrib/oberdiek/telprint.pdf b/macros/latex/contrib/oberdiek/telprint.pdf index 0b8e6808b5..a01f02b13b 100644 Binary files a/macros/latex/contrib/oberdiek/telprint.pdf and b/macros/latex/contrib/oberdiek/telprint.pdf differ diff --git a/macros/latex/contrib/oberdiek/thepdfnumber.pdf b/macros/latex/contrib/oberdiek/thepdfnumber.pdf index 8efaa9e500..a2a14e0cfc 100644 Binary files a/macros/latex/contrib/oberdiek/thepdfnumber.pdf and b/macros/latex/contrib/oberdiek/thepdfnumber.pdf differ diff --git a/macros/latex/contrib/oberdiek/twoopt.pdf b/macros/latex/contrib/oberdiek/twoopt.pdf index 5a1292e804..415203aef1 100644 Binary files a/macros/latex/contrib/oberdiek/twoopt.pdf and b/macros/latex/contrib/oberdiek/twoopt.pdf differ diff --git a/macros/latex/contrib/pagegrid/README.md b/macros/latex/contrib/pagegrid/README.md new file mode 100644 index 0000000000..2e9e50a1ec --- /dev/null +++ b/macros/latex/contrib/pagegrid/README.md @@ -0,0 +1,12 @@ +# pagegrid package + +Version: 2022-09-21 v1.6 + +This package prints a page grid in the background; + +## Copyright (C) +* 2009 Heiko Oberdiek +* 2016-2022 Oberdiek Package Support Group + +## License +LATEX Project Public License, version 1.3c or later. \ No newline at end of file diff --git a/macros/latex/contrib/pagegrid/pagegrid.dtx b/macros/latex/contrib/pagegrid/pagegrid.dtx new file mode 100644 index 0000000000..a38a4fe8de --- /dev/null +++ b/macros/latex/contrib/pagegrid/pagegrid.dtx @@ -0,0 +1,942 @@ +% \iffalse meta-comment +% +% File: pagegrid.dtx +% Version: 2022-09-21 v1.6 +% Info: Print page grid in background +% +% Copyright (C) +% 2009 Heiko Oberdiek +% 2016-2022 Oberdiek Package Support Group +% https://github.com/ho-tex/pagegrid/issues +% +% This work 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. This version of this license is in +% https://www.latex-project.org/lppl/lppl-1-3c.txt +% and the latest version of this license is in +% https://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of +% LaTeX version 2005/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% The Current Maintainers of this work are +% Heiko Oberdiek and the Oberdiek Package Support Group +% https://github.com/ho-tex/pagegrid/issues +% +% This work consists of the main source file pagegrid.dtx +% and the derived files +% pagegrid.sty, pagegrid.pdf, pagegrid.ins, pagegrid.drv, +% pagegrid-test1.tex. +% +% Distribution: +% CTAN:macros/latex/contrib/pagegrid/pagegrid.dtx +% CTAN:macros/latex/contrib/pagegrid/pagegrid.pdf +% +% Unpacking: +% (a) If pagegrid.ins is present: +% tex pagegrid.ins +% (b) Without pagegrid.ins: +% tex pagegrid.dtx +% (c) If you insist on using LaTeX +% latex \let\install=y\input{pagegrid.dtx} +% (quote the arguments according to the demands of your shell) +% +% Documentation: +% (a) If pagegrid.drv is present: +% latex pagegrid.drv +% (b) Without pagegrid.drv: +% latex pagegrid.dtx; ... +% The class ltxdoc loads the configuration file ltxdoc.cfg +% if available. Here you can specify further options, e.g. +% use A4 as paper format: +% \PassOptionsToClass{a4paper}{article} +% +% Programm calls to get the documentation (example): +% pdflatex pagegrid.dtx +% makeindex -s gind.ist pagegrid.idx +% pdflatex pagegrid.dtx +% makeindex -s gind.ist pagegrid.idx +% pdflatex pagegrid.dtx +% +% Installation: +% TDS:tex/latex/pagegrid/pagegrid.sty +% TDS:doc/latex/pagegrid/pagegrid.pdf +% TDS:source/latex/pagegrid/pagegrid.dtx +% +%<*ignore> +\begingroup + \catcode123=1 % + \catcode125=2 % + \def\x{LaTeX2e}% +\expandafter\endgroup +\ifcase 0\ifx\install y1\fi\expandafter + \ifx\csname processbatchFile\endcsname\relax\else1\fi + \ifx\fmtname\x\else 1\fi\relax +\else\csname fi\endcsname +% +%<*install> +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: pagegrid 2022-09-21 v1.6 Print page grid in background (HO)} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\let\MetaPrefix\relax +\preamble + +This is a generated file. + +Project: pagegrid +Version: 2022-09-21 v1.6 + +Copyright (C) + 2009 Heiko Oberdiek + 2016-2022 Oberdiek Package Support Group + +This work 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. This version of this license is in + https://www.latex-project.org/lppl/lppl-1-3c.txt +and the latest version of this license is in + https://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of +LaTeX version 2005/12/01 or later. + +This work has the LPPL maintenance status "maintained". + +The Current Maintainers of this work are +Heiko Oberdiek and the Oberdiek Package Support Group +https://github.com/ho-tex/pagegrid/issues + + +This work consists of the main source file pagegrid.dtx +and the derived files + pagegrid.sty, pagegrid.pdf, pagegrid.ins, pagegrid.drv, + pagegrid-test1.tex. + +\endpreamble +\let\MetaPrefix\DoubleperCent + +\generate{% + \file{pagegrid.ins}{\from{pagegrid.dtx}{install}}% + \file{pagegrid.drv}{\from{pagegrid.dtx}{driver}}% + \usedir{tex/latex/pagegrid}% + \file{pagegrid.sty}{\from{pagegrid.dtx}{package}}% +% \usedir{doc/latex/pagegrid/test}% +% \file{pagegrid-test1.tex}{\from{pagegrid.dtx}{test1}}% +} + +\catcode32=13\relax% active space +\let =\space% +\Msg{************************************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* file into a directory searched by TeX:} +\Msg{*} +\Msg{* pagegrid.sty} +\Msg{*} +\Msg{* To produce the documentation run the file `pagegrid.drv'} +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{*} +\Msg{************************************************************************} + +\endbatchfile +% +%<*ignore> +\fi +% +%<*driver> +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{pagegrid.drv}% + [2022-09-21 v1.6 Print page grid in background (HO)]% +\documentclass{ltxdoc} +\usepackage{holtxdoc}[2011/11/22] +\begin{document} + \DocInput{pagegrid.dtx}% +\end{document} +% +% \fi +% +% +% +% \GetFileInfo{pagegrid.drv} +% +% \title{The \xpackage{pagegrid} package} +% \date{2022-09-21 v1.6} +% \author{Heiko Oberdiek\thanks +% {Please report any issues at \url{https://github.com/ho-tex/pagegrid/issues}}} +% +% \maketitle +% +% \begin{abstract} +% The \LaTeX\ package prints a page grid in the background. +% \end{abstract} +% +% \tableofcontents +% +% \section{Documentation} +% +% The package puts a grid on the paper. It was written for +% developers of a class or package +% who have to put elements on definite locations on a page +% (e.g. letter class). The grid allows a faster optical check, +% whether the positions are correct. If the previewer already +% offers features for measuring, the package might be obsolete. +% Otherwise it saves the developer from printing the page and +% measuring by hand. +% +% \subsection{Options} +% +% Options are evaluated in the following order: +% \begin{enumerate} +% \item +% Configuration file \xfile{pagegrid.cfg} using \cs{pagegridsetup} +% if the file exists. +% \item +% Package options given for \cs{usepackage}. +% \item +% Later calls of \cs{pagegridsetup}. +% \end{enumerate} +% \begin{declcs}{pagegridsetup}\M{option list} +% \end{declcs} +% The options are key value options. Boolean options are enabled by +% default (without value) or by using the explicit value \texttt{true}. +% Value \texttt{false} disable the option. +% +% \subsubsection{Options \xoption{enable}, \xoption{disable}} +% +% \begin{description} +% \item[\xoption{enable}:] This boolean option controls whether the page grid +% is drawn. As default the page grid drawing is activated. +% \item[\xoption{disable}:] It is the opposite +% of option \xoption{enable}. It was added for convenience and +% allows the abbreviation \texttt{disable} for \texttt{enable=false}. +% \end{description} +% +% \subsubsection{Grid origins} +% +% The package supports up to two grids on a page allowing +% measurement from opposite directions. As default two grids are drawn, +% the first from bottom left to top right. The origin of the second +% grid is at the opposite top right corner. +% The origins are controlled by the following options. +% The number of grids (one or two) depend on the number of these options +% in one call of \cs{pagegridsetup}. +% The following frame shows a paper and in its corners are the +% corresponding options. At the left and right side alias names +% are given for the options inside the paper. +% \begin{quote} +% \begin{tabular}{@{}r|@{\,}l@{\qquad}r@{\,}|l@{}} +% \cline{2-3} +% \xoption{left-top}, \xoption{lt}, \xoption{top-left} +% & \vphantom{\"U}\xoption{tl} & \xoption{tr} +% & \xoption{top-right}, \xoption{rt}, \xoption{right-top}\\ +% &&&\\ +% \xoption{left-bottom}, \xoption{lb}, \xoption{bottom-left} +% & \xoption{bl} & \xoption{br} +% & \xoption{bottom-right}, \xoption{rb}, \xoption{right-bottom}\\ +% \cline{2-3} +% \end{tabular} +% \end{quote} +% Examples: +% \begin{quote} +% |\pagegridsetup{bl,tr}| +% \end{quote} +% This is the default setting with two grids as described previously. +% The following setups one grid only. Its origin is the upper left +% corner: +% \begin{quote} +% |\pagegridsetup{top-left}| +% \end{quote} +% +% \subsubsection{Grid unit} +% +% \begin{description} +% \item[\xoption{step}] This option takes a length and +% setups the unit for the grid. The page width and page height +% should be multiples of this unit. +% Currently the default is \texttt{1mm}. But this might change +% later by a heuristic based on the paper size. +% \end{description} +% +% \subsubsection{Color options} +% +% The basic grid lines are drawn as ultra thin help lines and is only +% drawn for the first grid. +% Each tenth and fiftyth line of the basic net is drawn thicker in a special +% color for the two grids. +% \begin{description} +% \item[\xoption{firstcolor}:] Color for the thicker lines and the arrows +% of the first grid. Default value is \texttt{red}. +% \item[\xoption{secondcolor}:] Color for the thicker lines and the arrows +% of the second grid. Default value is \texttt{blue}. +% \end{description} +% Use a color specification that package \xpackage{tikz} understands. +% (The grid is drawn with \xpackage{pgf}/\xpackage{tikz}.) +% +% \subsubsection{Arrow options} +% +% Arrows are put at the origin at the grid to show the grid start +% and the direction of the grid. +% \begin{description} +% \item[\xoption{arrows}:] This boolean option turns the arrows on or off. +% As default arrows are enabled. +% \item[\xoption{arrowlength}:] The length given as value is the +% length of the edge of a square at the origin within the +% arrow is put as diagonal. Default is 10 times the grid unit (10\,mm). +% The real arrow length is this length multiplied by $\sqrt2$. +% \end{description} +% +% \subsubsection{Miscellaneous options} +% +% \begin{description} +% \item[\xoption{double}:] The output page is doubled, one without page +% grid and the other with page grid. Possible values are shown in the +% following table: +% \begin{quote} +% \begin{tabular}{ll} +% Option & Meaning\\ +% \hline +% |false| & Turns option off.\\ +% |first| & Grid page comes first.\\ +% |last| & Grid page comes after the page without grid.\\ +% |true| & Same as |last|.\\ +% \meta{no value} & Same as |true|.\\ +% \end{tabular} +% \end{quote} +% \textbf{Note:} +% The double output of the page has side effects. +% All whatsits are executed twice, for example: file writing +% and anchor setting. Some unwanted actions are catched such +% as multiple \cs{label} definitions, duplicate entries in +% the table of contents. For bookmarks, use package \xpackage{bookmarks}. +% \item[\xoption{foreground}:] Boolean option, default is \texttt{false}. +% Sometimes there might be elements on the page (e.g. large images) +% that hide the grid. Then option \xoption{foreground} puts the grids +% over the current output page. +% \end{description} +% +% \StopEventually{ +% } +% +% \section{Implementation} +% \begin{macrocode} +%<*package> +% \end{macrocode} +% Reload check, especially if the package is not used with \LaTeX. +% \begin{macrocode} +\begingroup\catcode61\catcode48\catcode32=10\relax% + \catcode13=5 % ^^M + \endlinechar=13 % + \catcode35=6 % # + \catcode39=12 % ' + \catcode44=12 % , + \catcode45=12 % - + \catcode46=12 % . + \catcode58=12 % : + \catcode64=11 % @ + \catcode123=1 % { + \catcode125=2 % } + \expandafter\let\expandafter\x\csname ver@pagegrid.sty\endcsname + \ifx\x\relax % plain-TeX, first loading + \else + \def\empty{}% + \ifx\x\empty % LaTeX, first loading, + % variable is initialized, but \ProvidesPackage not yet seen + \else + \expandafter\ifx\csname PackageInfo\endcsname\relax + \def\x#1#2{% + \immediate\write-1{Package #1 Info: #2.}% + }% + \else + \def\x#1#2{\PackageInfo{#1}{#2, stopped}}% + \fi + \x{pagegrid}{The package is already loaded}% + \aftergroup\endinput + \fi + \fi +\endgroup% +% \end{macrocode} +% Package identification: +% \begin{macrocode} +\begingroup\catcode61\catcode48\catcode32=10\relax% + \catcode13=5 % ^^M + \endlinechar=13 % + \catcode35=6 % # + \catcode39=12 % ' + \catcode40=12 % ( + \catcode41=12 % ) + \catcode44=12 % , + \catcode45=12 % - + \catcode46=12 % . + \catcode47=12 % / + \catcode58=12 % : + \catcode64=11 % @ + \catcode91=12 % [ + \catcode93=12 % ] + \catcode123=1 % { + \catcode125=2 % } + \expandafter\ifx\csname ProvidesPackage\endcsname\relax + \def\x#1#2#3[#4]{\endgroup + \immediate\write-1{Package: #3 #4}% + \xdef#1{#4}% + }% + \else + \def\x#1#2[#3]{\endgroup + #2[{#3}]% + \ifx#1\@undefined + \xdef#1{#3}% + \fi + \ifx#1\relax + \xdef#1{#3}% + \fi + }% + \fi +\expandafter\x\csname ver@pagegrid.sty\endcsname +\ProvidesPackage{pagegrid}% + [2022-09-21 v1.6 Print page grid in background (HO)]% +% \end{macrocode} +% +% \begin{macrocode} +\begingroup\catcode61\catcode48\catcode32=10\relax% + \catcode13=5 % ^^M + \endlinechar=13 % + \catcode123=1 % { + \catcode125=2 % } + \catcode64=11 % @ + \def\x{\endgroup + \expandafter\edef\csname pagegrid@AtEnd\endcsname{% + \endlinechar=\the\endlinechar\relax + \catcode13=\the\catcode13\relax + \catcode32=\the\catcode32\relax + \catcode35=\the\catcode35\relax + \catcode61=\the\catcode61\relax + \catcode64=\the\catcode64\relax + \catcode123=\the\catcode123\relax + \catcode125=\the\catcode125\relax + }% + }% +\x\catcode61\catcode48\catcode32=10\relax% +\catcode13=5 % ^^M +\endlinechar=13 % +\catcode35=6 % # +\catcode64=11 % @ +\catcode123=1 % { +\catcode125=2 % } +\def\TMP@EnsureCode#1#2{% + \edef\pagegrid@AtEnd{% + \pagegrid@AtEnd + \catcode#1=\the\catcode#1\relax + }% + \catcode#1=#2\relax +} +\TMP@EnsureCode{9}{10}% (tab) +\TMP@EnsureCode{10}{12}% ^^J +\TMP@EnsureCode{33}{12}% ! +\TMP@EnsureCode{34}{12}% " +\TMP@EnsureCode{36}{3}% $ +\TMP@EnsureCode{38}{4}% & +\TMP@EnsureCode{39}{12}% ' +\TMP@EnsureCode{40}{12}% ( +\TMP@EnsureCode{41}{12}% ) +\TMP@EnsureCode{42}{12}% * +\TMP@EnsureCode{43}{12}% + +\TMP@EnsureCode{44}{12}% , +\TMP@EnsureCode{45}{12}% - +\TMP@EnsureCode{46}{12}% . +\TMP@EnsureCode{47}{12}% / +\TMP@EnsureCode{58}{12}% : +\TMP@EnsureCode{59}{12}% ; +\TMP@EnsureCode{60}{12}% < +\TMP@EnsureCode{62}{12}% > +\TMP@EnsureCode{63}{12}% ? +\TMP@EnsureCode{91}{12}% [ +\TMP@EnsureCode{93}{12}% ] +\TMP@EnsureCode{94}{7}% ^ (superscript) +\TMP@EnsureCode{95}{8}% _ (subscript) +\TMP@EnsureCode{96}{12}% ` +\TMP@EnsureCode{124}{12}% | +\edef\pagegrid@AtEnd{\pagegrid@AtEnd\noexpand\endinput} +% \end{macrocode} +% +% \begin{macrocode} +\RequirePackage{tikz} +\RequirePackage{atbegshi}[2009/12/02] +\RequirePackage{kvoptions}[2009/07/17] +% \end{macrocode} +% \begin{macrocode} +\def\pagegrid@width{\paperwidth}% +\def\pagegrid@height{\paperheight}% +\@ifundefined{stockwidth}{} + {% + \ifdim \stockwidth > 0pt\relax + \ifdim \stockheight > 0pt \relax + \def\pagegrid@width{\stockwidth}% + \def\pagegrid@height{\stockheight}% + \fi + \fi + } +% \end{macrocode} +% +% \begin{macrocode} +\SetupKeyvalOptions{% + family=pagegrid,% + prefix=pagegrid@,% +} +\def\pagegrid@init{% + \let\pagegrid@origin@a\@empty + \let\pagegrid@origin@b\@empty + \let\pagegrid@init\relax +} +\let\pagegrid@@init\pagegrid@init +\def\pagegrid@origin@a{bl} +\def\pagegrid@origin@b{tr} +\def\pagegrid@SetOrigin#1{% + \pagegrid@init + \ifx\pagegrid@origin@a\@empty + \def\pagegrid@origin@a{#1}% + \else + \ifx\pagegrid@origin@b\@empty + \else + \let\pagegrid@origin@a\pagegrid@origin@b + \fi + \def\pagegrid@origin@b{#1}% + \fi +} +\def\pagegrid@temp#1{% + \DeclareVoidOption{#1}{\pagegrid@SetOrigin{#1}}% + \@namedef{pagegrid@N@#1}{#1}% +} +\pagegrid@temp{bl} +\pagegrid@temp{br} +\pagegrid@temp{tl} +\pagegrid@temp{tr} +\def\pagegrid@temp#1#2{% + \DeclareVoidOption{#2}{\pagegrid@SetOrigin{#1}}% +}% +\pagegrid@temp{bl}{lb} +\pagegrid@temp{br}{rb} +\pagegrid@temp{tl}{lt} +\pagegrid@temp{tr}{rt} +\pagegrid@temp{bl}{bottom-left} +\pagegrid@temp{br}{bottom-right} +\pagegrid@temp{tl}{top-left} +\pagegrid@temp{tr}{top-right} +\pagegrid@temp{bl}{left-bottom} +\pagegrid@temp{br}{right-bottom} +\pagegrid@temp{tl}{left-top} +\pagegrid@temp{tr}{right-top} +% \end{macrocode} +% \begin{macrocode} +\DeclareBoolOption[true]{enable} +\DeclareComplementaryOption{disable}{enable} +% \end{macrocode} +% \begin{macrocode} +\DeclareBoolOption{foreground} +% \end{macrocode} +% \begin{macrocode} +\newlength{\pagegrid@step} +\define@key{pagegrid}{step}{% + \setlength{\pagegrid@step}{#1}% +} +% \end{macrocode} +% \begin{macrocode} +\DeclareStringOption[red]{firstcolor} +\DeclareStringOption[blue]{secondcolor} +% \end{macrocode} +% \begin{macrocode} +\DeclareBoolOption[true]{arrows} +\newlength\pagegrid@arrowlength +\pagegrid@arrowlength=\z@ +\define@key{pagegrid}{arrowlength}{% + \setlength{\pagegrid@arrowlength}{#1}% +} +% \end{macrocode} +% \begin{macrocode} +\define@key{pagegrid}{double}[true]{% + \@ifundefined{pagegrid@double@#1}{% + \PackageWarning{pagegrid}{% + Unsupported value `#1' for option `double'.\MessageBreak + Known values are:\MessageBreak + `false', `first', `last', `true'.\MessageBreak + Now `false' is used% + }% + \chardef\pagegrid@double\z@ + }{% + \chardef\pagegrid@double\csname pagegrid@double@#1\endcsname\relax + }% +} +\@namedef{pagegrid@double@false}{0} +\@namedef{pagegrid@double@first}{1} +\@namedef{pagegrid@double@last}{2} +\@namedef{pagegrid@double@true}{2} +\chardef\pagegrid@double\z@ +% \end{macrocode} +% \begin{macrocode} +\newcommand*{\pagegridsetup}{% + \let\pagegrid@init\pagegrid@@init + \setkeys{pagegrid}% +} +% \end{macrocode} +% \begin{macrocode} +\pagegridsetup{% + step=1mm% +} +\InputIfFileExists{pagegrid.cfg}{}% +\ProcessKeyvalOptions*\relax +\AtBeginDocument{% + \ifdim\pagegrid@arrowlength>\z@ + \else + \pagegrid@arrowlength=10\pagegrid@step + \fi +} +% \end{macrocode} +% +% \begin{macrocode} +\def\pagegridShipoutDoubleBegin{% + \begingroup + \let\newlabel\@gobbletwo + \let\zref@newlabel\@gobbletwo + \let\@writefile\@gobbletwo + \let\select@language\@gobble +} +\def\pagegridShipoutDoubleEnd{% + \endgroup +} +\def\pagegrid@WriteDouble#1#2{% + \immediate\write#1{% + \@backslashchar csname % + pagegridShipoutDouble#2% + \@backslashchar endcsname% + }% +} +\def\pagegrid@ShipoutDouble#1{% + \begingroup + \if@filesw + \pagegrid@WriteDouble\@mainaux{Begin}% + \ifx\@auxout\@partaux + \pagegrid@WriteDouble\@partaux{Begin}% + \def\pagegrid@temp{% + \pagegrid@WriteDouble\@mainaux{End}% + \pagegrid@WriteDouble\@partaux{End}% + }% + \else + \def\pagegrid@temp{% + \pagegrid@WriteDouble\@mainaux{End}% + }% + \fi + \else + \def\pagegrid@temp{}% + \fi + \let\protect\noexpand + \AtBeginShipoutOriginalShipout\copy#1\relax + \pagegrid@temp + \endgroup +} +% \end{macrocode} +% +% \begin{macrocode} +\AtBeginShipout{% + \ifdim\pagegrid@step>\z@ + \else + \pagegrid@enablefalse + \fi + \ifpagegrid@enable + \ifnum\pagegrid@double=\@ne + \pagegrid@ShipoutDouble\AtBeginShipoutBox + \else + \ifnum\pagegrid@double=\tw@ + \@ifundefined{pagegrid@DoubleBox}{% + \newbox\pagegrid@DoubleBox + }{}% + \setbox\pagegrid@DoubleBox=\copy\AtBeginShipoutBox + \fi + \fi + \ifpagegrid@foreground + \expandafter\AtBeginShipoutUpperLeftForeground + \else + \expandafter\AtBeginShipoutUpperLeft + \fi + {% + \put(0,0){% + \makebox(0,0)[lt]{% + \begin{tikzpicture}[% + bl/.style={},% + br/.style={xshift=\pagegrid@width,xscale=-1},% + tl/.style={yshift=\pagegrid@height,yscale=-1},% + tr/.style={xshift=\pagegrid@width,% + yshift=\pagegrid@height,scale=-1}% + ]% + \useasboundingbox + (0mm,\pagegrid@height) rectangle (0mm,\pagegrid@height);% + \draw[% + \pagegrid@origin@a,% + step=\pagegrid@step,% + style=help lines,% + ultra thin% + ] (0mm,0mm) grid (\pagegrid@width,\pagegrid@height);% + \ifx\pagegrid@origin@b\@empty + \else + \draw[% + \pagegrid@origin@b,% + step=10\pagegrid@step,% + {\pagegrid@secondcolor},% + very thin% + ] (0mm,0mm) grid (\pagegrid@width,\pagegrid@height);% + \fi + \draw[% + \pagegrid@origin@a,% + step=10\pagegrid@step,% + {\pagegrid@firstcolor},% + very thin% + ] (0mm,0mm) grid (\pagegrid@width,\pagegrid@height);% + \ifx\pagegrid@origin@b\@empty + \else + \draw[% + \pagegrid@origin@b,% + step=50\pagegrid@step,% + {\pagegrid@secondcolor},% + thick% + ] (0mm,0mm) grid (\pagegrid@width,\pagegrid@height);% + \fi + \draw[% + \pagegrid@origin@a,% + step=50\pagegrid@step,% + {\pagegrid@firstcolor},% + thick% + ] (0mm,0mm) grid (\pagegrid@width,\pagegrid@height);% + \ifpagegrid@arrows + \ifx\pagegrid@origin@b\@empty + \else + \draw[% + \pagegrid@origin@b,% + {\pagegrid@secondcolor},% + stroke,% + line width=1pt,% + line cap=round% + ] (0mm,0mm) % + -- (\pagegrid@arrowlength,\pagegrid@arrowlength) % + (\pagegrid@arrowlength,.5\pagegrid@arrowlength) % + -- (\pagegrid@arrowlength,\pagegrid@arrowlength) % + -- (.5\pagegrid@arrowlength,\pagegrid@arrowlength);% + \fi + \draw[% + \pagegrid@origin@a,% + {\pagegrid@firstcolor},% + stroke,% + line width=1pt,% + line cap=round% + ] (0mm,0mm) % + -- (\pagegrid@arrowlength,\pagegrid@arrowlength) % + (\pagegrid@arrowlength,.5\pagegrid@arrowlength) % + -- (\pagegrid@arrowlength,\pagegrid@arrowlength) % + -- (.5\pagegrid@arrowlength,\pagegrid@arrowlength);% + \fi + \end{tikzpicture}% + }% + }% + }% + \ifnum\pagegrid@double=\tw@ + \pagegrid@ShipoutDouble\pagegrid@DoubleBox + \fi + \fi +} +% \end{macrocode} +% +% \begin{macrocode} +\pagegrid@AtEnd% +% +% \end{macrocode} +%% \section{Installation} +% +% \subsection{Download} +% +% \paragraph{Package.} This package is available on +% CTAN\footnote{\CTANpkg{pagegrid}}: +% \begin{description} +% \item[\CTAN{macros/latex/contrib/pagegrid/pagegrid.dtx}] The source file. +% \item[\CTAN{macros/latex/contrib/pagegrid/pagegrid.pdf}] Documentation. +% \end{description} +% +% +% +% \subsection{Package installation} +% +% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting +% \docstrip\ archive. The files are extracted by running the +% \xfile{.dtx} through \plainTeX: +% \begin{quote} +% \verb|tex pagegrid.dtx| +% \end{quote} +% +% \paragraph{TDS.} Now the different files must be moved into +% the different directories in your installation TDS tree +% (also known as \xfile{texmf} tree): +% \begin{quote} +% \def\t{^^A +% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}} +% pagegrid.sty & tex/latex/pagegrid/pagegrid.sty\\ +% pagegrid.pdf & doc/latex/pagegrid/pagegrid.pdf\\ +% pagegrid.dtx & source/latex/pagegrid/pagegrid.dtx\\ +% \end{tabular}^^A +% }^^A +% \sbox0{\t}^^A +% \ifdim\wd0>\linewidth +% \begingroup +% \advance\linewidth by\leftmargin +% \advance\linewidth by\rightmargin +% \edef\x{\endgroup +% \def\noexpand\lw{\the\linewidth}^^A +% }\x +% \def\lwbox{^^A +% \leavevmode +% \hbox to \linewidth{^^A +% \kern-\leftmargin\relax +% \hss +% \usebox0 +% \hss +% \kern-\rightmargin\relax +% }^^A +% }^^A +% \ifdim\wd0>\lw +% \sbox0{\small\t}^^A +% \ifdim\wd0>\linewidth +% \ifdim\wd0>\lw +% \sbox0{\footnotesize\t}^^A +% \ifdim\wd0>\linewidth +% \ifdim\wd0>\lw +% \sbox0{\scriptsize\t}^^A +% \ifdim\wd0>\linewidth +% \ifdim\wd0>\lw +% \sbox0{\tiny\t}^^A +% \ifdim\wd0>\linewidth +% \lwbox +% \else +% \usebox0 +% \fi +% \else +% \lwbox +% \fi +% \else +% \usebox0 +% \fi +% \else +% \lwbox +% \fi +% \else +% \usebox0 +% \fi +% \else +% \lwbox +% \fi +% \else +% \usebox0 +% \fi +% \else +% \lwbox +% \fi +% \else +% \usebox0 +% \fi +% \end{quote} +% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's +% TDS installing feature, then some files can already be in the right +% place, see the documentation of \docstrip. +% +% \subsection{Refresh file name databases} +% +% If your \TeX~distribution +% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh +% these. For example, \TeX\,Live\ users run \verb|texhash| or +% \verb|mktexlsr|. +% +% \subsection{Some details for the interested} +% +% \paragraph{Unpacking with \LaTeX.} +% The \xfile{.dtx} chooses its action depending on the format: +% \begin{description} +% \item[\plainTeX:] Run \docstrip\ and extract the files. +% \item[\LaTeX:] Generate the documentation. +% \end{description} +% If you insist on using \LaTeX\ for \docstrip\ (really, +% \docstrip\ does not need \LaTeX), then inform the autodetect routine +% about your intention: +% \begin{quote} +% \verb|latex \let\install=y\input{pagegrid.dtx}| +% \end{quote} +% Do not forget to quote the argument according to the demands +% of your shell. +% +% \paragraph{Generating the documentation.} +% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate +% the documentation. The process can be configured by the +% configuration file \xfile{ltxdoc.cfg}. For instance, put this +% line into this file, if you want to have A4 as paper format: +% \begin{quote} +% \verb|\PassOptionsToClass{a4paper}{article}| +% \end{quote} +% An example follows how to generate the +% documentation with pdf\LaTeX: +% \begin{quote} +%\begin{verbatim} +%pdflatex pagegrid.dtx +%makeindex -s gind.ist pagegrid.idx +%pdflatex pagegrid.dtx +%makeindex -s gind.ist pagegrid.idx +%pdflatex pagegrid.dtx +%\end{verbatim} +% \end{quote} +% +% \section{Acknowledgement} +% +% \begin{description} +% \item[Klaus Braune:] +% He provided the idea and the first \xpackage{tikz} code. +% \end{description} +% +% \begin{History} +% \begin{Version}{2009/11/06 v1.0} +% \item +% The first version. +% \end{Version} +% \begin{Version}{2009/11/06 v1.1} +% \item +% Option \xoption{foreground} added. +% \end{Version} +% \begin{Version}{2009/12/02 v1.2} +% \item +% Color options, arrow options added. +% \item +% Names for origin options changed. +% \end{Version} +% \begin{Version}{2009/12/03 v1.3} +% \item +% Option \xoption{double} added. +% \item +% First CTAN release. +% \end{Version} +% \begin{Version}{2009/12/04 v1.4} +% \item +% Option \xoption{double}: Some unwanted side effects removed. +% \end{Version} +% \begin{Version}{2016/05/16 v1.5} +% \item +% Documentation updates. +% \end{Version} +% \begin{Version}{2022-09-21 v1.6} +% \item Adapted the test for stockwidth/stockheight to a change in the \LaTeX\ kernel. +% \end{Version} +% \end{History} +% +% \PrintIndex +% +% \Finale +\endinput diff --git a/macros/latex/contrib/pagegrid/pagegrid.pdf b/macros/latex/contrib/pagegrid/pagegrid.pdf new file mode 100644 index 0000000000..589e3ea019 Binary files /dev/null and b/macros/latex/contrib/pagegrid/pagegrid.pdf differ diff --git a/macros/latex/contrib/pdfcol/README.md b/macros/latex/contrib/pdfcol/README.md new file mode 100644 index 0000000000..e8281aeae1 --- /dev/null +++ b/macros/latex/contrib/pdfcol/README.md @@ -0,0 +1,18 @@ +# pdfcol + +Version: 2022-09-21 v1.7 + +Macros for setting and maintaining new color stacks. + +Since version 1.40 pdfTeX supports color stacks. +The driver file pdftex.def for package color +defines and uses a main color stack since version v0.04b. +Package pdfcol is intended for package writers. +It defines macros for setting and maintaining new color stacks. + +## Copyright (C) +* 2007 Heiko Oberdiek +* 2016-2022 Oberdiek Package Support Group + +## License +LATEX Project Public License, version 1.3c or later. diff --git a/macros/latex/contrib/pdfcol/pdfcol.dtx b/macros/latex/contrib/pdfcol/pdfcol.dtx new file mode 100644 index 0000000000..7d8c4b3457 --- /dev/null +++ b/macros/latex/contrib/pdfcol/pdfcol.dtx @@ -0,0 +1,882 @@ +% \iffalse meta-comment +% +% File: pdfcol.dtx +% Version: 2022-09-21 v1.7 +% Info: Handle new color stacks for pdfTeX +% +% Copyright (C) +% 2007 Heiko Oberdiek +% 2016-2022 Oberdiek Package Support Group +% https://github.com/ho-tex/pdfcol/issues +% +% This work 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. This version of this license is in +% https://www.latex-project.org/lppl/lppl-1-3c.txt +% and the latest version of this license is in +% https://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of +% LaTeX version 2005/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% The Current Maintainers of this work are +% Heiko Oberdiek and the Oberdiek Package Support Group +% https://github.com/ho-tex/pdfcol/issues +% +% The Base Interpreter refers to any `TeX-Format', +% because some files are installed in TDS:tex/generic//. +% +% This work consists of the main source file pdfcol.dtx +% and the derived files +% pdfcol.sty, pdfcol.pdf, pdfcol.ins, pdfcol.drv, pdfcol-test1.tex, +% pdfcol-test2.tex, pdfcol-test3.tex, pdfcol-test4.tex. +% +% Distribution: +% CTAN:macros/latex/contrib/pdfcol/pdfcol.dtx +% CTAN:macros/latex/contrib/pdfcol/pdfcol.pdf +% +% Unpacking: +% (a) If pdfcol.ins is present: +% tex pdfcol.ins +% (b) Without pdfcol.ins: +% tex pdfcol.dtx +% (c) If you insist on using LaTeX +% latex \let\install=y\input{pdfcol.dtx} +% (quote the arguments according to the demands of your shell) +% +% Documentation: +% (a) If pdfcol.drv is present: +% latex pdfcol.drv +% (b) Without pdfcol.drv: +% latex pdfcol.dtx; ... +% The class ltxdoc loads the configuration file ltxdoc.cfg +% if available. Here you can specify further options, e.g. +% use A4 as paper format: +% \PassOptionsToClass{a4paper}{article} +% +% Programm calls to get the documentation (example): +% pdflatex pdfcol.dtx +% makeindex -s gind.ist pdfcol.idx +% pdflatex pdfcol.dtx +% makeindex -s gind.ist pdfcol.idx +% pdflatex pdfcol.dtx +% +% Installation: +% TDS:tex/generic/pdfcol/pdfcol.sty +% TDS:doc/latex/pdfcol/pdfcol.pdf +% TDS:source/latex/pdfcol/pdfcol.dtx +% +%<*ignore> +\begingroup + \catcode123=1 % + \catcode125=2 % + \def\x{LaTeX2e}% +\expandafter\endgroup +\ifcase 0\ifx\install y1\fi\expandafter + \ifx\csname processbatchFile\endcsname\relax\else1\fi + \ifx\fmtname\x\else 1\fi\relax +\else\csname fi\endcsname +% +%<*install> +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: pdfcol 2022-09-21 v1.7 Handle new color stacks for pdfTeX (HO)} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\let\MetaPrefix\relax +\preamble + +This is a generated file. + +Project: pdfcol +Version: 2022-09-21 v1.7 + +Copyright (C) + 2007 Heiko Oberdiek + 2016-2022 Oberdiek Package Support Group + +This work 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. This version of this license is in + https://www.latex-project.org/lppl/lppl-1-3c.txt +and the latest version of this license is in + https://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of +LaTeX version 2005/12/01 or later. + +This work has the LPPL maintenance status "maintained". + +The Current Maintainers of this work are +Heiko Oberdiek and the Oberdiek Package Support Group +https://github.com/ho-tex/pdfcol/issues + + +The Base Interpreter refers to any `TeX-Format', +because some files are installed in TDS:tex/generic//. + +This work consists of the main source file pdfcol.dtx +and the derived files + pdfcol.sty, pdfcol.pdf, pdfcol.ins, pdfcol.drv, pdfcol-test1.tex, + pdfcol-test2.tex, pdfcol-test3.tex, pdfcol-test4.tex. + +\endpreamble +\let\MetaPrefix\DoubleperCent + +\generate{% + \file{pdfcol.ins}{\from{pdfcol.dtx}{install}}% + \file{pdfcol.drv}{\from{pdfcol.dtx}{driver}}% + \usedir{tex/generic/pdfcol}% + \file{pdfcol.sty}{\from{pdfcol.dtx}{package}}% +% \usedir{doc/latex/pdfcol/test}% +% \file{pdfcol-test1.tex}{\from{pdfcol.dtx}{test1}}% +% \file{pdfcol-test2.tex}{\from{pdfcol.dtx}{test2}}% +% \file{pdfcol-test3.tex}{\from{pdfcol.dtx}{test3}}% +% \file{pdfcol-test4.tex}{\from{pdfcol.dtx}{test4}}% +} + +\catcode32=13\relax% active space +\let =\space% +\Msg{************************************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* file into a directory searched by TeX:} +\Msg{*} +\Msg{* pdfcol.sty} +\Msg{*} +\Msg{* To produce the documentation run the file `pdfcol.drv'} +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{*} +\Msg{************************************************************************} + +\endbatchfile +% +%<*ignore> +\fi +% +%<*driver> +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{pdfcol.drv}% + [2022-09-21 v1.7 Handle new color stacks for pdfTeX (HO)]% +\documentclass{ltxdoc} +\usepackage{holtxdoc}[2011/11/22] +\begin{document} + \DocInput{pdfcol.dtx}% +\end{document} +% +% \fi +% +% +% +% \GetFileInfo{pdfcol.drv} +% +% \title{The \xpackage{pdfcol} package} +% \date{2022-09-21 v1.7} +% \author{Heiko Oberdiek\thanks +% {Please report any issues at \url{https://github.com/ho-tex/pdfcol/issues}}} +% +% \maketitle +% +% \begin{abstract} +% Since version 1.40 \pdfTeX\ supports color stacks. +% The driver file \xfile{pdftex.def} for package \xpackage{color} +% defines and uses a main color stack since version v0.04b. +% Package \xpackage{pdfcol} is intended for package writers. +% It defines macros for setting and maintaining new color stacks. +% It works also with lua\TeX. +% \end{abstract} +% +% \tableofcontents +% +% \section{Documentation} +% +% Version 1.40 of \pdfTeX\ adds new primitives \cs{pdfcolorstackinit} +% and \cs{pdfcolorstack}. Now color stacks can be defined and used. +% A main color stack is maintained by the driver file \xfile{pdftex.def} +% similar to dvips or dvipdfm. However the number of color stacks +% is not limited to one in \pdfTeX. Thus further color problems +% can now be solved, such as footnotes across pages or text +% that is set in parallel columns (e.g. packages \xpackage{parallel} +% or \xpackage{parcolumn}). Unlike the main color stack, +% the support by additional color stacks cannot be done in +% a transparent manner. +% +% This package \xpackage{pdfcol} provides an easier interface to +% additional color stacks without the need to use the +% low level primitives. +% +% \subsection{Requirements} +% \label{sec:req} +% +% \begin{itemize} +% \item +% \pdfTeX\ 1.40 or greater or lua\TeX. +% \item +% \pdfTeX or lua\TeX\ in PDF mode. (I don't know a DVI driver that +% support several color stacks.) +% \item +% \xfile{pdftex.def} or \xfile{luatex.def} newer than 2007. +% \end{itemize} +% Package \xpackage{pdfcol} checks the requirements and +% sets switch \cs{ifpdfcolAvailable} accordingly. +% +% \subsection{Interface} +% +% \begin{declcs}{ifpdfcolAvailable} +% \end{declcs} +% If the requirements of section \ref{sec:req} are met the +% switch \cs{ifpdfcolAvailable} behaves as \cs{iftrue}. +% Otherwise the other interface macros in this section will +% be disabled with a message. Also the first use of such a +% macro will print a message. The messages are print to +% the \xext{log} file only if \pdfTeX\ and lua\TeX\ not used in PDF mode. +% +% \begin{declcs}{pdfcolErrorNoStacks} +% \end{declcs} +% The first call of \cs{pdfcolErrorNoStacks} prints an error +% message, if color stacks are not available. +% +% \begin{declcs}{pdfcolInitStack} \M{name} +% \end{declcs} +% A new color stack is initialized by \cs{pdfcolInitStack}. +% The \meta{name} is used for identifying the stack. It usually +% consists of letters and digits. (The name must survive a \cs{csname}.) +% +% The intension of the macro is the definition of an additional +% color stack. Thus the stack is not page bounded like the +% main color stack. Black (\texttt{0 g 0 G}) is used as initial +% color value. And colors are written with modifier \texttt{direct} +% that means without setting the current transfer matrix and changing +% the current point (see documentation of \pdfTeX\ for +% |\pdfliteral direct{...}|). +% +% \begin{declcs}{pdfcolIfStackExists} \M{name} \M{then} \M{else} +% \end{declcs} +% Macro \cs{pdfcolIfStackExists} checks whether color stack \meta{name} +% exists. In case of success argument \meta{then} is executed +% and \meta{else} otherwise. +% +% \begin{declcs}{pdfcolSwitchStack} \M{name} +% \end{declcs} +% Macro \cs{pdfcolSwitchStack} switches the color stack. The color macros +% of package \xpackage{color} (or \xpackage{xcolor}) now uses the +% new color stack with name \meta{name}. +% +% \begin{declcs}{pdfcolSetCurrentColor} +% \end{declcs} +% Macro \cs{pdfcolSetCurrentColor} replaces the topmost +% entry of the stack by the current color (\cs{current@color}). +% +% \begin{declcs}{pdfcolSetCurrent} \M{name} +% \end{declcs} +% Macro \cs{pdfcolSetCurrent} sets the color that is read in +% the top-most entry of color stack \meta{name}. If \meta{name} +% is empty, the default color stack is used. +% +% \StopEventually{ +% } +% +% \section{Implementation} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% \subsection{Reload check and package identification} +% Reload check, especially if the package is not used with \LaTeX. +% \begin{macrocode} +\begingroup\catcode61\catcode48\catcode32=10\relax% + \catcode13=5 % ^^M + \endlinechar=13 % + \catcode35=6 % # + \catcode39=12 % ' + \catcode44=12 % , + \catcode45=12 % - + \catcode46=12 % . + \catcode58=12 % : + \catcode64=11 % @ + \catcode123=1 % { + \catcode125=2 % } + \expandafter\let\expandafter\x\csname ver@pdfcol.sty\endcsname + \ifx\x\relax % plain-TeX, first loading + \else + \def\empty{}% + \ifx\x\empty % LaTeX, first loading, + % variable is initialized, but \ProvidesPackage not yet seen + \else + \expandafter\ifx\csname PackageInfo\endcsname\relax + \def\x#1#2{% + \immediate\write-1{Package #1 Info: #2.}% + }% + \else + \def\x#1#2{\PackageInfo{#1}{#2, stopped}}% + \fi + \x{pdfcol}{The package is already loaded}% + \aftergroup\endinput + \fi + \fi +\endgroup% +% \end{macrocode} +% Package identification: +% \begin{macrocode} +\begingroup\catcode61\catcode48\catcode32=10\relax% + \catcode13=5 % ^^M + \endlinechar=13 % + \catcode35=6 % # + \catcode39=12 % ' + \catcode40=12 % ( + \catcode41=12 % ) + \catcode44=12 % , + \catcode45=12 % - + \catcode46=12 % . + \catcode47=12 % / + \catcode58=12 % : + \catcode64=11 % @ + \catcode91=12 % [ + \catcode93=12 % ] + \catcode123=1 % { + \catcode125=2 % } + \expandafter\ifx\csname ProvidesPackage\endcsname\relax + \def\x#1#2#3[#4]{\endgroup + \immediate\write-1{Package: #3 #4}% + \xdef#1{#4}% + }% + \else + \def\x#1#2[#3]{\endgroup + #2[{#3}]% + \ifx#1\@undefined + \xdef#1{#3}% + \fi + \ifx#1\relax + \xdef#1{#3}% + \fi + }% + \fi +\expandafter\x\csname ver@pdfcol.sty\endcsname +\ProvidesPackage{pdfcol}% + [2022-09-21 v1.7 Handle new color stacks for pdfTeX (HO)]% +% \end{macrocode} +% +% \subsection{Catcodes} +% +% \begin{macrocode} +\begingroup\catcode61\catcode48\catcode32=10\relax% + \catcode13=5 % ^^M + \endlinechar=13 % + \catcode123=1 % { + \catcode125=2 % } + \catcode64=11 % @ + \def\x{\endgroup + \expandafter\edef\csname PDFCOL@AtEnd\endcsname{% + \endlinechar=\the\endlinechar\relax + \catcode13=\the\catcode13\relax + \catcode32=\the\catcode32\relax + \catcode35=\the\catcode35\relax + \catcode61=\the\catcode61\relax + \catcode64=\the\catcode64\relax + \catcode123=\the\catcode123\relax + \catcode125=\the\catcode125\relax + }% + }% +\x\catcode61\catcode48\catcode32=10\relax% +\catcode13=5 % ^^M +\endlinechar=13 % +\catcode35=6 % # +\catcode64=11 % @ +\catcode123=1 % { +\catcode125=2 % } +\def\TMP@EnsureCode#1#2{% + \edef\PDFCOL@AtEnd{% + \PDFCOL@AtEnd + \catcode#1=\the\catcode#1\relax + }% + \catcode#1=#2\relax +} +\TMP@EnsureCode{39}{12}% ' +\TMP@EnsureCode{40}{12}% ( +\TMP@EnsureCode{41}{12}% ) +\TMP@EnsureCode{43}{12}% + +\TMP@EnsureCode{44}{12}% , +\TMP@EnsureCode{46}{12}% . +\TMP@EnsureCode{47}{12}% / +\TMP@EnsureCode{91}{12}% [ +\TMP@EnsureCode{93}{12}% ] +\TMP@EnsureCode{96}{12}% ` +\edef\PDFCOL@AtEnd{\PDFCOL@AtEnd\noexpand\endinput} +% \end{macrocode} +% +% \subsection{Check requirements} +% +% \begin{macro}{\PDFCOL@RequirePackage} +% \begin{macrocode} +\ifcsname RequirePackage\endcsname + \def\PDFCOL@RequirePackage#1[#2]{% + \RequirePackage{#1}[{#2}]% + }% +\else + \def\PDFCOL@RequirePackage#1[#2]{\input #1.sty\relax}% +\fi +% \end{macrocode} +% \end{macro} +% +% LuaTeX Compatability +% \begin{macrocode} +\ifx\pdfextension\@undefined\else + \def\pdfcolorstackinit {\pdffeedback colorstackinit} + \protected\def\pdfcolorstack {\pdfextension colorstack} +\fi +% \end{macrocode} +% +% \begin{macrocode} +\PDFCOL@RequirePackage{ltxcmds}[2010/03/01] +% \end{macrocode} +% +% \begin{macro}{ifpdfcolAvailable} +% \begin{macrocode} +\ltx@newif\ifpdfcolAvailable +\pdfcolAvailabletrue +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Check package \xpackage{luacolor}} +% +% \begin{macrocode} +\ltx@newif\ifPDFCOL@luacolor +\ifcsname ver@luacolor.sty\endcsname + \PDFCOL@luacolortrue +\else + \PDFCOL@luacolorfalse +\fi +% \end{macrocode} +% +% \subsubsection{Check PDF mode} +% +% \begin{macrocode} +\PDFCOL@RequirePackage{infwarerr}[2007/09/09] +\PDFCOL@RequirePackage{iftex}[2019/11/07] +\ifcase\ifpdf\ifPDFCOL@luacolor 1\fi\else 1\fi0 % + \def\PDFCOL@Message{% + \@PackageWarningNoLine{pdfcol}% + }% +\else + \pdfcolAvailablefalse + \def\PDFCOL@Message{% + \@PackageInfoNoLine{pdfcol}% + }% + \PDFCOL@Message{% + Interface disabled because of % + \ifPDFCOL@luacolor + package `luacolor'% + \else + missing PDF mode of pdfTeX% + \fi + }% +\fi +% \end{macrocode} +% +% \subsubsection{Check version of \pdfTeX} +% The version check has been removed. We assume a new enough \pdfTeX. +% +% \subsubsection{Check \xfile{pdftex.def}} +% We no longer check the version but assume that it is new enough. +% \begin{macrocode} +\ifpdfcolAvailable +% \end{macrocode} +% Try to load package color if it is not yet loaded (\LaTeX\ case). +% \begin{macrocode} + \ifcsname documentclass\endcsname + \RequirePackage{color} + \fi +\fi +% \end{macrocode} +% +% \begin{macrocode} +\let\pdfcolAvailabletrue\relax +\let\pdfcolAvailablefalse\relax +% \end{macrocode} +% +% \subsection{Enabled interface macros} +% +% \begin{macrocode} +\ifpdfcolAvailable +% \end{macrocode} +% +% \begin{macro}{\pdfcolErrorNoStacks} +% \begin{macrocode} + \let\pdfcolErrorNoStacks\relax +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pdfcol@Value} +% \begin{macrocode} + \expandafter\ifx\csname pdfcol@Value\endcsname\relax + \def\pdfcol@Value{0 g 0 G}% + \fi +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pdfcol@LiteralModifier} +% \begin{macrocode} + \expandafter\ifx\csname pdfcol@LiteralModifier\endcsname\relax + \def\pdfcol@LiteralModifier{direct}% + \fi +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pdfcolInitStack} +% \begin{macrocode} + \def\pdfcolInitStack#1{% + \expandafter\ifx\csname pdfcol@Stack@#1\endcsname\relax + \global\expandafter\chardef\csname pdfcol@Stack@#1\endcsname=% + \pdfcolorstackinit\pdfcol@LiteralModifier{\pdfcol@Value}% + \relax + \@PackageInfo{pdfcol}{% + New color stack `#1' = \number\csname pdfcol@Stack@#1\endcsname + }% + \else + \@PackageError{pdfcol}{% + Stack `#1' is already defined% + }\@ehc + \fi + }% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pdfcolIfStackExists} +% \begin{macrocode} + \def\pdfcolIfStackExists#1{% + \expandafter\ifx\csname pdfcol@Stack@#1\endcsname\relax + \expandafter\@secondoftwo + \else + \expandafter\@firstoftwo + \fi + }% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\@firstoftwo} +% \begin{macrocode} + \expandafter\ifx\csname @firstoftwo\endcsname\relax + \long\def\@firstoftwo#1#2{#1}% + \fi +% \end{macrocode} +% \end{macro} +% \begin{macro}{\@secondoftwo} +% \begin{macrocode} + \expandafter\ifx\csname @secondoftwo\endcsname\relax + \long\def\@secondoftwo#1#2{#2}% + \fi +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pdfcolSwitchStack} +% \begin{macrocode} + \def\pdfcolSwitchStack#1{% + \pdfcolIfStackExists{#1}{% + \expandafter\let\expandafter\@pdfcolorstack + \csname pdfcol@Stack@#1\endcsname + }{% + \pdfcol@ErrorNoStack{#1}% + }% + }% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pdfcolSetCurrentColor} +% \begin{macrocode} + \def\pdfcolSetCurrentColor{% + \pdfcolorstack\@pdfcolorstack set{\current@color}% + }% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pdfcolSetCurrent} +% \begin{macrocode} + \def\pdfcolSetCurrent#1{% + \ifx\\#1\\% + \pdfcolorstack\@pdfcolorstack current\relax + \else + \pdfcolIfStackExists{#1}{% + \pdfcolorstack\csname pdfcol@Stack@#1\endcsname current\relax + }{% + \pdfcol@ErrorNoStack{#1}% + }% + \fi + }% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pdfcol@ErrorNoStack} +% \begin{macrocode} + \def\pdfcol@ErrorNoStack#1{% + \@PackageError{pdfcol}{Stack `#1' does not exists}\@ehc + }% +% \end{macrocode} +% \end{macro} +% +% \subsection{Disabled interface macros} +% +% \begin{macrocode} +\else +% \end{macrocode} +% +% \begin{macro}{\pdfcolErrorNoStacks} +% \begin{macrocode} + \def\pdfcolErrorNoStacks{% + \@PackageError{pdfcol}{% + Color stacks are not available% + }{% + Update pdfTeX (1.40) and `pdftex.def' (0.04b) % + if necessary.\MessageBreak + Ensure that `pdftex.def' is loaded % + (package `color' or `xcolor').\MessageBreak + Further messages can be found in TeX's % + protocol file `\jobname.log'.\MessageBreak + \MessageBreak + \@ehc + }% + \global\let\pdfcolErrorNoStacks\relax + }% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PDFCOL@Disabled} +% \begin{macrocode} + \def\PDFCOL@Disabled{% + \PDFCOL@Message{% + pdfTeX's color stacks are not available% + }% + \global\let\PDFCOL@Disabled\relax + }% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pdfcolInitStack} +% \begin{macrocode} + \def\pdfcolInitStack#1{% + \PDFCOL@Disabled + }% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pdfcolIfStackExists} +% \begin{macrocode} + \long\def\pdfcolIfStackExists#1#2#3{#3}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pdfcolSwitchStack} +% \begin{macrocode} + \def\pdfcolSwitchStack#1{% + \PDFCOL@Disabled + }% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pdfcolSetCurrentColor} +% \begin{macrocode} + \def\pdfcolSetCurrentColor{% + \PDFCOL@Disabled + }% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pdfcolSetCurrent} +% \begin{macrocode} + \def\pdfcolSetCurrent#1{% + \PDFCOL@Disabled + }% +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\fi +% \end{macrocode} +% +% \begin{macrocode} +\PDFCOL@AtEnd% +% +% \end{macrocode} +%% \section{Installation} +% +% \subsection{Download} +% +% \paragraph{Package.} This package is available on +% CTAN\footnote{\CTANpkg{pdfcol}}: +% \begin{description} +% \item[\CTAN{macros/latex/contrib/pdfcol/pdfcol.dtx}] The source file. +% \item[\CTAN{macros/latex/contrib/pdfcol/pdfcol.pdf}] Documentation. +% \end{description} +% +% +% \subsection{Package installation} +% +% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting +% \docstrip\ archive. The files are extracted by running the +% \xfile{.dtx} through \plainTeX: +% \begin{quote} +% \verb|tex pdfcol.dtx| +% \end{quote} +% +% \paragraph{TDS.} Now the different files must be moved into +% the different directories in your installation TDS tree +% (also known as \xfile{texmf} tree): +% \begin{quote} +% \def\t{^^A +% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}} +% pdfcol.sty & tex/generic/pdfcol/pdfcol.sty\\ +% pdfcol.pdf & doc/latex/pdfcol/pdfcol.pdf\\ +% pdfcol.dtx & source/latex/pdfcol/pdfcol.dtx\\ +% \end{tabular}^^A +% }^^A +% \sbox0{\t}^^A +% \ifdim\wd0>\linewidth +% \begingroup +% \advance\linewidth by\leftmargin +% \advance\linewidth by\rightmargin +% \edef\x{\endgroup +% \def\noexpand\lw{\the\linewidth}^^A +% }\x +% \def\lwbox{^^A +% \leavevmode +% \hbox to \linewidth{^^A +% \kern-\leftmargin\relax +% \hss +% \usebox0 +% \hss +% \kern-\rightmargin\relax +% }^^A +% }^^A +% \ifdim\wd0>\lw +% \sbox0{\small\t}^^A +% \ifdim\wd0>\linewidth +% \ifdim\wd0>\lw +% \sbox0{\footnotesize\t}^^A +% \ifdim\wd0>\linewidth +% \ifdim\wd0>\lw +% \sbox0{\scriptsize\t}^^A +% \ifdim\wd0>\linewidth +% \ifdim\wd0>\lw +% \sbox0{\tiny\t}^^A +% \ifdim\wd0>\linewidth +% \lwbox +% \else +% \usebox0 +% \fi +% \else +% \lwbox +% \fi +% \else +% \usebox0 +% \fi +% \else +% \lwbox +% \fi +% \else +% \usebox0 +% \fi +% \else +% \lwbox +% \fi +% \else +% \usebox0 +% \fi +% \else +% \lwbox +% \fi +% \else +% \usebox0 +% \fi +% \end{quote} +% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's +% TDS installing feature, then some files can already be in the right +% place, see the documentation of \docstrip. +% +% \subsection{Refresh file name databases} +% +% If your \TeX~distribution +% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh +% these. For example, \TeX\,Live\ users run \verb|texhash| or +% \verb|mktexlsr|. +% +% \subsection{Some details for the interested} +% +% \paragraph{Unpacking with \LaTeX.} +% The \xfile{.dtx} chooses its action depending on the format: +% \begin{description} +% \item[\plainTeX:] Run \docstrip\ and extract the files. +% \item[\LaTeX:] Generate the documentation. +% \end{description} +% If you insist on using \LaTeX\ for \docstrip\ (really, +% \docstrip\ does not need \LaTeX), then inform the autodetect routine +% about your intention: +% \begin{quote} +% \verb|latex \let\install=y\input{pdfcol.dtx}| +% \end{quote} +% Do not forget to quote the argument according to the demands +% of your shell. +% +% \paragraph{Generating the documentation.} +% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate +% the documentation. The process can be configured by the +% configuration file \xfile{ltxdoc.cfg}. For instance, put this +% line into this file, if you want to have A4 as paper format: +% \begin{quote} +% \verb|\PassOptionsToClass{a4paper}{article}| +% \end{quote} +% An example follows how to generate the +% documentation with pdf\LaTeX: +% \begin{quote} +%\begin{verbatim} +%pdflatex pdfcol.dtx +%makeindex -s gind.ist pdfcol.idx +%pdflatex pdfcol.dtx +%makeindex -s gind.ist pdfcol.idx +%pdflatex pdfcol.dtx +%\end{verbatim} +% \end{quote} +% +% \begin{History} +% \begin{Version}{2007/09/09 v1.0} +% \item +% First version. +% \end{Version} +% \begin{Version}{2007/12/09 v1.1} +% \item +% \cs{pdfcolSetCurrentColor} added. +% \end{Version} +% \begin{Version}{2007/12/12 v1.2} +% \item +% Detection for package \xpackage{luacolor} added. +% \end{Version} +% \begin{Version}{2016/05/16 v1.3} +% \item +% Documentation updates. +% \end{Version} +% \begin{Version}{2016/05/17 v1.4} +% \item +% Use luatex85 package for new luatex compatibility +% \end{Version} +% \begin{Version}{2018/11/01 v1.5} +% \item +% Remove luatex85 dependency +% \end{Version} +% \begin{Version}{2019/12/29 v1.6} +% \item +% \xpackage{iftex} package. +% \end{Version} +% \begin{Version}{2022-09-21 v1.7} +% \item Improved luatex compatitiblity, removed unneeded version checks. +% \end{Version} +% \end{History} +% +% \PrintIndex +% +% \Finale +\endinput diff --git a/macros/latex/contrib/pdfcol/pdfcol.pdf b/macros/latex/contrib/pdfcol/pdfcol.pdf new file mode 100644 index 0000000000..2c748d2c0f Binary files /dev/null and b/macros/latex/contrib/pdfcol/pdfcol.pdf differ diff --git a/macros/latex/contrib/proflycee/doc/ProfLycee-doc.pdf b/macros/latex/contrib/proflycee/doc/ProfLycee-doc.pdf index 96ad581523..9ad760140f 100644 Binary files a/macros/latex/contrib/proflycee/doc/ProfLycee-doc.pdf and b/macros/latex/contrib/proflycee/doc/ProfLycee-doc.pdf differ diff --git a/macros/latex/contrib/proflycee/doc/ProfLycee-doc.tex b/macros/latex/contrib/proflycee/doc/ProfLycee-doc.tex index 761c36edaf..d653c2ac21 100644 --- a/macros/latex/contrib/proflycee/doc/ProfLycee-doc.tex +++ b/macros/latex/contrib/proflycee/doc/ProfLycee-doc.tex @@ -60,8 +60,8 @@ \setlength{\parindent}{0pt} \definecolor{LightGray}{gray}{0.9} -\def\PLversion{1.2.5} -\def\PLdate{3 Septembre 2022} +\def\PLversion{1.2.6} +\def\PLdate{22 Septembre 2022} \tcbset{vignettes/.style={% nobeforeafter,box align=base,boxsep=0pt,enhanced,sharp corners=all,rounded corners=southeast,% @@ -233,6 +233,8 @@ Quelques commandes pour convertir bin/dec/hex avec certains détails. Une commande pour, en \TikZ, créer un pixelart avec correction éventuelle. +Une commande pour, en \TikZ, créer un SudoMaths non forcément $9\times9$. + \vspace{1.5cm} \hfill{}\textit{Merci à Anne pour ses retours et sa relecture !} @@ -3968,8 +3970,167 @@ D,-,-,D,-,D,D,F,F,F,F,F,F,D,D,-,-,-,-,D,-,- \newpage +\section{SudoMaths, en \TikZ}\label{sudomaths} + +\subsection{Introduction} + +\begin{codeidee} +L'idée est de \textit{proposer} un environnement \TikZ, une commande permettant de tracer des grilles de SudoMaths. + +L'environnement créé, lié à \TikZ, trace la grille de SudoMaths (avec les blocs démarqués), et peut la remplir avec une liste d'éléments. +\end{codeidee} + +\begin{codetex}[listing only] +%grille classique non remplie, avec légendes H et V +%les {} non nécessaires pour préciser que les cases seront "vides" +\PLsudomaths{} +\end{codetex} + +\begin{codesortie} +\PLsudomaths{} +\end{codesortie} + +\begin{codeinfo} +La commande \ctex{PLsudomaths} crée donc la grille (remplie ou non), dans un environnement \TikZ, c'est \textit{c'est tout} ! + +\smallskip + +Si on veut exploiter le tracé de la grille, on peut utiliser l'\textit{environnement} \ctex{PLenvsudomaths} dans lequel on peut rajouter toute commande en \TikZ{} ! +\end{codeinfo} + +\begin{codetex}[listing only] +%grille "toute seule" +\PLsudomaths[]{} + +%grille avec ajout de code +\begin{PLenvsudomaths}[]{} + ; +\end{PLenvsudomaths} +\end{codetex} + +\pagebreak + +\subsection{Clés et options} + +\begin{codecles} +Quelques \Cle{clés} sont disponibles pour cette commande : + +\begin{itemize} + \item la clé \Cle{epaisseurg} pour gérer l'épaisseur des traits épais ; \hfill~défaut \Cle{1.5pt} + \item la clé \Cle{epaisseur} pour gérer l'épaisseur des traits fins ; \hfill~défaut \Cle{0.5pt} + \item la clé \Cle{unite} qui est l'unité graphique de la figure ; \hfill~défaut \Cle{1cm} + \item la clé \Cle{couleurcase} pour la couleur (éventuelles) des cases ; \hfill~défaut \Cle{LightBlue!50} + \item la clé \Cle{couleurtexte} pour gérer la couleur du label des cases ; \hfill~défaut \Cle{blue} + \item la clé \Cle{nbcol} qui est le nombre de colonnes ; \hfill~défaut \Cle{9} + \item la clé \Cle{nbsubcol} qui est le nombre de sous-colonnes ; \hfill~défaut \Cle{3} + \item la clé \Cle{nblig} qui est le nombre de lignes ; \hfill~défaut \Cle{9} + \item la clé \Cle{nbsublig} qui est le nombre de sous-colonnes ; \hfill~défaut \Cle{3} + \item la clé \Cle{police} qui formatte le label des cases ; \hfill~défaut \Cle{\textbackslash{}normalfont\textbackslash{}normalsize} + \item le booléen \Cle{legendes} qui affiche ou non les légendes (H et V) des cases ; \hfill~défaut \Cle{true} + \item la clé \Cle{policeleg} qui formatte le label des légendes ; \hfill~défaut \Cle{\textbackslash{}normalfont\textbackslash{}normalsize} + \item la clé \Cle{listelegv} qui est la liste de la légende verticale ; \hfill~défaut \Cle{ABCD...WXYZ} + \item la clé \Cle{listelegh} qui est la liste de la légende horizontale ; \hfill~défaut \Cle{abcd...wxyz} + \item la clé \Cle{decallegende} qui est le décalage de la légende par rapport à la grille. \hfill~défaut \Cle{0.45} +\end{itemize} +\end{codecles} + +\begin{codeinfo} +La liste éventuelle des éléments à rentrer dans le tableau est traitée par le package \ctex{listofitems}, et se présente sous la forme suivante : \ctex{ / / / ... / / § / / / ... / / § ... § / / / ... / / } + +\smallskip + +Il peut donc être intéressant de \textit{déclarer} la liste au préalable pour simplifier la saisie de la commande ! +\end{codeinfo} + +\begin{codeinfo} +La \Cle{couleurcase} est gérée -- en interne -- par le caractère \ctex{*} qui permet de préciser qu'on veut que la case soit coloriée. +\end{codeinfo} + +\begin{codetex}[listing only] +%grille 6x6 avec blocs 2x3, avec coloration de cases (présentée sous forme de "cases") +\def\grilleSuMa{% + (a)* / (b)* / / / (c)* / (d)* §% + (e)* / / / (f)* / (g)* / (h)* §% + / / (i)* / / / (j)* §% + / / (k)* / / (l)* / (m)* §% + (n)* / / (o)* / / / (p)* §% + / / / (q)* / / §% +} + +\PLsudomaths[unite=0.75cm,nbcol=6,nbsubcol=2,nblig=6,nbsublig=3,police=\small\bfseries\ttfamily,% + couleurtexte=red,couleurcase=yellow!50,legendes=false]{\grilleSuMa} +\end{codetex} + +\begin{codesortie} +\def\grilleSuMa{% + (a)* / (b)* / / / (c)* / (d)* §% + (e)* / / / (f)* / (g)* / (h)* §% + / / (i)* / / / (j)* §% + / / (k)* / / (l)* / (m)* §% + (n)* / / (o)* / / / (p)* §% + / / / (q)* / / §% +} + +\PLsudomaths[unite=0.75cm,nbcol=6,nbsubcol=2,nblig=6,nbsublig=3,police=\small\bfseries\ttfamily,couleurtexte=red,couleurcase=yellow!50,legendes=false]{\grilleSuMa} +\end{codesortie} + +\pagebreak + +\begin{codeinfo} +La grille, créée en \TikZ, est portée par le rectangle de \og coins \fg{} $(0\,;\,0)$ et $(\text{nbcol}\,;\,-\text{nblig})$, de sorte que les labels des cases sont situés au nœuds de coordonnées $(x,5\,;\,-y,5)$. +\end{codeinfo} + +\begin{codetex}[listing only] +%grille classique avec coloration de cases et commande tikz +%graduations rajoutées pour la lecture des coordonnées +\def\grilleSuMaB{% + */////4///§% + /*///3////§% + //*//////§% + ///*/////§% + ////*////§% + /////*///§% + //5*/////*/§% + /////B///*§% + *///9////Q/§% +} + +\begin{PLenvsudomaths}[% + unite=0.66cm,police=\footnotesize\bfseries\ttfamily,couleurcase=ForestGreen!50,% + listelegv=QSDFGHJKL,listelegh=poiuytrez]{\grilleSuMaB} + \draw[red,very thick,<-] (7.5,-4.5) to[bend right] ++ (4,-1) node[right] {code rajouté...} ; +\end{PLenvsudomaths} +\end{codetex} + +\begin{codesortie} +\def\grilleSuMaB{% + */////4///§% + /*///3////§% + //*//////§% + ///*/////§% + ////*////§% + /////*///§% + //5*/////*/§% + /////B///*§% + *///9////Q/§% +} + +\begin{PLenvsudomaths}[% + unite=0.66cm,police=\footnotesize\bfseries\ttfamily,couleurcase=ForestGreen!50,% + listelegv=QSDFGHJKL,listelegh=poiuytrez]{\grilleSuMaB} + \draw[red,very thick,<-] (7.5,-4.5) to[bend right] ++ (4,-1) node[right] {code rajouté pour montrer la case \textsf{Ge}} ; + \foreach \x in {0,1,...,9} \draw[lightgray] (\x,-9) node[below,font=\scriptsize\ttfamily] {\x} ; + \foreach \y in {-1,-2,...,-9} \draw[lightgray] (9,\y) node[right,font=\scriptsize\ttfamily] {\y} ; + \draw[lightgray] (9,0) node[right,font=\scriptsize\ttfamily] {~0} ; +\end{PLenvsudomaths} +\end{codesortie} + +\newpage + \section{Historique} +{\small \bverb|v1.2.6|~:~~~~Ajout d'un environnement pour des SudoMaths (page \pageref{sudomaths}) + {\small \bverb|v1.2.5|~:~~~~Ajout de commandes pour des boîtes à moustaches (page \pageref{boiteamoustaches}) {\small \bverb|v1.2.4|~:~~~~Correction de quelques bugs mineurs, et mise à jour de la doc diff --git a/macros/latex/contrib/proflycee/tex/ProfLycee.sty b/macros/latex/contrib/proflycee/tex/ProfLycee.sty index 56dda985a4..7fdd37b256 100644 --- a/macros/latex/contrib/proflycee/tex/ProfLycee.sty +++ b/macros/latex/contrib/proflycee/tex/ProfLycee.sty @@ -3,7 +3,8 @@ % or later, see http://www.latex-project.org/lppl.txtf \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{ProfLycee}[2022/09/03 v1.2.5 - Aide pour l'utilisation de LaTeX en lycee] +\ProvidesPackage{ProfLycee}[2022/09/22 v1.2.6 - Aide pour l'utilisation de LaTeX en lycee] +% 1.2.6 Ajout d'un environnement tikz pour des sudomaths personnalisés % 1.2.5 Ajout d'une commande pour des boites à moustaches, en tikz % 1.2.4 Correction de quelques bugs mineurs, et mise à jour de la doc % 1.2.3 Ajout d'un environnement simplifié pour du code python @@ -2011,7 +2012,7 @@ \def\BaMaxexmax{\fpeval{\BaMAxeMax+\BaMAxeElarg*\BaMaxelargeur}} \draw[\BaMAxeEpaisseur,->] (\BaMaxexmin,0) -- (\BaMaxexmax,0) ; \ifboolKV[boiteamoustachesaxe]{affvaleurs} - {\foreach \x in \BaMAxeValeurs \draw[\BaMAxeEpaisseur] (\x,3pt)--(\x,-3pt) node[below=3pt] {\x} ;} + {\foreach \x in \BaMAxeValeurs \draw[\BaMAxeEpaisseur] (\x,3pt)--(\x,-3pt) node[below=3pt] {\num{\x}} ;} {} } @@ -2051,4 +2052,131 @@ {} } +%================SUDOMATHS============= OK !! +\defKV[PLTIKZSUDOM]{% + couleurtexte=\def\PLSMcoultexte{#1},% + epaisseur=\def\PLSMepf{#1},% + epaisseurg=\def\PLSMepg{#1},% + unite=\def\PLSMunite{#1},% + couleurcase=\def\PLSMcoulcase{#1},% + nbcol=\def\PLSMnbcol{#1},% + nbsubcol=\def\PLSMnbsubcol{#1},% + nblig=\def\PLSMnblig{#1},% + nbsublig=\def\PLSMnbsublig{#1},% + police=\def\PLSMfonte{#1},% + policeleg=\def\PLSMfonteleg{#1},% + listelegv=\def\PLSMlistelegv{#1},% + listelegh=\def\PLSMlistelegh{#1},% + decallegende=\def\PLSMdecalleg{#1} +} + +\setKVdefault[PLTIKZSUDOM]{% + epaisseurg=1.5pt,% + epaisseur=0.5pt,% + unite=1cm,% + couleurcase=LightBlue!50,% + couleurtexte=blue,% + nbcol=9,% + nbsubcol=3,% + nblig=9,% + nbsublig=3, + police=\normalfont\normalsize,% + policeleg=\normalfont\sffamily,% + legendes=true,% + listelegv=ABCDEFGHIJKLMNOPQRSTUVWXYZ,% + listelegh=abcdefghijklmnopqrstuvwxyz,% + decallegende=0.45 +} + +\NewDocumentEnvironment{PLenvsudomaths}{ O{} m } + { + \useKVdefault[PLTIKZSUDOM] + \setKV[PLTIKZSUDOM]{#1}% on paramètres les nouvelles clés et on les simplifie + %calculs intermédiaires + \def\larcolinter{\inteval{\PLSMnbcol/\PLSMnbsubcol}} + \def\larliginter{\inteval{\PLSMnblig/\PLSMnbsublig}} + %lecture liste + \IfEq{#2}{}{}% + {% + \setsepchar[.]{§./}% + \readlist*\SPGrilleSudoMaths{#2}% + } + %débt envtik + \begin{tikzpicture}[x=\PLSMunite,y=\PLSMunite,line join=miter] + %cases + \IfEq{#2}{}{}% + {% + \foreach \i in {1,2,...,\PLSMnblig}{% + \foreach \j in {1,2,...,\PLSMnbcol}{% + \itemtomacro\SPGrilleSudoMaths[\i,\j]\SMcase + \IfSubStr{\SMcase}{*}%si on veut colorier via * + {% + \StrDel{\SMcase}{*}[\SMcaseb]% + \draw[draw=none,fill=\PLSMcoulcase] ({\j-1},{1-\i}) rectangle++ (1,-1) node[inner sep=0pt,outer sep=0pt,\PLSMcoultexte,font=\PLSMfonte,midway] {\SMcaseb} ;% + } + {% + \draw ({\j-0.5},{0.5-\i}) node[inner sep=0pt,outer sep=0pt,\PLSMcoultexte,font=\PLSMfonte] {\SMcase} ;% + } + } + }% + } + %grilles + \draw[line width=\PLSMepg] (0,0) rectangle ({\PLSMnbcol},{-\PLSMnblig}) ; + \draw[line width=\PLSMepf,xstep=1,ystep=1] (0,0) grid ({\PLSMnbcol},{-\PLSMnblig}) ; + \draw[line width=\PLSMepg,xstep=\larcolinter,ystep=\larliginter] (0,0) grid ({\PLSMnbcol},{-\PLSMnblig}) ; + %légendes + \ifboolKV[PLTIKZSUDOM]{legendes} + {% + \foreach \i in {1,2,...,\PLSMnbcol}{\draw ({\i-0.5},{\PLSMdecalleg}) node[inner sep=0pt,outer sep=0pt,font=\PLSMfonteleg] {\strut\StrChar{\PLSMlistelegh}{\i}} ;} + \foreach \j in {1,2,...,\PLSMnblig}{\draw ({-\PLSMdecalleg},{0.5-\j}) node[inner sep=0pt,outer sep=0pt,font=\PLSMfonteleg] {\StrChar{\PLSMlistelegv}{\j}} ;} + }{} + } + { + \end{tikzpicture} + } + +\NewDocumentCommand\PLsudomaths{ O{} m }{% + \useKVdefault[PLTIKZSUDOM] + \setKV[PLTIKZSUDOM]{#1}% on paramètres les nouvelles clés et on les simplifie + %calculs intermédiaires + \def\larcolinter{\inteval{\PLSMnbcol/\PLSMnbsubcol}} + \def\larliginter{\inteval{\PLSMnblig/\PLSMnbsublig}} + %lecture liste + \IfEq{#2}{}{}% + {% + \setsepchar[.]{§./}% + \readlist*\SPGrilleSudoMaths{#2}% + } + %débt envtik + \begin{tikzpicture}[x=\PLSMunite,y=\PLSMunite,line join=miter] + %cases + \IfEq{#2}{}{}% + {% + \foreach \i in {1,2,...,\PLSMnblig}{% + \foreach \j in {1,2,...,\PLSMnbcol}{% + \itemtomacro\SPGrilleSudoMaths[\i,\j]\SMcase + \IfSubStr{\SMcase}{*}%si on veut colorier via * + {% + \StrDel{\SMcase}{*}[\SMcaseb]% + \draw[draw=none,fill=\PLSMcoulcase] ({\j-1},{1-\i}) rectangle++ (1,-1) node[inner sep=0pt,outer sep=0pt,\PLSMcoultexte,font=\PLSMfonte,midway] {\SMcaseb} ;% + } + {% + \draw ({\j-0.5},{0.5-\i}) node[inner sep=0pt,outer sep=0pt,\PLSMcoultexte,font=\PLSMfonte] {\SMcase} ;% + } + } + }% + } + %grilles + \draw[line width=\PLSMepg] (0,0) rectangle ({\PLSMnbcol},{-\PLSMnblig}) ; + \draw[line width=\PLSMepf,xstep=1,ystep=1] (0,0) grid ({\PLSMnbcol},{-\PLSMnblig}) ; + \draw[line width=\PLSMepg,xstep=\larcolinter,ystep=\larliginter] (0,0) grid ({\PLSMnbcol},{-\PLSMnblig}) ; + %légendes + \ifboolKV[PLTIKZSUDOM]{legendes} + {% + \foreach \i in {1,2,...,\PLSMnbcol}{\draw ({\i-0.5},{\PLSMdecalleg}) node[inner sep=0pt,outer sep=0pt,font=\PLSMfonteleg] {\strut\StrChar{\PLSMlistelegh}{\i}} ;} + \foreach \j in {1,2,...,\PLSMnblig}{\draw ({-\PLSMdecalleg},{0.5-\j}) node[inner sep=0pt,outer sep=0pt,font=\PLSMfonteleg] {\StrChar{\PLSMlistelegv}{\j}} ;} + }{} + \end{tikzpicture} +} + \endinput \ No newline at end of file diff --git a/macros/latex/contrib/semantex/semantex.pdf b/macros/latex/contrib/semantex/semantex.pdf index 7bbf5313c2..2ed542a06f 100644 Binary files a/macros/latex/contrib/semantex/semantex.pdf and b/macros/latex/contrib/semantex/semantex.pdf differ diff --git a/macros/latex/contrib/semantex/semantex.sty b/macros/latex/contrib/semantex/semantex.sty index 325f2dbec5..8cdbecc789 100644 --- a/macros/latex/contrib/semantex/semantex.sty +++ b/macros/latex/contrib/semantex/semantex.sty @@ -1,5 +1,5 @@ \RequirePackage{xparse,l3keys2e,leftindex,semtex} -\ProvidesExplPackage{semantex}{2021/08/23}{0.513}{} +\ProvidesExplPackage{semantex}{2022/06/22}{0.520}{} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % @@ -10,7 +10,7 @@ % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\tl_set:Nn\SemantexVersion{0.513} +\tl_set:Nn\SemantexVersion{0.520} \cs_set_eq:NN \semantex_keyval_parse:NNn \keyval_parse:NNn \cs_set:Npn \semantex_singlekey_parse:Nn#1#2 { \clist_map_function:nN { #2 } #1 } @@ -50,8 +50,8 @@ \bool_if:NF \g__semantex_semtex_file_was_opened_bool { \iow_open:Nn \g__semantex_semtex_file_stream_temp_iow { \jobname.semtex } - \iow_now:Nn \g__semantex_semtex_file_stream_temp_iow { \DeclareClass {\SemantexBaseObject } } - \iow_now:Nn \g__semantex_semtex_file_stream_temp_iow { \DeclareObject {\SemantexDelimiterSize } } + \iow_now:Nn \g__semantex_semtex_file_stream_temp_iow { \RegisterClass {\SemantexBaseObject } } + \iow_now:Nn \g__semantex_semtex_file_stream_temp_iow { \RegisterObject {\SemantexDelimiterSize } } } \cs_set:Npn\semantex_write_to_semtex_file:n##1 @@ -126,17 +126,17 @@ \cs_new_protected:Npn\semantex_write_class_declaration_to_semtex_file:n#1 { - \semantex_write_to_semtex_file:n { \DeclareClass{#1} } + \semantex_write_to_semtex_file:n { \RegisterClass{#1} } } \cs_new_protected:Npn\semantex_write_object_declaration_to_semtex_file:n#1 { - \semantex_write_to_semtex_file:n { \DeclareObject{#1} } + \semantex_write_to_semtex_file:n { \RegisterObject{#1} } } -\cs_new_protected:Npn\SemantexIDcommand#1 +\cs_new_protected:Npn\SemantexID#1 { - \semantex_write_to_semtex_file:n { \SemantexID{#1} } + \semantex_write_to_semtex_file:n { \RegisterID{#1} } } \cs_set_eq:NN\SemantexRecordObject\semantex_write_object_declaration_to_semtex_file:n @@ -148,11 +148,9 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\DeclareDocumentCommand\semantex_new_simple_class:Nw{mO{}} % new simple-type class +\cs_new_protected:Npn\semantex_declare_simple_class:N#1 % new simple-type class { % #1 = class name - % #2 = options - \semantex_new_class:Nn { #1 } { \semantex_class_set_keys:Nn #1 { #2 } } \DeclareDocumentCommand{#1}{m} { % the actual \#1 command @@ -169,7 +167,7 @@ ##1 } } - \exp_args:Nc\DeclareDocumentCommand{__semantex_new_object_of_\semantex_class_to_register:N #1:Nw}{mgO{}} + \exp_args:Nc\DeclareDocumentCommand{__semantex_declare_object_of_\semantex_class_to_register:N #1:Nw}{mgO{}} { % the command for creating a new object of class #1 % ##1 = command name, with backslash @@ -177,13 +175,13 @@ % ##3 = options \IfValueTF{##2} { - \semantex_new_object:NNn #1 ##1 { + \semantex_declare_object:NNn #1 ##1 { \semantex_object_set_symbol:Nn ##1 { ##2 } \semantex_object_set_keys:Nn ##1 { ##3 } } } { - \semantex_new_object:NNn #1 ##1 { + \semantex_declare_object:NNn #1 ##1 { \semantex_object_set_keys:Nn ##1 { ##3 } } } @@ -197,13 +195,23 @@ } } -\tl_set_eq:NN\NewSimpleClass\semantex_new_simple_class:Nw +\NewDocumentCommand\DeclareSimpleClass{ m O{} } +{ + \semantex_declare_class:Nn { #1 } { \semantex_class_set_keys:Nn #1 { #2 } } + \semantex_declare_simple_class:N #1 +} + +\NewDocumentCommand\NewSimpleClass { m O{} } +{ + \semantex_new_class_and_do:NNnn #1 \DeclareSimpleClass { \semantex_class_set_keys:Nn #1 { #2 } } + { + \semantex_declare_simple_class:N #1 + } +} -\DeclareDocumentCommand\semantex_new_symbol_class:Nw{mO{}} % new symbol-type class +\cs_new_protected:Npn\semantex_declare_symbol_class:N #1 % new symbol-type class { % #1 = class name - % #2 = options - \semantex_new_class:Nn { #1 } { \semantex_class_set_keys:Nn #1 { #2 } } \DeclareDocumentCommand{#1}{mo} { % the actual \#1 command @@ -243,7 +251,7 @@ } } } - \exp_args:Nc\DeclareDocumentCommand{__semantex_new_object_of_\semantex_class_to_register:N #1:Nw}{mgO{}} + \exp_args:Nc\DeclareDocumentCommand{__semantex_declare_object_of_\semantex_class_to_register:N #1:Nw}{mgO{}} { % the command for creating a new object of class #1 % ##1 = command name, with backslash @@ -251,13 +259,13 @@ % ##3 = options \IfValueTF{##2} { - \semantex_new_object:NNn #1 ##1 { + \semantex_declare_object:NNn #1 ##1 { \semantex_object_set_symbol:Nn ##1 { ##2 } \semantex_object_set_keys:Nn ##1 { ##3 } } } { - \semantex_new_object:NNn #1 ##1 { + \semantex_declare_object:NNn #1 ##1 { \semantex_object_set_keys:Nn ##1 { ##3 } } } @@ -281,14 +289,23 @@ } } -\tl_set_eq:NN\NewSymbolClass\semantex_new_symbol_class:Nw +\NewDocumentCommand\DeclareSymbolClass{ m O{} } +{ + \semantex_declare_class:Nn { #1 } { \semantex_class_set_keys:Nn #1 { #2 } } + \semantex_declare_symbol_class:N #1 +} -\DeclareDocumentCommand\semantex_new_variable_class:Nw{mO{}} % new variable-type class +\NewDocumentCommand\NewSymbolClass { m O{} } +{ + \semantex_new_class_and_do:NNnn #1 \DeclareSymbolClass { \semantex_class_set_keys:Nn #1 { #2 } } + { + \semantex_declare_symbol_class:N #1 + } +} + +\cs_new_protected:Npn\semantex_declare_variable_class:N#1 % new variable-type class { % #1 = class name - % #2 = options - \semantex_new_class:Nn { #1 } { \semantex_class_set_keys:Nn #1 { #2 } } - %\semantex_new_class:Nn #1 { #2 } \DeclareDocumentCommand{#1}{mog} { % the actual \#1 command @@ -375,7 +392,7 @@ } } } - \exp_args:Nc\DeclareDocumentCommand{__semantex_new_object_of_\semantex_class_to_register:N #1:Nw}{mgO{}} + \exp_args:Nc\DeclareDocumentCommand{__semantex_declare_object_of_\semantex_class_to_register:N #1:Nw}{mgO{}} { % the command for creating a new object of class #1 % ##1 = command name, with backslash @@ -383,13 +400,13 @@ % ##3 = options \IfValueTF{##2} { - \semantex_new_object:NNn #1 ##1 { + \semantex_declare_object:NNn #1 ##1 { \semantex_object_set_symbol:Nn ##1 { ##2 } \semantex_object_set_keys:Nn ##1 { ##3 } } } { - \semantex_new_object:NNn #1 ##1 { + \semantex_declare_object:NNn #1 ##1 { \semantex_object_set_keys:Nn ##1 { ##3 } } } @@ -444,796 +461,20 @@ } } -\cs_set_eq:NN\NewVariableClass\semantex_new_variable_class:Nw - -\DeclareDocumentCommand\semantex_new_cohomology_class:Nw{mO{}} % new cohomology-type class +\NewDocumentCommand\DeclareVariableClass{ m O{} } { - % #1 = class name - % #2 = options - \semantex_new_class:Nn { #1 } { \semantex_class_set_keys:Nn #1 { #2 } } - \DeclareDocumentCommand{#1}{mogg}{ - % the actual \#1 command - \IfValueTF{##2} - { - \IfValueTF { ##3 } - { - \str_if_eq:nnTF { ##3 }{ * } - { - \IfValueTF { ##4 } - { - \semantex_write_original_source_to_semtex_file:n - { #1 { ##1 } [ ##2 ] { * } { ##4 } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } - \semantex_object_associated_to_class_set_keys:Nn #1 { ##2 } - \semantex_object_associated_to_class_use_bullet:N #1 - \semantex_object_associated_to_class_set_arg:Nn #1 { ##4 } - } - } - { - \semantex_write_original_source_to_semtex_file:n - { #1 { ##1 } [ ##2 ] { * } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } - \semantex_object_associated_to_class_set_keys:Nn #1 { ##2 } - \semantex_object_associated_to_class_use_bullet:N #1 - } - } - } - { - \str_if_eq:nnTF { ##3 }{ ** } - { - \IfValueTF { ##4 } - { - \semantex_write_original_source_to_semtex_file:n - { #1 { ##1 } [ ##2 ] { ** } { ##4 } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } - \semantex_object_associated_to_class_set_keys:Nn #1 { ##2 } - \semantex_object_associated_to_class_use_double_bullet:N #1 - \semantex_object_associated_to_class_set_arg:Nn #1 { ##4 } - } - } - { - \semantex_write_original_source_to_semtex_file:n - { #1 { ##1 } [ ##2 ] { ** } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } - \semantex_object_associated_to_class_set_keys:Nn #1 { ##2 } - \semantex_object_associated_to_class_use_double_bullet:N #1 - } - } - } - { - \IfValueTF { ##4 } - { - \semantex_write_original_source_to_semtex_file:n - { #1 { ##1 } [ ##2 ] { ##3 } { ##4 } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } - \semantex_object_associated_to_class_set_keys:Nn #1 { ##2 } - \semantex_object_associated_to_class_set_degree_default:Nn #1 { ##3 } - \semantex_object_associated_to_class_set_arg:Nn #1 { ##4 } - } - } - { - \semantex_write_original_source_to_semtex_file:n - { #1 { ##1 } [ ##2 ] { ##3 } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } - \semantex_object_associated_to_class_set_keys:Nn #1 { ##2 } - \semantex_object_associated_to_class_set_degree_default:Nn #1 { ##3 } - } - } - } - } - } - { - \IfValueTF { ##4 } - { - \semantex_write_original_source_to_semtex_file:n - { #1 { ##1 } [ ##2 ] { ##4 } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } - \semantex_object_associated_to_class_set_keys:Nn #1 { ##2 } - \semantex_object_associated_to_class_set_arg:Nn #1 { ##4 } - } - } - { - \semantex_write_original_source_to_semtex_file:n - { #1 { ##1 } [ ##2 ] } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } - \semantex_object_associated_to_class_set_keys:Nn #1 { ##2 } - } - } - } - } - { - \IfValueTF { ##3 } - { - \str_if_eq:nnTF { ##3 }{ * } - { - \IfValueTF { ##4 } - { - \semantex_write_original_source_to_semtex_file:n - { #1 { ##1 } { * } { ##4 } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } - \semantex_object_associated_to_class_use_bullet:N #1 - \semantex_object_associated_to_class_set_arg:Nn #1 { ##4 } - } - } - { - \semantex_write_original_source_to_semtex_file:n - { #1 { ##1 } { * } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } - \semantex_object_associated_to_class_use_bullet:N #1 - } - } - } - { - \str_if_eq:nnTF { ##3 }{ ** } - { - \IfValueTF { ##4 } - { - \semantex_write_original_source_to_semtex_file:n - { #1 { ##1 } { ** } { ##4 } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } - \semantex_object_associated_to_class_use_double_bullet:N #1 - \semantex_object_associated_to_class_set_arg:Nn #1 { ##4 } - } - } - { - \semantex_write_original_source_to_semtex_file:n - { #1 { ##1 } { ** } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } - \semantex_object_associated_to_class_use_double_bullet:N #1 - } - } - } - { - \IfValueTF { ##4 } - { - \semantex_write_original_source_to_semtex_file:n - { #1 { ##1 } { ##3 } { ##4 } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } - \semantex_object_associated_to_class_set_degree_default:Nn #1 { ##3 } - \semantex_object_associated_to_class_set_arg:Nn #1 { ##4 } - } - } - { - \semantex_write_original_source_to_semtex_file:n - { #1 { ##1 } { ##3 } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } - \semantex_object_associated_to_class_set_degree_default:Nn #1 { ##3 } - } - } - } - } - } - { - \IfValueTF { ##4 } - { - \semantex_write_original_source_to_semtex_file:n - { #1 { ##1 } { ##4 } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } - \semantex_object_associated_to_class_set_arg:Nn #1 { ##4 } - } - } - { - \semantex_write_original_source_to_semtex_file:n - { #1 { ##1 } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } - } - } - } - } - } - \exp_args:Nc\DeclareDocumentCommand{__semantex_make_object_of_\semantex_class_to_register:N #1_with_options:nnw}{mmogg} - { - \IfValueTF{##3} - { - \IfValueTF { ##4 } - { - \str_if_eq:nnTF { ##4 }{ * } - { - \IfValueTF { ##5 } - { - \semantex_add_to_existing_original_source_in_semtex_file:n - { [ ##3 ] { * } { ##5 } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } - ##1 - \semantex_object_associated_to_class_set_keys:Nn #1 { ##3 } - \semantex_object_associated_to_class_use_bullet:N #1 - \semantex_object_associated_to_class_set_arg:Nn #1 { ##5 } - } - } - { - \semantex_add_to_existing_original_source_in_semtex_file:n - { [ ##3 ] { * } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } - ##1 - \semantex_object_associated_to_class_set_keys:Nn #1 { ##3 } - \semantex_object_associated_to_class_use_bullet:N #1 - } - } - } - { - \str_if_eq:nnTF { ##4 }{ ** } - { - \IfValueTF { ##5 } - { - \semantex_add_to_existing_original_source_in_semtex_file:n - { [ ##3 ] { ** } { ##5 } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } - ##1 - \semantex_object_associated_to_class_set_keys:Nn #1 { ##3 } - \semantex_object_associated_to_class_use_double_bullet:N #1 - \semantex_object_associated_to_class_set_arg:Nn #1 { ##5 } - } - } - { - \semantex_add_to_existing_original_source_in_semtex_file:n - { [ ##3 ] { ** } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } - ##1 - \semantex_object_associated_to_class_set_keys:Nn #1 { ##3 } - \semantex_object_associated_to_class_use_double_bullet:N #1 - } - } - } - { - \IfValueTF { ##5 } - { - \semantex_add_to_existing_original_source_in_semtex_file:n - { [ ##3 ] { ##4 } { ##5 } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } - ##1 - \semantex_object_associated_to_class_set_keys:Nn #1 { ##3 } - \semantex_object_associated_to_class_set_degree_default:Nn #1 { ##4 } - \semantex_object_associated_to_class_set_arg:Nn #1 { ##5 } - } - } - { - \semantex_add_to_existing_original_source_in_semtex_file:n - { [ ##3 ] { ##4 } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } - ##1 - \semantex_object_associated_to_class_set_keys:Nn #1 { ##3 } - \semantex_object_associated_to_class_set_degree_default:Nn #1 { ##4 } - } - } - } - } - } - { - \IfValueTF { ##5 } - { - \semantex_add_to_existing_original_source_in_semtex_file:n - { [ ##3 ] { ##5 } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } - ##1 - \semantex_object_associated_to_class_set_keys:Nn #1 { ##3 } - \semantex_object_associated_to_class_set_arg:Nn #1 { ##5 } - } - } - { - \semantex_add_to_existing_original_source_in_semtex_file:n - { [ ##3 ] } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } - ##1 - \semantex_object_associated_to_class_set_keys:Nn #1 { ##3 } - } - } - } - } - { - \IfValueTF { ##4 } - { - \str_if_eq:nnTF { ##4 }{ * } - { - \IfValueTF { ##5 } - { - \semantex_add_to_existing_original_source_in_semtex_file:n - { { * } { ##5 } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } - ##1 - \semantex_object_associated_to_class_use_bullet:N #1 - \semantex_object_associated_to_class_set_arg:Nn #1 { ##5 } - } - } - { - \semantex_add_to_existing_original_source_in_semtex_file:n - { { * } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } - ##1 - \semantex_object_associated_to_class_use_bullet:N #1 - } - } - } - { - \str_if_eq:nnTF { ##4 }{ ** } - { - \IfValueTF { ##5 } - { - \semantex_add_to_existing_original_source_in_semtex_file:n - { { ** } { ##5 } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } - ##1 - \semantex_object_associated_to_class_use_double_bullet:N #1 - \semantex_object_associated_to_class_set_arg:Nn #1 { ##5 } - } - } - { - \semantex_add_to_existing_original_source_in_semtex_file:n - { { ** } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } - ##1 - \semantex_object_associated_to_class_use_double_bullet:N #1 - } - } - } - { - \IfValueTF { ##5 } - { - \semantex_add_to_existing_original_source_in_semtex_file:n - { { ##4 } { ##5 } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } - ##1 - \semantex_object_associated_to_class_set_degree_default:Nn #1 { ##4 } - \semantex_object_associated_to_class_set_arg:Nn #1 { ##5 } - } - } - { - \semantex_add_to_existing_original_source_in_semtex_file:n - { { ##4 } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } - ##1 - \semantex_object_associated_to_class_set_degree_default:Nn #1 { ##4 } - } - } - } - } - } - { - \IfValueTF { ##5 } - { - \semantex_add_to_existing_original_source_in_semtex_file:n - { { ##5 } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } - ##1 - \semantex_object_associated_to_class_set_arg:Nn #1 { ##5 } - } - } - { - % \semantex_add_to_existing_original_source_in_semtex_file:n { } % write nothing to file - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } - ##1 - } - } - } - } - } - \exp_args:Nc\DeclareDocumentCommand{__semantex_new_object_of_\semantex_class_to_register:N #1:Nw}{mgO{}} - { - % the command for creating a new object of class #1 - % ##1 = command name, with backslash - % ##2 = symbol - % ##3 = options - \IfValueTF{##2} - { - \semantex_new_object:NNn #1 { ##1 }{ - \semantex_object_set_symbol:Nn ##1 { ##2 } - \semantex_object_set_keys:Nn ##1 { ##3 } - } - } - { - \semantex_new_object:NNn #1 { ##1 }{ - \semantex_object_set_keys:Nn ##1 { ##3 } - } - } - % creates the object with name ##1 - \DeclareDocumentCommand{##1}{ogg} - { - % the actual \##1 command - \IfValueTF{####1} - { - \IfValueTF{####2} - { - \str_if_eq:nnTF { ####2 } { * } - { - \IfValueTF{####3} - { - \semantex_write_original_source_to_semtex_file:n - { ##1 [ ####1 ] { * } { ####3 } } - \semantex_render_object:Nn ##1 { - \semantex_object_do_output:N ##1 - \semantex_object_set_keys:Nn ##1 { ####1 } - \semantex_object_use_bullet:N ##1 - \semantex_object_set_arg:Nn ##1 { ####3 } - } - } - { - \semantex_write_original_source_to_semtex_file:n - { ##1 [ ####1 ] { * } } - \semantex_render_object:Nn ##1 { - \semantex_object_do_output:N ##1 - \semantex_object_set_keys:Nn ##1 { ####1 } - \semantex_object_use_bullet:N ##1 - } - } - } - { - \str_if_eq:nnTF { ####2 } { ** } - { - \IfValueTF{####3} - { - \semantex_write_original_source_to_semtex_file:n - { ##1 [ ####1 ] { ** } { ####3 } } - \semantex_render_object:Nn ##1 { - \semantex_object_do_output:N ##1 - \semantex_object_set_keys:Nn ##1 { ####1 } - \semantex_object_use_double_bullet:N ##1 - \semantex_object_set_arg:Nn ##1 { ####3 } - } - } - { - \semantex_write_original_source_to_semtex_file:n - { ##1 [ ####1 ] { ** } } - \semantex_render_object:Nn ##1 { - \semantex_object_do_output:N ##1 - \semantex_object_set_keys:Nn ##1 { ####1 } - \semantex_object_use_double_bullet:N ##1 - } - } - } - { - \IfValueTF{####3} - { - \semantex_write_original_source_to_semtex_file:n - { ##1 [ ####1 ] { ####2 } { ####3 } } - \semantex_render_object:Nn ##1 { - \semantex_object_do_output:N ##1 - \semantex_object_set_keys:Nn ##1 { ####1 } - \semantex_object_set_degree_default:Nn ##1 { ####2 } - \semantex_object_set_arg:Nn ##1 { ####3 } - } - } - { - \semantex_write_original_source_to_semtex_file:n - { ##1 [ ####1 ] { ####2 } } - \semantex_render_object:Nn ##1 { - \semantex_object_do_output:N ##1 - \semantex_object_set_keys:Nn ##1 { ####1 } - \semantex_object_set_degree_default:Nn ##1 { ####2 } - } - } - } - } - } - { - \IfValueTF{####3} - { - \semantex_write_original_source_to_semtex_file:n - { ##1 [ ####1 ] { ####3 } } - \semantex_render_object:Nn ##1 { - \semantex_object_do_output:N ##1 - \semantex_object_set_keys:Nn ##1 { ####1 } - \semantex_object_set_arg:Nn ##1 { ####3 } - } - } - { - \semantex_write_original_source_to_semtex_file:n - { ##1 [ ####1 ] } - \semantex_render_object:Nn ##1 { - \semantex_object_do_output:N ##1 - \semantex_object_set_keys:Nn ##1 { ####1 } - } - } - } - } - { - \IfValueTF{####2} - { - \str_if_eq:nnTF { ####2 } { * } - { - \IfValueTF{####3} - { - \semantex_write_original_source_to_semtex_file:n - { ##1 { * } { ####3 } } - \semantex_render_object:Nn ##1 { - \semantex_object_do_output:N ##1 - \semantex_object_use_bullet:N ##1 - \semantex_object_set_arg:Nn ##1 { ####3 } - } - } - { - \semantex_write_original_source_to_semtex_file:n - { ##1 { * } } - \semantex_render_object:Nn ##1 { - \semantex_object_do_output:N ##1 - \semantex_object_use_bullet:N ##1 - } - } - } - { - \str_if_eq:nnTF { ####2 } { ** } - { - \IfValueTF{####3} - { - \semantex_write_original_source_to_semtex_file:n - { ##1 { ** } { ####3 } } - \semantex_render_object:Nn ##1 { - \semantex_object_do_output:N ##1 - \semantex_object_use_double_bullet:N ##1 - \semantex_object_set_arg:Nn ##1 { ####3 } - } - } - { - \semantex_write_original_source_to_semtex_file:n - { ##1 { ** } } - \semantex_render_object:Nn ##1 { - \semantex_object_do_output:N ##1 - \semantex_object_use_double_bullet:N ##1 - } - } - } - { - \IfValueTF{####3} - { - \semantex_write_original_source_to_semtex_file:n - { ##1 { ####2 } { ####3 } } - \semantex_render_object:Nn ##1 { - \semantex_object_do_output:N ##1 - \semantex_object_set_degree_default:Nn ##1 { ####2 } - \semantex_object_set_arg:Nn ##1 { ####3 } - } - } - { - \semantex_write_original_source_to_semtex_file:n - { ##1 { ####2 } } - \semantex_render_object:Nn ##1 { - \semantex_object_do_output:N ##1 - \semantex_object_set_degree_default:Nn ##1 { ####2 } - } - } - } - } - } - { - \IfValueTF{####3} - { - \semantex_write_original_source_to_semtex_file:n - { ##1 { ####3 } } - \semantex_render_object:Nn ##1 { - \semantex_object_do_output:N ##1 - \semantex_object_set_arg:Nn ##1 { ####3 } - } - } - { - \semantex_write_original_source_to_semtex_file:n - { ##1 } - \semantex_render_object:Nn ##1 { } - } - } - } - } - } + \semantex_declare_class:Nn { #1 } { \semantex_class_set_keys:Nn #1 { #2 } } + \semantex_declare_variable_class:N #1 } -\cs_set_eq:NN\NewCohomologyClass\semantex_new_cohomology_class:Nw - -\DeclareDocumentCommand\semantex_new_delimiter_class:Nw{mO{}} % new delimiter-type class +\NewDocumentCommand\NewVariableClass { m O{} } { - % #1 = class name - % #2 = options - \semantex_new_class:Nn { #1 } { \semantex_class_set_keys:Nn #1 { #2 } } - \DeclareDocumentCommand{#1}{mog} % maybe this does not even make sense for delimiters - { - \IfValueTF { ##2 } - { - \IfValueTF { ##3 } - { - \semantex_write_original_source_to_semtex_file:n - { #1 { ##1 } [ ##2 ] { ##3 } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } - \semantex_object_associated_to_class_set_keys:Nn #1 { ##2 } - \semantex_object_associated_to_class_set_arg:Nn #1 { ##3 } - } - } - { - \semantex_write_original_source_to_semtex_file:n - { #1 { ##1 } [ ##2 ] } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } - \semantex_object_associated_to_class_set_keys:Nn #1 { ##2 } - } - } - } - { - \IfValueTF { ##3 } - { - \semantex_write_original_source_to_semtex_file:n - { #1 { ##1 } { ##3 } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } - \semantex_object_associated_to_class_set_arg:Nn #1 { ##3 } - } - } - { - \semantex_write_original_source_to_semtex_file:n - { #1 { ##1 } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } - } - } - } - } - % the actual \#1 command - \exp_args:Nc\DeclareDocumentCommand{__semantex_make_object_of_\semantex_class_to_register:N #1_with_options:nnw}{mmog} - { - \IfValueTF { ##3 } - { - \IfValueTF { ##4 } - { - \semantex_add_to_existing_original_source_in_semtex_file:n - { [ ##3 ] { ##4 } } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } - ##1 - \semantex_object_associated_to_class_set_keys:Nn #1 { ##3 } - \semantex_object_associated_to_class_set_arg:Nn #1 { ##4 } - } - } - { - \semantex_add_to_existing_original_source_in_semtex_file:n - { [ ##3 ] } - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } - ##1 - \semantex_object_associated_to_class_set_keys:Nn #1 { ##3 } - } - } - } - { - \IfValueTF { ##4 } - { - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_add_to_existing_original_source_in_semtex_file:n - { { ##4 } } - \semantex_object_associated_to_class_do_output:N #1 - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } - ##1 - \semantex_object_associated_to_class_set_arg:Nn #1 { ##4 } - } - } - { - % \semantex_add_to_existing_original_source_in_semtex_file:n { } % write nothing to file - \semantex_render_object_associated_to_class:Nn #1 { - \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } - ##1 - } - } - } - } - \exp_args:Nc\DeclareDocumentCommand{__semantex_new_object_of_\semantex_class_to_register:N #1:Nw}{mmmO{}} + \semantex_new_class_and_do:NNnn #1 \DeclareVariableClass { \semantex_class_set_keys:Nn #1 { #2 } } { - % the command for creating a new object of class #1 - % ##1 = command name, with backslash - % ##2 = symbol - % ##3 = options - \semantex_new_object:NNn #1 { ##1 }{ - \semantex_object_set_left_par:Nn ##1 { ##2 } - \semantex_object_set_right_par:Nn ##1 { ##3 } - \semantex_object_set_keys:Nn ##1 { ##4 } - } - % creates the object with name ##1 - \DeclareDocumentCommand{##1}{og} - { - % the actual \##1 command - \IfValueTF { ####1 } - { - \IfValueTF { ####2 } - { - \semantex_write_original_source_to_semtex_file:n - { ##1 [ ####1] { ####2 } } - \semantex_render_object:Nn ##1 { - \semantex_object_do_output:N ##1 - \semantex_object_set_keys:Nn ##1 { ####1 } - \semantex_object_set_arg:Nn ##1 { ####2 } - } - } - { - \semantex_write_original_source_to_semtex_file:n - { ##1 [ ####1] } - \semantex_render_object:Nn ##1 { - \semantex_object_do_output:N ##1 - \semantex_object_set_keys:Nn ##1 { ####1 } - } - } - } - { - \IfValueTF { ####2 } - { - \semantex_write_original_source_to_semtex_file:n - { ##1 { ####2 } } - \semantex_render_object:Nn ##1 { - \semantex_object_do_output:N ##1 - \semantex_object_set_arg:Nn ##1 { ####2 } - } - } - { - \semantex_write_original_source_to_semtex_file:n - { ##1 } - \semantex_render_object:Nn ##1 { } - } - } - } + \semantex_declare_variable_class:N #1 } } -\cs_set_eq:NN\NewDelimiterClass\semantex_new_delimiter_class:Nw - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % COMMANDS FOR CREATING AND HANDLING CLASSES AND OJBECTS @@ -1251,33 +492,48 @@ \cs_new:Npn\semantex_class_to_register:N#1 { % #1 = name of class - class_\cs_to_str:N #1 + class_\token_to_str:N #1 } \cs_new:Npn\semantex_class_to_associated_object_register:N#1 { % #1 = name of class - object_associated_to_class_\cs_to_str:N #1 + object_associated_to_class_\token_to_str:N #1 } \cs_new:Npn\semantex_object_to_register:N#1 { % #1 = name of object - object_\cs_to_str:N #1 + object_\token_to_str:N #1 } -\DeclareDocumentCommand\NewObject { m } +\tl_new:N \g_semantex_class_SemantexBaseObject_register_tl + +\tl_set:Nx \g_semantex_class_SemantexBaseObject_register_tl { \semantex_class_to_register:N \SemantexBaseObject } + +\DeclareDocumentCommand\DeclareObject { m m } { % #1 = name of object \semantex_class_if_exist:NTF #1 { - \use:c { __semantex_new_object_of_\semantex_class_to_register:N #1:Nw } + \use:c { __semantex_declare_object_of_\semantex_class_to_register:N #1:Nw } #2 } { \msg_error:nnn { semantex } { created_object_of_unknown_class } { #1 } } } +\DeclareDocumentCommand\NewObject { m m } +{ + \cs_if_exist:NTF #2 + { + \msg_error:nnn { semantex } { created_object_with_already_defined_name } { #2 } + } + { + \DeclareObject #1 #2 + } +} + \DeclareDocumentCommand\UseClassInCommand { mo } { \semantex_class_if_exist:NTF #1 @@ -1306,7 +562,7 @@ \semantex_data_tl_provide:nn { #1 } { parent } - \semantex_data_tl_set:nnn { #1 } { parent } { class_SemantexBaseObject } + \semantex_data_tl_set:nno { #1 } { parent } { \g_semantex_class_SemantexBaseObject_register_tl } % The parent class by default is \SemantexBaseObject \cs_set:cpn { __semantex_data_cs_#1_valuekey:nn } ##1##2 % command controlling valuekeys @@ -1339,7 +595,7 @@ \cs_generate_variant:Nn \semantex_new_register:nn { xn } -\cs_new_protected:Npn \semantex_new_class:Nn#1#2 +\cs_new_protected:Npn \semantex_declare_class:Nn#1#2 { % create a new class % #1 = name of class @@ -1357,7 +613,24 @@ } } -\cs_set_protected:Npn \semantex_new_object:NNn#1#2#3 +\cs_new_protected:Npn \semantex_new_class_and_do:NNnn#1#2#3#4 +{ + % create a new class + % #1 = name of class + % #2 = name of \Declare...Class variant of command, for error messages + % #3 = standard keyval setup + % #4 = code to execute if successful + \cs_if_exist:NTF #1 + { + \msg_error:nnnn { semantex } { created_class_with_already_defined_name } { #1 } { #2 } + } + { + \semantex_declare_class:Nn #1 { #3 } + #4 + } +} + +\cs_set_protected:Npn \semantex_declare_object:NNn#1#2#3 { % create a new object % #1 = name of class @@ -1427,56 +700,6 @@ \semantex_valuekey:nnn { \semantex_object_to_register:N #1 } { arg } { #2 } } -\cs_new_protected:Npn\semantex_object_associated_to_class_set_degree_default:Nn#1#2 -{ - \semantex_valuekey:nnn { \semantex_class_to_associated_object_register:N #1 } { degree~default } { #2 } -} - -\cs_new_protected:Npn\semantex_object_set_degree_default:Nn#1#2 -{ - \semantex_valuekey:nnn { \semantex_object_to_register:N #1 } { degree~default } { #2 } -} - -\cs_new_protected:Npn\semantex_object_associated_to_class_use_bullet:N#1 -{ - \semantex_singlekey:nn { \semantex_class_to_associated_object_register:N #1 } { * } -} - -\cs_new_protected:Npn\semantex_object_use_bullet:N#1 -{ - \semantex_singlekey:nn { \semantex_object_to_register:N #1 } { * } -} - -\cs_new_protected:Npn\semantex_object_associated_to_class_use_double_bullet:N#1 -{ - \semantex_singlekey:nn { \semantex_class_to_associated_object_register:N #1 } { * } -} - -\cs_new_protected:Npn\semantex_object_use_double_bullet:N#1 -{ - \semantex_singlekey:nn { \semantex_object_to_register:N #1 } { * } -} - -\cs_new_protected:Npn\semantex_object_associated_to_class_set_left_par:Nn#1#2 -{ - \semantex_data_tl_set:nnn { \semantex_class_to_associated_object_register:N #1 } { left~par } { #2 } -} - -\cs_new_protected:Npn\semantex_object_set_left_par:Nn#1#2 -{ - \semantex_data_tl_set:nnn { \semantex_object_to_register:N #1 } { left~par } { #2 } -} - -\cs_new_protected:Npn\semantex_object_associated_to_class_set_right_par:Nn#1#2 -{ - \semantex_data_tl_set:nnn { \semantex_class_to_associated_object_register:N #1 } { right~par } { #2 } -} - -\cs_new_protected:Npn\semantex_object_set_right_par:Nn#1#2 -{ - \semantex_data_tl_set:nnn { \semantex_object_to_register:N #1 } { right~par } { #2 } -} - \cs_new_protected:Npn\semantex_object_associated_to_class_set_class:Nn#1#2 { \semantex_data_class_set:nn { \semantex_class_to_associated_object_register:N #1 } { #2 } @@ -2449,7 +1672,7 @@ \use:c { g__semantex_data_tl_#1_#2 } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \semantex_msg_error:nnx { #3 } { data_tl_not_found } { #2 } } @@ -2478,7 +1701,7 @@ \exp_not:v { g__semantex_data_tl_#1_#2 } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \semantex_msg_error:nnx { #3 } { data_tl_not_found } { #2 } } @@ -2509,7 +1732,7 @@ \tl_set_eq:Nc #3 { g__semantex_data_tl_#1_#2 } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \semantex_msg_error:nnx { #4 } { data_tl_not_found } { #2 } } @@ -2553,7 +1776,7 @@ \tl_set:cn { g__semantex_data_tl_#1_#2 } { #3 } } -\cs_generate_variant:Nn \semantex_data_tl_set:nnn { nnx } +\cs_generate_variant:Nn \semantex_data_tl_set:nnn { nno, nnx } \cs_new_protected:Npn \semantex_data_tl_put_right:nnn#1#2#3 { @@ -2632,7 +1855,7 @@ \int_use:c { g__semantex_data_int_#1_#2 } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \semantex_msg_error:nnx { #3 } { data_int_not_found } { #2 } } @@ -2642,7 +1865,7 @@ } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \semantex_msg_error:nnx { #3 } { data_int_not_found } { #2 } } @@ -2673,7 +1896,7 @@ \int_set_eq:Nc#3 { g__semantex_data_int_#1_#2 } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \semantex_msg_error:nnx { #4 } { data_int_not_found } { #2 } } @@ -2683,7 +1906,7 @@ } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \semantex_msg_error:nnx { #4 } { data_int_not_found } { #2 } } @@ -2821,7 +2044,7 @@ \bool_if:cTF { g__semantex_data_bool_#1_if_#2 } { #3 } { #4 } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { #4 } @@ -2831,7 +2054,7 @@ } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \semantex_msg_error:nnx { #5 } { data_bool_not_found } { #2 } } @@ -3003,7 +2226,7 @@ \use:c { __semantex_data_cs_custom_valuekey_#1_#2:nn } { #4 } { #3 } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \semantex_msg_error:nnn { #4 } { valuekey_not_found } { #2 } } @@ -3027,7 +2250,7 @@ % #1 = register % #2 = key % #3 = value - \use:c { __semantex_data_cs_custom_valuekey_class_SemantexBaseObject_#2:nn } { #1 } { #3 } + \use:c { __semantex_data_cs_custom_valuekey_\g_semantex_class_SemantexBaseObject_register_tl _#2:nn } { #1 } { #3 } } \cs_new_protected:Npn\semantex_singlekey:nn#1#2 @@ -3050,7 +2273,7 @@ \use:c { __semantex_data_cs_custom_singlekey_#1_#2:n } { #3 } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \semantex_valuekey:nnn { #3 } { default } { #2 } } @@ -3080,7 +2303,7 @@ % the name of the register } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \semantex_valuekey:nnx { #3 } { default } { #2 } } @@ -3104,7 +2327,7 @@ \exp_args:NNNo \exp_args:NNo\tl_set:No#3 { \use:c { __semantex_data_cs_custom_valuekey_#1_\tl_trim_spaces:n{#2}:nn } { ##1 } { ##2 } } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \tl_set:Nn #3 {} } @@ -3127,7 +2350,7 @@ \exp_args:NNNo \exp_args:NNo\tl_set:No#3 { \use:c { __semantex_data_cs_custom_singlekey_#1_\tl_trim_spaces:n{#2}:n } { ##1 } } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \tl_set:Nn #3 {} } @@ -3151,7 +2374,7 @@ \exp_args:NNNo \exp_args:NNo\tl_set:No#3 { \use:c { __semantex_data_cs_custom_two_valuekey_#1_\tl_trim_spaces:n{#2}_auxiliary:nnn } { ##1 } { ##2 } { ##3 } } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \tl_set:Nn #3 {} } @@ -3175,7 +2398,7 @@ \exp_args:NNNo \exp_args:NNo\tl_set:No#3 { \use:c { __semantex_data_cs_custom_three_valuekey_#1_\tl_trim_spaces:n{#2}_auxiliary:nnnn } { ##1 } { ##2 } { ##3 } { ##4 } } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \tl_set:Nn #3 {} } @@ -3199,7 +2422,7 @@ \exp_args:NNNo \exp_args:NNo\tl_set:No#3 { \use:c { __semantex_data_cs_custom_four_valuekey_#1_\tl_trim_spaces:n{#2}_auxiliary:nnnnn } { ##1 } { ##2 } { ##3 } { ##4 } { ##5 } } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \tl_set:Nn #3 {} } @@ -3223,7 +2446,7 @@ \exp_args:NNNo \exp_args:NNo\tl_set:No#3 { \use:c { __semantex_data_cs_custom_five_valuekey_#1_\tl_trim_spaces:n{#2}_auxiliary:nnnnnn } { ##1 } { ##2 } { ##3 } { ##4 } { ##5 } { ##6 } } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \tl_set:Nn #3 {} } @@ -3247,7 +2470,7 @@ \exp_args:NNNo \exp_args:NNo\tl_set:No#3 { \use:c { __semantex_data_cs_custom_six_valuekey_#1_\tl_trim_spaces:n{#2}_auxiliary:nnnnnnn } { ##1 } { ##2 } { ##3 } { ##4 } { ##5 } { ##6 } { ##7 } } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \tl_set:Nn #3 {} } @@ -3271,7 +2494,7 @@ \exp_args:NNNo \exp_args:NNo\tl_set:No#3 { \use:c { __semantex_data_cs_custom_seven_valuekey_#1_\tl_trim_spaces:n{#2}_auxiliary:nnnnnnnn } { ##1 } { ##2 } { ##3 } { ##4 } { ##5 } { ##6 } { ##7 } { ##8 } } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \tl_set:Nn #3 {} } @@ -3295,7 +2518,7 @@ \exp_args:NNNo \exp_args:NNo\tl_set:No#3 { \use:c { __semantex_data_cs_custom_eight_valuekey_#1_\tl_trim_spaces:n{#2}_auxiliary:nnnnnnnnn } { ##1 } { ##2 } { ##3 } { ##4 } { ##5 } { ##6 } { ##7 } { ##8 } { ##9 } } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \tl_set:Nn #3 {} } @@ -3319,7 +2542,7 @@ \exp_args:NNNo \exp_args:NNo\tl_set:No#3 { \use:c { __semantex_data_cs_custom_nine_valuekey_#1_\tl_trim_spaces:n{#2}_auxiliary:nnnnnnnnn } { ##1 } { ##2 } { ##3 } { ##4 } { ##5 } { ##6 } { ##7 } { ##8 } { ##9 } } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \tl_set:Nn #3 {} } @@ -3349,7 +2572,7 @@ \use:c { __semantex_data_cs_custom_arg_valuekey_#1_#2:nn } { #4 } { #3 } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \semantex_msg_error:nnn { #1 } { arg_valuekey_not_found } { #2 } } @@ -3379,7 +2602,7 @@ \use:c { __semantex_data_cs_custom_arg_singlekey_#1_#2:n } { #3 } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \semantex_arg_valuekey:nnn { #3 } { default } { #2 } } @@ -3409,7 +2632,7 @@ % the name of the register } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \semantex_arg_valuekey:nnx { #3 } { default } { #2 } } @@ -3443,7 +2666,7 @@ \exp_args:NNNo \exp_args:NNo\tl_set:No#3 { \use:c { __semantex_data_cs_custom_arg_valuekey_#1_\tl_trim_spaces:n{#2}:nn } { ##1 } { ##2 } } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \tl_set:Nn #3 {} } @@ -3466,7 +2689,7 @@ \exp_args:NNNo \exp_args:NNo\tl_set:No#3 { \use:c { __semantex_data_cs_custom_arg_singlekey_#1_\tl_trim_spaces:n{#2}:n } { ##1 } } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \tl_set:Nn #3 {} } @@ -3490,7 +2713,7 @@ \exp_args:NNNo \exp_args:NNo\tl_set:No#3 { \use:c { __semantex_data_cs_custom_arg_two_valuekey_#1_\tl_trim_spaces:n{#2}_auxiliary:nnn } { ##1 } { ##2 } { ##3 } } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \tl_set:Nn #3 {} } @@ -3514,7 +2737,7 @@ \exp_args:NNNo \exp_args:NNo\tl_set:No#3 { \use:c { __semantex_data_cs_custom_arg_three_valuekey_#1_\tl_trim_spaces:n{#2}_auxiliary:nnnn } { ##1 } { ##2 } { ##3 } { ##4 } } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \tl_set:Nn #3 {} } @@ -3538,7 +2761,7 @@ \exp_args:NNNo \exp_args:NNo\tl_set:No#3 { \use:c { __semantex_data_cs_custom_arg_four_valuekey_#1_\tl_trim_spaces:n{#2}_auxiliary:nnnnn } { ##1 } { ##2 } { ##3 } { ##4 } { ##5 } } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \tl_set:Nn #3 {} } @@ -3562,7 +2785,7 @@ \exp_args:NNNo \exp_args:NNo\tl_set:No#3 { \use:c { __semantex_data_cs_custom_arg_five_valuekey_#1_\tl_trim_spaces:n{#2}_auxiliary:nnnnnn } { ##1 } { ##2 } { ##3 } { ##4 } { ##5 } { ##6 } } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \tl_set:Nn #3 {} } @@ -3586,7 +2809,7 @@ \exp_args:NNNo \exp_args:NNo\tl_set:No#3 { \use:c { __semantex_data_cs_custom_arg_six_valuekey_#1_\tl_trim_spaces:n{#2}_auxiliary:nnnnnnn } { ##1 } { ##2 } { ##3 } { ##4 } { ##5 } { ##6 } { ##7 } } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \tl_set:Nn #3 {} } @@ -3610,7 +2833,7 @@ \exp_args:NNNo \exp_args:NNo\tl_set:No#3 { \use:c { __semantex_data_cs_custom_arg_seven_valuekey_#1_\tl_trim_spaces:n{#2}_auxiliary:nnnnnnnn } { ##1 } { ##2 } { ##3 } { ##4 } { ##5 } { ##6 } { ##7 } { ##8 } } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \tl_set:Nn #3 {} } @@ -3634,7 +2857,7 @@ \exp_args:NNNo \exp_args:NNo\tl_set:No#3 { \use:c { __semantex_data_cs_custom_arg_eight_valuekey_#1_\tl_trim_spaces:n{#2}_auxiliary:nnnnnnnnn } { ##1 } { ##2 } { ##3 } { ##4 } { ##5 } { ##6 } { ##7 } { ##8 } { ##9 } } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \tl_set:Nn #3 {} } @@ -3658,7 +2881,7 @@ \exp_args:NNNo \exp_args:NNo\tl_set:No#3 { \use:c { __semantex_data_cs_custom_arg_nine_valuekey_#1_\tl_trim_spaces:n{#2}_auxiliary:nnnnnnnnn } { ##1 } { ##2 } { ##3 } { ##4 } { ##5 } { ##6 } { ##7 } { ##8 } { ##9 } } } { - \str_if_eq:nnTF { #1 } { class_SemantexBaseObject } + \str_if_eq:nVTF { #1 } \g_semantex_class_SemantexBaseObject_register_tl { \tl_set:Nn #3 {} } @@ -7050,49 +6273,53 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\msg_new:nnnn { semantex } { semantex_setup_key_not_found } { Unknown~key~#1~passed~to~\SemantexSetup~on~line~\msg_line_number: } {} +\msg_new:nnnn { semantex } { semantex_setup_key_not_found } { Unknown~key~#1~passed~to~\token_to_str:N\SemantexSetup~on~line~\msg_line_number: } {} + +\msg_new:nnnn { semantex } { semantex_setup_key_value_not_found } { Unknown~value~#2~passed~to~key~#1~in~\token_to_str:N\SemantexSetup~on~line~\msg_line_number: } {} + +\msg_new:nnnn { semantex } { valuekey_not_found } { Unknown~key~#2~passed~to~#1~on~line~\msg_line_number: } {} -\msg_new:nnnn { semantex } { semantex_setup_key_value_not_found } { Unknown~value~#2~passed~to~key~#1~in~\SemantexSetup~on~line~\msg_line_number: } {} +\msg_new:nnnn { semantex } { arg_valuekey_not_found } { Unknown~argument~key~#2~passed~to~#1~on~line~\msg_line_number: } {} -\msg_new:nnnn { semantex } { valuekey_not_found } { Unknown~key~#2~passed~to~#1 on~line~\msg_line_number: } {} +\msg_new:nnnn { semantex } { data_tl_not_found } { Unknown~data~#2~requested~from~#1~on~line~\msg_line_number: } {} -\msg_new:nnnn { semantex } { arg_valuekey_not_found } { Unknown~argument~key~#2~passed~to~#1on~line~\msg_line_number: } {} +\msg_new:nnnn { semantex } { data_int_not_found } { Unknown~integer~#2~requested~from~#1~on~line~\msg_line_number: } {} -\msg_new:nnnn { semantex } { data_tl_not_found } { Unknown~data~#2~requested~from~#1 on~line~\msg_line_number: } {} +\msg_new:nnnn { semantex } { data_bool_not_found } { Unknown~boolean~#2~requested~from~#1~on~line~\msg_line_number: } {} -\msg_new:nnnn { semantex } { data_int_not_found } { Unknown~integer~#2~requested~from~#1 on~line~\msg_line_number: } {} +\msg_new:nnnn { semantex } { data_cs_not_found } { Unknown~command~sequence~#2~requested~from~#1~on~line~\msg_line_number: } {} -\msg_new:nnnn { semantex } { data_bool_not_found } { Unknown~boolean~#2~requested~from~#1 on~line~\msg_line_number: } {} +\msg_new:nnnn { semantex } { data_prop_not_found } { Unknown~property~list~#2~requested~from~#1~on~line~\msg_line_number: } {} -\msg_new:nnnn { semantex } { data_cs_not_found } { Unknown~command~sequence~#2~requested~from~#1 on~line~\msg_line_number: } {} +\msg_new:nnnn { semantex } { key_value_not_found } { Unknown~value~#3~passed~to~key~#2~in~#1~on~line~\msg_line_number: } {} -\msg_new:nnnn { semantex } { data_prop_not_found } { Unknown~property~list~#2~requested~from~#1 on~line~\msg_line_number: } {} +\msg_new:nnnn { semantex } { arg_key_value_not_found } { Unknown~value~#3~passed~to~argument~key~#2~in~#1~on~line~\msg_line_number: } {} -\msg_new:nnnn { semantex } { key_value_not_found } { Unknown~value~#3~passed~to~key~#2~in~#1 on~line~\msg_line_number: } {} +\msg_new:nnnn { semantex } { class_already_defined } { Class~#1~already~defined;~you~tried~defining~it~again~on~line~\msg_line_number: } {} -\msg_new:nnnn { semantex } { arg_key_value_not_found } { Unknown~value~#3~passed~to~argument~key~#2~in~#1 on~line~\msg_line_number: } {} +\msg_new:nnnn { semantex } { object_already_defined } { Object~#1~already~defined;~you~tried~defining~it~again~on~line~\msg_line_number: } {} -\msg_new:nnnn { semantex } { class_already_defined } { Class~#1 already~defined;~you~tried~defining~it~again~on~line~\msg_line_number: } {} +\msg_new:nnnn { semantex } { class_not_found } { Unknown~class~#3~declared~as~#2~of~#1~on~line~\msg_line_number: } {} -\msg_new:nnnn { semantex } { object_already_defined } { Object~#1 already~defined;~you~tried~defining~it~again~on~line~\msg_line_number: } {} +\msg_new:nnnn { semantex } { object_not_found } { You~set~#1~as~#2~of~unknown~object~#3~on~line~\msg_line_number: } {} -\msg_new:nnnn { semantex } { class_not_found } { Unknown~class~#3 declared~as~#2~of~#1 on~line~\msg_line_number: } {} +\msg_new:nnnn { semantex } { created_object_of_unknown_class } { Unknown~class~#1~declared~as~class~of~#2~on~line~\msg_line_number: } {} -\msg_new:nnnn { semantex } { object_not_found } { You~set~#1 as~#2~of~unknown~object~#3 on~line~\msg_line_number: } {} +\msg_new:nnnn { semantex } { created_object_with_already_defined_name } { Command~#1~already~defined;~you~can~use~\token_to_str:N\DeclareObject~to~override~existing~commands. } {} -\msg_new:nnnn { semantex } { created_object_of_unknown_class } { Unknown~class~#1 declared~as~class~of~#2 on~line~\msg_line_number: } {} +\msg_new:nnnn { semantex } { created_class_with_already_defined_name } { Command~#1~already~defined;~you~can~use~\token_to_str:N #2~to~override~existing~commands. } {} -\msg_new:nnnn { semantex } { used_unknown_class } { Unknown~class~#1 received~by~\token_to_str:N\UseClassInCommand~on~line~\msg_line_number: } {} +\msg_new:nnnn { semantex } { used_unknown_class } { Unknown~class~#1~received~by~\token_to_str:N\UseClassInCommand~on~line~\msg_line_number: } {} -\msg_new:nnnn { semantex } { setup_unknown_class } { You~tried~setting~up~an~unknown~#1 on~line~\msg_line_number: } {} +\msg_new:nnnn { semantex } { setup_unknown_class } { You~tried~setting~up~an~unknown~#1~on~line~\msg_line_number: } {} -\msg_new:nnnn { semantex } { setup_unknown_object } { You~tried~setting~up~an~unknown~#1 on~line~\msg_line_number: } {} +\msg_new:nnnn { semantex } { setup_unknown_object } { You~tried~setting~up~an~unknown~#1~on~line~\msg_line_number: } {} \msg_new:nnnn { semantex } { created_a_SemantexBaseObject } { Never~create~objects~of~class~\token_to_str:N\SemantexBaseObject;~create~a~new~class~yourself~instead.~You~created~the~object~#1 on~line~\msg_line_number: } {} \msg_new:nnnn { semantex } { SemantexThis_in_input_stream } { The~command~\token_to_str:N\SemantexThis~was~found~outside~a~class~or~object~on~line~\msg_line_number:;~did~you~forget~to~use~set~keys~x={...}? } {} -\msg_new:nnnn { semantex } { generic_error } { #2~#1 on~line~\msg_line_number: } {} +\msg_new:nnnn { semantex } { generic_error } { #2~#1~on~line~\msg_line_number: } {} \cs_generate_variant:Nn \msg_error:nnnn { nnnx } @@ -7101,10 +6328,9 @@ \cs_new_protected:Npn\semantex_error_output_format:nN#1#2 { \tl_set:Nn \l__semantex_error_output_format_temp { #1 } - \tl_replace_all:Nnn \l__semantex_error_output_format_temp { object_associated_to_class_ } { object~of~class~\cs:w } - \tl_replace_all:Nnn \l__semantex_error_output_format_temp { object_ } { object~\cs:w } - \tl_replace_all:Nnn \l__semantex_error_output_format_temp { class_ } { class~\cs:w } - \tl_put_right:Nn \l__semantex_error_output_format_temp { \cs_end: } + \tl_replace_all:Nnn \l__semantex_error_output_format_temp { object_associated_to_class_ } { object~of~class~ } + \tl_replace_all:Nnn \l__semantex_error_output_format_temp { object_ } { object~ } + \tl_replace_all:Nnn \l__semantex_error_output_format_temp { class_ } { class~ } \tl_trim_spaces:N \l__semantex_error_output_format_temp \tl_set_eq:NN #2 \l__semantex_error_output_format_temp } @@ -7172,7 +6398,7 @@ {define~keys[1]}{execute={ \semantex_define_valuekeys:nn { ##1 } { #1 } }}, } -\semantex_new_simple_class:Nw \SemantexBaseObject [ +\NewSimpleClass \SemantexBaseObject [ define~keys[1]={ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % @@ -7686,7 +6912,6 @@ }, }, {default}{sep~i={#1}}, - {degree~default}{sep~d={#1}}, {arg}{ execute={ \semantex_arg_singlekeys_set:nn { ##1 } { #1 } } }, {*~with~other~sep}{ d~*~with~other~sep={#1}, @@ -9456,12 +8681,12 @@ }, ] -\cs_set_eq:NN\__semantex_old_version_of_semantex_new_object_of_class_SemantexBaseObject:Nw \__semantex_new_object_of_class_SemantexBaseObject:Nw +\cs_set_eq:cc { __semantex_old_version_of_semantex_declare_object_of_\g_semantex_class_SemantexBaseObject_register_tl :Nw } { __semantex_declare_object_of_\g_semantex_class_SemantexBaseObject_register_tl :Nw } -\cs_set_protected:Npn \__semantex_new_object_of_class_SemantexBaseObject:Nw#1 +\cs_set_protected:Npn \__semantex_declare_object_of_class_SemantexBaseObject:Nw#1 { \msg_error:nnn { semantex } { created_a_SemantexBaseObject } { #1 } - \__semantex_old_version_of_semantex_new_object_of_class_SemantexBaseObject:Nw #1 + \use:c { __semantex_old_version_of_semantex_declare_object_of_\g_semantex_class_SemantexBaseObject_register_tl :Nw } #1 } diff --git a/macros/latex/contrib/semantex/semantex.tex b/macros/latex/contrib/semantex/semantex.tex index 3b2630da08..a377e0f217 100644 --- a/macros/latex/contrib/semantex/semantex.tex +++ b/macros/latex/contrib/semantex/semantex.tex @@ -42,19 +42,6 @@ \usepackage[nameinlink]{cleveref} -\title{Seman\!\TeX: semantic, keyval-based mathematics (v0.513)} -\date{\today} -\author{Sebastian Ørsted (\href{mailto:sorsted@gmail.com}{sorsted@gmail.com})} - -\hypersetup{ - pdfauthor={Sebastian Ørsted}, - pdftitle={SemanTeX: semantic, keyval-based mathematics}, - %pdfsubject={}, - %pdfkeywords={}, - %pdfproducer={Latex with hyperref, or other system}, - %pdfcreator={pdflatex, or other tool}, -} - \usepackage{showexpl} \lstset{% @@ -103,6 +90,19 @@ \usepackage{semantex} +\title{Seman\!\TeX: semantic, keyval-based mathematics (v\SemantexVersion)} +\date{\today} +\author{Sebastian Ørsted (\href{mailto:sorsted@gmail.com}{sorsted@gmail.com})} + +\hypersetup{ + pdfauthor={Sebastian Ørsted}, + pdftitle={SemanTeX: semantic, keyval-based mathematics (v\SemantexVersion)}, + %pdfsubject={}, + %pdfkeywords={}, + %pdfproducer={Latex with hyperref, or other system}, + %pdfcreator={pdflatex, or other tool}, +} + \SemantexSetup{ semtex file=true, } @@ -1761,7 +1761,7 @@ by default, so we shall have to turn them on first: } \end{lstlisting} The key \lstinline!other sep! is a key that controls the separator -between the current argument and the previous argument (it will only be printed if there was a previous argument). By default, this separator is a comma. So in the syntax~\lstinline!\co{*}{\vX,coef=\vR}!, +between the current argument and the previous argument (it will only be printed if there was a previous argument). By default, this separator is a comma. So in the syntax~\lstinline!\co[*]{\vX,coef=\vR}!, there are two arguments, \lstinline!\vX! and~\lstinline!\vR!, and the separator is a semicolon. We shall later (see~\cref{ch:parse_coho_coef}) see another, possibly more natural way to write cohomology with coefficients, and which avoids turning on keyval syntax in the argument. @@ -1867,7 +1867,9 @@ $ \vP[command=\overline,return, upper left=*] $ \end{LTXexample} -\chapter{The \texorpdfstring{\texttt{Symbol}}{Symbol} class type (Example: Derived tensor products and fibre products)} +\chapter{The \texorpdfstring{\texttt{Symbol}}{Symbol} class type (Example: Derived tensor products and fibre products)}\label{chap:symbol_class} + +\begingroup \NewSymbolClass\MyBinaryOperator[ define keys={ @@ -1933,6 +1935,12 @@ $\vX[*] \tensor[\vR] \vY[*]$ $\vk \tensor[\vA,der] \vk$, $\vX \fibre[\vY,der] \vX$ \end{LTXexample} +Later (in~\cref{sec:smart_binary_operators}), we shall see another, more advanced +solution for binary operators which also allows us to express the application of the operator +on \( \vn \)~elements. + + +\endgroup \chapter{Paired delimiters} @@ -1977,12 +1985,12 @@ $\norm[\infty]{\vx}$ We can also create for more complicated constructions, like sets. The following is inspired from the \pack{mathtools} package where a similar construction is created using the commands from that package. My impression is that Lars Madsen is the main mastermind behind the code I use for the \lstinline!\where!~construction: \begin{lstlisting} -\newcommand\wherecommand[1]{ - \nonscript\: +\newcommand\wherecommand[1]{% + \nonscript\:% #1\vert \allowbreak - \nonscript\: - \mathopen{} + \nonscript\:% + \mathopen{}% } \NewObject\MyVar\where{ \wherecommand{\SemantexDelimiterSize} } @@ -1995,12 +2003,12 @@ The following is inspired from the \pack{mathtools} package where a similar cons % this turns off all keyval syntax in the argument ] \end{lstlisting} -\newcommand\wherecommand[1]{ - \nonscript\: +\newcommand\wherecommand[1]{% + \nonscript\:% #1\vert \allowbreak - \nonscript\: - \mathopen{} + \nonscript\:% + \mathopen{}% } \NewObject\MyVar\where{ \wherecommand{\SemantexDelimiterSize} } @@ -2848,6 +2856,104 @@ As you see, we use the \lstinline!d!~key to tell the command what superscript it \] \end{LTXexample} +\section{Example: Smart binary operators}\label{sec:smart_binary_operators} + +\begingroup + +\NewVariableClass\MyBinaryOperator[ + set arg dots=\dotsb, + never par, + prepend keys[1]={ + {arg}{ + return, + set keys x={ + set arg sep=\SemantexDataGetExpNot{symbol}, + }, + }, + }, + parse options={ + int if greater T={ \SemantexIntGet{number of arguments} } { 0 } + { + symbol={}, + output=\MyVar, + }, + }, +] + +\NewObject\MyBinaryOperator\mult{\cdot} +\NewObject\MyBinaryOperator\tensor{\otimes} + +\NewVariableClass\InvisibleBinaryOperator[parent=\MyBinaryOperator, set arg dots=\dotsm] +\NewObject\InvisibleBinaryOperator\invmult{} +\NewObject\InvisibleBinaryOperator\spacemult{\,} + +In~\cref{chap:symbol_class}, we saw a simple solution for binary operators using the \lstinline!Symbol!~class. +But that solution only printed the operator itself. However, in semantic markup systems, it is ofen desirable +to also be able to explicitly typeset applications of the operator on \( \vn \)~arguments, like this: +\begin{LTXexample} +Applying the tensor product~$\tensor$ to $\vn$~elements, we get +\[ + \tensor{ \vx[1], \vx[2], ..., + \vx[\vn] }. +\] +Applying the multiplication operator~$\mult$ to $\vn$~elements, we get +\[ + \mult{ \vx[1], \vx[2], ..., + \vx[\vn] }. +\] +\end{LTXexample} + +This can be accomplished using the \lstinline!parse!~routine as follows: + +\begin{lstlisting} +\NewVariableClass\MyBinaryOperator[ + set arg dots=\dotsb, + never par, + prepend keys[1]={ + {arg}{ + return, + set keys x={ + set arg sep=\SemantexDataGetExpNot{symbol}, + }, + }, + }, + parse options={ + int if greater T={ \SemantexIntGet{number of arguments} } { 0 } + { + symbol={}, + output=\MyVar, + }, + }, +] + +\NewObject\MyBinaryOperator\tensor{\otimes} +\NewObject\MyBinaryOperator\mult{\cdot} +\end{lstlisting} + +In mathematical texts, the multiplication symbols in that last equation would usually be omitted. +However, if we want to make the syntax fully semantic, we should also type these multiplication operators explicitly, even if they will be invisible in the final output. +We do this by changing the argument dots and creating an object with an empty symbol. +Alternatively, if we want to insert a space between the variables being multiplied, +we can set the symbol to~\lstinline!\,!: +\begin{lstlisting} +\NewVariableClass\InvisibleBinaryOperator[parent=\MyBinaryOperator, + set arg dots=\dotsm] +\NewObject\InvisibleBinaryOperator\invmult{} +\NewObject\InvisibleBinaryOperator\spacemult{\,} +\end{lstlisting} +\begin{LTXexample} +In mathematical texts, we denote the product of \( \vn \)~elements simply by +\[ + \invmult{ \vx[1], \vx[2], ..., + \vx[\vn] } + = + \spacemult{ \vx[1], \vx[2], ..., + \vx[\vn] }. +\] +\end{LTXexample} + +\endgroup + \chapter{\texorpdfstring{\texttt{stripsemantex}}{stripsemantex} -- stripping your document of \texorpdfstring{\semantex}{SemanTeX} markup} \semantex{} is a big, heavy package, and it might raise eyebrows if you try using it in submissions to journals. On top of that, \url{arXiv.org} @@ -2993,7 +3099,7 @@ Let us take a look at the commands defined by \pack{semtex}: \mylst!\SemantexDoubleBullet! The commands that contain the bullets we use in \semantex, - i.e.~the superscript in~\( \co{*} \). + i.e.~the superscript in~\( \co[*] \). These bullets are smaller (and prettier, in my opinion) than the standard \lstinline!\bullet! command from~\LaTeX. @@ -3053,8 +3159,8 @@ Suppose in the following that you \TeX\ document is called~\texttt{mydoc.tex}. After this step, another document will have been created in the same folder, called~\lstinline!mydoc_prestripped.tex!. It will look just like \texttt{mydoc.tex}, - but in the document body, each \semantex{} markup command will now - have a command \mylst!\SemantexIDcommand{$\$}! + but in the document body, each command defined using \semantex{} will now + have an expression of the form~\mylst!\SemantexID{$\$}! preceding it. \item\label{pt:pre_strip_point} @@ -3079,6 +3185,9 @@ Suppose in the following that you \TeX\ document is called~\texttt{mydoc.tex}. left. You will then have to remove these few commands from your document manually. \end{enumerate} +\newpage +\section{Stripping comments from the document} + Apart from the machinery for stripping \semantex{} markup from documents, the package \pack{stripsemantex} also provides the command~\lstinline!\StripSemantexStripComments!, which is in principle completely unrelated to \semantex{} itself. @@ -3583,14 +3692,6 @@ In the following sections, we include the full list. e.g.~the~\lstinline!1! in~\lstinline!\vf[1]!. By default, this keys has been set to be equal to~\lstinline!sep i!, but it is meant to be changeable by the user. - - \item - \mylst!degree default={$\$}! - - This is the key where the grading goes. - It is the one used by the (now deprecated) \lstinline!Cohomology! class type. - By default, this key has been set to be equal to~\lstinline!sep d!, - but it is meant to be changeable by the user. \item \mylst!*! @@ -5701,39 +5802,6 @@ Let me add that \semantex{} uses a very clear separation between the input synta The last class type, called \lstinline!Simple!, is the class type of the class~\lstinline!\SemantexBaseObject!. This class is pretty useless as all it does is print its symbol, without allowing any keyval syntax. So you simply should not use it. -There are also a few extra class types which are now deprecated, as their syntax will only cause confusion. -They are still included for backwards compatibility, but I highly discourage their use: - -\begin{itemize} - \item \lstinline!Cohomology!: - A new class is declared with the - syntax - \begin{lstlisting} - \NewCohomologyClass@\usercommand\@[@\@] - \end{lstlisting} - A new object is declared by - \begin{lstlisting} - \NewObject@\usercommand\@@\usercommand\@{@\@}[@\@] - \end{lstlisting} - The syntax for this object is - \begin{lstlisting} - @\usercommand\@[@\@]{@\@}{@\@} - \end{lstlisting} - \item \lstinline!Delimiter!: - A new class is declared with the syntax - \begin{lstlisting} - \NewDelimiterClass@\usercommand\@[@\@] - \end{lstlisting} - A new object is declared by - \begin{lstlisting} - \NewObject@\usercommand\@@\usercommand\@{@\@}{@\@}[@\@] - \end{lstlisting} - The syntax for this object is - \begin{lstlisting} - @\usercommand\@[@\@]{@\@} - \end{lstlisting} -\end{itemize} - \section{The predefined data} By default, the following data are defined for each class or object and are accessible via @@ -5773,7 +5841,7 @@ the programming keys and commands: \lstinline!par size! (token list): the size of the argument parentheses. - Here, the value~\lstinline!normal! means normal size + The value~\lstinline!normal! means normal size parentheses, \lstinline!auto! and~\lstinline!*! mean auto-scaled parentheses using~\lstinline!\left ...\right!. @@ -5796,7 +5864,7 @@ the programming keys and commands: \lstinline!spar size! (token list): the size of the symbol parentheses (for use with the \lstinline!spar!~routine). - Here, the value~\lstinline!normal! means normal size + The value~\lstinline!normal! means normal size parentheses, \lstinline!auto! and~\lstinline!*! mean auto-scaled parentheses using~\lstinline!\left ...\right!. diff --git a/macros/latex/contrib/semantex/stripsemantex.lua b/macros/latex/contrib/semantex/stripsemantex.lua index f50648dd23..30d4c58be6 100644 --- a/macros/latex/contrib/semantex/stripsemantex.lua +++ b/macros/latex/contrib/semantex/stripsemantex.lua @@ -55,7 +55,7 @@ end addIDsToRegisters = function(str) str = removeStricttexFormatting(str) - content = content:gsub('\\' .. str .. '([^%a])' ,'\\SemantexIDcommand{}\\' .. str .. '%1') + content = content:gsub('\\' .. str .. '([^%a])' ,'\\SemantexID{}\\' .. str .. '%1') -- '%f[^%a]' does not work here, as it will not react if the last character of str is a number, -- which stricttex allows. -- Because of this choice, there will be an issue if you use stricttex and let @@ -64,33 +64,33 @@ addIDsToRegisters = function(str) end removeSuperfluousIDs = function() - local p = content:find('([^\\]%%[^\n]-)\\SemantexIDcommand{}([^\n]-\n)') + local p = content:find('([^\\]%%[^\n]-)\\SemantexID{}([^\n]-\n)') while p do - content = content:gsub('([^\\]%%[^\n]-)\\SemantexIDcommand{}([^\n]-\n)','%1%2') - p = content:find('([^\\]%%[^\n]-)\\SemantexIDcommand{}([^\n]-\n)') + content = content:gsub('([^\\]%%[^\n]-)\\SemantexID{}([^\n]-\n)','%1%2') + p = content:find('([^\\]%%[^\n]-)\\SemantexID{}([^\n]-\n)') end - content = content:gsub('parent(%s*)=(%s*)\\SemantexIDcommand{}','parent%1=%2') - content = content:gsub('class(%s*)=(%s*)\\SemantexIDcommand{}','class%1=%2') - content = content:gsub('clone(%s*)=(%s*)\\SemantexIDcommand{}','clone%1=%2') - content = content:gsub('copy(%s*)=(%s*)\\SemantexIDcommand{}','copy%1=%2') - content = content:gsub('\\New(%w+)Class(%s*{?)\\SemantexIDcommand{}','\\New%1Class%2') - content = content:gsub('\\NewObject(%s*{?%s*)\\SemantexIDcommand{}(\\%w+%s*}?%s*{?%s*)\\SemantexIDcommand{}', '\\NewObject%1%2') - content = content:gsub('\\SetupClass(%s*{?%s*)\\SemantexIDcommand{}', '\\SetupClass%1') - content = content:gsub('\\SetupObject(%s*{?%s*)\\SemantexIDcommand{}', '\\SetupObject%1') + content = content:gsub('parent(%s*)=(%s*)\\SemantexID{}','parent%1=%2') + content = content:gsub('class(%s*)=(%s*)\\SemantexID{}','class%1=%2') + content = content:gsub('clone(%s*)=(%s*)\\SemantexID{}','clone%1=%2') + content = content:gsub('copy(%s*)=(%s*)\\SemantexID{}','copy%1=%2') + content = content:gsub('\\New(%w+)Class(%s*{?)\\SemantexID{}','\\New%1Class%2') + content = content:gsub('\\NewObject(%s*{?%s*)\\SemantexID{}(\\%w+%s*}?%s*{?%s*)\\SemantexID{}', '\\NewObject%1%2') + content = content:gsub('\\SetupClass(%s*{?%s*)\\SemantexID{}', '\\SetupClass%1') + content = content:gsub('\\SetupObject(%s*{?%s*)\\SemantexID{}', '\\SetupObject%1') end addNumbersToIDs = function() local n = 0 - local p,q = string.find(content,'\\SemantexIDcommand{}') + local p,q = string.find(content,'\\SemantexID{}') while q do n = n + 1 content = content:sub(1,q-1) .. n .. content:sub(q,-1) - p, q = string.find(content,'\\SemantexIDcommand{}') + p, q = string.find(content,'\\SemantexID{}') end end semantexIDluacommand = function(id, source, output) - local p, q = string.find(content, '\\SemantexIDcommand{' .. id .. '}') + local p, q = string.find(content, '\\SemantexID{' .. id .. '}') while p do content = content:sub(1,p-1) .. content:sub(q+1,-1) @@ -228,12 +228,12 @@ semantexIDluacommand = function(id, source, output) else content = content:sub(1,p-1) .. output .. content:sub(p,-1) end - p, q = string.find(content, '\\SemantexIDcommand{' .. id .. '}') + p, q = string.find(content, '\\SemantexID{' .. id .. '}') end end stripRemainingSemantexIDs = function() - content = content:gsub('\\SemantexIDcommand{%d+}', '') + content = content:gsub('\\SemantexID{%d+}', '') end removeParenthesisCommands = function() diff --git a/macros/latex/contrib/semantex/stripsemantex.sty b/macros/latex/contrib/semantex/stripsemantex.sty index 4e5dafc2ee..1dd814689c 100644 --- a/macros/latex/contrib/semantex/stripsemantex.sty +++ b/macros/latex/contrib/semantex/stripsemantex.sty @@ -1,5 +1,5 @@ \RequirePackage{xparse} -\ProvidesExplPackage{stripsemantex}{2021/08/23}{0.513}{} +\ProvidesExplPackage{stripsemantex}{2022/09/22}{0.530}{} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % @@ -40,12 +40,12 @@ openFile('\lua_escape:e{#1}_prestripped.tex') } - \cs_set:Npn\DeclareObject##1 + \cs_set:Npn\RegisterObject##1 { \lua_now:e { addIDsToRegisters ( '\cs_to_str:N ##1' ) } } - \cs_set:Npn\DeclareClass##1{ + \cs_set:Npn\RegisterClass##1{ \lua_now:e { addIDsToRegisters ( '\cs_to_str:N ##1' ) } } @@ -76,7 +76,7 @@ openFile('\lua_escape:e{#1}_prestripped.tex') } - \DeclareDocumentCommand\SemantexID{ m t{\BeginSource} } + \DeclareDocumentCommand\RegisterID{ m t{\BeginSource} } { \IfBooleanT{##2} { @@ -94,9 +94,9 @@ } } - \cs_set:Npn\DeclareObject##1{} + \cs_set:Npn\RegisterObject##1{} - \cs_set:Npn\DeclareClass##1{} + \cs_set:Npn\RegisterClass##1{} \cs_set:Npn\BeginSource##1\EndSource\BeginOutput##2\EndOutput{} @@ -109,17 +109,17 @@ \bool_if:NTF \g_stripsemantex_something_left_to_strip_bool { - \cs_set:Npn\DeclareObject##1 + \cs_set:Npn\RegisterObject##1 { \lua_now:e { addIDsToRegisters ( '\cs_to_str:N ##1' ) } } - \cs_set:Npn\DeclareClass##1 + \cs_set:Npn\RegisterClass##1 { \lua_now:e { addIDsToRegisters ( '\cs_to_str:N ##1' ) } } - \cs_set:Npn\SemantexID##1 {} + \cs_set:Npn\RegisterID##1 {} \cs_set:Npn\BeginSource##1\EndSource\BeginOutput##2\EndOutput {} -- cgit v1.2.3