\newif\if@design \@designfalse
\def\moduledesign{\@designtrue}
\def\design#1{\if@design{#1}\fi}
...
\design{Hello world}
which inserts "Hello world" if \moduledesign has been included.
However, this fails if the conditional text spans more than one
paragraph:
! Argument of \@xdblarg has an extra }.
<inserted text>
\par
<to be read again>
}
\design #1->\if@design {#1}
\fi
l.412 \section
{Implementation}
? x
I tried ifthen.sty, but
\ifthenelse{1 = 0}{
\section{Next}
Para 6.
}
includes the text. Ideally I would like
\begin{design}
Design text.
\end{design}
Can someone point me in the right direction?
Thanks,
David
--
David Allen Laser-Scan Ltd
dav...@lsl.co.uk Science Park
Tel: 01223 420414 Milton Road
Fax: 01223 420044 Cambridge
England
... or if there's anything untoward about the skipped text. It's not
a solution I would go for. (However, the problem you outline can be
attacked by defining the macro \long.)
>[...] Ideally I would like
>
>\begin{design}
>Design text.
>\end{design}
>
>Can someone point me in the right direction?
comment.sty solves this problem. [I _think_ it's old enough that I
left a copy on Laser-Scan's discs (in an obvious sort of place on the
VAXcluster) before I left]. As I recall, its documentation is
included in the style file.
--
Robin (Campaign for the Third Programme) Fairbairns r...@cl.cam.ac.uk
U of Cambridge Computer Lab, Pembroke St, Cambridge CB2 3QG, UK
Private page: http://www.cl.cam.ac.uk/users/rf/robin.html
>I want to get fine-grained "conditional compilation" of LaTeX source
>to produce slightly different documents from the same text. My best
>effort so far is:
>\newif\if@design \@designfalse
>\def\moduledesign{\@designtrue}
>\def\design#1{\if@design{#1}\fi}
I may have misunderstood what you are trying to do,
but have you considered just saying
\ifundefined\moduledesign
...
\else
...
\fi
?
--
Timothy Murphy
e-mail: t...@maths.tcd.ie
tel: +353-1-2842366
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland
macros/latex209/contrib/misc/comment.sty
It has facilities for doing exactly what you're asking
e.g.
\documentclass{article}
\usepackage{comment}
\begin{document}
\includecomment{versiona}
\excludecomment{versionb}
\begin{versiona}
AAAAAAAAA
\end{versiona}
\begin{versionb}
BBBBBBBB
\end{versionb}
\end{document}
Graham