Is there a way to get a macro to hide its output but still do the logic with counters etc.?
I'm stuck on the definition of macro \dontoutput below.
% \documentclass, \usepackage, ...
\newcount\innercount
\def\dontoutput#1{#1} % ???
\long\def\inner#1{\advance\innercount 1\relax}
\long\def\outer#1{
\innercount 0\relax
\dontoutput{#1} % call it, increment counters in \inner, but don't output anything!
Inner called \the\innercount times.
\def\inner##1{##1} % we want to output it too now.
#1 % call again
}
\begin{document}
\outer{
a
\inner{b}
\inner{c}
\inner{d}
e
}
\end{document}
% Outputs: a e Inner called 3 times. abcde
% I'd like: Inner called 3 times. abcde