I use Edmac in plain XeTeX for typesetting scholarly editions, and for the first time have come across a problem that may be intractable. The text in question has frequently changing section numbers, which can occur either at the start of paragraphs or within the body of paragraphs. These are given as bold numerals, which ideally should be picked up by a
\mark (or rather
\marks) command so that they can be given in the running headlines, along with other changing elements.
The problem is that within text that is line-numbered by Edmac all of plain TeX's standard insert routines are broken. A
\mark in the midst of running text causes the line to burst apart, so that the only thing that's right is the headline - everything else is messed up. Any suggestions as to how this might be overcome? I vaguely thought of
\write, but I don't think it can be used to do the necessary - viz. in the left headline place the section number that is in operation in the first line of that page and in the right headline place the section number that is in operation in the last line of the page. I think I'm going to have to do these manually once the pagination has settled down. Or is there another solution?