Is there any way to re-define a variable a finite number of times? Here's MWE of what I'm looking for to work:
\documentclass[11pt]{article}
\newcommand{\A}{..}
\newcommand{\B}{../\A{}}
% \renewcommand{\A}{\B{}} % Breaks the build
\newcommand{\SUCCESS}{Success!}
\begin{document}
\section{Test}
\A
\B
\SS
\end{document}
When I uncomment line 4, I get an error saying "TeX capacity exceeded, sorry [input stack size=5000]. [\A]".
I was hoping to do this in a simple way, without packages. If I remove the curly-braces in the definition for \B and re-definition for \A, the build hangs and never seems to finish.
I appreciate any help/suggestions.
\newcommand{\A}{..} \edef\A{../\A} ... \edef\A{../\A} ...– Werner Jan 17 '18 at 23:34