<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% \iffalse meta-comment
%
% Part of Will Robertson's DTXGALLERY bundle, version 1.
%
%&lt;*driver&gt;
\documentclass{ltxdoc}
\usepackage{fancyvrb}
\begin{document}
  \DocInput{conditional-code.dtx}
\end{document}
%&lt;/driver&gt;
% \fi
%
% \section{Conditional inclusion of code}
%
% From previous examples the |%&lt;*guard&gt;|\dots|%&lt;/guard&gt;| syntax should be a little familiar. This example demonstrates conditional extraction of such elements in the source document into multiple files. This technique makes it easy, say, to maintain a `debug' version of a package without polluting the public source with code for testing.
%
%    \begin{macrocode}
%&lt;A&gt;  code in `A'
%&lt;B&gt;  code in `B'
%&lt;!A&gt;  code not in `A'
%&lt;!B&gt;  code not in `B'
%&lt;A&amp;B&gt;  code in `A' and `B'
%&lt;A|B&gt;  code in `A' or `B'
%&lt;(A|B)&amp;!(A&amp;B)&gt;  code in `A' xor `B'
%    \end{macrocode}
% Note the change in the typeset source when guards are nested: \\
% (this is equivalent to \verb|%&lt;A&amp;B&gt;|)
%    \begin{macrocode}
%&lt;*A&gt;
%&lt;B&gt;  `B' nested inside `A'
%&lt;/A&gt;
%    \end{macrocode}
% 
% \section{Verbatim files that are produced}
% \begin{minipage}{0.45\linewidth}
% \subsection{Generated from `A'}
% \VerbatimInput[frame=single]{A.txt}
% \end{minipage}\hfill
% \begin{minipage}{0.45\linewidth}
% \subsection{Generated from `B'}
% \VerbatimInput[frame=single]{B.txt}
% \end{minipage}
% \subsection{Generated from `A' and `B'}
% \VerbatimInput[frame=single]{AB.txt}
%
% \Finale
\endinput
</pre></body></html>