I have the following construction for a figure. The background is, when \submit is defined, only the caption is included, but no figure. Otherwise the figure is included.
The problem is that I have two places in which the same caption needs to be put. It is a pain to keep this in sync. I'm hoping there is a easy way to save the text to a value, and input it to both places. I have multiple such figures, so I'd like to do this in as generic a way as possible. So, if I have n figures, I'd like one command or function, not n, to do the job. Also, this is for a journal which doesn't like extra packages, so I need a solution that doesn't require a special package. I'd also be interested in solutions that use a different approach.
\newcommand{\figlegend}{% figure legend
\refstepcounter{figure}% Increment counter for correct referencing
}
\ifdefined\submit \figlegend
Caption text
\label{schema}
\else
\par \mbox{}
\par
\begin{figure}[tp]
\begin{center}
\tikzsetnextfilename{Figure1-schema}
\input{SCHEMA}
\caption{%
Caption text
}
\label{schema}
\end{center}
\end{figure}
\fi
EDIT: I've edited the title to reflect more accurately what I'm trying to do here. @Mike Renfro thought that one could solve the issue by not including the figure if \submit was active. So, I've changed the code to what I'm actually using. The \input{SCHEMA} inputs a SCHEMA.tex file which contains TikZ/PGF code.
EDIT2: Edited title again. Unusually, I've accepted an answer that did not answer my original question. @Mike Renfro made a compelling case that I was asking the wrong question. I think his is a better answer to the question I wasn't asking, which was how to abstract out my conditional construct. Thanks Mike!
For reference, I'm including the Guidelines for Figure and Table Preparation of the journal in question, in question, PLoS ONE.




\newcommand{\savestring}[2]{\newcommand{#1]{#2}}where one sticks in the macro for the string as first arg, and the actual text as second arg, theoretically looks like a possible approach, but (unsurprisingly) is rejected by LaTeX. – Faheem Mitha Sep 14 '11 at 08:24]should be a}. (2)\newcommanddefines commands locally. If you want a global definition, you will need\gdef#1{#2}. That should work. – Bruno Le Floch Sep 14 '11 at 14:49]is that? What would the whole thing look like, please? Thanks. – Faheem Mitha Sep 14 '11 at 15:36\newcommand{\savestring}[2]{\gdef{#1}{#2}}? – Faheem Mitha Sep 14 '11 at 16:13\newcommand{\savestring}[2]{\gdef#1{#2}}. I tested that and it works. Please add that as an answer. Thanks. – Faheem Mitha Sep 14 '11 at 16:25\newcommand{\savestring}[2]{\newcommand{#1}{#2}}or\newcommand{\savestring}[2]{\gdef#1{#2}}(the first one doesn't work if within an environment). – Bruno Le Floch Sep 14 '11 at 20:54