sillsdev / ptx2pdf

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

Enable marginal verses on outer or inner and not just left #504

Closed mhosken closed 3 years ago

mhosken commented 3 years ago

This involves tracking which side verses end up on (columns as well), sigh.

mhosken commented 3 years ago

One approach is to introduce a side notes mechanism for out of stream notes that don't change the text flow (unlike side bars, for example). These would store the note id, position (page, col, x distance from text, y) and bounding rectangle. Python code could then analyse that to insert adjustments to resolve clashes which would then apply on the next xetex run.

mhosken commented 3 years ago

This involves a refactoring of how marginal verses work. You can adjust the space between the verse number and the text by setting the left margin on \v. To change the position of the verse number from the default of left (right, inner, outer), you have to set the position parameter on \v. This can't currently be done using .sty so at the moment you have to add something like:

\expandafter\def\csname v:position\endcsname{inner}

to ptxprint-mods.tex. Yes it's ugly. But we aren't finished with this in general. There is quite a bit of cleanup to go.

mhosken commented 3 years ago

If you want to be snazzy and have one verse number per paragraph. Here is a snippet to do that in conjunction with marginal verses.

\newif\iffirstinpara \firstinparatrue
\let\mytv=\printverse
\catcode`\@=11
\def\printverse{\iffirstinpara\global\firstinparafalse\global\let\v@rseto=\v@rsefrom\mytv\fi}
\catcode`\@=12
\def\paramarker#1{\expandafter\let\csname _#1\expandafter\endcsname \csname #1\endcsname
    \expandafter\gdef\csname #1\endcsname{\global\firstinparatrue\csname _#1\endcsname}}
\paramarker{p}\paramarker{q1}\paramarker{li}