diff options
author | Karl Berry <karl@freefriends.org> | 2010-05-15 00:30:40 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-05-15 00:30:40 +0000 |
commit | df96c8184d3c5802e048d2d8538717a98230c929 (patch) | |
tree | ec8be880bb8084f78a3c3a48a13888dc15868e93 /Master/texmf-dist | |
parent | e10ad83d90b52e4e9a049154008dba384ad6cc12 (diff) |
new latex package skeycommand (13may10)
git-svn-id: svn://tug.org/texlive/trunk@18267 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/skeycommand/README | 29 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/skeycommand/skeycommand-guide.pdf | bin | 0 -> 162439 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/skeycommand/skeycommand-guide.tex | 481 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/skeycommand/skeycommand.sty | 465 |
4 files changed, 975 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/skeycommand/README b/Master/texmf-dist/doc/latex/skeycommand/README new file mode 100644 index 00000000000..89b8247d749 --- /dev/null +++ b/Master/texmf-dist/doc/latex/skeycommand/README @@ -0,0 +1,29 @@ +%+++++++++++++++++++++++++++++++++++ INTRODUCTION +++++++++++++++++++++++++++++++++++% +% % +% This is the Readme file for the skeycommand package, version 0.1. % +% May 2010 % +% % +% Copyright (c) 2010 Ahmed Musa (a.musa@rocketmail.com). % +% % +%+++++++++++++++++++++++++++++++++++++ MOTIVATION +++++++++++++++++++++++++++++++++++% +% % +% The skeycommand package introduces concepts for defining commands and % +% environments using keys and parameters. All the facilities of the xkeyval % +% and skeyval packages are available to users of the skeycommand package. % +% The user interface is made as user-friendly as possible. % +% % +%+++++++++++++++++++++++++++++++++++++ LICENSE ++++++++++++++++++++++++++++++++++++++% +% % +% This package and accompanying files may be distributed and/or modified under % +% the conditions of the LaTeX Project Public License, either version 1.3 of % +% this license or any later version. The latest version of this license is in % +% http://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. % +% % +% The LPPL maintenance status of this software is 'author-maintained'. % +% % +% This software is provided 'as it is', without warranty of any kind, either % +% expressed or implied, including, but not limited to, the implied warranties of % +% merchantability and fitness for a particular purpose. % +% % +%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/skeycommand/skeycommand-guide.pdf b/Master/texmf-dist/doc/latex/skeycommand/skeycommand-guide.pdf Binary files differnew file mode 100644 index 00000000000..4ae71dec09f --- /dev/null +++ b/Master/texmf-dist/doc/latex/skeycommand/skeycommand-guide.pdf diff --git a/Master/texmf-dist/doc/latex/skeycommand/skeycommand-guide.tex b/Master/texmf-dist/doc/latex/skeycommand/skeycommand-guide.tex new file mode 100644 index 00000000000..32f3f96cf66 --- /dev/null +++ b/Master/texmf-dist/doc/latex/skeycommand/skeycommand-guide.tex @@ -0,0 +1,481 @@ +\documentclass[a4paper,10pt,final,language=UKenglish,fancysec,fancyfnote]{amltxdoc} +\makeatletter +\let\sectionbreak\medbreak + +\begin{document} + +\begin{frontmatter} +\suptitle{} +\title{The \texttt{\color{blue}skeycommand} Package\titleref{t1}} +\iftogon{pdf}{% + \titlenote[t1]{The package is available at \url{\@titleurl}.}% +}{% + \titlenote[t1]{The package is available at \url{\@shorttitleurl}.}% +} +\subtitle{Version 0.1} +\titleurl{http://www.ctan.org/tex-archive/macros/latex/contrib/skeycommand/} +\shorttitleurl{http://www.ctan.org/} +\author{Ahmed Musa\Email{a.musa@rocketmail.com}\\Preston, Lancashire, UK} + +\redef*\abstractname{\vspace{-\baselineskip}} +\begin{abstract} +\frameshade[width=\hsize,fillcolor=yellow!20,framesep=2pt,framerule=2pt, + framecolor=brown]{% + \frameshade[fillcolor=white,width=2.5cm,framecolor=red!60,framerule=2pt]% + {\centering SUMMARY}\small + The \pkgm{skeycommand} provides tools for defining \latex-style commands and environments using parameters and keys together. The advantages of keys over parameters include the facts that the former aren't limited to nine but can rise as desired by the user, and keys are much easier to match to their values than parameters to arguments, especially if the parameters are many. Moreover, keys can have natural functions. The design approach and user interfaces in the \pkg{skeycommand} differ from those found in the \pkgm{keycommand}. This package also provides the \acmd{\newtwooptcmd} and \acmd{\newtwooptenviron} macros for defining new commands and environments with two options/optional arguments. At both key command definition and invocation times there is no reference by the user to the semantics of key parsing and management. All the complex semantics and calculations involved in defining and setting keys are transparent to the user. The user of the \pkg{skeycommand} has access to some (but not all) of the machinery of \asty{xkeyval} and \asty{skeyval} packages (including the pointer mechanism) at the much lesser cost of worrying only about the key names and their values. Native boolean keys are automatically recognized and handled appropriately. However, because of the need to keep the user interface simple, toggle boolean keys aren't available in this package; neither are choice keys. +} +\end{abstract} +\pkgm*{xkeyval,skeyval} + +\NewLet\licname\licensename +\redef*\licensename{\vspace{-\baselineskip}} +\begin{license} +\frameshade[width=\hsize,fillcolor=white,framesep=2pt,framerule=2pt, + framecolor=brown]{\small + \vspace{1ex}\centerline{\licname}\endgraf + This work (\ie, all the files in the \asty{skeycommand} bundle) may be distributed and/or modified under the conditions of the \lppl (LPPL), either version~1.3 of this license or any later version. + \endgraf + The \lppl maintenance status of this software is ``author-maintained''. This software is provided ``as it is,'' without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. + \endgraf + \endgraf\centerline{\makered{\CopyrightYear}}% +} +\end{license} +\end{frontmatter} + +\frameshade[fillcolor=yellow!20,framecolor=brown,framerule=2pt,framesep=2pt, + width=1.1\hsize]{\tableofcontents} + +\section{Package options} +\label{sec:pack-options} + +The package has only one option (namely, \acmdm{verbose}) and can be invoked at the time of loading the package or via the \acmd{\skeycommand} macro. The option \fx{verbose} is a boolean, initially set to false (\ie, its complement, \acmdm{silent}, is true by default). Setting \fx{silent} to \fx{false} is tantamount to setting \fx{verbose} to \fx{true}. +\begin{example} +|comm(In style files:) +\RequirePackage[verbose=true |orr false]{skeycommand} +|comm(In document files:) +\usepackage[verbose=true |orr false]{skeycommand} +|comm(In all cases:) +\skeycommand{verbose=true |orr false |orr on |orr off} +\end{example} + +If you enter the boolean \fx{verbose} (or \fx{silent}) without value, the value is assumed to be \fx{true}. The \fx{verbose} option is simply passed on to the \pkgm{skeyval} to log informational messages in the transcript file. The major task of key parsing for the \pkg{skeycommand} is undertaken by the \pkgm{skeyval}. + +\section{User interfaces} + +\subsection{Defining new key commands and environments} + +The user interfaces for defining new key commands and environments are as follows: +\begin{macro} +\newkeycmd|vang(cmd)<|vang(mprefix)>|:|vang(keyval)|![|vang(narg)] + [|vang(default1)]{|vang(defn)} +\newkeycmd|redstar|vang(cmd)<|vang(mprefix)>|:|vang(keyval)|![|vang(narg)] + [|vang(default1)]{|vang(defn)} + +\renewkeycmd|vang(cmd)<|vang(mprefix)>|:|vang(keyval)|![|vang(narg)] + [|vang(default1)]{|vang(defn)} +\renewkeycmd|redstar|vang(cmd)<|vang(mprefix)>|:|vang(keyval)|![|vang(narg)] + [|vang(default1)]{|vang(defn)} + +\newkeyenviron|vang(env)<|vang(mprefix)>|:|vang(keyval)|![|vang(narg)] + [|vang(default1)]{|vang(defn)} +\newkeyenviron|redstar|vang(env)<|vang(mprefix)>|:|vang(keyval)|![|vang(narg)] + [|vang(default1)]{|vang(defn)} + +\renewkeyenviron|vang(env)<|vang(mprefix)>|:|vang(keyval)|![|vang(narg)] + [|vang(default1)]{|vang(defn)} +\renewkeyenviron|redstar|vang(env)<|vang(mprefix)>|:|vang(keyval)|![|vang(narg)] + [|vang(default1)]{|vang(defn)} +\end{macro} + +Here, \ang{narg} is the number of user arguments, as usual in \fx{\newcommand} and \fx{\newenvironment} (excluding the \ang{keyval} list); \ang{cmd} is the new command sequence; \ang{env} is the new environment name; \ang{mprefix} is the prefix for macros deriving from the defined keys whose values will be used in the new command or environment (this is called the \emph{macro prefix} in the parlance of keys); \ang{keyval} is the key-value list [\eg, (\fx{keya=valuea}, \fx{keyb=valueb})]; \ang{narg} is the number of arguments for the new command or environment (excluding the keys), as you would enter it in \fx{\newcommand} and \fx{\newenvironment}; \ang{default1} is the default value for your optional argument (normally the first argument in \fx{\newcommand} and \fx{\newenvironment}); \ang{defn} is the replacement text (as in \fx{\newcommand} and \fx{\newenvironment}). If you don't supply the optional \ang{mprefix}, the package will use the first three letters of the key command or environment name, excluding the escape character but including an added ``at sign'' (\fx{@}). The aim of default ``at sign'' is to aid the visual separation of key names from macro prefixes. + +Please note the angles surrounding \ang{mprefix}, and the parenthesis surrounding \ang{keyval} in the above syntaxes. The \ang{mprefix} can't be empty (\ie, don't enter \texttt{<>}) because it will be used by the package to build unique names for the macros that will hold the key values. You can choose not to enter anything for \ang{mprefix}, and the package will happily use the default prefix \fx{<xxx@>}, where ``\fx{xxx}'' represents the first three letters of the new command or environment name. Also, \ang{keyval} can't be empty: if it was empty, then we should ask: why use key commands instead of \latex's \fx{\newcommand} and \fx{\newenvironment}? + +In \ang{defn}, you refer to your arguments in the normal way. You refer to the values of the keys using macros whose first three characters (after the escape character) are the \ang{mprefix} or, if \ang{mprefix} is not supplied, the first three letters of the declared key command (excluding the escape character). The family name of the keys defined via a key command is the key command name itself (without the escape character). The package uses this internally in developing the keys. The key prefix is always ``KV''. If any of your key values contains parenthesis, simply enclose it in braces, to avoid confusing it with \ang{keyval} list. + +The starred variants (\RedStar) give ``short'' macros, while the unstarred variants yield ``long'' macros. + +\Note The optional \ang{mprefix} will be useful if you fear clashes with previously defined key commands. Although, to be defined, key commands must be definable, two key commands may have their first three or four characters identical, thereby leading to clashes of their key-value prefixes. + +\subsection{Invoking new key commands and environments} + +The syntaxes for calling new key commands and environments are as follows: + +\begin{macro} +\cmd[|vang(arg1)]{|vang(arg2)}...{|vang(argn)}|:|vang(keyval)|! + +\begin{env}[|vang(arg1)]{|vang(arg2)}...{|vang(argn)}|:|vang(keyval)|! + environment body +\end{env} +\end{macro} +where \fx{\cmd} and \fx{env} have been previously defined using key command and key environment. You refer to your arguments using parameter number one \hash{1} onwards, up to a maximum of \hash{8} (yes, \hash{8}, not \hash{9}). Here, \ang{keyval} (including the parenthesis) are optional arguments: you can omit them if you want to use the values of the keys set at key command definition time. Using keys is preferable to using parameters: you don't have to match parameters to arguments and, in principle, there is no limit to the number of keys that are permissible. + +\subsection{Commands and environments with two optional arguments} + +The \pkg{skeycommand} uses the following macros internally. They can be used to define new commands and environments with two optional arguments. Their philosophy, intent, and use syntaxes differ from those of the \pkgm{twoopt}. They may be useful to some users, although I recommend the use of the above key commands. + +\begin{macro} +\newtwooptcmd|vang(cmd)[|vang(narg)][|vang(default1)]{|vang(defn)} +\newtwooptcmd|redstar|vang(cmd)[|vang(narg)][|vang(default1)]{|vang(defn)} + +\renewtwooptcmd|vang(cmd)[|vang(narg)][|vang(default1)]{|vang(defn)} +\renewtwooptcmd|redstar|vang(cmd)[|vang(narg)][|vang(default1)]{|vang(defn)} + +\newtwooptenviron|vang(cmd)[|vang(narg)][|vang(default1)]{|vang(defn)} +\newtwooptenviron|redstar|vang(cmd)[|vang(narg)][|vang(default1)]{|vang(defn)} + +\renewtwooptenviron|vang(cmd)[|vang(narg)][|vang(default1)]{|vang(defn)} +\renewtwooptenviron|redstar|vang(cmd)[|vang(narg)][|vang(default1)]{|vang(defn)} +\end{macro} + +\ang{narg} is the total number of arguments, including the first and second optional arguments. +Where are the second optional arguments here, you might be wondering? The second optional argument is usually empty and doesn't appear at command definition time. The second optional argument isn't the second argument of your command (as in \pkg{twoopt}), but the last. At command invocation, if you don't supply a value for the second optional argument, the command will assume it to be empty. But how do you supply a value for the second optional argument? The next section shows how. + +\subsubsection[Calling commands and environments] +{Invoking commands and environments with two optional arguments} + +The syntaxes for calling commands and environments with two optional arguments are as follows: + +\begin{macro} +\cmd[|vang(1st optarg)]{|vang(arg2)}...{|vang(argn)}|:|vang(2nd optarg)|! + +\begin{env}[|vang(1st optarg)]{|vang(arg2)}...{|vang(argn)}|:|vang(2nd optarg)|! + environment body +\end{env} +\end{macro} + +If \ang{2nd optarg} is empty at command or environment invocation, the command or environment will assume it to be empty. Now you can see the conceptual link between \fx{\newtwooptcmd} (and friends) and \fx{\newkeycmd} (and friends). + +\section{Examples} + +\begin{example} +|comm(The following is a macro of 3 parameters and 4 keys:) + +|makered(\newkeycmd*)\demomacro|:name=Steve,height=1.60m,weight=75kg, + tested=true|![3][Registered]{% + \def\x{#1}\def\y{#2}\def\z{#3}% + \edef\xxx{\dem@name}% +} +|comm(|makered(\dem@name) will hold the value supplied for |makered(`name')) +|comm(by the user of \demomacro. |makered(`dem') is from |makered(`demomacro').) +|comm(Observe the LaTeX-like syntax of this command.) +|comm(The user doesn't have to bother about the nitty-gritty) +|comm(of key infrastructure.) + +|comm(You can use the following statement to instruct the user) +|comm(to always supply value for `name' in \demomacro macro:) + +|makered(\uservaluekeys)[KV]{demomacro}{name} +\end{example} + +Instead of using the macro \acmd{\uservaluekeys}, you can use the full pointer system of the \pkg{skeyval}. For example, the following requires the user to supply a value for `name' and the package will save that value for some later use: +\begin{example} +|makered(\newkeycmd)*\demomacro|:|makered(\uservalue\savevalue|mcolor({)name|mcolor(}))=Steve, + height=1.60m,wieght=75kg,tested=true|![3][Registered]{% + \def\x{#1}\def\y{#2}\def\z{#3}}% + \edef\xxx{\dem@name}% + +|comm(User now calls the \demomacro macro:) +\demomacro[data1]{data2}{data3}|:name,height=1.55m,wieght=55kg, + tested=true|! + |makered(|tto Error: no value supplied for `name') +\end{example} + +Now you can use \fx{\demomacro}. If you don't supply a key-value pair here, the macro will use the above defaults: +\begin{example} +\demomacro[data1]{data2}{data3}|:name=John,height=1.55m, + weight=55kg,tested=true|! +\end{example} + +\begin{example} +|makered(\newkeycmd*)\firstmacro<sk@>|:name=Steve, + height=1.6m|![8][xxx]{% + \noindent Name: \sk@name\newline + Height: \sk@height\newline + Details: #1#2#3#4#5#6#7#8% + \newline\newline +} + +\begin{document} +\firstmacro[1]{-2}{-3}{-4}{-5}{-6}{-7}{-8} + |:name=John {|:Winne|!}r,height=1.54m|! +\end{document} +\end{example} + +\begin{example} +|makered(\newkeyenviron*){vdescription}<skv@>|:labelwidth=5pt, + labelsep=5pt|![2][\qquad] + {\begin{list}{}{\redef*\makelabel##1{\sffamily ##1:\hfil}% + \settowidth\labelwidth{\makelabel{#1}}% + \SKV@dimdef\leftmargin{\labelwidth+\skv@labelwidth + +\labelsep+\skv@labelsep}}% + \item[Description Preamble] #2% +}{\end{list}\ignorespacesafterend} + +\begin{document} +\begin{vdescription}[Description Postamble]% + {$\star\star\star$}|:labelwidth=10pt,labelsep=10pt|! + \item[Item 1] xxx + \item[Item 2] yyy + \item[Description Postamble] $\langle$End of my + environment$\rangle$ +\end{vdescription} +\end{document} +\end{example} + +\begin{example} +\def\@barbara{An author writing an article for publication + in TUGboat is encouraged to create it on a computer file + and submit it on magnetic tape.} +\def\barbara{BARBARA BEETON,\\ \emph{How to Prepare a File For + Publication in TUGboat} |:1981|!} +\def\@hieronymus{The printer should refuse to employ wandering + men, foreigners who, after having committed some grievous + error, can easily disappear and return to their own country.} +\def\hieronymus{HIERONYMUS HORNSCHUCH |:1608|!} + +|comm(The macros \@barbara, \barbara, etc. are just shorthands:) +|comm(you can enter their contents directly in key commands.) + +|makered(\newkeyenviron){Quote}<mp@>|:leftmargin=\leftmargin, + rightmargin=\rightmargin,mode=false,whoby=\null, + source=\null|!{\begin{list}{}{% + \setlength\leftmargin{\mp@leftmargin}% + \setlength\rightmargin{\mp@rightmargin}% + }% + \item[]\makebox[0pt][r]{``}% +}{% + \unskip\makebox[0pt][l]{''}% + \item[] \flushright\mp@whoby + \item[] \flushleft\small Source: \mp@source + \end{list} + \endgraf\vskip\baselineskip +} +\usepackage{lipsum} +\lipsum[1] +\begin{Quote}|:leftmargin=30pt,rightmargin=30pt,mode=false, + whoby=\barbara,source={The \TeX Book}|! + {\ifmp@mode\color{red}\else\color{blue}\fi\@barbara} +\end{Quote} + +\lipsum[1] +\begin{Quote}|:leftmargin=20pt,rightmargin=20pt,mode=true, + whoby=\hieronymus,source={The \TeX Book}|! + {\ifmp@mode\color{red}\else\color{blue}\fi\@hieronymus} +\end{Quote} +\end{example} + +\begin{example} +\usepackage{lipsum} +\newcounter{notecnt} +\def\noteparameters{\labelsep=\notelabelsep + \itemindent=\noteitemindent \leftmargin=\noteleftmargin + \rightmargin=\noterightmargin \labelwidth=\notelabelwidth} + +|makered(\newkeyenviron*){note}<note>|:labelsep=8pt,itemindent=8pt, + leftmargin=\parindent,rightmargin=\parindent,labelwidth=0pt, + preskip=0ex|![1][\baselineskip]% + {\begin{list}{\textsc{Note}~\arabic{notecnt}: }% + {\noteparameters\usecounter{notecnt}}% + \vskip#1}% + {\end{list}\ignorespacesafterend} + +\begin{document} +\noindent\lipsum[1] +\begin{note}[\notepreskip]|:labelsep=8pt,itemindent=8pt, + leftmargin=30pt,rightmargin=30pt,labelwidth=0pt,preskip=2ex|! +\item \lipsum[1] +\item \lipsum[1] +\end{note} +\end{document} +\end{example} + + +\begin{example} +\def\sitation{} +\def\sitparameters{\leftmargin=\sit@leftmargin + \rightmargin=\sit@rightmargin} +\newbox\sitname +|makered(\renewkeyenviron*){sitation}|:leftmargin=\parindent, + rightmargin=\parindent,nolinebreak=1|![2][1]% + {\def\cnolinebreak{#1}\sitparameters\sbox\sitname + {\textit{#2}}% + \begin{quote}% + }% + {\hspace*{\fill}\nolinebreak[\cnolinebreak]% + \quad\hspace*{\fill}\finalhyphendemerits\z@ + \box\sitname + \end{quote}\ignorespacesafterend} + +\begin{document} +\begin{sitation}[\sit@nolinebreak]% + {Hieronymus Hornschuch~|:1608|!}% + |:leftmargin=30pt,rightmargin=30pt,nolinebreak=2|! +The printer should refuse to employ wandering men, +foreigners who, after having committed some grievous error, +can easily disappear and return to their own country. +\end{sitation} + +\begin{sitation}{William Stanley Jevons~|:1878|!}% +Some compositors still object to work in offices where +type-composing machines are introduced. They are all afraid +that if the work is done too easily and rapidly, they will +not be wanted to do it. Justifying and page makeup can't be +done profitably by machines, so the employees needn't fear +losing their jobs. +\end{sitation} +\end{document} +\end{example} + +\begin{example} +|makered(\newkeyenviron*){vdescription}|:labelwidth=5pt, + labelsep=5pt|![2][\qquad]% + {\begin{list}{}{\redef*\makelabel##1{\sffamily ##1:\hfil}% + \settowidth\labelwidth{\makelabel{#1}}% + \SKV@dimdef\leftmargin{\labelwidth+\vde@labelwidth + +\labelsep+\vde@labelsep}}% + \item[Description Preamble] #2% +}{\end{list}\ignorespacesafterend} + +\begin{document} +\begin{vdescription}[Description Postamble]{+++xxx+++}% + |:labelwidth=10pt,labelsep=5pt|! + \item[Item 1] xxx + \item[Item 2] yyy + \item[Description Postamble] $\langle$End of my + environment$\rangle$ +\end{vdescription} +\end{document} +\end{example} + +\begin{example} +|makered(\renewtwooptenviron*){vdescription}[3][\qquad] + {\begin{list}{}{\redef*\makelabel##1{\sffamily ##1:\hfil}% + \settowidth\labelwidth{\makelabel{#1}}% + \SKV@dimdef\leftmargin{\labelwidth+\labelsep+#2}}% + \item[Description Preamble] #3% + }{\end{list}\ignorespacesafterend} + +\begin{document} +\begin{vdescription}[Description Postamble]{4cm}|:{|:Begin + environment no.\ 1|!}|! + \item[Item 1] xxx + \item[Item 2] yyy + \item[Description Postamble] |:End of environment no.\ 1|! +\end{vdescription} +\end{document} +\end{example} + +\begin{example} +|makered(\newtwooptenviron*){udescription}[3][\hspace{1cm}] + {\begin{list}{}{\redef*\makelabel##1{\sffamily ##1:\hfil}% + \settowidth\labelwidth{\makelabel{#1}}% + \SKV@dimdef\leftmargin{\labelwidth+\labelsep+#3}}% + \item[Description Preamble] #2% + }{\end{list}\ignorespacesafterend} + +\begin{document} +\begin{udescription}[Description Postamble]{uuu}|:4cm|! + \item[Item 1] xxx + \item[Item 2] yyy + \item[Description Postamble] The End +\end{udescription} +\end{document} +\end{example} + +\begin{example} +\def\firstmacro{} +|makered(\renewkeycmd*)\firstmacro<skv@>|:name=Steve, + module=Martian logic,pass=true|![2][\@ptsize]{% + \edef\x{\skv@name}% + \wlog{\if0#1 10pt\else\if1#1 11pt\else + \if2#1 12pt\fi\fi\fi\space font used}% + \def\y{#2}% +} + +\firstmacro[0]{aaa}|:name=John,module=Philosophy,pass=false|! +\end{example} + +\begin{example} +|makered(\newtwooptcmd*)\macro[3][xxx]{\def\x{#1}\def\y{#2}\def\z{#3}} +\macro[uuu]{vvv}|:www|! +\macro{vvv}|:www|! +\macro{vvv} +\end{example} + +\begin{example} +\SKV@undef\macro +|makered(\newtwooptcmd*)\macro[2][xxx]{\def\x{#1}\def\y{#2}} +\macro[uuu]|:vvv|! +\macro|:vvv|! +\end{example} + +\begin{example} +|makered(\renewtwooptcmd)\macro[2][xxx]{\def\x{#1}\long\def\y{#2}} +\macro[uuu]|:\par|! +\macro|:\par|! +\end{example} + +\begin{example} +\let\tcl\textcolor +|makered(\newkeycmd*)\firstrule|:raise=.5ex,width=1em,thick=2pt, + proclaim=false|![1]{% + \tcl{blue}{\rule[\fir@raise]{\fir@width}{\fir@thick}}% + #1% + \tcl{cyan}{\rule[\fir@raise]{\fir@width}{\fir@thick}}% + \iffir@proclaim \color{red}\fi\textdaggerdbl +} + +\usepackage[left=2cm,right=2cm]{geometry} +\begin{document} +\parindent\z@ +\begin{tabular*}\textwidth{lr} +\verb+\firstrule{Hello World}|:width=2em,thick=4pt, + proclaim|!+:|ampersand + \firstrule{Hello World}|:width=2em,thick=4pt|!\cr +\verb+\firstrule{Hello}|:width=2em,thick=.5pt, + proclaim=true|!+:|ampersand + \firstrule{Hello}|:width=2em,thick=.5pt,proclaim=true|!\cr +\verb+\firstrule{Hello World}|:thick=2pt, + proclaim=true|!+:|ampersand + \firstrule{Hello World}|:thick=2pt,proclaim=true|!\cr +\verb+\firstrule{Hello World}|:raise=1ex,width=2em, + thick=1pt|!+:|ampersand + \firstrule{Hello}|:raise=1ex,width=2em,thick=1pt|! +\end{tabular*} +\end{document} +\end{example} + + +\begin{example} +\let\tcl\textcolor +|makered(\newkeycmd)\secondrule<mp@>|:raise=.5ex,width=1em,thick=2pt, + proclaim=false|![2][\tcl{magenta}{$\star$}]{% + \tcl{cyan}{\rule[\mp@raise]{\mp@width}{\mp@thick}}% + #1#2#1% + \tcl{blue}{\rule[\mp@raise]{\mp@width}{\mp@thick}}% + \ifmp@proclaim \color{red}\fi\textdaggerdbl +} +\usepackage[left=2cm,right=2cm]{geometry} +\begin{document} +\parindent\z@ +\begin{tabular*}\textwidth{lr} +\verb+\secondrule[\textbullet]{Hello World}|:width=2em, + thick=4pt,proclaim|!+:|ampersand + \secondrule[\textbullet]{Hello World}|:width=2em, + thick=4pt|!\cr +\verb+\secondrule{Hello}|:width=2em,thick=.5pt, + proclaim=true|!+:|ampersand + \secondrule{Hello}|:width=2em,thick=.5pt,proclaim=true|!\cr +\verb+\secondrule{Hello World}|:thick=2pt, + proclaim=true|!+:|ampersand + \secondrule{Hello World}|:thick=2pt,proclaim=true|!\cr +\verb+\secondrule{Hello World}|:raise=1ex,width=2em, + thick=1pt|!+:|ampersand + \secondrule{Hello}|:raise=1ex,width=2em,thick=1pt|! +\end{tabular*} +\end{document} +\end{example} + +\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/skeycommand/skeycommand.sty b/Master/texmf-dist/tex/latex/skeycommand/skeycommand.sty new file mode 100644 index 00000000000..e9231f299e9 --- /dev/null +++ b/Master/texmf-dist/tex/latex/skeycommand/skeycommand.sty @@ -0,0 +1,465 @@ +%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% +% % +% This is file 'skeycommand.sty', version 0.1. % +% % +% This package and accompanying files may be distributed and/or % +% modified under the conditions of the LaTeX Project Public License, % +% either version 1.3 of this license or any later version. The latest % +% version of this license is in http://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. % +% % +% The LPPL maintenance status of this software is 'author-maintained'. % +% % +% This software is provided 'as it is', without warranty of any kind, % +% either expressed or implied, including, but not limited to, the % +% implied warranties of merchantability and fitness for a particular % +% purpose. % +% % +% Copyright (c) 2010 Ahmed Musa (a.musa@rocketmail.com). % +% % +%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% + +\begingroup +\catcode064 11% @ +\catcode123 01% { +\catcode125 02% } +\def\SKC@tempa{\endgroup + \edef\SKC@reincodes{% + \catcode035 \the\catcode035% # + \catcode064 \the\catcode064% @ + \catcode123 \the\catcode123% { + \catcode125 \the\catcode125% } + \catcode061 \the\catcode061% = + }% +} +\SKC@tempa +\catcode035 06% # +\catcode061 12% = +\catcode064 11% @ +\catcode123 01% { +\catcode125 02% } +\def\SKC@catcode#1#2{% + \edef\SKC@reincodes{% + \SKC@reincodes + \catcode#1 \the\catcode#1\relax + }% + \catcode#1 #2\relax +} +\AtEndOfPackage{% + \SKV@AfterPackageEnd{% + \SKC@reincodes + \SKV@Undef?{\SKC@catcode\SKC@reincodes}% + }% +} +\SKC@catcode{036}{03}% $ +\SKC@catcode{038}{03}% & +\SKC@catcode{040}{12}% ( +\SKC@catcode{041}{12}% ) +\SKC@catcode{042}{12}% * +\SKC@catcode{043}{12}% + +\SKC@catcode{044}{12}% , +\SKC@catcode{045}{12}% - +\SKC@catcode{047}{12}% / +\SKC@catcode{058}{12}% : +\SKC@catcode{059}{12}% ; +\SKC@catcode{063}{12}% ? +\SKC@catcode{091}{12}% [ +\SKC@catcode{093}{12}% ] +\SKC@catcode{126}{13}% ~ +\def\SKC@rcsid$#1: #2 #3 #4 #5${#4 v#3} +\ProvidesPackage{skeycommand}[% + \SKC@rcsid + $Id: skeycommand.sty,v 0.1 2010/05/05 09:00:00 Ahmed Musa $ + Defining new commands and environments using keys (AM) +] +\NeedsTeXFormat{LaTeX2e}[1996/12/01] +\ifcase0% + \ifx\eTeXversion\SKC@undefined1\else\ifnum\eTeXversion<\tw@1\fi\fi +\else + \PackageError{skeycommand}% + {eTeX not loaded or old version}% + {This package requires eTeX version 2 or later.}% + \endinput +\fi +\@ifpackageloaded{skeyval}{% + \@ifpackagecurrent{skeyval}{2010/05/01}{}{% + \PackageError{skeycommand}% + {Your loaded version of skeyval package is not current}% + {You need version 0.7 (or higher) of skeyval package.}% + \endinput + }% +}{% + \RequirePackage[verbose=true,keyparser=;,macroprefix=mp@, + keyprefix=KV,keyfamily=fam]{skeyval}[2010/05/01] +} +\TestProvidedCommand\newdef{}{\let\newdef\SKV@def} +\TestProvidedCommand\robustdef{}{\let\robustdef\SKV@pdef} +\TestProvidedCommand\redef{}{\let\redef\SKV@redef} +\robustdef\SKC@info#1{\PackageInfo{skeycommand}{#1\@gobble}} +\robustdef\SKC@warn#1{\PackageWarningNoLine{skeycommand}{#1}} +\robustdef\SKC@err#1#2{\PackageError{skeycommand}{#1}{#2}} +\NewBooleans[SKC@sw]{a}[false] +\newbiboolkeys[KV]{skeycmd}[SKC@]{verbose}[true]{silent}{% + \setkeys[KV]{skeyval}{verbose=true}}% + {\setkeys[KV]{skeyval}{verbose=false}} +\DeclareOptionX*{\SKC@warn{Unknown option '\CurrentOption' ignored}} +\ExecuteOptionsX[KV]<skeycmd>{verbose=false} +\ProcessOptionsX*[KV]<skeycmd>\relax +\robustdef*\skeycommand#1{\setkeys[KV]{skeycmd}{#1}} +\newdef*\SKC@fdigit#1{% + \let\SKC@resvda\@empty + \SKV@tfor{#1}\SKC@resvdb{% + \SKV@addtolist[,]\SKC@resvda\SKC@resvdb + }% + \SKC@swatrue + \XKV@whilist\SKC@resvda\SKC@resvdb\ifSKC@swa\fi{% + \SKV@in@o\SKC@resvdb{0123456789}\SKC@swafalse\SKC@swatrue + }% +} +\let\SKC@rskey\SKV@resolvekey +\robustdef*\newkeycmd{\@star@or@long\SKC@keycmd@i} +\robustdef*\csnewkeycmd{\SKV@aftercs\newkeycmd} +\SKV@emptycmds{\SKC@keycmdlist,\SKC@k@ycmdlist} +\newdef\SKC@keycmd@i#1{% + \SKV@ensurescape{#1}% + \gdef\SKC@keycmdname{#1}% + \edef\SKC@tfam{\expandafter\@gobble\string#1}% + \edef\SKC@pref{\expandafter\expandafter\expandafter% + \SKV@carcube\expandafter\@gobble\string#1xxx\@nil}% + \edef\SKC@pref{\SKC@pref @}% + \SKV@scantoksa{\SKC@tfam,\SKC@pref}% + \SKV@testopth\SKC@keycmd@ii\SKC@pref +} +\newdef\SKC@keycmd@ii<#1>{% + \SKV@ifnotblank{#1}\relax\SKC@nilprefix + \SKC@badprefix{#1}% + \edef\SKC@pref{#1}% + \edef\SKC@tempa##1{\skvoptions{##1,keyfamily=\SKC@tfam, + macroprefix=\SKC@pref}}% + \SKC@tempa{keyparser=;,keyprefix=KV}% + \SKV@testoptp\SKC@keycmd@iii{}% +} +\newdef\SKC@keycmd@iii(#1){% + \SKV@ifnotempty{#1}\relax\SKC@nilkeylist + \SKC@keycmd@iv{#1}% + \SKV@despacelist*\SKC@keycmdlist + \SKV@despacelist*\SKC@k@ycmdlist + \define@keylist*\SKC@keycmdlist + \edef\SKC@tempa{\setkeys[KV]{\SKC@tfam}{\SKC@k@ycmdlist}}% + \SKC@tempa + \SKV@testopt\SKC@keycmd@v{0}% +} +\newdef\SKC@keycmd@iv#1{% + \SKV@emptycmds*{\SKC@keycmdlist,\SKC@k@ycmdlist}% + \XKV@checksanitizea{#1}\SKC@tempa + \SKV@normalizea\SKC@tempa + \SKV@for*[,]\SKC@tempa\SKC@tempa{% + \expandafter\SKC@getkeyname\SKC@tempa==\@nil + \SKC@addtokeylist\SKC@tkey\SKC@tval + }% +} +\newdef\SKC@keycmd@v[#1]{% + \SKC@paramerr{#1}% + \SKV@testopt{\SKC@keycmd@vi[#1]}{}% +} +\newdef\SKC@keycmd@vi[#1][#2]#3{% + \edef\SKC@resvda##1##2{% + ##1[\the\numexpr#1+1]\SKV@ifblank{#2}{}{[\unexpanded{#2}]}% + {\setkeys[KV]{\SKC@tfam}{####\the\numexpr#1+1}##2}% + }% + \SKV@ifx\l@ngrel@x\relax + {\def\SKC@resvdb{\newtwooptcmd*}}% + {\let\SKC@resvdb\newtwooptcmd}% + \SKC@resvda{\expandafter\SKC@resvdb\SKC@keycmdname}{#3}% +} +\robustdef*\renewkeycmd{\@star@or@long\SKC@renewkeycmd@i} +\robustdef*\csrenewkeycmd{\SKV@aftercs\renewkeycmd} +\newdef*\SKC@renewkeycmd@i#1{% + \SKV@ifdef#1{}% + {\SKC@err{Command '\string#1' undefined}% + {Undefined command '\string#1' can't be redefined.\SKV@MB + Use '\string\newkeycmd' instead.}% + }% + \let\SKV@ifdefinable\SKC@rc@ifdefinable + \let\@ifdefinable\@rc@ifdefinable + \SKC@keycmd@i#1% +} +\robustdef*\newkeyenviron{\@star@or@long\SKC@keyenviron@i} +\robustdef*\csnewkeyenviron{\SKV@aftercs\newkeyenviron} +\newdef\SKC@keyenviron@i#1{% + \SKV@ensurenoscape{#1}% + \SKV@ifcsdef{#1}{% + \SKV@err{You have submitted an existing macro '\string#1' as an\SKV@MB + environment name}{'\string#1' not allowed as environment name}% + }{}% + \edef\SKC@tfam{#1}% + \edef\SKC@pref{\SKV@carcube#1xxx\@nil @}% + \xdef\SKC@keycmdname{\SKV@noexpcs{#1}}% + \SKV@testopth\SKC@keyenviron@ii\SKC@pref +} +\newdef\SKC@keyenviron@ii<#1>{% + \SKV@ifnotblank{#1}\relax\SKC@nilprefix + \SKC@badprefix{#1}% + \edef\SKC@pref{#1}% + \edef\SKC@tempa##1{% + \skvoptions{##1,keyfamily=\SKC@tfam,macroprefix=\SKC@pref}}% + \SKC@tempa{keyparser=;,keyprefix=KV}% + \SKV@testoptp\SKC@keyenviron@iii{}% +} +\newdef\SKC@keyenviron@iii(#1){% + \SKV@ifnotempty{#1}\relax\SKC@nilkeylist + \SKC@keycmd@iv{#1}% + \define@keylist*\SKC@keycmdlist + \edef\SKC@tempa{\setkeys[KV]{\SKC@tfam}{\SKC@k@ycmdlist}}% + \SKC@tempa + \SKV@testopt\SKC@keyenviron@v{0}% +} +\newdef\SKC@keyenviron@v[#1]{% + \SKC@paramerr{#1}% + \SKV@testopt{\SKC@keyenviron@vi[#1]}{}% +} +\newdef\SKC@keyenviron@vi[#1][#2]#3#4{% + \edef\SKC@resvda##1##2{% + ##1[\the\numexpr#1+1]\SKV@ifblank{#2}{}{[\unexpanded{#2}]}% + {\setkeys[KV]{\SKC@tfam}{####\the\numexpr#1+1}##2}% + }% + \SKV@ifx\l@ngrel@x\relax{% + \def\SKC@resvdb{\SKV@csdef*}% + \def\SKC@resvdc{\newtwooptcmd*}% + }{% + \let\SKC@resvdb\SKV@csdef + \let\SKC@resvdc\newtwooptcmd + }% + \SKC@resvdb{end\SKC@tfam}{#4}% + \SKC@resvda{\expandafter\SKC@resvdc\SKC@keycmdname}{#3}% +} +\robustdef*\renewkeyenviron{\@star@or@long\SKC@renewkeyenviron@i} +\robustdef*\csrenewkeyenviron{\SKV@aftercs\renewkeyenviron} +\newdef*\SKC@renewkeyenviron@i#1{% + \SKV@ifcsdef{#1}{}{% + \SKV@err{Environment '#1' undefined}% + {Undefined environment '#1' can't be redefined.}% + }% + \SKV@Undef+?{#1,end#1}% + \SKC@keyenviron@i{#1}% +} +\newdef\SKC@getkeyname#1=#2=#3\@nil{% + \XKV@g@tkeyname#1=\@nil\SKC@tkey + \SKV@expnext\SKV@sp@def\SKC@tkey\SKC@tkey + \def\SKC@tval{#2}% + \SKV@oifempty{\SKC@tkey}{% + \SKV@ifempty{#2}{}% + {\SKC@err{No key specified for value '#2'}% + {Key required for value '#2'.}% + }% + }{}% + \SKV@ifnotempty{#3}{}% + {\SKC@err{No value specified for key '#1'}% + {Value required for key '#1'.}}% +} +\newdef\SKC@addtokeylist#1#2{% + \SKV@checkchoice{#2}{true,on,false,off}{% + \def\SKC@tempa{bool}}{\def\SKC@tempa{cmd}}% + \SKV@oifblank{#1}{}{% + \edef\SKC@resvd##1{\SKV@addtolist?[;]##1{\SKC@tempa,% + \SKV@expox{#1},\SKV@expox{#2},}}% + \SKC@resvd\SKC@keycmdlist + \SKV@expnext\SKC@fpointers#1% + \edef\SKC@resvd##1{\SKV@addtolist?[,]##1{\SKV@expox\SKC@resa + =\SKV@expox{#2}}}% + \SKC@resvd\SKC@k@ycmdlist + }% +} +\SKV@def*\SKC@fpointers#1{% + \SKC@rskey{#1}\uservalue\savevalue\@nil\SKC@resa{}% + {\SKC@rskey{#1}\guservalue\savevalue\@nil\SKC@resa{}% + {\SKC@rskey{#1}\savevalue\uservalue\@nil\SKC@resa{}% + {\SKC@rskey{#1}\gsavevalue\uservalue\@nil\SKC@resa{}% + {\SKC@rskey{#1}\guservalue\gsavevalue\@nil\SKC@resa{}% + {\SKC@rskey{#1}\gsavevalue\guservalue\@nil\SKC@resa{}% + {\SKC@rskey{#1}\uservalue\@nil\SKC@resa{}% + {\SKC@rskey{#1}\guservalue\@nil\SKC@resa{}% + {\SKC@rskey{#1}\savevalue\@nil\SKC@resa{}% + {\SKC@rskey{#1}\gsavevalue\@nil\SKC@resa{}{}}}}}}}}}}% +} +\robustdef*\newtwooptcmd{\@star@or@long\SKC@newcommand@i} +\newdef*\SKC@newcommand@i#1{\SKV@testopt{\SKC@newcommand@ii#1}0} +\newdef*\SKC@newcommand@ii#1[#2]{% + \SKV@if@brack{\SKC@xargdef#1[#2]}{\SKC@argdef#1[#2]}} +\newdef\SKC@argdef#1[#2]#3{\SKV@ifdefinable#1{\SKC@yargdef#1\@ne{#2}{#3}}} +\newdef\SKC@xargdef#1[#2][#3]#4{% + \SKV@ifdefinable#1{% + \edef\SKC@resvda##1##2##3{% + \def##1{##2\SKV@noexpcs{\string#1}{##3}}}% + \SKC@resvda#1{\SKC@protected@testopt#1}{#3}% + \SKV@aftercs\SKC@yargdef{\string#1}\tw@{#2}{#4}% + }% +} +\newdef\SKC@protected@testopt#1{% + \SKV@ifx\protect\@typeset@protect\SKV@testopt{\SKC@x@protect#1}% +} +\newdef\SKC@x@protect#1#2#3{\protect#1} +\newdef\SKC@yargdef#1#2#3{% + \SKV@ifx{#2}\tw@ + {\edef\SKC@shear##11{[\detokenize{####1}]}}% + {\let\SKC@shear\@gobble}% + \SKV@expnext\SKC@yargd@f{\the\numexpr#3}#1% +} +\newdef*\SKC@dotparse@a#1{% + \SKV@toks{}% + \edef\SKC@resa{\unexpanded{#1}.}% + \def\SKC@resb##1.##2\@nil{% + \SKV@in@o{[}{##1}% + {\SKV@toks\expandafter{\the\SKV@toks##1}}% + {\SKV@toks\expandafter{\the\SKV@toks{##1}}}% + \SKV@ifempty{##2}{}{\SKC@resb##2\@nil}% + }% + \expandafter\SKC@resb\SKC@resa\@nil + \edef\SKC@resa{\the\SKV@toks}% +} +\newdef*\SKC@dotparse@b#1{% + \SKV@toks{}% + \edef\SKC@resa{\unexpanded{#1}.}% + \def\SKC@resb##1.##2\@nil{% + \SKV@toks\expandafter{\the\SKV@toks##1}% + \SKV@ifempty{##2}{}{\SKC@resb##2\@nil}% + }% + \expandafter\SKC@resb\SKC@resa\@nil + \edef\SKC@resa{\the\SKV@toks}% +} +\newdef\SKC@yargd@f#1#2{% + \edef\SKC@resvdb{\detokenize{0####1.####2.####3.####4.####5.% + ####6.####7.####8.####9.#####1}}% + \def\SKC@resvda##1#1##2\@nil{% + \def\SKC@resvdb{##1}% + \def\SKC@resvda####1{% + \def\SKC@resvda########1####1########2\@nil{% + \SKV@ifempty{########1}{% + \edef\SKC@tempa{\SKC@shear####1########2#1}% + \let\SKC@tempb\SKC@tempa + \let\SKC@tempc\SKC@tempa + }{% + \edef\SKC@resvda{\SKC@shear########1####1}% + \SKV@expnext\SKC@dotparse@a\SKC@resvda + \let\SKC@tempa\SKC@resa + \SKV@expnext\SKC@dotparse@b\SKC@resvda + \let\SKC@tempb\SKC@resa + \edef\SKC@resvda{########2#1}% + \SKV@expnext\SKC@dotparse@b\SKC@resvda + \edef\SKC@tempc{\SKC@tempb(\SKC@resa)}% + }% + }% + \expandafter\SKC@resvda\SKC@resvdb\@nil + }% + \SKV@iftest{num}{#1=0}{% + \SKV@emptycmds{\SKC@tempa,\SKC@tempb,\SKC@tempc}% + }{% + \SKV@expnext\SKC@resvda{\the\numexpr#1-1}% + }% + }% + \expandafter\SKC@resvda\SKC@resvdb\@nil + \SKV@scantoksa{\SKC@tempa,\SKC@tempb,\SKC@tempc}% + \edef\SKC@resvda{\expandafter\@gobble\string#2@SKC}% + \edef\SKC@resvdb{\l@ngrel@x\def\noexpand#2\SKC@tempb + \ifnum#1<\tw@ + \ifx\SKC@shear\@gobble + {\SKV@noexpcs\SKC@resvda{\SKC@tempa}}% + \else + {\SKV@noexpcs\SKC@resvda\SKC@tempa}% + \fi + \else + {\noexpand\SKV@testoptp{\SKV@noexpcs\SKC@resvda\SKC@tempa}{}}% + \fi + }% + \SKC@resvdb + \edef\SKC@resvdb{\l@ngrel@x\def\SKV@noexpcs\SKC@resvda\SKC@tempc}% + \SKC@resvdb +} +\newdef\SKC@reargdef#1[#2]{\SKC@yargdef#1\@ne{#2}} +\robustdef*\renewtwooptcmd{\@star@or@long\SKC@renewcommand@i} +\newdef*\SKC@renewcommand@i#1{% + \SKV@ifdef#1{}% + {\SKC@err{Command '\string#1' undefined}% + {Command '\string#1' can't be redefined.}% + }% + \let\SKV@ifdefinable\SKC@rc@ifdefinable + \SKC@newcommand@i#1% +} +\let\SKC@ifd@finable\SKV@ifdefinable +\newdef\SKC@rc@ifdefinable#1#2{\let\SKV@ifdefinable\SKC@ifd@finable#2} +\newdef*\newtwooptenviron{\@star@or@long\SKC@newenvironment@i} +\newdef*\SKC@newenvironment@i#1{\SKV@testopt{\SKC@newenv@a#1}0} +\newdef*\SKC@newenv@a#1[#2]{% + \SKV@if@brack{\SKC@newenv@b#1[#2]}{\SKC@newenv{#1}{[#2]}}} +\newdef*\SKC@newenv@b#1[#2][#3]{\SKC@newenv{#1}{[#2][{#3}]}} +\newdef*\renewtwooptenviron{\@star@or@long\SKC@renewenvironment@i} +\newdef*\SKC@renewenvironment@i#1{% + \SKV@ifcsdef{#1}{}{% + \SKV@err{Environment '#1' undefined}% + {Environment '#1' can't be redefined}% + }% + \SKV@Undef+?{#1,end#1}% + \SKC@newenvironment@i{#1}% +} +\newdef\SKC@newenv#1#2#3#4{% + \SKV@ifcsdef{#1}{}{\SKV@csletcs*{#1}{end#1}}% + \SKV@aftercs\SKC@newcommand@i{#1}#2{#3}% + \l@ngrel@x\@namedef{end#1}{#4}% +} +\robustdef*\SKC@nilprefix{% + \SKC@err{% + No key-value prefix submitted.\SKV@MB + The prefix will be used to hold your values\SKV@MB + for the declared keys + }{% + Keycommand requires key-value prefix.\SKV@MB + I guess you submitted an empty prefix using '<>'.\SKV@MB + I can use the default key-value prefix 'skv' if\SKV@MB + you don't submit any prefix. In that case\SKV@MB + leave out '<>' from your command. + }% +} +\robustdef*\SKC@badprefix#1{% + \SKC@fdigit{#1}% + \unless\ifSKC@swa\SKV@afterfi + \SKC@err{% + '\string#1' is likely a wrong macro prefix + }{% + I expected letters here, not digits.\SKV@MB + OK, digits are actually acceptable as prefix\SKV@MB + but you need to be wary of them if they appear\SKV@MB + in your control sequences. Also, I fear\SKV@MB + you may have wrongly entered the number of\SKV@MB + arguments of your key command here, instead\SKV@MB + of putting it in the right place (in square brackets). + }% + \fi +} +\robustdef*\SKC@nilkeylist{% + \SKC@err{% + No key list submitted.\SKV@MB + Why use keycommand without keys? + }{% + Keycommand requires keys.\SKV@MB + Perhaps you submitted an empty key list,\SKV@MB + or your arguments to command are inconsistent.\SKV@MB + Please see the user guide. + }% +} +\newdef*\SKC@paramerr#1{% + \SKV@uniftest{num}{#1>8}{}{% + \SKC@err{% + Number '\string#1' of parameters too large + }{% + You're limited to 8 parameters here.\SKV@MB + If necessary, you can use keys to submit\SKV@MB + more variables. In fact, you can use keys to\SKV@MB + submit all your variables. + }% + }% +} + +\endinput + +%%% End of file skeycommand.sty %%% |