ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Daniel Schopper <daniel.schopper@aon.at>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: counter values as label names
Date: Mon, 03 Jan 2011 15:11:17 +0100	[thread overview]
Message-ID: <4D21D905.8000800@aon.at> (raw)

Dear list,
this seems a really basic question (and probably not even strictly 
ConTeXt-focused) - so please accept my apologies…

I'm trying to construct a macro which first creates two labels in the 
text (\start/stopline and \pagereference) with the value of a counter as 
the label name and then a footnote which prints the page and line 
numbers of those two. Supposedly because of my limited understanding of 
TeX's expansion mechanism I haven't been able to get things working with 
this code:

\setuplinenumbering[%
	location=inner,
	step=5,
         method=page,
         style=\tfxx,
         align=left,
         distance=1.5cm,
         width=0.3cm]
\setupfootnotes[
	location=text,
	numberconversion=empty,
	paragraph=yes,
	]
\definenumber[entrycounter]
\setnumber[entrycounter]{0}
\def\appentry#1#2{%
	\startline[line:\getnumber[entrycounter]]%
	\pagereference[page:\getnumber[entrycounter]]%
	#1%
	\stopline[line:\getnumber[entrycounter]]%
	\footnote{{\bf \at[page:\getnumber[entrycounter]]}%
	\inline[line:\getnumber[entrycounter]] #1] #2}%
	\incrementnumber[entrycounter]%
}

By now I tried to adapt a LaTeX-only-solution which Uwe Lueck suggested 
on the texhax-mailinglist some years ago (cf. 
http://tug.org/pipermail/texhax/2006-July/006599.html) but failed quite 
miserably.
I also tried the same with plain TeX registers (\newcount\entrycounter 
\entrycounter=0 etc.) instead of ConTeXt counters.
Could it be easier to stuff the \pagereference and \startline-commands 
into before= and after= of setupfootnotes?
Could anyone please give me a hint on this?

The purpose of this: I'm trying to use mkIV's page and linenumbering 
facilities for a critical apparatus (in this case endnotes with page and 
line references). As I didn't succeed with Hans Hagen's recent 
suggestion (cf. 
http://www.mail-archive.com/ntg-context@ntg.nl/msg49695.html) I tried 
this quick and dirty way. Although it's far away from being perfect (in 
an ideal world the endnotes should be grouped into one paragraph per 
page and of course there would be more then one apparatus and so on) 
this seems to be a first approach to me…

Cheers,
Daniel
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

             reply	other threads:[~2011-01-03 14:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-03 14:11 Daniel Schopper [this message]
2011-01-03 16:47 ` Thomas A. Schmitz
2011-01-03 18:09   ` Daniel Schopper
2011-01-03 21:15     ` Thomas A. Schmitz
2011-01-03 22:23     ` Aditya Mahajan
2011-01-04  8:38       ` Daniel Schopper

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=4D21D905.8000800@aon.at \
    --to=daniel.schopper@aon.at \
    --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).