[NTG-context] counter values as label names

Thomas A. Schmitz thomas.schmitz at uni-bonn.de
Mon Jan 3 22:15:01 CET 2011


On Jan 3, 2011, at 7:09 PM, Daniel Schopper wrote:

> \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

Tricky. I can't figure out how to do it. First, the code you write can never work. You define a \newcount and set it to 0. Before your text starts, you increase this count, so now its value is 1. Then, you never touch this value again, so effectively, all your references expand to page:1 and line:1. (And, on top of it all, your file has only one line since \\ doesn't start a new line.) But even if you try to increment your counter within the definition of your macro, it won't work because it will be advanced and frozen by the time your footnotes are typeset. So this approach will not work, I'm afraid. I'm not sure this can be done in ConTeXt.

Thomas


More information about the ntg-context mailing list