A standard way to grab and store a short text (say, a title of a document) is to use something like
\def\title#1{\def\@title{#1}}.
But if the content to be stored is longer (say, an abstract}, I guess it is considered more elegant to specify it by something like
\begin{abstract}
...
\end{abstract}
on the user side.
So, the question is: what techniques are available to do something like this? (Some that spring to my mind immediately are: use a \vbox
, use delimited arguments, use the environ
LaTeX package, use ConTeXt \grabbufferdata
(if I am not mistaken as to the name of that macro)…)
I'd be delighted to see all kinds of answers, for various engines (Knuthian vanilla TeX, eTeX, luaTeX) and formats (plain TeX, LaTeX2e, LaTeX3, ConTeXt).
Best Answer
The
collect
package; a little example (defining an environment to collect text and format it between rules and using\section
):