diff options
author | Norbert Preining <norbert@preining.info> | 2024-03-05 03:02:44 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2024-03-05 03:02:44 +0000 |
commit | 262a8b0c9d7aa383a7d1ec3a2efa25817abfc2d6 (patch) | |
tree | aec7f5d2ebb9b9bc2939469f0deec23ce81b9d51 /macros/latex/contrib | |
parent | 2af51a2a2d7a231effe8ef99a49b76d8c65e80be (diff) |
CTAN sync 202403050302
Diffstat (limited to 'macros/latex/contrib')
-rw-r--r-- | macros/latex/contrib/draftwatermark/draftwatermark.dtx | 69 | ||||
-rw-r--r-- | macros/latex/contrib/draftwatermark/draftwatermark.pdf | bin | 153827 -> 155364 bytes | |||
-rw-r--r-- | macros/latex/contrib/useclass/README.md | 26 | ||||
-rw-r--r-- | macros/latex/contrib/useclass/useclass.dtx | 250 | ||||
-rw-r--r-- | macros/latex/contrib/useclass/useclass.ins | 70 | ||||
-rw-r--r-- | macros/latex/contrib/useclass/useclass.pdf | bin | 0 -> 490171 bytes |
6 files changed, 388 insertions, 27 deletions
diff --git a/macros/latex/contrib/draftwatermark/draftwatermark.dtx b/macros/latex/contrib/draftwatermark/draftwatermark.dtx index 1263ae637a..7efd7d98f0 100644 --- a/macros/latex/contrib/draftwatermark/draftwatermark.dtx +++ b/macros/latex/contrib/draftwatermark/draftwatermark.dtx @@ -40,12 +40,12 @@ % % \fi % -% \CheckSum{576} +% \CheckSum{577} % % \def\filename{draftwatermark.dtx} -% \def\fileversion{3.1} -% \def\filedate{2024/01/22} -% \def\docdate{2024/01/22} +% \def\fileversion{3.3} +% \def\filedate{2024/03/04} +% \def\docdate{2024/03/03} % % \DoNotIndex{\\} % \DoNotIndex{\begin, \end, \begingroup, \endgroup} @@ -80,7 +80,7 @@ % \DoNotIndex{\wd, \wmbox} % % \setcounter{IndexColumns}{2} -% \setlength{\IndexMin}{3cm} +% \setlength{\IndexMin}{3cm} % % \newcommand*{\Lpack}[1]{\textsf {#1}} ^^A typeset a package % \newcommand*{\Lopt}[1]{\texttt {#1}} ^^A typeset an option @@ -95,7 +95,7 @@ % % \author{% % Sergio Callegari\thanks{Sergio Callegari can be reached at -% \texttt{sergio.callegari at gmail dot com}}} +% \texttt{sergio.callegari at gmail dot com}}} % % \date{\docdate} % @@ -117,7 +117,7 @@ % the \emph{KOMA script} bundle or directly using the new \hologo{LaTeX} % shipout hooks. % \end{abstract} -% +% % \section{Introduction} % % \changes{R1.0}{2006/06/30}{Initial release.}% @@ -211,7 +211,7 @@ % \begin{itemize} % \changes{R1.1}{2012/01/06}{Introduce the ``stamp'', ``nostamp'' and % ``final'' options to control whether the watermark should actually -% be printed.}^^A +% be printed.}^^A % \item \verb!firstpageonly=true|false!\\ % If no value is provided, |true| is assumed. Default is |false|.\\ % Instructs \Lpack{draftwatermark} to only apply the watermark on the @@ -459,7 +459,7 @@ % \subsection{Compatibility notes for package version 3.0 and later} % % \changes{R3.0}{2020/12/08}{Remove dependency on package -% \Lpack{everypage}.}^^A +% \Lpack{everypage}.}^^A % Version 3.0 of the package takes advantage of the new functionalities % introduced in \hologo{LaTeX} with the Fall 2020 release and gets rid of % its dependency on \Lpack{everypage}. In principle, this could result in @@ -542,7 +542,7 @@ % As an example, consider this first document source: % % \iffalse -%<*samplecode-modern> +%<*samplecode-modern> % \fi % \begin{macrocode} \documentclass{article} @@ -579,7 +579,7 @@ % Using the legacy interface, the source for the same sample document as % above would look like: % \iffalse -%<*samplecode-legacy> +%<*samplecode-legacy> % \fi % \begin{macrocode} \documentclass{article} @@ -618,7 +618,7 @@ % right top angle of every page. With the modern interface, such a result % can be easily obtained as in the following sample code: % \iffalse -%<*samplecode-anchor> +%<*samplecode-anchor> % \fi % \begin{macrocode} \documentclass{article} @@ -655,7 +655,7 @@ % of conditionals to achieve effects such as differentiating the watermark % for odd and even pages, as shown in the following code: % \iffalse -%<*samplecode-dynamic> +%<*samplecode-dynamic> % \fi % \begin{macrocode} \documentclass{article} @@ -697,7 +697,7 @@ % following example shows how it can be used, once again differentiating % the watermark for odd and even pages. %\iffalse -%<*samplecode-custom> +%<*samplecode-custom> % \fi % \begin{macrocode} \documentclass{article} @@ -737,7 +737,7 @@ %</samplecode-custom> % \fi % -% +% % \section{Development and support} % % The package is developed on \emph{github}: @@ -750,26 +750,27 @@ % against some fundamental design decisions. % % \StopEventually {} -% +% % \section{Implementation} % \subsection{Implementation of \Lpack{draftwatermark}} % % Announce the name and version of the package, which requires % \LaTeXe. +% \changes{R3.2}{2024/03/03}{Fix version number of main package.}^^A % \iffalse %<*draftwatermark> % \fi % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{draftwatermark}% - [2020/12/08 3.0 Put a gray textual watermark on document pages] + [2024/03/04 3.3 Put a gray textual watermark on document pages] % \end{macrocode} % \changes{R3.0}{2020/12/08}{Automatically load legacy code for older % \hologo{LaTeX} formats.}^^A % Depending on the actual functionalities provided by \hologo{LaTeX} % consider loading \Lpack{draftwatermark-2x}. If so doing, warn about this, % and hand over the operation to that package. -% \begin{macrocode} +% \begin{macrocode} \@ifundefined{AddToHook}{% \PackageWarningNoLine{draftwatermark}{% You appear to be running a version of LaTeX\MessageBreak @@ -867,7 +868,7 @@ % \begin{macrocode} \ProcessKeyvalOptions* % \end{macrocode} -% +% % \dots\, and then disable the |firstpageonly| and |firstpage| options, % that can only be used at the package loading time. % \begin{macrocode} @@ -979,7 +980,7 @@ \PackageError{draftwatermark}{% Illegal anchor directive `\draftwatermark@tempb'}% {Anchoring to left side.}% - \fi\fi\fi + \fi\fi\fi \edef \draftwatermark@tempa{\draftwatermark@vanchor}% \@onelevel@sanitize \draftwatermark@tempa \expandafter\def\expandafter\draftwatermark@tempb @@ -994,7 +995,7 @@ \PackageError{draftwatermark}{% Illegal anchor directive `\draftwatermark@tempb'}% {Anchoring to top side.}% - \fi\fi\fi + \fi\fi\fi \put(\@tempdima,\@tempdimb){\usebox\@tempboxa}% } @@ -1008,7 +1009,7 @@ \fi} % \end{macrocode} % -% \dots\, and finally the code to set up the \Lpack{everypage} hooks to +% \dots\, now, the code to set up the \Lpack{everypage} hooks to % assure that the watermark printing commands are called when needed % \begin{macrocode} \ifdraftwatermark@firstpageonly @@ -1019,6 +1020,19 @@ \draftwatermark@print{\draftwatermark@markcmd}}% \fi % \end{macrocode} +% Finally, declare precedence rules with respect to shipout/background +% hooks that may be set up by other packages. These are important +% because they end up controlling the stacking of background +% artifacts. Specifically, the draft watermark should go below +% anything else. A notable package that must be considered is +% \Lpack{eso-pic}, particularly because it gets used by +% \Lpack{pdfpages} +% \changes{R3.3}{2024/03/04}{Declare precedence rules with respect to +% other users of the shipout/background hook. This fixes the +% background stacking order when using \Lpack{pdfpages}.}% +% \begin{macrocode} +\DeclareHookRule{shipout/background}{draftwatermark}{<}{eso-pic} +% \end{macrocode} % \iffalse %</draftwatermark> % \fi @@ -1027,12 +1041,13 @@ % % Announce the name and version of the package, which requires % \LaTeXe. +% \changes{R3.2}{2024/03/03}{Fix name of legacy package.} % \iffalse %<*draftwatermark-2x> % \fi % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{draftwatermark}% +\ProvidesPackage{draftwatermark-2x}% [2020/12/06 2.3 Put a gray textual watermark on document pages] % \end{macrocode} @@ -1131,7 +1146,7 @@ % \begin{macrocode} \ProcessKeyvalOptions* % \end{macrocode} -% +% % \dots\, and then disable the |firstpageonly| and |firstpage| options, % that can only be used at the package loading time. % \begin{macrocode} @@ -1241,7 +1256,7 @@ \PackageError{draftwatermark}{% Illegal anchor directive `\draftwatermark@tempb'}% {Anchoring to left side.}% - \fi\fi\fi + \fi\fi\fi \edef \draftwatermark@tempa{\draftwatermark@vanchor}% \@onelevel@sanitize \draftwatermark@tempa \expandafter\def\expandafter\draftwatermark@tempb @@ -1258,7 +1273,7 @@ \PackageError{draftwatermark}{% Illegal anchor directive `\draftwatermark@tempb'}% {Anchoring to top side.}% - \fi\fi\fi + \fi\fi\fi \vbox to 0pt {% \vspace*{-1in}% \vspace*{\@tempdimb}% @@ -1315,7 +1330,7 @@ % Right brace \} Tilde \~} \endinput -%%% Local Variables: +%%% Local Variables: %%% mode: doctex %%% TeX-master: t %%% End: diff --git a/macros/latex/contrib/draftwatermark/draftwatermark.pdf b/macros/latex/contrib/draftwatermark/draftwatermark.pdf Binary files differindex 6ca13c405c..8de1926f10 100644 --- a/macros/latex/contrib/draftwatermark/draftwatermark.pdf +++ b/macros/latex/contrib/draftwatermark/draftwatermark.pdf diff --git a/macros/latex/contrib/useclass/README.md b/macros/latex/contrib/useclass/README.md new file mode 100644 index 0000000000..baabb9b6e7 --- /dev/null +++ b/macros/latex/contrib/useclass/README.md @@ -0,0 +1,26 @@ +# The `useclass.sty` Package: Use Classes as Packages + +## Introduction +`useclass` is a package that enables the usage of classes as packages. It was originally designed for the `l3doc` class, which is employed for documenting LaTeX code with numerous useful features. However, employing the `l3doc` class as a package is not convenient when using the developing class as the style for the document. Therefore, this package provides a simple interface for utilizing classes as packages. + +## Usage +Use `\useclass` to load a class with the same usage as `\usepackage`: +```tex +\useclass[<options>]{<class>} +``` +where `<options>` and `<class>` are the options and the name of the loaded class, respectively. + +Example: +```tex +\usepackage{useclass} +\useclass[full]{l3doc} +``` + +## License +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + https://www.latex-project.org/lppl.txt +and version 1.3c or later is part of all distributions of LaTeX +version 2008 or later. diff --git a/macros/latex/contrib/useclass/useclass.dtx b/macros/latex/contrib/useclass/useclass.dtx new file mode 100644 index 0000000000..74d9d63ca1 --- /dev/null +++ b/macros/latex/contrib/useclass/useclass.dtx @@ -0,0 +1,250 @@ +% \iffalse meta-comment +% !TEX program = pdfLaTeX +% +% DO NOT REMOVE THE MARK MANUALLY (used in l3build) -> % +% +%<*internal> +\iffalse +%</internal> +%<*internal> +\fi +\begingroup + \def\nameofLaTeXe{LaTeX2e} +\expandafter\endgroup\ifx\fmtname\nameofLaTeXe\else +\csname fi\endcsname +%</internal> +%<*install> +\input docstrip +\keepsilent +\askforoverwritefalse +\preamble + + Copyright (C) 2024 by HUANG Yuxi <useclass@hyxi.dev> + + This work may be distributed and/or modified under the + conditions of the LaTeX Project Public License, either + version 1.3 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 Maintainer of this work is HUANG Yuxi. + +\endpreamble +\postamble + + This work consists of the files \jobname.dtx + and the derived files \jobname.sty and \jobname.ins. + +\endpostamble + +\generate + { +%</install> +%<*internal> + \usedir{source/latex/useclass} + \file{\jobname.ins}{\from{\jobname.dtx}{install}} +%</internal> +%<*install> + \usedir{tex/latex/useclass} + \file{\jobname.sty}{\from{\jobname.dtx}{package}} + } +\endbatchfile +%</install> +%<*internal> +\fi +%</internal> + +%<package>\NeedsTeXFormat{LaTeX2e} +%<package>\ProvidesExplPackage{useclass} +%<package> {2024-03-04}{0.9}{Use Classes as Packages} % +%<*driver> +\documentclass{article} +\usepackage{useclass} +\useclass[full]{l3doc} +\usepackage{mdframed} + +\providecommand{\pkgname}{\pkg{\jobname}} +\begin{document} + \DocInput{\jobname.dtx} + \PrintIndex +\end{document} +%</driver> +% \fi +% +% \title{The \pkgname.sty Package: Use Classes as Packages} +% \author +% { +% Huang Yuxi +% \thanks{ +% \textit{Huang} is his surname. +% } +% <^^A +% \href +% {mailto:useclass@hyxi.dev} +% {useclass@hyxi.dev}^^A +% > +% } +% \date{2024-03-04 \quad Version 0.9} +% + +% \maketitle +% +% +% +% \begin{mdframed} +% \textsf{TL;DR} \; Use \cs{useclass} to load a class with the same usage as \cs{usepackage}: +% \begin{verbatim} +% \usepackage{useclass} +% \useclass[full]{l3doc} +% \end{verbatim} +% \end{mdframed} +% +% \tableofcontents +% +% \begin{documentation} +% +% \section{Introduction} +% +% \pkgname{} is a package that enables the usage of classes as packages. It was originally designed for the \cls{l3doc} class, which is employed for documenting \LaTeX{} code with numerous useful features. However, employing the \cls{l3doc} class as a package is not convenient when using the developing class as the style for the document. Therefore, this package provides a simple interface for utilizing classes as packages. +% The package \pkgname{} was initially released on 2024-03-04, under the LaTeX Project Public License Version 1.3c^^A +% \footnote{\url{https://www.latex-project.org/lppl/lppl-1-3c.txt}} +% or later, and is maintained at \url{https://github.com/huangyxi/useclass}. +% +% \section{Usage} + +% +% \begin{function}{\useclass} +% \begin{syntax} + % \cs{useclass} \marg{class} +% \cs{useclass} \oarg{options} \marg{class} +% \end{syntax} +% Load class with options, where \meta{options} is the options for the class and \meta{class} is the class name without the extension. +% \end{function} +% +% Example for a \file{dtx} file: +% \begin{mdframed} +% \begin{verbatim} +% % \iffalse +% \documentclass{article} +% \usepackage{l3doc} +% \begin{document} +% \DocInput{\jobname.dtx} +% \end{document} +% % \fi +% % +% % \section{Implementation} +% % \begin{variable}{\l_demo_tl} +% % \begin{macrocode} +% \tl_new:N \l_demo_tl +% % \end{macrocode} +% % \end{variable} +% \end{verbatim} +% \end{mdframed} +% +% \end{documentation} +% +% \begin{implementation} +% +% +% \section{\pkgname{} Implementation} +% \begin{macrocode} +%<@@=useclass> +%<*package> +% \end{macrocode} +% +% +% \subsection{Variables} +% +% \begin{variable}{\@@_tempa_cs:w} +% Temporary control sequence. +% \begin{macrocode} +\cs_new_eq:NN \@@_tempa_cs:w ? +% \end{macrocode} +% \end{variable} +% +% \subsection{Helpers} +% +% \begin{macro}{\@@_cs_swap:NN} +% Define a helper function to swap two control sequences. +% \begin{macrocode} +\cs_new:Npn \@@_cs_swap:NN #1 #2 + { + \cs_set_eq:NN \@@_tempa_cs:w #1 + \cs_set_eq:NN #1 #2 + \cs_set_eq:NN #2 \@@_tempa_cs:w + } +% \end{macrocode} +% \end{macro} +% \subsection{Dependences loading} +% \pkgname{} currently don't have any explicit dependences. +% +% \subsection{Patched Macros} +% +% \begin{macro}{\@@_LoadClass:n} +% Patched \cs{LoadClass} to do nothing. +% \begin{macrocode} +\cs_new:Npn \@@_LoadClass:n #1 {} +% \end{macrocode} +% \end{macro} +% +% \subsection{Before Loading Class} +% +% \begin{macro}{\@@_use_before:} +% These are the things to do before loading class. +% \begin{macrocode} +\cs_new_protected:Npn \@@_use_before: + { + \@@_cs_swap:NN \LoadClass \@@_LoadClass:n + } +% \end{macrocode} +% \end{macro} +% +% \subsection{Loading Class} +% +% \begin{macro}{\@@_use_class:nn} +% Load class with options. +% \begin{macrocode} +\cs_new_protected:Npn \@@_use_class:nn #1 #2 + { + \@fileswithoptions\@clsextension[#1]{#2} + } +% \end{macrocode} +% \end{macro} +% +% \subsection{After Loading Class} +% +% \begin{macro}{\@@_use_after:} +% These are the things to do after loading class. +% \begin{macrocode} +\cs_new_protected:Npn \@@_use_after: + { + \@@_cs_swap:NN \LoadClass \@@_LoadClass:n + } +% \end{macrocode} +% \end{macro} +% +% \subsection{User Interface} +% \begin{macro}{\useclass} +% Load patch class with options. +% \begin{macrocode} +\NewDocumentCommand {\useclass} { O{} m } + { + \@@_use_before: + \@@_use_class:nn {#1} {#2} + \@@_use_after: + } +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +%</package> +% \end{macrocode} + +% \end{implementation} +% \PrintIndex diff --git a/macros/latex/contrib/useclass/useclass.ins b/macros/latex/contrib/useclass/useclass.ins new file mode 100644 index 0000000000..3d8431cde6 --- /dev/null +++ b/macros/latex/contrib/useclass/useclass.ins @@ -0,0 +1,70 @@ +%% +%% This is file `useclass.ins', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% useclass.dtx (with options: `install') +%% +%% Copyright (C) 2024 by HUANG Yuxi <useclass@hyxi.dev> +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 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 Maintainer of this work is HUANG Yuxi. +%% +\input docstrip +\keepsilent +\askforoverwritefalse +\preamble + + Copyright (C) 2024 by HUANG Yuxi <useclass@hyxi.dev> + + This work may be distributed and/or modified under the + conditions of the LaTeX Project Public License, either + version 1.3 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 Maintainer of this work is HUANG Yuxi. + +\endpreamble +\postamble + + This work consists of the files \jobname.dtx + and the derived files \jobname.sty and \jobname.ins. + +\endpostamble + +\generate + { + \usedir{tex/latex/useclass} + \file{\jobname.sty}{\from{\jobname.dtx}{package}} + } +\endbatchfile + + + + % \cs{useclass} \marg{class} + +%% +%% This work consists of the files useclass.dtx +%% and the derived files useclass.sty and useclass.ins. +%% +%% +%% End of file `useclass.ins'. diff --git a/macros/latex/contrib/useclass/useclass.pdf b/macros/latex/contrib/useclass/useclass.pdf Binary files differnew file mode 100644 index 0000000000..499da57e29 --- /dev/null +++ b/macros/latex/contrib/useclass/useclass.pdf |