ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: endnotes/critical apparatus
Date: Thu, 19 May 2011 23:23:31 +0200	[thread overview]
Message-ID: <2294DB2C-3330-47F2-906D-8915444EAAA0@googlemail.com> (raw)
In-Reply-To: <4DD53A7C.7010304@aon.at>


Am 19.05.2011 um 17:42 schrieb Daniel Schopper:

> Dear list,
> I’m fiddling around with a simple apparatus for critical editions with endnotes. For now this is working ok - but I’m wondering if somebody could advise me on some aspects of it (see below). Here’s a minimal example:
> 
> […]
> 
> Now, this is obviously a really primitive approach (I’m still learning…) which I’d like to improve in some ways:
> 
> - How can I get rid of the blackrule in the apparatus?
> 	\noexpand\let\blackrule[#1]=\noexpand\relax
> throws an error (You can't use `macro parameter character #' in vertical mode.) while
> 	\noexpand\let\blackrule=\noexpand\relax
> eliminates the rule but simply prints the arguments in the square brackets. (Same holds true for every macro with arguments.)

You can use \simplifycommands, see my example below.

> - What to do if I’d want to gobble \crlf or \par in the lemma while using them as separators after each apparatus entry? I tried to \let them to \relax, which ends in luatex getting stuck when it tries to import the .en-file.
> 
> - How could I reset gobbled commands like \bf to their original meaning (I’d like to ignore \bf inside a lemma but still be able to have bold page numbers at the beginning of the apparatus entry)?
> 
> I’m sure there are much more elegant ways to do this (probably in lua?), maybe someone could provide me with a hint where to start from?

You can use contexts own note mechanism to collect the data and place them later in your document.

\define[2]\Apparatus
  {\ifdefined\ApparatusCounter
     \doglobal\increment\ApparatusCounter
   \else
     \doglobal\newcounter\ApparatusCounter
   \fi
   \pagereference[apparatus:page:\ApparatusCounter]%
   \startline[apparatus:line:\ApparatusCounter]{#1}\stopline[apparatus:line:\ApparatusCounter]%
   \begingroup\simplifycommands
   \expanded{\endnote{\at[apparatus:page:\ApparatusCounter]/\noexpand\inline[apparatus:line:\ApparatusCounter]~{#1}]~{#2}}}%
   \endgroup}

\appendtoks\def\blackrule[#1]{}\to\simplifiedcommands
\appendtoks         \def\crlf{}\to\simplifiedcommands
\appendtoks           \def\bf{}\to\simplifiedcommands

\setuplabeltext[en][lines=,line=]

\setupnote
  [endnote]
  [textcommand=\gobbleoneargument,
       command=\gobbleoneargument]

\starttext

\startlinenumbering
That’s a \Apparatus{\bf lemma}{That’s a variant reading…}. \input tufte

But then there’s a blackrule \Apparatus{\blackrule[width=5cm]\crlf and a linebreak}{-- which we don’t want to repeat in the apparatus.}.
\stoplinenumbering

\placenotes[endnote]

\stoptext

Wolfgang

___________________________________________________________________________________
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-05-19 21:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-19 15:42 Daniel Schopper
2011-05-19 21:23 ` Wolfgang Schuster [this message]
2011-05-20 18:23   ` Daniel Schopper
2011-05-21  8:57     ` Wolfgang Schuster

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=2294DB2C-3330-47F2-906D-8915444EAAA0@googlemail.com \
    --to=schuster.wolfgang@googlemail.com \
    --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).