From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/24840 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: 'Glossary' on every page Date: Thu, 29 Dec 2005 21:59:07 +0100 Message-ID: <43B44E1B.7060308@wxs.nl> References: <72e74e250512290847w3b1f0b34u8fe944f12239da39@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1135890041 23905 80.91.229.2 (29 Dec 2005 21:00:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 29 Dec 2005 21:00:41 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Thu Dec 29 22:00:34 2005 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 ciao.gmane.org with esmtp (Exim 4.43) id 1Es4rk-0007MO-Nn for gctc-ntg-context-518@m.gmane.org; Thu, 29 Dec 2005 21:59:18 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B7A73127F0; Thu, 29 Dec 2005 21:59:13 +0100 (CET) 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 17813-05; Thu, 29 Dec 2005 21:59:07 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 970F3127CE; Thu, 29 Dec 2005 21:59:07 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 1857A127CE for ; Thu, 29 Dec 2005 21:59:06 +0100 (CET) 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 17954-01 for ; Thu, 29 Dec 2005 21:59:04 +0100 (CET) Original-Received: from mail.pragma-ade.net (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by ronja.ntg.nl (Postfix) with SMTP id B8F14127BB for ; Thu, 29 Dec 2005 21:59:04 +0100 (CET) Original-Received: from [10.100.1.102] (unverified [10.100.1.102]) by controller-1 (SurgeMail 3.5b3) with ESMTP id 9667 for ; Thu, 29 Dec 2005 22:07:23 +0300 User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: <72e74e250512290847w3b1f0b34u8fe944f12239da39@mail.gmail.com> X-Server: High Performance Mail Server - http://surgemail.com r=-274017400 X-Authenticated-User: hagen@controller-1 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 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:24840 Archived-At: =EF=BF=BD wrote: >Hello to all, > >I have a problem: I want to add a kind of glossary on a book. It will >be, in fact, an explanation of acronyms ('NATO: North Atlantic Treaty >Organisation' for instance). > >But... I'd want it on every page, only for the acronyms used on the >current page (and alphabetically sorted if possible)... > >I tried using layers (with or without tying them to backgrounds), >blocks (\begin... \end...), buffers, list of synonyms, etc. but I had >problems with one of the requirements or another. :-) > >My first idea was to use blocks for each page : > >\beginABREV[1] >NATO: North Atlantic Treaty Organisation >\endABREV > >\beginABREV[1] >BLOB: Binary Large Object >\endABREV > >and to use them with \useblocks[ABREV][\pagenumber] in the footer. To >be sure to give the right page number to \beginABREV, I tried to >define a label and use it, something like (from memory, I don't have >my code near to me): > >\reference[abbrev\ABREVcount]% Put a label >\beginABREV[{\ref[r][abbrev\ABREVcount]}]% and use the label to get >the current page on subsequent runs. > >but I went on a nightmare of expansion problems... Plus it didn't >eliminate duplicates nor sort the acronyms. But it would have been a >start... :-) > >Can someone point me to the right direction? > =20 > well, instead of making some complex new mechanism, why not misuse notes=20 .... % output=3Dpdf \definenote [glossary] [way=3Dbypage, location=3D{page,high}, factor=3D0, width=3D\leftmarginwidth, scope=3Dpage, conversion=3Dempty, % no number rule=3D, before=3D, after=3D] \setuplayout [width=3Dmiddle, height=3Dmiddle, backspace=3D5cm, margin=3D4cm, margindistance=3D.25cm, cutspace=3D2cm] \setuptexttexts [margin] [\setups{glossary}] [] \startsetups glossary \vbox to \textheight { \placenotes[glossary] \vfill } \stopsetups \setupnotedefinition [glossary] [location=3Dleft, width=3Dfit, distance=3D.5em, align=3D{right,tolerant,stretch}, headstyle=3Dbold, hang=3D1] % ok, we will plug in some code (will go into the kernel) \unprotect \def\ownnotesymbol#1% #1 gets number passed {\executeifdefined{\??vn::\currentnote}\empty} \def\setnotesymbol[#1]#2#3% {\prewordbreak % prevent lookback \gdef\lastnotenumber{#2}% \setgvalue{\??vn::#1}{#3} \dolastnotesymbol} \def\ownnote[#1]#2#3#4% {\setnotesymbol[#1]{#2}{#3}% \setnotetext [#1]{#4}} \protect % here we hook the code into the footnote handler \defineconversion [ownnote] [\ownnotesymbol] \setupnote [glossary] [conversion=3Downnote, textcommand=3D, textstyle=3D, numbercommand=3D] \showframe \starttext \dorecurse{10} {\dorecurse{5} {I'm \ownnote[glossary]{whowing}{whow}{whatever needs to be=20 glossed:~\recurselevel} a bit. \input tufte \relax}} \stoptext if there is interest i can add the glossary defs (maybe using a=20 different name) to the kernel. I'm a bit puzzled why the notes don't split well ... maybe taco has an=20 idea (he knows ttp -) concerning abbreviations ... maybe some day i'll add a feature like this=20 to it Hans Hans