summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/dtxgallery/conditional-code.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-08-08 17:46:07 +0000
committerKarl Berry <karl@freefriends.org>2007-08-08 17:46:07 +0000
commite5fe7bcd5a619359401f314997d3e95db5100c5f (patch)
tree0b702e1f6db15e9d38f62cae172caf44fb664dd0 /Master/texmf-dist/source/latex/dtxgallery/conditional-code.dtx
parent47a39d3836481a603a6eed0de31822508101f6d5 (diff)
new package dtxgallery (6aug07)
git-svn-id: svn://tug.org/texlive/trunk@4715 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/dtxgallery/conditional-code.dtx')
-rw-r--r--Master/texmf-dist/source/latex/dtxgallery/conditional-code.dtx48
1 files changed, 48 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/dtxgallery/conditional-code.dtx b/Master/texmf-dist/source/latex/dtxgallery/conditional-code.dtx
new file mode 100644
index 00000000000..658ff48ed18
--- /dev/null
+++ b/Master/texmf-dist/source/latex/dtxgallery/conditional-code.dtx
@@ -0,0 +1,48 @@
+% \iffalse meta-comment
+%
+% Part of Will Robertson's DTXGALLERY bundle, version 1.
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{fancyvrb}
+\begin{document}
+ \DocInput{conditional-code.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \section{Conditional inclusion of code}
+%
+% From previous examples the |%<*guard>|\dots|%</guard>| 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}
+%<A> code in `A'
+%<B> code in `B'
+%<!A> code not in `A'
+%<!B> code not in `B'
+%<A&B> code in `A' and `B'
+%<A|B> code in `A' or `B'
+%<(A|B)&!(A&B)> code in `A' xor `B'
+% \end{macrocode}
+% Note the change in the typeset source when guards are nested: \\
+% (this is equivalent to \verb|%<A&B>|)
+% \begin{macrocode}
+%<*A>
+%<B> `B' nested inside `A'
+%</A>
+% \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