[OS X TeX] conditional text

Alain Schremmer Schremmer.Alain at gmail.com
Fri Feb 2 19:19:48 EST 2007


Axel E. Retif wrote:

> On Feb 2, 2007, at 17:53 , Alain Schremmer wrote:
>
>> I would like to have multi-paragraphs optional text in a file,  
>> namely text that I can comment/uncomment with a \boolean{Optional}  
>> at the top of the file.
>>
>> I thought of creating a newenvironment like
>>
>>    \newenvironment{OptionalText}%
>>    {\ifthenelse{\boolean{Optional}}{}{\renewcommand{\par}{\%}}
>>    {\ifthenelse{\boolean{Optional}}{}{\par}}
>>
>> but I have not been able to carry this out.
>
>
> Recently, there was a discussion on TeXhax mailing list about this,  
> with interesting solutions; for example, Hartmut Henkel suggested:
>
>> \documentclass{article}
>>
>> \newif\ifdocA
>> \expandafter\def\csname doc-a\endcsname{\docAtrue}
>> \expandafter\def\csname doc-b\endcsname{\docAfalse}
>> \csname\jobname\endcsname
>>
>> \begin{document}
>> This is the  \ifdocA original \else alternate \fi version.
>> \end{document}
>
>
> and E. Krishnan recommended the optional package (by Donald  
> Arseneau). I would try this.

I got obsessed with conditional and forgot about optional and, sure 
enough, there it was on page 21 of Companion 2ed.

Embarrassed but grateful regards
--schremmer

------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/





More information about the MacOSX-TeX mailing list