Hi Walter, On Sat Feb 8, 2025 at 12:40 PM CET, Walter Alejandro Iglesias wrote: > On Fri, Feb 07, 2025 at 08:33:20PM +0100, onf wrote: > [...] > > Your approach seems unnecessarily complicated. Unless I am missing > > something, what you are trying to do with > > \v'\\n[.v]u/5u' > > can be achieved via > > .sp 0.2v > > or its equivalent > > .sp 0.2 > > [...] > Now I get to the part that made the story more complicated. Please, > open the linked document with a PDF viewer that allows you to turn pages > without altering the vertical position of the pages, skip document > title, credits, etc., go forward to where the first chapter begins and > then position a second window over the viewer so that the top edge of > the window matches one of the paragraph base lines. Hitting spacebar in > your PDF viewer you'll notice that the base lines on all the pages match > the guide perfectly (except for titles subtitles and dates, which are > the ones modified with the "adjust" string.) I found that this feature, > in addition to making the vertical size of the text box more uniform > across the pages, serves to check the operation of the widow and orphan > automation (which we recently discussed in another thread[2].) But to > achieve this uniformity you have to sit down and do the math with the > spaces so that they add up to round numbers in "v" units. This is why I > found it easier and less prone to error to round all the spaces to 1v > and use the string trick I showed in the previous post only in those > cases that require different spacing above and below (titles, subtitles > and dates). Well, this is the botch job I've come up with so far. :-) > [...]
I understand your use case, but it still seems simpler to me to use sp over strings. You could define registers which specify the ratio between the top and bottom space, so that instead of 1v:1v it becomes e.g. 0.4v:0.6v. Obviously the ratios could be defined without units, e.g. 40:60, and could be multiplied by the appropriate unit later; this would allow you to generalize the task of shifting the text. I don't have the time to study your approach in more depth, sorry. ~ onf