From 8191c5d4b304dbad19de59a1eed3bcb5fa0206b0 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 9 Oct 2020 20:21:09 +0000 Subject: kvoptions (9oct20) git-svn-id: svn://tug.org/texlive/trunk@56609 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/kvoptions/kvoptions.dtx | 308 +++------------------ 1 file changed, 32 insertions(+), 276 deletions(-) (limited to 'Master/texmf-dist/source/latex/kvoptions') diff --git a/Master/texmf-dist/source/latex/kvoptions/kvoptions.dtx b/Master/texmf-dist/source/latex/kvoptions/kvoptions.dtx index 8dd9701d479..38dfa185861 100644 --- a/Master/texmf-dist/source/latex/kvoptions/kvoptions.dtx +++ b/Master/texmf-dist/source/latex/kvoptions/kvoptions.dtx @@ -1,12 +1,12 @@ % \iffalse meta-comment % % File: kvoptions.dtx -% Version: 2019/11/29 v3.13 +% Version: 2020-10-07 v3.14 % Info: Key value format for package options % % Copyright (C) % 2004, 2006, 2007, 2009-2011 Heiko Oberdiek -% 2016-2019 Oberdiek Package Support Group +% 2016-2020 Oberdiek Package Support Group % https://github.com/ho-tex/kvoptions/issues % % This work may be distributed and/or modified under the @@ -85,7 +85,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: kvoptions 2019/11/29 v3.13 Key value format for package options (HO)} +\Msg{* Package: kvoptions 2020-10-07 v3.14 Key value format for package options (HO)} \Msg{************************************************************************} \keepsilent @@ -97,11 +97,11 @@ This is a generated file. Project: kvoptions -Version: 2019/11/29 v3.13 +Version: 2020-10-07 v3.14 Copyright (C) 2004, 2006, 2007, 2009-2011 Heiko Oberdiek - 2016-2019 Oberdiek Package Support Group + 2016-2020 Oberdiek Package Support Group This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either @@ -145,10 +145,6 @@ and the derived files % \file{kvoptions-test3.tex}{\from{kvoptions.dtx}{test3}}% % \file{kvoptions-test4.tex}{\from{kvoptions.dtx}{test4}}% % \file{kvoptions-test4.sty}{\from{kvoptions.dtx}{test4pkg}}% - \nopreamble - \nopostamble -% \usedir{source/latex/kvoptions/catalogue}% -% \file{kvoptions.xml}{\from{kvoptions.dtx}{catalogue}}% } \catcode32=13\relax% active space @@ -175,7 +171,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{kvoptions.drv}% - [2019/11/29 v3.13 Key value format for package options (HO)]% + [2020-10-07 v3.14 Key value format for package options (HO)]% \documentclass{ltxdoc} \usepackage{holtxdoc}[2011/11/22] \begin{document} @@ -185,26 +181,11 @@ and the derived files % \fi % % -% \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 -% Lower-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 -% Digits \0\1\2\3\4\5\6\7\8\9 -% Exclamation \! Double quote \" Hash (number) \# -% Dollar \$ Percent \% Ampersand \& -% Acute accent \' Left paren \( Right paren \) -% Asterisk \* Plus \+ Comma \, -% Minus \- Point \. Solidus \/ -% Colon \: Semicolon \; Less than \< -% Equals \= Greater than \> Question mark \? -% Commercial at \@ Left bracket \[ Backslash \\ -% Right bracket \] Circumflex \^ Underscore \_ -% Grave accent \` Left brace \{ Vertical bar \| -% Right brace \} Tilde \~} % % \GetFileInfo{kvoptions.drv} % % \title{The \xpackage{kvoptions} package} -% \date{2019/11/29 v3.13} +% \date{2020-10-07 v3.14} % \author{Heiko Oberdiek\thanks % {Please report any issues at \url{https://github.com/ho-tex/kvoptions/issues}}} % @@ -883,6 +864,11 @@ and the derived files % % \subsection{Package \xpackage{kvoptions-patch}} % +% \begin{description} +% \item[Change in version v3.14:] \xpackage{kvoptions-patch} is not compatible with a +% \LaTeX\ 2020-10-01 or newer and will abort loading if it detects it! +% \end{description} +% % \LaTeX's system of package/class options has some severe limitations % that especially affects the value part if options are used as % pair of key and value. @@ -1075,7 +1061,19 @@ and the derived files % } % % \section{Implementation} -% +% \subsection{Disabling the patches for newer LaTeX} +% \xpackage{kvoptions-patch} is not compatible with \LaTeX{} 2020-10-01 and newer +% so it is disabled and issues a warning. +% \begin{macrocode} +%<*patch> +\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} +\IfFormatAtLeastTF{2020/10/01}{\PackageWarning{kvoptions-patch}% + {kvoptions-patch is not compatible with \MessageBreak + LaTeX \fmtversion\MessageBreak Loading is aborted}{}}{} +\IfFormatAtLeastTF{2020/10/01}{\endinput}{} +% +% \end{macrocode} + % \subsection{Preamble} % % \begin{macrocode} @@ -1154,7 +1152,7 @@ and the derived files \fi \expandafter\x\csname ver@kvoptions.sty\endcsname \ProvidesPackage{kvoptions}% - [2019/11/29 v3.13 Key value format for package options (HO)]% + [2020-10-07 v3.14 Key value format for package options (HO)]% % \end{macrocode} % % \paragraph{Catcodes} @@ -2288,7 +2286,7 @@ and the derived files \TMP@EnsureCode{124}{12}% | \edef\KVO@AtEnd{\KVO@AtEnd\noexpand\endinput} \ProvidesPackage{kvoptions-patch}% - [2019/11/29 v3.13 LaTeX patch for keyval options (HO)]% + [2020-10-07 v3.14 LaTeX patch for keyval options (HO)]% % \end{macrocode} % % Check for \eTeX. @@ -2789,253 +2787,6 @@ and the derived files \KVO@AtEnd% % % \end{macrocode} -% -% \section{Test} -% -% \subsection{Preface for standard catcode check} -% -% \begin{macrocode} -%<*test1> -\input miniltx.tex\relax -% -% \end{macrocode} -% -% \subsection{Catcode checks for loading} -% -% \begin{macrocode} -%<*test1> -% \end{macrocode} -% \begin{macrocode} -\catcode`\{=1 % -\catcode`\}=2 % -\catcode`\#=6 % -\catcode`\@=11 % -\expandafter\ifx\csname count@\endcsname\relax - \countdef\count@=255 % -\fi -\expandafter\ifx\csname @gobble\endcsname\relax - \long\def\@gobble#1{}% -\fi -\expandafter\ifx\csname @firstofone\endcsname\relax - \long\def\@firstofone#1{#1}% -\fi -\expandafter\ifx\csname loop\endcsname\relax - \expandafter\@firstofone -\else - \expandafter\@gobble -\fi -{% - \def\loop#1\repeat{% - \def\body{#1}% - \iterate - }% - \def\iterate{% - \body - \let\next\iterate - \else - \let\next\relax - \fi - \next - }% - \let\repeat=\fi -}% -\def\RestoreCatcodes{} -\count@=0 % -\loop - \edef\RestoreCatcodes{% - \RestoreCatcodes - \catcode\the\count@=\the\catcode\count@\relax - }% -\ifnum\count@<255 % - \advance\count@ 1 % -\repeat - -\def\RangeCatcodeInvalid#1#2{% - \count@=#1\relax - \loop - \catcode\count@=15 % - \ifnum\count@<#2\relax - \advance\count@ 1 % - \repeat -} -\def\RangeCatcodeCheck#1#2#3{% - \count@=#1\relax - \loop - \ifnum#3=\catcode\count@ - \else - \errmessage{% - Character \the\count@\space - with wrong catcode \the\catcode\count@\space - instead of \number#3% - }% - \fi - \ifnum\count@<#2\relax - \advance\count@ 1 % - \repeat -} -\def\space{ } -\expandafter\ifx\csname LoadCommand\endcsname\relax - \def\LoadCommand{\input kvoptions.sty\relax}% -\fi -\def\Test{% - \RangeCatcodeInvalid{0}{47}% - \RangeCatcodeInvalid{58}{64}% - \RangeCatcodeInvalid{91}{96}% - \RangeCatcodeInvalid{123}{255}% - \catcode`\@=12 % - \catcode`\\=0 % - \catcode`\%=14 % - \LoadCommand - \RangeCatcodeCheck{0}{36}{15}% - \RangeCatcodeCheck{37}{37}{14}% - \RangeCatcodeCheck{38}{47}{15}% - \RangeCatcodeCheck{48}{57}{12}% - \RangeCatcodeCheck{58}{63}{15}% - \RangeCatcodeCheck{64}{64}{12}% - \RangeCatcodeCheck{65}{90}{11}% - \RangeCatcodeCheck{91}{91}{15}% - \RangeCatcodeCheck{92}{92}{0}% - \RangeCatcodeCheck{93}{96}{15}% - \RangeCatcodeCheck{97}{122}{11}% - \RangeCatcodeCheck{123}{255}{15}% - \RestoreCatcodes -} -\Test -\csname @@end\endcsname -\end -% \end{macrocode} -% \begin{macrocode} -% -% \end{macrocode} -% -% \begin{macrocode} -%<*test2> -\NeedsTeXFormat{LaTeX2e} -\makeatletter -\catcode`\@=11 % -\def\RestoreCatcodes{} -\count@=0 % -\loop - \edef\RestoreCatcodes{% - \RestoreCatcodes - \catcode\the\count@=\the\catcode\count@\relax - }% -\ifnum\count@<255 % - \advance\count@\@ne -\repeat - -\def\RangeCatcodeInvalid#1#2{% - \count@=#1\relax - \loop - \catcode\count@=15 % - \ifnum\count@<#2\relax - \advance\count@\@ne - \repeat -} -\def\Test#1{% - \RangeCatcodeInvalid{0}{47}% - \RangeCatcodeInvalid{58}{64}% - \RangeCatcodeInvalid{91}{96}% - \RangeCatcodeInvalid{123}{255}% - \catcode`\@=12 % - \catcode`\\=0 % - \catcode`\{=1 % - \catcode`\}=2 % - \catcode`\#=6 % - \catcode`\[=12 % - \catcode`\]=12 % - \catcode`\%=14 % - \catcode`\ =10 % - \catcode13=5 % - #1\relax - \RestoreCatcodes -} -\Test{\RequirePackage{kvoptions-patch}}% -\Test{\RequirePackage{kvoptions}}% -\csname @@end\endcsname -% -% \end{macrocode} -% -% \begin{macrocode} -%<*test3> -\NeedsTeXFormat{LaTeX2e} -\makeatletter -\RequirePackage{kvoptions}[2019/11/29] -\def\msg#{\immediate\write16} -\define@key{testfamily}{testkey}{% - \msg{[testfamily/testkey/#1]}% -} -\define@key{testfamily}{testdefaultkey}[testdefault]{% - \msg{[testfamily/testdefaultkey/#1]}% -} -\AddToKeyvalOption{testfamily}{testkey}{% - \msg{[addition/#1]}% -} -\AddToKeyvalOption{testfamily}{testdefaultkey}{% - \msg{[addition/#1]}% -} -\setkeys{testfamily}{% - testkey=testA,% - testdefaultkey=testB,% - testdefaultkey,% -} -\SetupKeyvalOptions{% - family=testfamily% -} -\AddToKeyvalOption*{testkey}{% - \msg{[star addition/#1]}% -} -\AddToKeyvalOption*{testdefaultkey}{% - \msg{[star addition/#1]}% -} -\setkeys{testfamily}{% - testkey=testA,% - testdefaultkey=testB,% - testdefaultkey,% -} -\@@end -% -% \end{macrocode} -% -% \begin{macrocode} -%<*test4pkg> -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{kvoptions-test4}[2019/11/29 package for testing] -\RequirePackage{kvoptions}[2019/11/29] -\SetupKeyvalOptions{% - family=FOO,% - prefix=foo,% - setkeys=\kvsetkeys,% -} -\DeclareStringOption{str} -\define@key{FOO}{set}{% - \setkeys{BAR}{strbar={#1}}% -} -\define@key{BAR}{strbar}{% - \def\foostr{[BAR:#1]}% -} -\ProcessKeyvalOptions* -% -% \end{macrocode} -% \begin{macrocode} -%<*test4> -\NeedsTeXFormat{LaTeX2e} -\ProvidesFile{kvoptions-test4.tex}[2019/11/29 test file] -\RequirePackage[% - str=A,set=B,str=C,% -]{kvoptions-test4}[2019/11/29] -\def\TestExpected{C} -\ifx\foostr\TestExpected - \typeout{* Test ok.}% -\else - \typeout{* Result: [\foostr]}% - \typeout{* Expected: [\TestExpected]}% - \errmessage{Test failed!}% -\fi -\csname @@end\endcsname\end -% -% \end{macrocode} -% % \section{Installation} % % \subsection{Download} @@ -3368,6 +3119,11 @@ and the derived files % \item % Documentation updates. % \end{Version} +% \begin{Version}{2020-10-07 v3.14} +% \item \xpackage{kvoptions-patch} is not compatible with a +% \LaTeX\ 2020-10-01 or newer and so it will abort loading if it detects it. +% This fixes github issue \#5. +% \end{Version} % \end{History} % % \PrintIndex -- cgit v1.2.3