From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/53531 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: \starbuffer in own macros Date: Mon, 19 Oct 2009 00:50:50 +0200 Message-ID: References: <6faad9f00910161206h7540f0fai2d6cde281cbc9977@mail.gmail.com> <4AD9DBA5.1020707@bredband.net> <4AD9E6F3.5090406@bredband.net> <8CACE944-2B73-4387-90CE-1351EE13B8F4@googlemail.com> <6966E6F8-C63D-451F-8B7E-0E815BE17F21@uni-koblenz.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset="us-ascii"; Format="flowed"; DelSp="yes" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1255906308 19421 80.91.229.12 (18 Oct 2009 22:51:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 18 Oct 2009 22:51:48 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Oct 19 00:51:38 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.50) id 1MzebB-0000hD-Gj for gctc-ntg-context-518@m.gmane.org; Mon, 19 Oct 2009 00:51:37 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id F37E8C9AF9; Mon, 19 Oct 2009 00:51:35 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id fmbXdZl4OTA6; Mon, 19 Oct 2009 00:51:35 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 93B53C9ABB; Mon, 19 Oct 2009 00:51:29 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 43D93C9ABB for ; Mon, 19 Oct 2009 00:51:21 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id DixzRZOvhl2O for ; Mon, 19 Oct 2009 00:50:59 +0200 (CEST) Original-Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155]) by balder.ntg.nl (Postfix) with ESMTP id 1033FC9AB7 for ; Mon, 19 Oct 2009 00:50:54 +0200 (CEST) Original-Received: by fg-out-1718.google.com with SMTP id 19so255081fgg.2 for ; Sun, 18 Oct 2009 15:50:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:content-type:mime-version :subject:from:in-reply-to:date:content-transfer-encoding:message-id :references:to:x-mailer; bh=oqe4zOUeImIIWiqj8DiBT053/K/RoZCnTX8Hekp24Ss=; b=aStpJDl50GP+ER9SG/Q9d0SXgXxMY8EVncdfNa3FmfPeOMvnRcml5PS5DhE6RoY725 ICuPOgHKOhytvRo/9nyATgTT93y4soCmGGGYbxmHQ9vICFTrgLbYCexTyP9VMvZLoos1 6cI5n8Ba0OX0u9FeCoyibAK+CJyjFL+hJsFAI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=VbfIPBKlHVBxJcZuclyPtM2ueZytUW0vGecjW2wRJf3Dyh/CuO3g7IgJk+xVGFjmoV fRQxAxTjICWzDhUSlqBo1rOpeHhoBMK4nu7jb5XDEhso4d9rnMWLVytu2jUYtX4tECZl Q7rJ5JKnAT6N89ZoSA7P/j+lAH7zewCkzSFrA= Original-Received: by 10.86.227.26 with SMTP id z26mr2720417fgg.76.1255906254717; Sun, 18 Oct 2009 15:50:54 -0700 (PDT) Original-Received: from ?192.168.2.23? (p54953F25.dip.t-dialin.net [84.149.63.37]) by mx.google.com with ESMTPS id 4sm2332295fge.22.2009.10.18.15.50.52 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 18 Oct 2009 15:50:53 -0700 (PDT) In-Reply-To: <6966E6F8-C63D-451F-8B7E-0E815BE17F21@uni-koblenz.de> X-Mailer: Apple Mail (2.1076) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 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 Xref: news.gmane.org gmane.comp.tex.context:53531 Archived-At: Am 18.10.2009 um 12:02 schrieb Andreas Harder: >> Before I help you provide us with more information, e.g. should the >> text in the buffer >> appear also in the complete text or do you it only in the snippet? > > Sorry, that I did not make myself clear. The real setup is: I've a > lot of line numbered text in the appendix of the document. In the > body I'd like to cite out of it (with the same line numbers as in > the source/appendix). The appendix should stay unchanged. For the beginning you can play with this code, it has to be changed in a few parts (e.g. make \setuplines local) but it's what I can read from your description above and the code you showed in the previous message. \def\doifelsesamelinereference#1#2#3% {\doifreferencefoundelse{lr:b:#1} {\edef\fline{\currentreferencedefault}% was \currentreferencetext \doifreferencefoundelse{lr:e:#1} {\edef\tline{\currentreferencedefault}% was \currentreferencetext \ifx\fline\tline#2\else#3\fi} {\unknownreference{#1}#2}} {\unknownreference{#1}#2}} \def\startMyCite[#1]% {\def\stopMyCite {\setuplines[before=,after=]% \startlines\startline[#1]\getbuffer[#1]\stopline[#1]\stoplines \savebuffer[#1]}% \dostartbuffer[#1][startMyCite][stopMyCite]} \def\getMyCite[#1]% {\doifreferencefoundelse{lr:b:#1} {\startlinenumbering[\currentreferencedefault]} \startlinenumbering \startlines\readfile{\jobname-#1.tmp}{}{}\stoplines \stoplinenumbering} \starttext \startbodymatter test text test text test text test text test text test text test text test text test text test text test text test text test text she told: \getMyCite[test] % perhaps better \getMyCite[test] test text test text test text test text test text test text test text test text test text test text test text test text test text \stopbodymatter \startappendices \startlinenumbering We thrive in information--thick worlds because of our marvelous and everyday ca- pacity to select, edit, single out, structure, highlight, group, pair, merge, harmo- nize, synthesize, focus, \startMyCite[test] organize, condense, reduce, boil down, choose, categorize, catalog, classify, list, abstract, scan, look into, idealize, isolate, discriminate, dis- tinguish, screen, pigeonhole, pick over, sort, integrate, blend, inspect, filter, lump, skip, smooth, chunk, average, approximate, cluster, aggregate, outline, summarize, itemize, review, dip into, flip through, browse, glance into, leaf through, \stopMyCite skim, re- fine, enumerate, glean, synopsize, winnow the wheat from the chaff and separate the sheep from the goats. \stoplinenumbering \stopappendices \stoptext Wolfgang ___________________________________________________________________________________ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________