Skip to content

Commit

Permalink
Merge cbbdfdc into 6ad9b76
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Jun 7, 2024
2 parents 6ad9b76 + cbbdfdc commit 88b2c45
Show file tree
Hide file tree
Showing 13 changed files with 98 additions and 81 deletions.
14 changes: 6 additions & 8 deletions classes/base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -696,16 +696,13 @@ end

-- WARNING: not called as class method
function class.endPar (typesetter)
-- If we're already explicitly out of hmode don't do anything special in the way of skips or indents. Assume the user
-- has handled that how they want, e.g. with a skip.
if typesetter:vmode() then
return
end
SILE.settings:set("current.parindent", nil)
typesetter:pushVglue(SILE.settings:get("document.parskip"))
if SILE.settings:get("current.hangIndent") then
SILE.settings:set("current.hangIndent", nil)
SILE.settings:set("linebreak.hangIndent", nil)
end
if SILE.settings:get("current.hangAfter") then
SILE.settings:set("current.hangAfter", nil)
SILE.settings:set("linebreak.hangAfter", nil)
end
end

function class:newPage ()
Expand All @@ -725,6 +722,7 @@ end

function class:finish ()
SILE.inputter:postamble()
SILE.typesetter:endline()
SILE.call("vfill")
while not SILE.typesetter:isQueueEmpty() do
SILE.call("supereject")
Expand Down
4 changes: 3 additions & 1 deletion classes/book.lua
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,16 @@ function class:registerCommands ()
if SILE.Commands[postcmd .. ":" .. lang] then
postcmd = postcmd .. ":" .. lang
end
SILE.call("nofoliothispage")
SILE.call(postcmd)
SILE.call("book:chapterfont", {}, content)
SILE.call("left-running-head", {}, function ()
SILE.settings:temporarily(function ()
SILE.call("book:left-running-head-font", {}, content)
end)
end)
SILE.call("par")
SILE.call("bigskip")
SILE.call("nofoliothispage")
-- English typography (notably) expects the first paragraph under a section
-- not to be indented. Frenchies, don't use this class :)
SILE.call("noindent")
Expand Down Expand Up @@ -214,6 +215,7 @@ function class:registerCommands ()
end)
end)
end
SILE.call("par")
SILE.call("novbreak")
SILE.call("bigskip")
SILE.call("novbreak")
Expand Down
12 changes: 10 additions & 2 deletions classes/plain.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,16 @@ function class:registerCommands ()

