From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/52048 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: New to TeX, ConTeXt - How to conditionally include document sections? Date: Thu, 23 Jul 2009 17:10:24 -0400 (EDT) Message-ID: References: <73D5696F6096F9478FA4CA43E2FD99B96E245934@mail6.millersville.edu> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1248383508 4266 80.91.229.12 (23 Jul 2009 21:11:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Jul 2009 21:11:48 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Jul 23 23:11:41 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1MU5Zj-0001l7-2A for gctc-ntg-context-518@m.gmane.org; Thu, 23 Jul 2009 23:11:39 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 3CA191FBCB; Thu, 23 Jul 2009 23:11:38 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 28225-05; Thu, 23 Jul 2009 23:10:57 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id EB33A1FB89; Thu, 23 Jul 2009 23:10:56 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 3D6F61FB89 for ; Thu, 23 Jul 2009 23:10:55 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 28184-04-2 for ; Thu, 23 Jul 2009 23:10:47 +0200 (CEST) Original-Received: from filter1-nij.mf.surf.net (filter1-nij.mf.surf.net [195.169.124.152]) by ronja.ntg.nl (Postfix) with ESMTP id 3CF401FB77 for ; Thu, 23 Jul 2009 23:10:47 +0200 (CEST) Original-Received: from hackers.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.81]) by filter1-nij.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n6NLAjZb032509 for ; Thu, 23 Jul 2009 23:10:46 +0200 Original-Received: FROM dhcp128036155077.central.yale.edu (dhcp128036155077.central.yale.edu [128.36.155.77]) By hackers.mr.itd.umich.edu ID 4A68D1D4.38AF8.5518 ; Authuser adityam; 23 Jul 2009 17:10:44 EDT In-Reply-To: <73D5696F6096F9478FA4CA43E2FD99B96E245934@mail6.millersville.edu> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=141.211.14.81; country=US; region=MI; city=Ann Arbor; postalcode=48109; latitude=42.2923; longitude=-83.7145; metrocode=505; areacode=734; http://maps.google.com/maps?q=42.2923,-83.7145&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 265160099 - 16a075a09210 - 20090723 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.152 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.11 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:52048 Archived-At: On Thu, 23 Jul 2009, Stephen Gadsby wrote: > Please pardon my newness to TeX, ConTeXt, and this list. If I violate > list etiquette, I apologize and hope you will let me know. Thank you. Don't worry. Newbie questions are welcome here. > I'm attempting to abandon the use of Word for a maintaining a growing > set of 30 to 60 page documents that provide information on similar, but > not identical, equipment at a range of locations. My idea was to create > one ConTeXt project that, depending upon the definition of one string in > the project file, appropriately adjusts the resulting document's title > and pulls in component "foo" for location "A", "bar" for location "B", > etc. > > My problem is, after playing with if, ifx, and ifcase for some time and > digging through all the ConTeXt and TeX documentation I can find, I'm > still not understanding how to accomplish the TeX/ConTeXt equivalent of: > > if equals then > do thing 1 > ... > do thing n > else if... ConTeXt has a mechanism called modes that does exactly this. The official documentation is a bit terse, but should give you enough hints to get started. http://pragma-ade.com/general/manuals/mmodes.pdf There are also some hints on the wiki page: http://wiki.contextgarden.net/Modes > If someone would please point me to documentation or an example of how > to accomplish string comparison based if-thens in ConTeXt, I'd greatly > appreciate it. For what you want, modes should be sufficient. If for something else you really want to do string comparisons, ConTeXt provides a bunch of \doifelse commands http://wiki.contextgarden.net/System_Macros/Branches_and_Decisions Aditya ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________