\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}