10

I'm working on a project very similar to the one described in this question, only for various reasons I'm using ConTeXt rather than that poster's use of XeLaTeX.

I too am typesetting a text with verse/line numbers in the margin and am interested in combining them should there happen to be two that end up on the same line, dividing them with a slash or a comma or something like that.

The comments there allude to a possible solution in ConTeXt with the possible use of \EveryLine, but I have not yet been able to figure out how to implement a solution using that command - I think I'm a bit newer at various implementations of TeX than the previous questioner! Is there a reliable way to implement this in ConTeXt?

EDITED TO ADD:

A very simple MWE:

\starttext

\inmargin{1}Now we are engaged in a great civil war.
\inmargin{2}We are testing whether that nation or any nation so conceived 
and so dedicated, can long endure.
\inmargin{3}We are met on a great battle-field of that war.

\stoptext

Results in:

The result

I would like the 1 and 2 not to be overlapping, nor to be stacked like the \setupmargindata[stack=yes] would get me, but rather to automatically combine those that would overlap to get something like "1,2" that would look like:

Desired output

I would appreciate any help...thank you!

Benjamin
  • 101
  • In the project I work on we had a similar problem. A colleague of mine solved it by traversing each line of the document with Lua and building a string, that separates each margin datum with a comma. This string is stored in a separate file that is used to run a PERL script with regexes that produce the desired effect. If you're interested, I can write a more detailed answer with code etc. -- but I'd prefer a simpler solution that only relies on ConTeXt, too. – meliade Mar 15 '18 at 15:07
  • I have looked at the margin notes code and it appears to me as if it was possible to add this possibility as an alternative to the stack option. It's a good idea to ask about this on the mailing list https://mailman.ntg.nl/mailman/listinfo/ntg-context – Henri Menke Mar 17 '18 at 08:34
  • 1
    @meliade I would be quite interested in your solution. Are you still willing to write up an answer? – TeXnician Dec 05 '18 at 12:15
  • 2
    I’m voting to close this question because the OP has lost interest in the question. – Sebastiano Dec 25 '23 at 20:59
  • @Sebastiano - I haven't actually lost interest in it; I've simply hit a wall. I went over to the mailing list and found no help there: https://mailman.ntg.nl/archives/list/ntg-context@ntg.nl/thread/6EIPU7IFETY3FKSTBRUXCPJ2SSX3GBMI/ If anything changes, I'd still be interested in hearing more about it! – Benjamin Dec 26 '23 at 21:08
  • @Benjamin It is an old question. I think no one will control it. Excuse me for closing it. I will be the first to reopen it. – Sebastiano Dec 26 '23 at 21:10

0 Answers0