ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: Can \note repeat its footnote?
Date: Mon, 21 Jun 2004 19:45:51 +0200	[thread overview]
Message-ID: <40D71ECF.8040501@wxs.nl> (raw)
In-Reply-To: <cas2te$9jc$1@sea.gmane.org>

Stefan Wachter wrote:

> Hi all!
>
> The \note[xxx] command is used to reference a previously defined 
> footnote. Is it possible that the previously defined footnote is 
> repeated if a page break had occured between the \footnote[xxx]{bla 
> bla bla} and the corresponding \note[xxx] command?

it's incredible what kin dof wishes users can come up with -)

\def\myfootnote[#1]#2% let's guess that #2 is without catcode problems  
  {\setxvalue{note:#1}{\footnote{#2}}\footnote[note:a:#1]{#2}}

\def\mynote[#1]%
  {\removeunwantedspaces
   \pagereference[note:b:#1]%
   \doifreferencefoundelse{note:a:#1}
     {\edef\NotePageA{\number\currentrealreference}%
      \doifreferencefoundelse{note:b:#1}
        {\edef\NotePageB{\number\currentrealreference}%
         \ifnum\NotePageA<\NotePageB\relax
           \getvalue{note:#1}%
         \else
           \note[note:a:#1]%
         \fi}
        {\note[note:a:#1]}}
     {\note[note:a:#1]}}

\starttext

test \myfootnote[funny]{first occurence} test\mynote[funny]
test \myfootnote[again]{first occurence} \page test \mynote[again]

\stoptext

hardly tested 

Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

  parent reply	other threads:[~2004-06-21 17:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-17 13:01 Stefan Wachter
2004-06-18 17:23 ` Peter Münster
2004-06-21 17:45 ` Hans Hagen [this message]
2004-06-23 14:00   ` Stefan Wachter
2004-06-25 17:25     ` Hans Hagen
2004-06-30 16:02       ` Stefan Wachter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40D71ECF.8040501@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).