[NTG-context] Re: Can \note repeat its footnote?

2004-06-30 Thread Stefan Wachter
Hi Hans,
many thanks for your help. Now it works. Great!
I try to come along without having the same footnote marker for repeated 
footnotes. (This would make sense only if footnotes are sequentially 
numbered over a whole document.)

Thanks again,
--Stefan
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Re: Can \note repeat its footnote?

2004-06-25 Thread Hans Hagen
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
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Re: Can \note repeat its footnote?

2004-06-23 Thread Stefan Wachter
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?

Hans Hagen wrote:
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
-
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context