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: Re: counter values as label names
Date: Tue, 04 Jan 2011 09:38:17 +0100	[thread overview]
Message-ID: <4D22DC79.5000505@aon.at> (raw)
In-Reply-To: <alpine.LNX.2.01.1101031718170.9980@ybpnyubfg.ybpnyqbznva>

Thomas and Aditya, thank you both for your replies! As Thomas already 
suspected it was a mere typo that \advance\entrycounter lied outside of 
the macro definition - sorry for the unnecessary confusion.
I tried to compile Aditya's attempt (MKIV  ver: 2010.12.31) but receive 
the following errors:

references      : unknown reference [][lr:b:line:0]
! Missing control sequence inserted.
<inserted text> \inaccessible

 > I am not sure what you want to do,
My simple idea - being a total newbie to macro programming - was to 
create an automation of the following, in which the unique numbers in 
the label names would be inserted by a counter:

\starttext
\startlinenumbering
This is a sample %
	% wrapper macro would start here
	\startline[line:1]\pagereference[page:1]lemma\stopline[line:1]
	\footnote{\at[page:1] \inline[line:1] some comment}%
	% and end here
. \crlf
And this is another 
\startline[line:2]\pagereference[page:2]one\stopline[line:2]\footnote{\at[page:2] 
\inline[line:2] another comment}. \crlf
\stoplinenumbering
\bigskip
Endnotes
\placefootnotes
\stoptext

But probably my whole approach is completely out of the (Con)TeXt-Way of 
thinking… (May it be possible to collect the "endnotes" into various 
buffers and recurse over them at the end?)
Thanks for the hints,
Daniel



Am 03.01.11 23:23, schrieb Aditya Mahajan:
> 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
>
>
>
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
___________________________________________________________________________________
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-04  8:38 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
2011-01-03 22:23     ` Aditya Mahajan
2011-01-04  8:38       ` Daniel Schopper [this message]

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=4D22DC79.5000505@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).