# Templates in DocTeX : Documenting and producing code within the macrocode environment

I'm writing a DocTeX file (*.dtx) to create a family of classes. From this file I am also generating and documenting the templates that illustrate their usage.

%\iffalse
%<*template>
%\fi
%
% There are now two versions of the \package{invoice} Package
%
%    \begin{macrocode}
%<VersionA>\documentclass{CustomInvoiceA}
%<VersionB>\documentclass{CustomInvoiceB}
%    \end{macrocode}
%
%\iffalse
%</template>
%\fi


For the most part this is working well but I can't seem to shake the guards (HTML like tags) in the documented code and I'm not sure where I'm going wrong

From Scott Pakins' DTX tutorial (Invoke texdoc --view dtxtut from the command line to view at home) the following summary table is useful for determining where code will usually apply but the behavior is different within a macrocode environment.

Is it possible to remove the <GUARDS> in the output (The first image) ? I know I could move the <GUARDS> from the macrocode environment into additional \iffalse...\fi but I would prefer not to pepper the document with these statements everywhere, perhaps there is another way.

• what is your question exactly? the output you show is what I would expect. Dec 8 '18 at 1:04
• @DavidCarlisle I was hoping to remove the tags in the output, is this the expected behaviour ? (I updated the question to include one) Dec 8 '18 at 8:39
• Normally the docstrip tags allow you to make multiple files but with a shared documentation, so without the tags the documentation would be very hard t follow, eg the image you show it would look like a document with two \documentclass but as it is it document that two documents will be made, and shows the documentclass in each Dec 8 '18 at 9:51
• Ah so I'm fighting the design, I wasn't sure. Dec 8 '18 at 10:04
• @DavidCarlisle Coincidentally could one stylize the tags instead with say rounded rectangles in different colours or would that be a bit gaudy ? Dec 8 '18 at 10:09