ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Thomas A. Schmitz" <thomas.schmitz@uni-bonn.de>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: counter values as label names
Date: Mon, 3 Jan 2011 22:15:01 +0100	[thread overview]
Message-ID: <3268D707-0647-4A8E-8803-4A9F71278704@uni-bonn.de> (raw)
In-Reply-To: <4D2210CE.5010709@aon.at>


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
___________________________________________________________________________________
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 21:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-03 14:11 Daniel Schopper
2011-01-03 16:47 ` Thomas A. Schmitz
2011-01-03 18:09   ` Daniel Schopper
2011-01-03 21:15     ` Thomas A. Schmitz [this message]
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=3268D707-0647-4A8E-8803-4A9F71278704@uni-bonn.de \
    --to=thomas.schmitz@uni-bonn.de \
    --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).