From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/53519 Path: news.gmane.org!not-for-mail From: Andreas Harder Newsgroups: gmane.comp.tex.context Subject: Re: \starbuffer in own macros Date: Sun, 18 Oct 2009 12:02:28 +0200 Message-ID: <6966E6F8-C63D-451F-8B7E-0E815BE17F21@uni-koblenz.de> References: <6faad9f00910161206h7540f0fai2d6cde281cbc9977@mail.gmail.com> <4AD9DBA5.1020707@bredband.net> <4AD9E6F3.5090406@bredband.net> <8CACE944-2B73-4387-90CE-1351EE13B8F4@googlemail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: multipart/mixed; boundary=Apple-Mail-4-527558187 X-Trace: ger.gmane.org 1255860182 29523 80.91.229.12 (18 Oct 2009 10:03:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 18 Oct 2009 10:03:02 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Oct 18 12:02:51 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 1MzSbA-0003QO-Do for gctc-ntg-context-518@m.gmane.org; Sun, 18 Oct 2009 12:02:48 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D590EC9BA6; Sun, 18 Oct 2009 12:02:46 +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 nFWH-wc8wGfw; Sun, 18 Oct 2009 12:02:42 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E1641C9B91; Sun, 18 Oct 2009 12:02:41 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 59530C9B91 for ; Sun, 18 Oct 2009 12:02:38 +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 dJj6fysHEvRn for ; Sun, 18 Oct 2009 12:02:32 +0200 (CEST) Original-Received: from deliver.uni-koblenz.de (deliver.uni-koblenz.de [141.26.64.15]) by balder.ntg.nl (Postfix) with ESMTP id 12623C9B41 for ; Sun, 18 Oct 2009 12:02:32 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by deliver.uni-koblenz.de (Postfix) with ESMTP id DC3FE78A191B for ; Sun, 18 Oct 2009 12:02:31 +0200 (CEST) Original-Received: from deliver.uni-koblenz.de ([127.0.0.1]) by localhost (deliver.uni-koblenz.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 05101-09 for ; Sun, 18 Oct 2009 12:02:29 +0200 (CEST) X-CHKRCPT: Envelopesender vrfy aharder@uni-koblenz.de Original-Received: from [192.168.1.112] (95-88-47-87-dynip.superkabel.de [95.88.47.87]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTP id 76C0C7825738 for ; Sun, 18 Oct 2009 12:02:29 +0200 (CEST) In-Reply-To: <8CACE944-2B73-4387-90CE-1351EE13B8F4@googlemail.com> X-Mailer: Apple Mail (2.1076) X-Virus-Scanned: amavisd-new at uni-koblenz.de 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:53519 Archived-At: --Apple-Mail-4-527558187 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252; format=flowed; delsp=yes Am 18.10.2009 um 11:14 schrieb Wolfgang Schuster: > > Am 17.10.2009 um 22:29 schrieb Andreas Harder: > >> Hi all, >> >> now that \inline[ref] etc. work=97whereas in the case of \someline=20 >> [ref] \inline[ref] always jumps to the else-branch of its =20 >> definition and outputs the same line twice=97I tried, obviously =20 >> naive, to realize the following functionality (attachment). >> >> It seems that the (wrong?) use of \starbuffer in a macro is the =20 >> cause of the error: ! File ended while scanning use of =20 >> \dododowithbuffer. >> >> Can someone provide a correction? > > 1. This \doifelsesamelinereference macro in page-lin.mkiv should be =20= > changed to: > > \def\doifelsesamelinereference#1#2#3% > {\doifreferencefoundelse{lr:b:#1} > {\edef\fline{\currentreferencedefault}% was \currentreferencetext > \doifreferencefoundelse{lr:e:#1} > {\edef\tline{\currentreferencedefault}% was =20 > \currentreferencetext > \ifx\fline\tline#2\else#3\fi} > {\unknownreference{#1}#2}} > {\unknownreference{#1}#2}} > Hello Wolfgang! Thanks a lot! > 2. You can't hide start/stopbuffer. > > Before I help you provide us with more information, e.g. should the =20= > 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 =20= of line numbered text in the appendix of the document. In the body I'd =20= like to cite out of it (with the same line numbers as in the source/=20 appendix). The appendix should stay unchanged. I've made a new test =20 file: --Apple-Mail-4-527558187 Content-Disposition: attachment; filename=test-linenumbering5.tex Content-Type: application/octet-stream; name="test-linenumbering5.tex" Content-Transfer-Encoding: 7bit \def\startMyCite#1{\startbuffer[#1]\startlines[#1]} \def\stopMyCite#1{\stoplines[#1]\stopbuffer} \def\getMyCite#1{% \startlinenumbering[{\in[lr:b:#1]}] % the result of \in[lr:b:#1] \getbuffer[#1] \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{test} skim, re- fine, enumerate, glean, synopsize, winnow the wheat from the chaff and separate the sheep from the goats. \stoplinenumbering \stopappendices \stoptext %%% Local Variables: %%% mode: context %%% TeX-master: t %%% End: --Apple-Mail-4-527558187 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii; format=flowed Thanks for your effort Andreas --Apple-Mail-4-527558187 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --Apple-Mail-4-527558187--