From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/15570 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Re: Can \note repeat its footnote? Date: Fri, 25 Jun 2004 19:25:48 +0200 Sender: ntg-context-admin@ntg.nl Message-ID: <40DC601C.7010107@wxs.nl> References: <40D71ECF.8040501@wxs.nl> <40D98CFD.5080308@gmx.de> Reply-To: ntg-context@ntg.nl NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1088184520 1642 80.91.224.253 (25 Jun 2004 17:28:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 25 Jun 2004 17:28:40 +0000 (UTC) Original-X-From: ntg-context-admin@ntg.nl Fri Jun 25 19:28:18 2004 Return-path: Original-Received: from ref.vet.uu.nl ([131.211.172.13] helo=ref.ntg.nl) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BduUr-0004Kb-00 for ; Fri, 25 Jun 2004 19:28:17 +0200 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id 9D1C910B1D; Fri, 25 Jun 2004 19:28:14 +0200 (MEST) Original-Received: from mailrelay02.solcon.nl (maillb.solcon.nl [212.45.32.200]) by ref.ntg.nl (Postfix) with ESMTP id 4C62E10ABF for ; Fri, 25 Jun 2004 19:25:52 +0200 (MEST) Original-Received: from server-1.pragma-net.nl (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by mailrelay02.solcon.nl (8.12.11/SQL-8.12.11-5/8.12.11) with ESMTP id i5PHPmXF030511 for ; Fri, 25 Jun 2004 19:25:48 +0200 Original-Received: by server-1.pragma-net.nl (Postfix, from userid 65534) id B450A18570; Fri, 25 Jun 2004 19:25:51 +0200 (CEST) Original-Received: from [10.100.1.191] (unknown [10.100.1.191]) by server-1.pragma-net.nl (Postfix) with ESMTP id 7BFB817AE8 for ; Fri, 25 Jun 2004 17:25:50 +0000 (UTC) User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502) X-Accept-Language: en-us, en Original-To: ntg-context@ntg.nl In-Reply-To: <40D98CFD.5080308@gmx.de> X-Virus-Scanned: clamd / ClamAV version 0.73, clamav-milter version 0.73a on mailrelay02.solcon.nl X-Virus-Status: Clean Errors-To: ntg-context-admin@ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.0.13 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.comp.tex.context:15570 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:15570 Stefan Wachter wrote: > Hi Hans, > > thanks for your reply. Unfortunately your solution does not work > correctly. The following example produces one footnote at the first > page but no footnote on the second page. > > \starttext > > funny\myfootnote[funny]{funny} funny\mynote[funny] > \page > funny\mynote[funny] funny\mynote[funny] > > \stoptext > > --Stefan > > PS: Would it be possible to use the same footnote mark again when a > footnote is repeated? sure but this needs some thought (for instance clashing numbers/symbols) \def\myfootnote[#1]#2% let's guess that #2 is without catcode problems {\setgvalue{note:t:#1}% {\setxvalue{note:l:#1}{\getvalue{note:n:#1}}% \footnote[note:a:#1:\getvalue{note:l:#1}]{#2}}% \setgvalue{note:n:#1}% {1}% \getvalue{note:t:#1}}% \def\mynote[#1]% {\removeunwantedspaces \scratchcounter\getvalue{note:n:#1}\relax \edef\NoteNumber{\the\scratchcounter}% \doglobal\incrementvalue{note:n:#1}\relax \doifreferencefoundelse{note:a:#1:1} {\edef\NotePageA{\number\currentrealreference}% \doifreferencefoundelse{note:a:#1:\getvalue{note:n:#1}} {\edef\NotePageB{\number\currentrealreference}% \doifreferencefoundelse{note:a:#1:\NoteNumber} {\ifnum\currentrealreference=\NotePageB\relax \pagereference[note:a:#1:\getvalue{note:n:#1}]% \note[note:a:#1:\getvalue{note:l:#1}]% \else\ifnum\NotePageA=\NotePageB\relax \pagereference[note:a:#1:\getvalue{note:n:#1}]% \note[note:a:#1:\getvalue{note:l:#1}]% \else \getvalue{note:t:#1}% \fi\fi} {\ifnum\NotePageA=\NotePageB\relax \pagereference[note:a:#1:\getvalue{note:n:#1}]% \note[note:a:#1:\getvalue{note:l:#1}]% \else \getvalue{note:t:#1}% \fi}} {\pagereference[note:a:#1:\getvalue{note:n:#1}]% \note[note:a:#1:\getvalue{note:l:#1}]}} {\pagereference[note:a:#1:\getvalue{note:n:#1}]% \note[note:a:#1:\getvalue{note:l:#1}]}} \starttext % test \myfootnote[funny]{first occurence} test\mynote[funny] % test \myfootnote[again]{first occurence} \page test \mynote[again] funny \myfootnote[funny]{funny} funny \mynote[funny] \page funny \mynote[funny] funny \mynote[funny] funny \mynote[funny] \page funny \mynote[funny] funny \mynote[funny] \page funny \mynote[funny] funny \mynote[funny] funny \mynote[funny] \page \stoptext