diff options
author | Karl Berry <karl@freefriends.org> | 2014-05-09 22:39:48 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-05-09 22:39:48 +0000 |
commit | 610c45beb863b008027a871701c889fe40bed7fb (patch) | |
tree | 5b879b56850db183fd749a497edd1d91172edf69 /Master/texmf-dist/source/latex/graphics/keyval.dtx | |
parent | 18fa80c232cf479ae713b01b17d48bdc1d653aac (diff) |
latex2e 2014/05/01 (via latex-tds)
git-svn-id: svn://tug.org/texlive/trunk@33946 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/graphics/keyval.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/graphics/keyval.dtx | 55 |
1 files changed, 36 insertions, 19 deletions
diff --git a/Master/texmf-dist/source/latex/graphics/keyval.dtx b/Master/texmf-dist/source/latex/graphics/keyval.dtx index d86da03348a..864e2c08380 100644 --- a/Master/texmf-dist/source/latex/graphics/keyval.dtx +++ b/Master/texmf-dist/source/latex/graphics/keyval.dtx @@ -1,6 +1,6 @@ % % \iffalse -%% keyval.dtx Copyright (C) 1993 1994 1995 1997 1998 1999 David Carlisle +%% keyval.dtx Copyright (C) 1993 1994 1995 1997 1998 1999 2014 David Carlisle %% %% This file is part of the Standard LaTeX `Graphics Bundle'. %% It may be distributed under the terms of the LaTeX Project Public @@ -17,7 +17,7 @@ %<driver> \ProvidesFile{keyval.drv} % \fi % \ProvidesFile{keyval.dtx} - [1999/03/16 v1.13 key=value parser (DPC)] + [2014/05/08 v1.15 key=value parser (DPC)] % % \iffalse %</!plain> @@ -40,13 +40,13 @@ % % \begin{abstract} % A \LaTeX\ package implementing a system allowing the setting -% of parameters (or `named arguments' with a +% of parameters (or `named arguments' with a % \meta{key}${}={}$\meta{value} syntax. % % Eg: |\foo[height=3in, shadow = true ]{bar}| % \end{abstract} % -% \CheckSum{149} +% \CheckSum{158} % % \changes{v1.03} % {1993/10/13}{Initial version} @@ -62,6 +62,12 @@ % {Improve docstrip handling} % \changes{v1.09}{1995/09/21} % {Move a comma for graphics/1698} +% \changes{v1.14}{2014/04/25} +% {Make most definitions \cs{long} to allow \cs{par} in values: graphics/3446} +% \changes{v1.14}{2014/04/25} +% {Only strip a single brace pair from values: graphics/3446} +% \changes{v1.15}{2014/05/08} +% {revert this change: Only strip a single brace pair from values: graphics/3446} % % % This package implements a system of defining and using sets of @@ -213,7 +219,7 @@ % argument \meta{value}. The second form is only allowed if the key was % declared with a default value. % \begin{macrocode} -\def\setkeys#1#2{% +\long\def\setkeys#1#2{% % \end{macrocode} % Save the `family' for later. Then begin acting on the comma % separated list. @@ -228,9 +234,11 @@ % % \begin{macro}{\KV@do} % Iterate down the list of comma separated argument pairs. +% \changes{v1.14}{2014/04/25} +% {Add \cs{@empty} not \cs{empty}} % \begin{macrocode} -\def\KV@do#1,{% - \ifx\relax#1\empty\else +\long\def\KV@do#1,{% + \ifx\relax#1\@empty\else \KV@split#1==\relax \expandafter\KV@do\fi} % \end{macrocode} @@ -241,7 +249,7 @@ % This macro was slightly reorganised for version 1.04, after some % suggestions from Timothy Van Zandt. % \begin{macrocode} -\def\KV@split#1=#2=#3\relax{% +\long\def\KV@split#1=#2=#3\relax{% \KV@@sp@def\@tempa{#1}% \ifx\@tempa\@empty\else \expandafter\let\expandafter\@tempc @@ -285,9 +293,9 @@ % \begin{macrocode} %<plain>\def\KV@err#1{\errmessage{key-val: #1}} %<*!plain> -\DeclareOption{unknownkeysallowed}{% +\DeclareOption{unknownkeysallowed}{% \def\KV@errx#1{\PackageInfo{keyval}{#1}}} -\DeclareOption{unknownkeyserror}{% +\DeclareOption{unknownkeyserror}{% \def\KV@errx#1{\PackageError{keyval}{#1}\@ehc}} \ExecuteOptions{unknownkeyserror} \let\KV@err\KV@errx @@ -315,16 +323,17 @@ % drop any initial brace group, so |{abc}d| would incorrectly % be treated as |abcd|. The current version only removes brace % groups that surround the entire value, so |{abcd}| \emph{is} treated -% correctly as |abcd|. In fact, two levels of bracing are removed, if -% you require the entire argument to be a single brace group, you must -% use |{{{abcd}}}|. +% correctly as |abcd|. Prior to v1.14, two levels of bracing are removed, if +% you require the entire argument to be a single brace group, you had +% use |{{{abcd}}}|, fron v1.14 exactly one brace grup is removed, so to make +% the entire value be a brace group you need |{{abc}}|. % % \begin{macrocode} \def\@tempa#1{% % \end{macrocode} % % \begin{macrocode} -\def\KV@@sp@def##1##2{% +\long\def\KV@@sp@def##1##2{% \futurelet\KV@tempa\KV@@sp@d##2\@nil\@nil#1\@nil\relax##1}% % \end{macrocode} % @@ -342,8 +351,12 @@ \fi}% % \end{macrocode} % +% \changes{v1.14}{2014/04/25} +% {Add \cs{@empty} to avoid dropping a brace pair: graphics/3446} +% \changes{v1.15}{2014/05/08} +% {revert last change} % \begin{macrocode} -\def\KV@@sp@b#1##1 \@nil{\KV@@sp@c##1}% +\long\def\KV@@sp@b#1##1 \@nil{\KV@@sp@c##1}% % \end{macrocode} % % \begin{macrocode} @@ -356,8 +369,12 @@ \@tempa{ } % \end{macrocode} % +% \changes{v1.14}{2014/04/25} +% {Add \cs{expandafter} to remove the extra \cs{@empty} token: graphics/3446} +% \changes{v1.15}{2014/05/08} +% {revert last change} % \begin{macrocode} -\def\KV@@sp@c#1\@nil#2\relax#3{\KV@toks@{#1}\edef#3{\the\KV@toks@}} +\long\def\KV@@sp@c#1\@nil#2\relax#3{\KV@toks@{#1}\edef#3{\the\KV@toks@}} % \end{macrocode} % \end{macro} % \end{macro} @@ -379,7 +396,7 @@ % key) % \begin{macrocode} \def\define@key#1#2{% - \@ifnextchar[{\KV@def{#1}{#2}}{\@namedef{KV@#1@#2}####1}} + \@ifnextchar[{\KV@def{#1}{#2}}{\long\@namedef{KV@#1@#2}####1}} % \end{macrocode} % \end{macro} % @@ -387,9 +404,9 @@ % Make the definitions of the command, and the default value. % \begin{macrocode} \def\KV@def#1#2[#3]{% - \@namedef{KV@#1@#2@default\expandafter}\expandafter + \long\@namedef{KV@#1@#2@default\expandafter}\expandafter {\csname KV@#1@#2\endcsname{#3}}% - \@namedef{KV@#1@#2}##1} + \long\@namedef{KV@#1@#2}##1} % \end{macrocode} % \end{macro} % |