# Store values, text, commands in variables

I want to store values, texts, commands... in variables to use them later. For example, I would like to have something like

\documentclass{article}
<preamble>
\begin{document}
\parta{A}
\partc{C}
\partb{B}
\partd{D}
\printit
\end{document}


where the commands \partx should be defined in the preamble and the arguments A,B,C,D are passed to variables that are used in the command \printit. More precisely, the \printit command could be to print the arguments A,B,C,D in a certain style and a certain order (not neccesarily the one given in the document). I am aware of \newcommand but I am not sure if this can be of help here?

## 1 Answer

this seems to be the same model as as \author{...} , \title{...} etc which save their arguments for use by \maketitle.

For that you just need


\newcommand\printit{ blah \zzpartb\ and foobar \zzparta.}

• Hi, I vote your answer +1. I vote always positive for my friends. – Sebastiano Oct 12 '17 at 17:33