Related to this question, however, I was not able to solve my problem.
Let me give some background. I want to switch between the article style and a specific journal style. The journal style has specific commands that it uses for the abstract, proofs, appendices, etc. The variable \var
states if I use the article style (0) or the journal style (1). Let us assume the command \ABSTRACT
is used by the journal and it takes one argument as the actual abstract. So, normally you would print your abstract as \ABSTRACT{This is my abstract.}
.
The following MWE does not work, and the error is that it is missing a closing argument }.
MWE
\documentclass{article}
\usepackage{ifthen}
\newcommand{\var}{1}
\newcommand{\ABSTRACT}[1]{\begin{abstract}#1\end{abstract}}
\begin{document}
\ifthenelse{\var = 1}{\ABSTRACT\bgroup}{\begin{abstract}}%
This is my abstract.%
\ifthenelse{\var = 1}{\egroup}{\end{abstract}}%
Some other text below the abstract.
\end{document}
{}
explicitly they can not be\bgroup