[OS X TeX] conditional text

Axel E. Retif axel.retif at mac.com
Sat Feb 3 01:07:45 CET 2007


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.


Best,

Axel

------------------------- 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 macostex-archives mailing list