summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/storecmd
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/storecmd
Initial commit
Diffstat (limited to 'macros/latex/contrib/storecmd')
-rw-r--r--macros/latex/contrib/storecmd/README138
-rw-r--r--macros/latex/contrib/storecmd/storecmd-example.tex31
-rw-r--r--macros/latex/contrib/storecmd/storecmd-guide.pdfbin0 -> 262857 bytes
-rw-r--r--macros/latex/contrib/storecmd/storecmd-guide.tex195
-rw-r--r--macros/latex/contrib/storecmd/storecmd.sty280
5 files changed, 644 insertions, 0 deletions
diff --git a/macros/latex/contrib/storecmd/README b/macros/latex/contrib/storecmd/README
new file mode 100644
index 0000000000..6d29072ce4
--- /dev/null
+++ b/macros/latex/contrib/storecmd/README
@@ -0,0 +1,138 @@
+This is the README file for the 'storecmd' package.
+
+VERSION
+
+Version 0.0.1, October 2011.
+
+SUMMARY
+
+This package provides macros for command definition that save the
+name of the command being defined in a file or a macro container.
+Even when the user uses a syntax similar to that of \newcommand,
+some or all of the parameters of the defined command can be delimited,
+as desired by the command author.
+
+It was written in response to a post on comp.text.tex for a macro
+that will define commands and also save the commands being defined
+in a file or a container macro, eg, for spelling exceptions. Three
+macros are provided for this purpose:
+
+\defsavecmd<cmd><param>{<defn>}
+\newsavecmd<cmd><param>{<defn>}
+\renewsavecmd<cmd><param>{<defn>}
+
+Here <cmd> is the command name, <param> is the parameter list, and
+<defn> is the replacement text. In \defsavecmd, the <param> list is
+as in \def; in \newsavecmd and \renewsavecmd, the <param> list is
+as in \newcommand. \defsavecmd will overwrite an existing command;
+both \newsavecmd and \renewsavecmd will not do so.
+
+The commands \defsavecmd, \newsavecmd and \renewsavecmd may be
+prefixed by \globalcmd and/or \protectedcmd to yield global or robust
+definitions, respectively. For example,
+
+\defsavecmd\cmda#1#2{xxx#1#2}
+\globalcmd\defsavecmd\cmdb#1#2{xxx#1#2}
+\globalcmd\newsavecmd\cmdc[2]{xxx#1#2}
+\protectedcmd\globalcmd\renewsavecmd*\cmda[2][zz]{\def\y##1{##1xxx}}
+
+The parameters of \defsavecmd can readily be delimited as in the case
+of \def. The parameters of \newsavecmd and \renewsavecmd can be
+delimited as follows:
+
+\newsavecmd<cmd><param>(<delimiters>){<defn>}
+\renewsavecmd<cmd><param>(<delimiters>){<defn>}
+
+The <delimiters>, given in parenthesis, have the syntax:
+
+1<\delim1> 2<\delim2> ... 9<\delim9>
+
+where <\delim1> is the delimiter for the first parameter, etc. Only the
+parameters with delimiters are to be specified in <delimiters>.
+For example,
+
+\protectedcmd\newsavecmd\cmda[2](1\@nil 2\@mil){xxx#1#2}
+\newsavecmd\cmdb[9][yy](3\@nil 9\@mil){xxx#1#2#3...#9}
+
+When the first argument is optional, then it can't have a delimiter,
+since the delimiter for that parameter is already '[]'.
+
+
+The package options are
+
+neversave - Never save/store the new commands in the container
+ file or command. The new commands will still be defined.
+ Default: false
+
+storerenew - Allow the storage of a command that has already
+ been stored. This is used by \renewsavecmd.
+ Default: false.
+
+overwrite - Allow overwrite of an existing container file or
+ command. Default: false.
+
+storefile - Container file. Default: cmdnamesfile.
+
+storecmd - Container command. Default: cmdnamesmacro.
+
+verbose - Give extra information in the transcript file.
+ Default: true. Turn this off if you don't like
+ or need such information.
+
+
+EXAMPLE FILE
+
+\begin{filecontents}{storecmd-example.tex}
+\documentclass{article}
+% Container commands are also accepted as package options,
+% but in this case 'catoptions' must be loaded before
+% \usepackage{storecmd}.
+% Eg,
+% \usepackage{catoptions}
+% \usepackage[storecmd=\mycommands]{storecmd}
+%
+% Uncomment the next line to test what happens when
+% an existing command is being refilled:
+% \def\mycommands{}
+
+\usepackage[
+ storerenew=true,storecmd=mycommands,storefile=mycommands
+]{storecmd}
+
+\defsavecmd\cmda#1#2{xxx#1#2}
+\globalcmd\defsavecmd\cmdb#1#2{xxx#1#2}
+\globalcmd\newsavecmd\cmdc[2]{xxx#1#2}
+\globalcmd\newsavecmd\cmdd[2][yy]{xxx#1#2}
+\protectedcmd\globalcmd\renewsavecmd*\cmda[2][zz]{\def\y##1{##1xxx}}
+\newsavecmd\cmde[2](1\@nil 2\@mil){xxx#1#2}
+\newsavecmd\cmdf[9][yy](2\@nil 3\@mil){xxx#1#2#3...#9}
+
+% Try \show\mycommands or see file 'mycommands.tex'.
+
+\begin{document}
+Blackberry lily.
+\end{document}
+\end{filecontents}
+
+
+LICENSE
+
+Copyright (c) October 2011 Ahmed Musa (amusa22@gmail.com)
+
+This work (ie, all the files in the storecmd manifest) may be
+distributed and/or modified under the conditions of the LaTeX
+Project Public License (LPPL), 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.
+
+
+
+
diff --git a/macros/latex/contrib/storecmd/storecmd-example.tex b/macros/latex/contrib/storecmd/storecmd-example.tex
new file mode 100644
index 0000000000..d7f0afc968
--- /dev/null
+++ b/macros/latex/contrib/storecmd/storecmd-example.tex
@@ -0,0 +1,31 @@
+\documentclass{article}
+% Container commands are also accepted as package options,
+% but in this case 'catoptions' must be loaded before
+% \usepackage{storecmd}.
+% Eg,
+% \usepackage{catoptions}
+% \usepackage[storecmd=\mycommands]{storecmd}
+%
+% Uncomment the next line to test what happens when
+% an existing command is being refilled:
+% \def\mycommands{}
+
+\usepackage[
+ storerenew=false,storecmd=mycommands,storefile=mycommands,
+]{storecmd}
+
+\defsavecmd\cmda#1#2{xxx#1#2}
+\globalcmd\defsavecmd\cmdb#1#2{xxx#1#2}
+\globalcmd\newsavecmd*\cmdc[2]{xxx#1#2}
+\globalcmd\newsavecmd\cmdd[2][yy]{xxx#1#2}
+\protectedcmd\globalcmd\renewsavecmd*\cmda[2][zz]{\def\y##1{##1xxx}}
+\protectedcmd\newsavecmd\cmde[2](1\@nil 2\@mil){xxx#1#2}
+\newsavecmd\cmdf[9][yy](3\@nil 9\@mil){xxx#1#2#3...#9}
+
+% Try \show\mycommands or see file 'mycommands.tex'.
+
+\begin{document}
+
+Blackberry lily.
+
+\end{document}
diff --git a/macros/latex/contrib/storecmd/storecmd-guide.pdf b/macros/latex/contrib/storecmd/storecmd-guide.pdf
new file mode 100644
index 0000000000..d770dd5a3f
--- /dev/null
+++ b/macros/latex/contrib/storecmd/storecmd-guide.pdf
Binary files differ
diff --git a/macros/latex/contrib/storecmd/storecmd-guide.tex b/macros/latex/contrib/storecmd/storecmd-guide.tex
new file mode 100644
index 0000000000..b6a30c4b2a
--- /dev/null
+++ b/macros/latex/contrib/storecmd/storecmd-guide.tex
@@ -0,0 +1,195 @@
+\documentclass[
+ use-a4-paper,
+ use-10pt-font,
+ final-version,
+ use-UK-English,
+ fancy-section-headings,
+ frame-section-numbers,
+ para-abstract-style,
+ input-config-file,
+ no-hyperref-messages,
+ wrapquote
+]{amltxdoc}
+
+\makeatletter
+\hfuzz1pt
+\makeindex
+\usepackage{makeidx}
+\subtitlefont{\bf\sf}
+
+\useshortdoccmds
+
+\begin{document}
+
+\begin{frontmatter}
+\title{The \texttt{\color{blue}storecmd} Package\titleref{t1}}
+\titlenotes[t1]{%
+ The package is available at \url{\titleurltext}.
+ This user manual corresponds to version~0.0.2 of the package.
+}
+\subtitle{Define command and save its name in a container file or macro}
+\titleurl{http://www.ctan.org/tex-archive/macros/latex/contrib/storecmd/}
+\author{Ahmed Musa\Email{amusa22@gmail.com}\\Preston, Lancashire, UK}
+
+\end{frontmatter}
+
+
+\hrule height.5pt depth.5pt width\textwidth
+\vskip 1ex plus 1pt minus 1pt
+\begingroup
+\hypersetup{linkcolor=blue}\tableofcontents
+\endgroup
+\hrule height.5pt depth.5pt width\textwidth
+
+
+\docsection(sec:intro){Introduction}
+
+This package provides macros for command definition that save the name of the command being defined in a file or a macro container. For ease of reference, we refer to macros for command definition as \quoted{master macros}, and the macro that stores the defined commands as the \quoted{container macro}. The file that stores the defined commands is the \quoted{container file}. In this package there are two categories of master macros for command definition: one category has a syntax similar to that of \tex's \hx{\def} while the other category has the syntax of \latex's \hx{\newcommand}. Only one master macro is available in the first category. Naturally, commands defined by the master macro of the first category can have their parameters delimited in the usual way. When the user uses one of the master macros for command definition from the second category (\ie, one of those that have a syntax similar to that of \hx{\newcommand}), some or all of the parameters of the defined command can be delimited, as desired by the command author. Normally, parameters of commands defined by \latex's \hx{\newcommand} can't be delimited.
+
+The package can also be used as a debugging tool, or at least as a command location tool: namely, to store the names of defined commands and the sources in which they are defined. This can be realized by using the \fx{showsource} package option. However, this will track only the commands defined by the master macros of this package. It is safe to assign \hhx'{\newcommand, \renewcommand} to \ffx'{\newsavecmd, \renewsavecmd}, respectively. But, for rather obvious reasons, it is not advisable to simply replace the native \hhx'{\global,\long,\protected,\def,\gdef} by the master macros of this package\footnote{One reason for this is that, for example, you can't do \ftfx{\stcglobal\let\x\y} or \ftfx{\stcglobal\@tempswatrue} because \ftffx'{\stcprotected,\stcglobal} are tailor made for the commands \ftffx'{\defsavecmd, \newsavecmd, \renewsavecmd}.}.
+
+
+\docsection{Motivation}
+
+The package was written in response to a post on \ltshref{https://groups.google.com/forum/
+#!topic/comp.text.tex/o14P2e83o4A}{comp.text.tex} for a macro that will define commands and also save the commands being defined in a file or a container macro, \eg, for spelling exceptions on editors that don't support \tex syntax.
+
+
+\docsection{Package options}
+
+The package options are described in \sref{tab:pkgoptions}.
+
+\extrarowheight=2pt
+\arrayrulecolor{yellow}
+\begin{tabularx}{\linewidth}{|m{3cm}|m{2.5cm}|X|}
+\caption{Package options\label{tab:pkgoptions}}\\\hline
+\rowcolor{pink}
+\bfseries Option&\bfseries Default&\bfseries Meaning\\\hline
+\endfirsthead
+\hline
+\multicolumn{3}{|l|}{\emph{Continued from last page}}\\\hline
+\bfseries Option&\bfseries Default&\bfseries Meaning\\\hline
+\endhead
+\multicolumn{3}{|r|}{\emph{Continued on next page}}\\\hline
+\endfoot
+\hline
+\endlastfoot
+\fxi{neversave} & \texttt{false} & Never save/store the new command name in the container file or container macro. The new commands will still be defined.\\\hline
+\fxi{storerenew} & \texttt{false} & Allow the storage of a command name that has already been stored. This is used by \fx{\renewsavecmd}.\\\hline
+\fxi{overwrite} & \texttt{false} & Allow overwrite of an existing container file or container macro.\\\hline
+\fxi{storefile} & \fxi{containerfile} & Container file name.\\\hline
+\fxi{storecmd} & \fxi{containermacro} & Container macro name.\\\hline
+\fxi{showsource} & \texttt{false} & Show the name of the source file of the command.\\\hline
+\fxi{verbose} & \texttt{true} & Give extra information in the transcript file. Turn this option off if you don't like or need such information, but only minimal information is actually logged.\\\hline
+\end{tabularx}
+
+When a boolean option is given without value, its value is assumed to be \hx{true}.
+
+
+\docsection{User commands}
+
+Three master macros are provided for storing command names:
+
+\start{newmacro}[\defsavecmd,\newsavecmd,\renewsavecmd]
+\defsavecmd|A(cmd)|A(param){|A(defn)}
+\newsavecmd|A(cmd)[|A(nparam)][|A(default)]{|A(defn)}
+\renewsavecmd|A(cmd)[|A(nparam)][|A(default)]{|A(defn)}
+\finish{newmacro}
+\fxi*{\defsavecmd,\newsavecmd,\renewsavecmd}
+
+Here \ang{cmd} is the command name, \ang{param} is the parameter list, \ang{nparam} is the number of parameters, \ang{default} is the default value of the first parameter/argument, and \ang{defn} is the replacement text. In \fx{\defsavecmd}, the \ang{param} list is as in \tex's \hx{\def}; in \ffx'{\newsavecmd, \renewsavecmd}, the \ang{nparam} and \ang{default} are as in \hx{\newcommand}. Both \ffx'{\defsavecmd, \renewsavecmd} will overwrite an existing command, but \fx{\newsavecmd} will not do so.
+
+The commands \ffx'{\defsavecmd, \newsavecmd, \renewsavecmd} may be prefixed by \fx{\stcglobal} and/or \fx{\stcprotected} to yield global or robust definitions, respectively. For example,
+
+\start{example}[\stcglobal,\stcprotected]
+\defsavecmd\cmda#1#2{xxx#1#2}
+|R(\stcglobal)\defsavecmd\cmdb#1#2{xxx#1#2}
+|R(\stcglobal)\newsavecmd\cmdc[2]{xxx#1#2}
+|R(\stcprotected\stcglobal)\renewsavecmd*\cmda[2][zz]{\def\y##1{##1xxx}}
+\finish{example}
+\fxi*{\stcglobal,\stcprotected}
+
+
+\docsubsection{Delimited parameters}
+
+The parameters of \fx{\defsavecmd} can readily be delimited as in the case of \tex's \hx{\def}. The parameters of \ffx'{\newsavecmd, \renewsavecmd} can be delimited as follows:
+
+\start'{newmacro}[Delimited parameters]
+\newsavecmd|A(cmd)[|A(param)][|A(default)]|(|A(delimiters)|){|A(defn)}
+\renewsavecmd|A(cmd)[|A(param)][|A(default)]|(|A(delimiters)|){|A(defn)}
+\finish{newmacro}
+
+The \ang{delimiters}, given here in parenthesis, have the syntax
+
+\start'{newmacro}[Delimited parameters]
+1|A(delim1) 2|A(delim2) ... 9|A(delim9)
+\finish{newmacro}
+
+where \ang{delim1} is the delimiter for the first parameter, etc. Only the parameters with delimiters are to be specified in \ang{delimiters}. For example,
+
+\start'{example}[Delimited parameters]
+\newsavecmd\cmda[2]|(1\@nil 2\@mil|){xxx#1#2}
+\newsavecmd\cmdb[9][yy]|(3\@nil 4\@mil 6\@nnil|){xxx#1#2#3...#9}
+\finish{example}
+
+When the first argument is optional, then it can't have a delimiter, since the delimiter for that parameter is already \quotedfx{[]}.
+
+
+\docsection{Examples}
+
+The following example is available in the accompanying \file{storecmd-example} file:
+
+\start{example}[\defsavecmd,\newsavecmd,\stcglobal, etc]
+\documentclass{article}
+% Container commands are also accepted as package options, but in this
+% case `catoptions' must be loaded before \usepackage{storecmd}.
+% Eg,
+% \usepackage{catoptions}
+% \usepackage[storecmd=\mycommands]{storecmd}
+%
+% Uncomment the next line to test what happens when an existing container
+% command is being refilled:
+% \def\mycommands{}
+
+\usepackage[
+ storerenew=true,storecmd=mycommands,storefile=mycommands
+]{storecmd}
+
+\defsavecmd\cmda#1#2{xxx#1#2}
+\stcglobal\defsavecmd\cmdb#1#2{xxx#1#2}
+\stcglobal\newsavecmd\cmdc[2]{xxx#1#2}
+\stcglobal\newsavecmd\cmdd[2][yy]{xxx#1#2}
+\stcprotected\stcglobal\renewsavecmd*\cmda[2][zz]{\def\y##1{##1xxx}}
+\stcprotected\newsavecmd\cmde[2]|(1\@nil 2\@mil|){xxx#1#2}
+\newsavecmd\cmdf[9][yy]|(3\@nil 9\@mil|){xxx#1#2#3...#9}
+
+% Try \show\mycommands or see file `mycommands.tex'.
+
+\begin{document}
+Blackberry lily.
+\end{document}
+\finish{example}
+\fxi*{\defsavecmd,\newsavecmd,\renewsavecmd}
+
+
+\docsection(sec:version-hist){Version history}
+
+The \stsign on the right-hand side of the following lists means the subject features in the package but is not reflected anywhere in this user guide.
+
+\begin{versionhist}
+ \begin{version}{0.0.2}{2011/10/22}
+ \item User guide completed.\vsecref*
+ \end{version}
+ \begin{version}{0.0.1}{2011/10/17}
+ \item First public release.\vsecref*
+ \end{version}
+\end{versionhist}
+
+\newpage
+\ltsindexpreamble{Index numbers refer to page numbers.}
+\ltsindexpreambleformat{\centering}
+\ltsindexcolumns\tw@
+
+\printindex
+
+\end{document} \ No newline at end of file
diff --git a/macros/latex/contrib/storecmd/storecmd.sty b/macros/latex/contrib/storecmd/storecmd.sty
new file mode 100644
index 0000000000..08a81919d0
--- /dev/null
+++ b/macros/latex/contrib/storecmd/storecmd.sty
@@ -0,0 +1,280 @@
+%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
+% %
+% This is file 'storecmd.sty', version 0.0.1, October 2011. %
+% %
+% 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) 2011 Ahmed Musa (amusa22@gmail.com). %
+% %
+%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
+
+\@ifpackageloaded{catoptions}{}{\RequirePackage{catoptions}[2011/08/07]}
+\UseNormalCatcodes
+\StyleFilePurpose{Store command name at definition time}
+\StyleFileRCSInfo
+$Id: storecmd.sty,v 0.0.1 2011/10/15 09:00:00 Ahmed Musa Exp $
+\ProvidesPackage{storecmd}[\StyleFileInfo]
+\NeedsTeXFormat{LaTeX2e}[2005/12/01]
+\SetStyleFileMessages[stcmd@]{info}{warn}{err}
+\RequirePackage{ltxtools}[2011/09/10]
+\robust@def*\stcmd@verbosewarn#1{\ifstcmd@verbose\stcmd@warn{#1}\fi}
+\robust@def*\stcmd@verboseinfo#1{\ifstcmd@verbose\stcmd@info{#1}\fi}
+\providecommand*\ifsentinelTF[1]{%
+ \edef\reserved@a{\unexpanded{#1}}%
+ \ifx\reserved@a\currsentinel\expandafter\@firstoftwo
+ \else\expandafter\@secondoftwo\fi
+}
+\robust@def*\stcmd@merge{\LTS@testopt\stcmd@m@rge,}
+\robust@def*\stcmd@m@rge[#1]#2#3{%
+ \trim@@spaces{#3}\LTS@tempa
+ \ifdefTF#2{}{\def#2{}}%
+ \xifinsetTF{#1\@space\LTS@tempa#1}{#1\@space#2#1}{}{%
+ \xdef#2{\csliststack{#1\@space}#2\expandcsonce\LTS@tempa}%
+ }%
+}
+\newvariables{if}[stcmd@]{storefile,storecmd,cmdescap,global,long,
+ protected,verbose}
+\robust@def*\stcmd@typeintocontinue{%
+ \message{^^JType x or X to quit, or <RETURN> to proceed^^J}%
+ {\endlinechar-1\global\read-1 to\@gtempa}%
+ \lowercase\expandafter{\expandafter\def\expandafter
+ \@gtempa\expandafter{\@gtempa}}%
+ \xifstrcmpTF\@gtempa{x}\LTS@emergencystop\relax
+}
+
+\docommalist{storerenew,overwrite,neversave,showsource}{%
+ \XDeclareSwitchOption{#1}[true](stcmd@){%
+ \ifdefswitchTF{stcmd@#1}{%
+ \stcmd@verboseinfo{'#1' set true\on@line}%
+ }{}%
+ }%
+}
+
+\XDeclareSwitchOption{verbose}[true](stcmd@){%
+ \ifdefswitchTF{stcmd@verbose}{%
+ \stcmd@info{'verbose' set true\on@line}%
+ }{}%
+}
+\XDeclareCommandOption{storefile}[cmdnamesfile](stcmd@){%
+ \ifblankTF{#1}{%
+ \stcmd@err{No storage file name}\@ehc
+ \stcmd@storefilefalse
+ }{%
+ \if\stcmd@overwrite\else
+ \IfFileExists\stcmd@storefile{%
+ \message{^^J! File '\stcmd@storefile' already exists:}%
+ \stcmd@typeintocontinue
+ }{}%
+ \fi
+ \stcmd@storefiletrue
+ \NewWrites[stcmd@]{outputcheck}%
+ \immediate\openout\stcmd@outputcheck=\stcmd@storefile\@space
+ \immediate\write\stcmd@outputcheck{\relax}%
+ \LTS@AfterEndDocument{\immediate\closeout\stcmd@outputcheck}%
+ }%
+}
+\XDeclareCommandOption{storecmd}[cmdnamesmacro](stcmd@){%
+ \def\stcmd@tempa##1{%
+ \message{^^J! Command '##1\stcmd@storecmd' already exists:}%
+ \stcmd@typeintocontinue
+ }%
+ \ifblankTF{#1}{%
+ \stcmd@err{No storage command name}\@ehc
+ \stcmd@storecmdfalse
+ }{%
+ \stcmd@storecmdtrue
+ \ifescapedTF{#1}{%
+ \if\stcmd@overwrite\else
+ \ifdefFT{#1}{}{\stcmd@tempa\expandcsonce}%
+ \fi
+ \stcmd@cmdescaptrue
+ \gdef#1{}%
+ }{%
+ \if\stcmd@overwrite\else
+ \ifcsndefFT{#1}{}{\stcmd@tempa\noexpandcsn}%
+ \fi
+ \stcmd@cmdescapfalse
+ \csn@gdef{#1}{}%
+ }%
+ }%
+}
+\XDeclareOption*{\stcmd@warn{Unknown option '\CurrentOption' ignored}}
+\XExecuteOptions{%
+ verbose=true,neversave=false,storerenew=false,overwrite=false,
+ showsource=false
+}
+\XProcessOptions*\relax
+\robust@def*\longcmd{\stcmd@longtrue}
+\robust@def*\globalcmd{\stcmd@globaltrue}
+\robust@def*\protectedcmd{\stcmd@protectedtrue}
+\robust@def*\stcmd@cmdprefixes@a{%
+ \ifstcmd@global\global\fi
+ \ifstcmd@long\long\fi
+ \ifstcmd@protected\protected\fi
+}
+\robust@def*\stcmd@cmdprefixes@b{%
+ \ifstcmd@global
+ \stcmd@globalfalse
+ \let\stcmd@global\global
+ \else
+ \let\stcmd@global\@empty
+ \fi
+ \ifstcmd@long
+ \stcmd@longfalse
+ \let\stcmd@long\long
+ \else
+ \let\stcmd@long\@empty
+ \fi
+ \ifstcmd@protected
+ \stcmd@protectedfalse\protected
+ \fi
+ \stcmd@global\stcmd@long
+}
+\robust@def*\defsavecmd{\cpt@starorlong\stcmd@defsavecmd}
+\robust@def*\newsavecmd{\cpt@starorlong\stcmd@newsavecmd}
+\robust@def*\renewsavecmd{\cpt@starorlong\stcmd@renewsavecmd}
+\robust@def*\stcmd@savecmd#1{%
+ \if\stcmd@neversave\else
+ \begingroup
+ \escapechar=92
+ \xdef\@gtempa{%
+ \expandafter\@gobble\string#1%
+ \if\stcmd@showsource
+ \@space(\ifx\@currname\@empty
+ \jobname.tex\else\@currname.\@currext\fi)%
+ \fi
+ }%
+ \endgroup
+ \ifstcmd@storefile
+ \immediate\write\stcmd@outputcheck{\@gtempa}%
+ \fi
+ \ifboolFT{stcmd@storecmd}{}{%
+ \cptexpanded{%
+ \stcmd@merge
+ \ifstcmd@cmdescap
+ \expandcsonce\stcmd@storecmd
+ \else
+ \noexpandcsn\stcmd@storecmd
+ \fi
+ {\@gtempa}%
+ }%
+ }%
+ \fi
+}
+\robust@def*\stcmd@defsavecmd#1{%
+ \ifdefFT{#1}{}{%
+ \if\stcmd@verbose
+ \stcmd@info{Command '\string#1' is redefined\on@line}%
+ \fi
+ }%
+ \stcmd@savecmd{#1}%
+ \stcmd@cmdprefixes@b\l@ngrel@x\def#1%
+}
+\robust@def*\stcmd@newsavecmd#1{%
+ \stcmd@savecmd{#1}%
+ \LTS@testopt{\stcmd@n@wc@mmand#1}{0}%
+}
+\robust@def*\stcmd@renewsavecmd#1{%
+ \ifdefTF{#1}{%
+ \if\stcmd@storerenew
+ \stcmd@savecmd{#1}%
+ \fi
+ \let\ifcsdefinable\rc@ifcsdefinable
+ \stcmd@n@wcommand#1%
+ }{%
+ \stcmd@err{Command '\string#1' is undefined:
+ \MessageBreak it can't be redefined}\@ehc
+ }%
+}
+\robust@def*\stcmd@newcommand{\cpt@starorlong\stcmd@n@wcommand}
+\robust@def*\stcmd@n@wcommand#1{\LTS@testopt{\stcmd@n@wc@mmand#1}0}
+\robust@def*\stcmd@n@wc@mmand#1[#2]{%
+ \ifnextisbrack{\stcmd@xargdef@a#1{#2}}{\stcmd@argdef@a#1{#2}}%
+}
+\robust@def\stcmd@argdef@a#1#2{%
+ \LTS@testpnopt{\stcmd@argdef@b{#1}{#2}}{}%
+}
+\robust@def\stcmd@argdef@b#1#2(#3)#4{%
+ \def\stcmd@tempd{#3}%
+ \ifcsdefinable#1{\stcmd@yargdef#1\@ne{#2}{#4}}%
+}
+\robust@def\stcmd@xargdef@a#1#2[#3]{%
+ \LTS@testpnopt{\stcmd@xargdef@b{#1}{#2}{#3}}{}%
+}
+\robust@def\stcmd@xargdef@b#1#2#3(#4)#5{%
+ \def\stcmd@tempd{#4}%
+ \ifcsdefinable#1{%
+ \stcmd@cmdprefixes@a
+ \expandafter\def\expandafter#1\expandafter{%
+ \expandafter\@protected@testopt\expandafter#1%
+ \csname\string#1\endcsname{#3}%
+ }%
+ \aftercsname\stcmd@yargdef{\string#1}\tw@{#2}{#5}%
+ }%
+}
+\robust@def\stcmd@yargdef#1#2#3{%
+ \ifnum#2=\tw@
+ \def\stcmd@tempb##11{[####1]}%
+ \else
+ \let\stcmd@tempb\@gobble
+ \fi
+ \expandafter\stcmd@zargdef\expandafter{\number#3}#1%
+}
+\robust@def\stcmd@zargdef#1#2{%
+ \begingroup
+ \def\stcmd@tempa##1#1##2##{%
+ \def\stcmd@tempc{\stcmd@cmdprefixes@b\l@ngrel@x}%
+ \cptexpandsecond{\expandafter\endgroup\stcmd@tempc
+ \expandafter\def\expandafter#2\stcmd@tempb##1#1}{\elt{#1}}%
+ }%
+ \@tempcnta\z@pt
+ \loop
+ \advance\@tempcnta\@ne
+ \csn@def{d\number\@tempcnta}{}%
+ \ifnum\@tempcnta<9\relax
+ \repeat
+ \ifx\stcmd@tempd\@empty\else
+ \@tempcnta\z@pt
+ \def\do##1##2{%
+ \ifstrcmpTF{##1}\zargdef@nil{}{%
+ \advance\@tempcnta\@ne
+ \ifnum\@tempcnta>#1\relax
+ \stcmd@err{Number of delimiters exceeds
+ number of parameters}\@ehc
+ \fi
+ \ifinsetTF{,##1,}{,1,2,3,4,5,6,7,8,9,}{}{%
+ \stcmd@err{Invalid delimiter syntax:
+ \MsgBrk no digit [1-9] found before delimiter}\@ehc
+ }%
+ \csn@def{d##1}{##2}\do
+ }%
+ }%
+ \expandafter\do\stcmd@tempd\zargdef@nil\zargdef@nil
+ \fi
+ \ifx\stcmd@tempb\@gobble\else
+ \expandafter\ifx\csname d1\endcsname\@empty\else
+ \stcmd@err{Argument one of command \string#2 is
+ \MsgBrk already delimited by '[]'}\@ehc
+ \fi
+ \fi
+ \def\elt##1{\expandcsnonce{d##1}}%
+ \edef\stcmd@tempc{0####1\ifx\stcmd@tempb\@gobble\elt1\fi
+ ####2\elt2####3\elt3####4\elt4####5\elt5####6\elt6%
+ ####7\elt7####8\elt8####9\elt9%
+ }%
+ \expandafter\stcmd@tempa\stcmd@tempc###1%
+}
+
+\endinput