I was wondering if there's a way to do the following:
- to wrap an excerpt of text in an environment and to label it;
- to quote it (entirely) later in the same document, via a
\refcommand or similar.
By doing so, one could modify the wrapped text, without having to update all of the later references to it in the document.
I'm aware that a simple workaround would be to use \input{} both in the first and in the later occurrences of the wrapped sentence; I only wanted to know if there's something more specific.
More in detail, my purpose is to wrap some text that I have to cite in an answer letter to the reviewer of a submitted paper.
Suppose I wrote in a first version of the paper that:
it is clear that 2+2=5
Now the reviewer makes me pay attention to the fact that there's an error. I correct it and:
1 - in the revised version of the paper I write:
\wraptext{twoplustwo}{it is clear that 2+2=4}
provided that \wraptext{}{} is the command I was looking for;
2 - in the answer to the reviewer, I specify:
the error has been corrected, as you can see in the following reported excerpt:
\citewrappedtext{twoplustwo}
again provided that \citewrappedtext{} is the command to recall the excerpt.
This way, one can later modify again the sentence:
\wraptext{twoplustwo}{it is obvious that 2+2=4}
without having to correct the quotes, too.


\savebox.) – Sean Allred Oct 17 '13 at 16:17\newcommand; can you show some short examples of what you want? – egreg Oct 17 '13 at 16:52\newcommandwould definitely get the job done. Couldn't manage to express\newcommandas an environment though, even with packages likeenviron. – Sean Allred Oct 17 '13 at 17:07\expandafterhere and there at random. ;-) – egreg Oct 17 '13 at 20:07expl3for practice. – Sean Allred Oct 17 '13 at 20:20\expandafter\endcsnametrick is really nice. – egreg Oct 17 '13 at 20:23