self:registerCommand("noindent", function (_, content)
if #SILE.typesetter.state.nodes ~= 0 then
SU.warn(
"\\noindent called after nodes already received in a paragraph, the setting will have no effect because the parindent (if any) has already been output"
SU.warn([[\noindent was called after paragraph content has already been procesed.
This will not result in avoiding the current paragraph being indented.
This function must be called before any content belonging to the
paragraph is processed. If the intent was to suppress indentation of a
following paragraph, first explicitly close the current paragraph. From
an input document this is typically done with an empty line between
paragraphs, but calling the \par command explicitly or from Lua code
running SILE.call("par") will end the current paragraph.
]]
)
end
SILE.settings:set("current.parindent", SILE.types.node.glue())
Expand Down
26 changes: 13 additions & 13 deletions tests/alignment.expected
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Mx 4.4700
Mx 5.4200
T 72 a=5.0000 86 a=5.3100 67 a=4.9300 70 a=4.4700 83 a=3.7200 72 a=5.0000 83 a=3.7200 70 a=4.4700 79 a=5.4200 (gubergren)
Mx 26.8819
My 95.9564
My 85.9564
Set font Libertinus Serif;10;400;Italic;normal;;;LTR
Mx 5.8700
Mx 4.5700
Expand Down Expand Up @@ -200,7 +200,7 @@ T 68 80 79 84 70 85 70 85 86 83 w=42.9300 (consetetur)
Mx 239.8919
T 84 66 69 74 81 84 68 74 79 72 w=42.7400 (sadipscing)
Mx 14.8819
My 107.9564
My 97.9564
T 70 77 74 85 83 w=16.7000 (elitr)
Mx 33.8353
Mx 3.9000
Expand Down Expand Up @@ -250,7 +250,7 @@ Mx 3.6400
Mx 4.4700
T 69 a=5.0600 80 a=5.0400 77 a=2.6400 80 a=5.0400 83 a=3.7200 70 a=4.4700 (dolore)
Mx 14.8819
My 119.9564
My 109.9564
T 78 66 72 79 66 w=27.4600 (magna)
Mx 44.8368
T 66 77 74 82 86 90 66 78 w=37.8800 (aliquyam)
Expand Down Expand Up @@ -293,7 +293,7 @@ T 66 68 68 86 84 66 78 w=34.8100 (accusam)
Mx 275.1259
T 70 85 w=7.6300 (et)
Mx 14.8819
My 131.9564
My 121.9564
T 75 86 84 85 80 w=20.1300 (justo)
Mx 37.5119
T 69 86 80 w=15.4100 (duo)
Expand Down Expand Up @@ -335,7 +335,7 @@ Mx 4.4700
Mx 5.4200
T 72 a=5.0000 86 a=5.3100 67 a=4.9300 70 a=4.4700 83 a=3.7200 72 a=5.0000 83 a=3.7200 70 a=4.4700 79 a=5.4200 (gubergren)
Mx 18.9889
My 163.9564
My 143.9564
Set font Libertinus Serif;10;400;Italic;normal;;;LTR
Mx 6.4600
Mx 4.4700
Expand Down Expand Up @@ -369,7 +369,7 @@ T 84 66 69 74 81 84 68 74 79 72 w=42.7400 (sadipscing)
Mx 261.9489
T 70 77 74 85 83 w=16.7000 (elitr)
Mx 23.2489
My 175.9564
My 155.9564
Mx 3.9000
Mx 4.5400
Mx 5.0600
Expand Down Expand Up @@ -417,7 +417,7 @@ Mx 3.6400
Mx 4.4700
T 69 a=5.0600 80 a=5.0400 77 a=2.6400 80 a=5.0400 83 a=3.7200 70 a=4.4700 (dolore)
Mx 14.8819
My 187.9564
My 167.9564
T 78 66 72 79 66 w=27.4600 (magna)
Mx 44.8368
T 66 77 74 82 86 90 66 78 w=37.8800 (aliquyam)
Expand Down Expand Up @@ -460,7 +460,7 @@ T 66 68 68 86 84 66 78 w=34.8100 (accusam)
Mx 275.1259
T 70 85 w=7.6300 (et)
Mx 37.0639
My 199.9564
My 179.9564
T 75 86 84 85 80 w=20.1300 (justo)
Mx 59.6939
T 69 86 80 w=15.4100 (duo)
Expand Down Expand Up @@ -502,7 +502,7 @@ Mx 4.4700
Mx 5.4200
T 72 a=5.0000 86 a=5.3100 67 a=4.9300 70 a=4.4700 83 a=3.7200 72 a=5.0000 83 a=3.7200 70 a=4.4700 79 a=5.4200 (gubergren)
Mx 26.8819
My 231.9564
My 201.9564
Set font Libertinus Serif;10;400;Italic;normal;;;LTR
Mx 3.2200
Mx 5.3100
Expand Down Expand Up @@ -536,7 +536,7 @@ T 84 66 69 74 81 84 68 74 79 72 w=42.7400 (sadipscing)
Mx 266.0559
T 70 77 74 85 83 w=16.7000 (elitr)
Mx 14.8819
My 243.9564
My 213.9564
Mx 3.9000
Mx 4.5400
Mx 5.0600
Expand Down Expand Up @@ -588,7 +588,7 @@ T 78 66 w=12.4700 (ma)
Mx 279.3759
T 14 w=3.3800 (-)
Mx 14.8819
My 255.9564
My 225.9564
T 72 79 66 w=14.9900 (gna)
Mx 33.5004
T 66 77 74 82 86 90 66 78 w=37.8800 (aliquyam)
Expand Down Expand Up @@ -631,7 +631,7 @@ T 66 68 68 86 84 66 78 w=34.8100 (accusam)
Mx 275.1259
T 70 85 w=7.6300 (et)
Mx 14.8819
My 267.9564
My 237.9564
T 75 86 84 85 80 w=20.1300 (justo)
Mx 37.5174
T 69 86 80 w=15.4100 (duo)
Expand Down Expand Up @@ -673,7 +673,7 @@ Mx 4.4700
Mx 5.4200
T 72 a=5.0000 86 a=5.3100 67 a=4.9300 70 a=4.4700 83 a=3.7200 72 a=5.0000 83 a=3.7200 70 a=4.4700 79 a=5.4200 (gubergren)
Mx 138.2259
My 299.9564
My 259.9564
Set font Libertinus Serif;10;400;Italic;normal;;;LTR
T 51 74 72 73 85 w=22.1200 (Right)
Mx 162.8459
Expand Down
2 changes: 1 addition & 1 deletion tests/bug-1580.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Set paper size 209.7637818 297.6377985
Begin page
Mx 10.4882
My 10.4882
My 272.0958
My 272.3000
Set font Gentium Plus;10;400;;normal;;;LTR
T 79 82 85 72 80 w=24.3506 (lorem)
Mx 39.1334
Expand Down
1 change: 1 addition & 0 deletions tests/bug-1647.sil
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
This paragraph is at the page top.

This paragraph has a big parskip before it.

\vfill
This paragraph must be at the page bottom.
\par
Expand Down
20 changes: 10 additions & 10 deletions tests/bug-262.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Set paper size 419.5275636 595.275597
Begin page
Mx 28.3906
My 11.9055
My 454.9055
My 455.9055
Set font Gentium Plus;10;400;;normal;;;LTR
T 79 82 85 72 80 w=24.3506 (lorem)
Mx 56.5801
Expand All @@ -22,7 +22,7 @@ T 87 72 w=8.0615 (te)
Mx 181.2230
T 16 w=3.3691 (-)
Mx 8.3906
My 467.9055
My 468.9055
T 87 88 85 w=12.7002 (tur)
Mx 24.4014
T 86 68 71 76 83 86 70 76 81 74 w=42.9980 (sadipscing)
Expand All @@ -39,7 +39,7 @@ T 72 76 85 w=11.2891 (eir)
Mx 181.2230
T 16 w=3.3691 (-)
Mx 8.3906
My 480.9055
My 481.9055
T 80 82 71 w=18.2617 (mod)
Mx 30.4683
T 87 72 80 83 82 85 w=30.3809 (tempor)
Expand All @@ -54,7 +54,7 @@ T 72 87 w=8.0615 (et)
Mx 158.0443
T 71 82 79 82 85 72 w=26.5479 (dolore)
Mx 8.3906
My 493.9055
My 494.9055
T 80 68 74 81 68 w=27.6074 (magna)
Mx 38.5192
T 68 79 76 84 88 92 68 80 w=38.0127 (aliquyam)
Expand All @@ -69,7 +69,7 @@ T 89 82 79 88 83 87 88 68 w=36.5967 (voluptua)
Mx 176.5599
T 68 87 w=8.0322 (at)
Mx 8.3906
My 506.9055
My 507.9055
T 89 72 85 82 w=18.5400 (vero)
Mx 29.2677
T 72 82 86 w=13.5107 (eos)
Expand All @@ -88,7 +88,7 @@ T 71 82 79 82 85 72 86 w=30.4102 (dolores)
Mx 176.5306
T 72 87 w=8.0615 (et)
Mx 8.3906
My 519.9055
My 520.9055
T 72 68 w=9.2090 (ea)
Mx 20.7225
T 85 72 69 88 80 w=26.9873 (rebum)
Expand All @@ -105,7 +105,7 @@ T 81 82 w=10.5469 (no)
Mx 171.5208
T 86 72 68 w=13.0713 (sea)
Mx 8.3906
My 532.9055
My 533.9055
T 87 68 78 76 80 68 87 68 w=36.2744 (takimata)
Mx 47.2594
T 86 68 81 70 87 88 86 w=30.9424 (sanctus)
Expand All @@ -120,7 +120,7 @@ T 71 82 79 82 85 w=21.9287 (dolor)
Mx 174.5775
T 86 76 87 w=10.0146 (sit)
Mx 8.3906
My 545.9055
My 546.9055
T 68 80 72 87 w=20.6836 (amet)
Mx 32.1593
T 79 82 85 72 80 w=24.3506 (lorem)
Expand All @@ -141,7 +141,7 @@ T 87 72 w=8.0615 (te)
Mx 181.2230
T 16 w=3.3691 (-)
Mx 8.3906
My 558.9055
My 559.9055
T 87 88 85 w=12.7002 (tur)
Mx 24.4014
T 86 68 71 76 83 86 70 76 81 74 w=42.9980 (sadipscing)
Expand All @@ -158,7 +158,7 @@ T 72 76 85 w=11.2891 (eir)
Mx 181.2230
T 16 w=3.3691 (-)
Mx 8.3906
My 571.9055
My 572.9055
T 80 82 71 w=18.2617 (mod)
Mx 30.4683
T 87 72 80 83 82 85 w=30.3809 (tempor)
Expand Down
12 changes: 6 additions & 6 deletions tests/bug-301.expected
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ T 45 82 75 81 w=18.1604 (John)
Mx 146.8685
T 43 68 81 70 82 70 78 w=33.5283 (Hancock)
Mx 37.4104
My 225.7379
My 224.7379
T 36 w=5.6545 (A)
Mx 47.0753
T 79 76 81 72 w=14.7788 (line)
Expand All @@ -76,7 +76,7 @@ T 83 68 85 68 74 85 68 83 75 w=40.5466 (paragraph)
Mx 164.2543
T 87 75 68 87 w=16.1426 (that)
Mx 17.4104
My 242.7423
My 241.7423
T 90 85 68 83 86 w=23.5320 (wraps)
Mx 44.9637
T 82 81 w=10.0195 (on)
Expand All @@ -101,14 +101,14 @@ T 82 81 w=10.0195 (on)
Mx 69.5699
T 17 w=2.1755 (.)
Mx 123.9924
My 59.7203
My 58.2203
T 55 75 72 w=14.8623 (The)
Mx 141.3651
T 88 81 71 72 85 86 76 74 81 72 71 w=48.8127 (undersigned)
Mx 190.1779
T 15 w=2.1755 (,)
Mx 138.1542
My 78.7247
My 74.7247
T 45 82 75 81 w=18.1604 (John)
Mx 158.8251
T 43 68 81 70 82 70 78 w=33.5283 (Hancock)
Expand All @@ -129,7 +129,7 @@ T 87 75 72 w=12.9001 (the)
Mx 162.7189
T 81 72 91 87 w=17.6780 (next)
Mx 17.4104
My 58.5609
My 58.6971
T 83 68 74 72 w=18.4155 (page)
Mx 39.0274
T 71 82 72 86 81 10 87 w=28.6624 (doesn't)
Expand All @@ -150,7 +150,7 @@ T 76 87 w=5.8447 (it)
Mx 170.3773
T 82 81 w=10.0195 (on)
Mx 17.4104
My 75.4058
My 75.6783
T 87 75 76 86 w=14.7556 (this)
Mx 34.6895
T 83 68 74 72 w=18.4155 (page)
Expand Down
2 changes: 1 addition & 1 deletion tests/bug-301.sil
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ A line of stuff in a paragraph that wraps on the page following the one it start

\raggedleft{John Hancock}

\skip[height=16em]
\vfill

The problem with hfills on the next page doesn't repro if you try to do it on this page.

Expand Down
4 changes: 2 additions & 2 deletions tests/bug-344.expected
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ T 80 68 81 w=18.1396 (man)
Mx 108.8377
T 17 w=2.2900 (.)
Mx 54.8208
My 459.2688
My 457.2688
T 50 81 72 w=16.1377 (One)
Mx 70.9585
T 15 w=2.2900 (,)
Expand All @@ -28,7 +28,7 @@ T 86 75 82 72 w=19.0283 (shoe)
Mx 161.0933
T 17 w=2.2900 (.)
Mx 54.8208
My 483.9172
My 481.9172
T 50 81 72 w=16.1377 (One)
Mx 70.9585
T 15 w=2.2900 (,)
Expand Down
2 changes: 1 addition & 1 deletion tests/disappearing-skip.expected
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ T 20 w=4.6924 (1)
Mx 64.0185
T 17 w=2.2900 (.)
Mx 38.2835
My 488.4344
My 487.7319
T 51 68 85 68 w=18.3691 (Para)
Mx 59.3261
T 21 w=4.6924 (2)
Expand Down
Loading

0 comments on commit 88b2c45

Please sign in to comment.