I would like to define a command which would increment a counter, and create a new savebox whose name is generated from the counter value. Something like:
\documentclass{article}
\newcounter{mycounter}
\newcommand{\mycommand}[1]{%
\addtocounter{mycounter}{1}%
\newsavebox{\csname foobox\roman{mycounter}\endcsname}%
\savebox{\csname foobox\roman{mycounter}\endcsname}{#1}%
}
\begin{document}
\mycommand{This is the content of fooboxi.}
\mycommand{This is the content of fooboxii.}
\usebox{\fooboxi}
\usebox{\fooboxii}
\end{document}
My Google-fu has been too weak for me to find a way to code this. Any pointers?
\mycommand? Also, how can you know what box contains what, after a long string of\mycommandstatements? An example of real usage may give ideas for a more efficient way to do the job. – egreg Sep 19 '12 at 06:53