I want to decorate some text and then reprint it undecorated. This is the code that I was using to do this.
\documentclass{article}
\usepackage{xcolor}
\makeatletter
\newcommand{\@aeformatcontent}[1]{\parbox[t]{5in}{\emph{#1}}}
\newcommand{\aeformatcontent}[1]{%%'
$\star$\hspace*{0.5em}\@aeformatcontent{#1}\par
\bgroup
\def\aeget#1{#1}%%'
$\phantom{\star}$\hspace*{0.5em}\@aeformatcontent{#1}%%'
\egroup
}
\newcommand{\aeget}[1]{\csname aephrase #1\endcsname}
\newcommand{\aedefine}[1]{\expandafter\def\csname aephrase #1\endcsname{{\color{red}#1}}}
\makeatother
\begin{document}
\aedefine{this is a trial}
\aeget{this is a trial}
\aeformatcontent{\aeget{this is a trial}}
\end{document}
When I try to compile this, I get the error:
! Use of \aeget doesn't match its definition.
<argument> \aeget {
this is a trial}
l.24 ... \aeformatcontent{\aeget{this is a trial}}
?
If I replace \def\aeget#1{#1} with
\renewcommand{\aeget}[1]{#1}
I get stuck in an infinite loop until LaTeX's capacity is exceeded.
I don't understand why neither of these approaches works. Neither do I understand why I'm getting different error messages.
