sillsdev / ptx2pdf

XeTeX based macro package for typesetting USFM formatted (Paratext output) scripture files
21 stars 8 forks source link

Styling things inside \k #766

Closed davidg-sil closed 1 year ago

davidg-sil commented 1 year ago

\k does some clever-ish things to grab its argument to make it an anchor target. This is very useful for anchoring figures in glossaries. But it looks like sequences such as \k The \+nd Lord\+nd*\k* are going to be broken for the foreseeable future, with the \+nd* being read as \+nd * .

The work-around at the moment is to use \+k rather than \k, which does not have the magic side-effects I.e. \+k The \+nd Lord\*nd*\+k*, and accept that such sequences will not be anchor points. A python expert can no doubt write a non-greedy changes.txt line to automate this, looking for \ inside \k...\k* and making the \ks into \+k

A possible solution might be to make the input \+nd ... \+nd * an equivalent of \+nd ... \+nd* I.e. nesting a style inside itself checks a few more tokens ahead to see if there's a * coming.

davidg-sil commented 1 year ago

The above work-around may still be necessary for some situations, but in general it should not be needed now.