[NTG-context] counter values as label names

Aditya Mahajan adityam at umich.edu
Mon Jan 3 23:23:35 CET 2011


On Mon, 3 Jan 2011, Daniel Schopper wrote:

> First of all thanks for the advice and sorry for my naïve posting!
> Here's a test file for what I try to do. The problem is that the page- and 
> linenumbers printed by \placefootnotes all take the values of the last 
> reference.
>
> \setupfootnotes[
> 	location=text,
> 	numberconversion=empty,
> 	paragraph=,
> 	]
> \newcount\entrycounter
> \entrycounter=0
> \def\appentry#1#2{%
> 	\startline[line:\the\entrycounter]%
> 	\pagereference[page:\the\entrycounter]%
> 	#1%
> 	\stopline[line:\the\entrycounter]%
> 	\footnote{{\bf \at[page:\the\entrycounter]} 
> \inline[line:\the\entrycounter] #1] #2}}%
> 	\advance\entrycounter by1%
> \starttext\startlinenumbering
> This is a sample \appentry{paragraph}{om. h1}.\\
> An this is another \appentry{one}{sentence}.
> \stoplinenumbering
> \bigskip
> Endnotes
> \placefootnotes
> \stoptext
>
>> Finally: is the format of your apparatus (endnotes) a requirement?
> Yes, unfortunately it is.

I am not sure what you want to do, but the following at least increments 
the references (in MKIV)

\setupfootnotes
         [
          location=text,
          numberconversion=empty,
          paragraph=,
         ]

\newcount\entrycounter \entrycounter=0
\def\appentry#1#2%
   {\expanded
     {\startline[line:\the\entrycounter]%
         \noexpand\pagereference[page:\the\entrycounter]%
         #1%
      \noexpand\stopline[line:\the\entrycounter]%
      \noexpand\footnote{{\bf \at[page:\the\entrycounter]}
                          \inline[line:\the\entrycounter]
                          #1 #2}}%
      \advance\entrycounter by 1\relax}

\starttext
\startlinenumbering
This is a sample \appentry{paragraph}{om. h1}. \crlf
An this is another \appentry{one}{sentence}.
\stoplinenumbering
\bigskip
Endnotes
\placefootnotes
\stoptext


Aditya


More information about the ntg-context mailing list