| 1 |
\documentclass{article} |
| 2 |
% Container commands are also accepted as package options, |
| 3 |
% but in this case 'catoptions' must be loaded before |
| 4 |
% \usepackage{storecmd}. |
| 5 |
% Eg, |
| 6 |
% \usepackage{catoptions} |
| 7 |
% \usepackage[storecmd=\mycommands]{storecmd} |
| 8 |
% |
| 9 |
% Uncomment the next line to test what happens when |
| 10 |
% an existing command is being refilled: |
| 11 |
% \def\mycommands{} |
| 12 |
|
| 13 |
\usepackage[ |
| 14 |
storerenew=false,storecmd=mycommands,storefile=mycommands, |
| 15 |
]{storecmd} |
| 16 |
|
| 17 |
\defsavecmd\cmda#1#2{xxx#1#2} |
| 18 |
\globalcmd\defsavecmd\cmdb#1#2{xxx#1#2} |
| 19 |
\globalcmd\newsavecmd*\cmdc[2]{xxx#1#2} |
| 20 |
\globalcmd\newsavecmd\cmdd[2][yy]{xxx#1#2} |
| 21 |
\protectedcmd\globalcmd\renewsavecmd*\cmda[2][zz]{\def\y##1{##1xxx}} |
| 22 |
\protectedcmd\newsavecmd\cmde[2](1\@nil 2\@mil){xxx#1#2} |
| 23 |
\newsavecmd\cmdf[9][yy](3\@nil 9\@mil){xxx#1#2#3...#9} |
| 24 |
|
| 25 |
% Try \show\mycommands or see file 'mycommands.tex'. |
| 26 |
|
| 27 |
\begin{document} |
| 28 |
|
| 29 |
Blackberry lily. |
| 30 |
|
| 31 |
\end{document} |