I have several piece of text for which I would like to be able to change easily the order in which they appear. Is there a way to do that?
The only solution I found until now is the following:
\documentclass{article}
\newcommand{\firsttext}{blabla 1}
\newcommand{\secondtext}{$$blabla 2$$}
\newcommand{\thirdtext}{{\Large blabla 3}}
\begin{document}
\firsttext
\secondtext
\thirdtext
\end{document}
with output
In this way I can easily change the order of the paragraphs just by switching the call for macros in the document. For example
\documentclass{article}
\newcommand{\firsttext}{blabla 1}
\newcommand{\secondtext}{$$blabla 2$$}
\newcommand{\thirdtext}{{\Large blabla 3}}
\begin{document}
\secondtext
\thirdtext
\firsttext
\end{document}
The problem of this method is that the text that can be defined in the \newcommand{}{}
is very limited. For example, I get an error if I replace
\newcommand{\secondtext}{$$blabla 2$$}
by \newcommand{\secondtext}{ \begin{equation*}blabla 2\end{equation*}}
However, the text I would like to easily be able to switch contains theorems, equations, etc...
Is there a proper way to do that?
\usepackage{amsmath}
to useequation*
, add that and it works.equation*
environment normally as part of your document body because it simply isn't defined.\usepackage{mathtools}
solves the problem.