ubsicap / usfm

Unified Standard Format Markers
39 stars 18 forks source link

\LineSpacing description describes two completely different things #147

Open chris-morgan opened 1 year ago

chris-morgan commented 1 year ago

sty/README.md:

Property: \LineSpacing
Example: \LineSpacing 2
Description: Amount of extra space between lines in this paragraph in points. 0 = single space, 1 = space and a half, 2 = double space.

Is it describing leading in points, or is it an enumeration with three possible values?

Nothing else in the repository mentions or uses LineSpacing, so there’s nothing simple to compare with.

davidg-sil commented 1 year ago

That's fun! I don't think any of us PTXprint authors have read that README.md file. Therefore, facing what I presume a similar need, we came up with an identically named property, but we have another definition.... First of all, I'll state (in case it's not clear) the property \LineSpacing is not set in any stylesheet from Paratext.

PTXprint inherited the older \BaseLine from ptxplus codebase of the early 2010s, which requires a unit, and defines the baseline in any TeX unit, i.e. it could be an absolute on-page measure like 12pt, or could be in font-relative units like 1.8ex. Neither of those allowed for a scalable parameter ("Make me a large-print version with the same relative line spacing without me needing to rewrite the whole stylesheet") which also allowed distinct font-sizes to be used with the same grid.

In PTXprint (and the current set of ptx2pdf TeX macros), \LineSpacing is a taken as a simple multiplier (taking decimal numbers), relative to the value of a "standard line" that it calculates based on the \FontSize of \p and various other multipliers.

\LineSpacing 2 thus means that baselines are twice the normal baseline for the document, and \LineSpacing 1.5 would be line and a half of that grid, and footnotes might use \LineSpacing 0.8 or so.