| 1 |
% \subsubsection{hideEnv} |
| 2 |
% \DescribeMacro{hideEnv}[replacementCode]{environmentName} |
| 3 |
% This macro allows you to hide an environment by name, ensuring it - and all its contents - are no longer visible on the pdf output. It also allows you an optional input to replace the block of content with new (uniform) content if desired. |
| 4 |
% #1 is replacementCode and is optional. This will be code that is executed when the env is executed, |
| 5 |
% even though the content of the environment is hidden. |
| 6 |
% #2 is the name of the environment which gets hidden. |
| 7 |
% \begin{macrocode} |
| 8 |
%<*classXimera> |
| 9 |
\newcommand{\hideEnv}[2][]{ |
| 10 |
%% Syntax: \hideEnv[NewCode]{environmentName} |
| 11 |
|
| 12 |
\expandafter\def\csname temp@#2\endcsname\csname #2\endcsname |
| 13 |
\expandafter\def\csname temp@end#2\endcsname\csname end#2\endcsname |
| 14 |
\expandafter\def\csname#2\endcsname{ |
| 15 |
\ifnum\value{depth@Check}<1 |
| 16 |
Suppress Should start here. |
| 17 |
\suppress |
| 18 |
\fi |
| 19 |
\stepcounter{depth@Check} |
| 20 |
|
| 21 |
% Current Depth reported as: \arabic{depth@Check} |
| 22 |
} |
| 23 |
\expandafter\def\csname end#2\endcsname{ |
| 24 |
\addtocounter{depth@Check}{-1} |
| 25 |
\ifnum\value{depth@Check}<1 |
| 26 |
Suppress Should End Here. |
| 27 |
\endsuppress |
| 28 |
\fi |
| 29 |
|
| 30 |
% Current Depth reported as: \arabic{depth@Check} |
| 31 |
\noexpand{#1} |
| 32 |
} |
| 33 |
} |
| 34 |
%</classXimera> |
| 35 |
% \end{macrocode} |
| 36 |
|