Path: utzoo!attcan!uunet!mcsun!ukc!icdoc!sot-ecs!spqr From: spqr@ecs.soton.ac.uk (Sebastian Rahtz) Newsgroups: comp.text.tex Subject: Re: #ifdef equivalent of selective inclusion for TeX/LaTeX??? Message-ID: Date: 20 Oct 90 15:02:38 GMT References: <1990Oct18.021309.22918@cs.umn.edu> <40303@shemp.CS.UCLA.EDU> Sender: spqr@ecs.soton.ac.uk Organization: Southampton University Computer Science Lines: 40 In-reply-to: kirkaas@ewa.cs.ucla.edu's message of 18 Oct 90 03:33:45 GMT In article <40303@shemp.CS.UCLA.EDU> kirkaas@ewa.cs.ucla.edu (paul kirkaas) writes: \ifdef{adef1} I want to see the first line of text included. \fi \ifdef{adef2} I want to see the second line of text included. \fi The point is that rather than defining adef1 to some value and testing for it, I can still run the source through TeX EVEN IF adef1 is NOWHERE DEFINED. I want that because I want to \include its not quite the same, but here, for instance, is code which takes various actions dependent on the value of \driver@setup, and starts by checking to see if it defined at all. \@ifundefined is LaTeX-ese, and needs to be in a style file or enclosed by \makeatletter .... \makeatother. \@ifundefined{driver@setup}% { \typeout{WARNING *** driver setup codes are unknown in this setup ***} } { \typeout{Driver type \the\driver@setup} \ifcase\driver@setup % case 0 \typeout{case 0} \or % case 1 \typeout{case 1} \or % case 2 \else \typeout{WARNING *** This driver setup is unknown -} \fi } -- Sebastian Rahtz S.Rahtz@uk.ac.soton.ecs (JANET) Computer Science S.Rahtz@ecs.soton.ac.uk (Bitnet) Southampton S09 5NH, UK S.Rahtz@sot-ecs.uucp (uucp)