Skip to content

Instantly share code, notes, and snippets.

@vermiculus
Created October 17, 2013 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vermiculus/7031558 to your computer and use it in GitHub Desktop.
Save vermiculus/7031558 to your computer and use it in GitHub Desktop.
\documentclass{article}
\usepackage{xparse,expl3,environ}
\ExplSyntaxOn
\NewEnviron{save}[1]{
\tl_new:c { saved_text__#1 }
\tl_set:cv { saved_text__#1 } {
\BODY
}
}
\NewDocumentCommand \UseSaved { m } {
\use:c { saved_text__#1 }
}
\ExplSyntaxOff
\begin{document}
\begin{save}{some text}
I have some text.
This is a quotation.
I'm bad at coming up with examples.
\end{save}
\UseSaved{some text}
\UseSaved{some text}
\UseSaved{some text}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment