# [NTG-context] Critical editions with ConTeXt

Talal talazem at fastmail.fm
Wed Jul 22 21:26:29 CEST 2015

Hans Hagen <pragma <at> wxs.nl> writes:

> >  Actually ranges have always been supported ...
> > Maybe I should add those commands.
> > Hans

Picking up on an old thread, again.

The document below lays out the three basic parts of a critical
apparatus of a critical edition of a text: (1) the body text; (2) the
lemma (which is the part of the body text being commented upon); and
(3) the comment on the lemma.

I would like to be able to automate (through macros) the making of a
critical apparatus' note. This is for two reasons. First, the body text
and the lemma in the note below should be identical: as such, they
ideally not have to be typed twice, as it introduces the possibility of
error. Furthermore, if one manually writes out \linenote{Lemma ]
Comment} in the body of the text, you forego the separation of content
and style, since the separator ] has been hardcoded in.

This is my attempt so far:

- - -

\setuplinenumbering[% 	style=\tfxx, 	referencing=on, 	step=1,
location=outer, 	method=page, 	align=left, 	distance=1em,
width=0.4em, 	]

\definelinenote[linenote][% 	paragraph=yes, 	frame=on,framecolor=red,
distance=.5em, 	display=yes, 	]%

\def\variant#1#2{{#1}\linenote{{#1}] {#2}}}

\def\lemma{This is the LEMMA.} \def\comment{This is my COMMENT on the
lemma.} \def\bodytext{This is the BODY TEXT. It should be identical to
the lemma in the note: their being identical should be automated so as
to minimise errors and reduce the amount of typing.}

%% DOCUMENT

\starttext

\startlinenumbering

% EX1 \section{EX1} \variant{Lemma lemma lemma lemma lemma lemma lemma
lemma lemma lemma lemma lemma lemma} {Comment comment comment.}.\blank

% EX2 \section{EX2} \section{With start and stop} \startlinenote[one]
{\lemma ] \comment} \bodytext \stoplinenote[one]

\stoplinenumbering

\stoptext

- - -

In the above, I have been able to successfully do "automate" this using
the macro command "variant". With this approach, however, the line
number is only that of the last word in the lemma.

To get line numbers that span more than one line, Hans instructed us to
use \startlinenote[x]...\stoplinenote[x]. However, I have not been able
to figure out how to "automate" the making of the lemma and comment
like was done in EX1 in such a stopstart block. I assume that the
solution lies in using \startsetups…\stopsetups + \definestartstop.
However, despite many attempts, I haven't been able to concoct the
right set of macros within that to get it working.

I'd be grateful for any help that could be offered.

Many thanks, Talal

p.s. Hans: When using \startlinenote…\stoplinenote, the addition of
some unique name (e.g. \startlinenote[one]) is obviously necessary. Is
there any way to automate this as well, as part of some sets of
macros/commands?