Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MWE and mess around with pushback bugs #1191

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion core/baseclass.lua
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,9 @@ SILE.baseClass = std.object {
end,

endPar = function (typesetter)
typesetter:pushVglue(SILE.settings.get("document.parskip"))
local parskip = SILE.settings.get("document.parskip")
typesetter:pushVglue(parskip)
SILE.typesetter:leaveHmode()
end,

options = {
Expand Down
18 changes: 9 additions & 9 deletions core/typesetter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -489,21 +489,21 @@ SILE.defaultTypesetter = std.object {
self.state.previousVbox = nil
local lastMargins = self:getMargins()
for _, vbox in ipairs(oldqueue) do
SU.debug("pushback", { "process box", vbox })
SU.debug("pushback", "process box", vbox)
if vbox.margins and vbox.margins ~= lastMargins then
SU.debug("pushback", { "new margins", lastMargins, vbox.margins })
if not self.state.grid then self:endline() end
self:setMargins(vbox.margins)
end
if vbox.explicit then
SU.debug("pushback", { "explicit", vbox })
SU.debug("pushback", "explicit", vbox)
self:endline()
self:pushExplicitVglue(vbox)
elseif vbox.is_insertion then
SU.debug("pushback", { "pushBack", "insertion", vbox })
SU.debug("pushback", "pushBack", "insertion", vbox)
SILE.typesetter:pushMigratingMaterial({ material = { vbox } })
elseif not vbox.is_vglue and not vbox.is_penalty then
SU.debug("pushback", { "not vglue or penalty", vbox.type })
SU.debug("pushback", "not vglue or penalty", vbox.type)
local discardedFistInitLine = false
if (#self.state.nodes == 0) then
-- Setup queue but avoid calling newPar
Expand All @@ -513,15 +513,15 @@ SILE.defaultTypesetter = std.object {
if node.is_glue and not node.discardable then
self:pushHorizontal(node)
elseif node.is_glue and node.value == "margin" then
SU.debug("pushback", { "discard", node.value, node })
SU.debug("pushback", "discard", node.value, node)
elseif node.is_discretionary then
SU.debug("pushback", { "re-mark discretionary as unused", node })
SU.debug("pushback", "re-mark discretionary as unused", node)
node.used = false
if i == 1 then
SU.debug("pushback", { "keep first discretionary", node })
SU.debug("pushback", "keep first discretionary", node)
self:pushHorizontal(node)
else
SU.debug("pushback", { "discard all other discretionaries", node })
SU.debug("pushback", "discard all other discretionaries", node)
end
elseif node.is_zero then
if discardedFistInitLine then self:pushHorizontal(node) end
Expand All @@ -534,7 +534,7 @@ SILE.defaultTypesetter = std.object {
end
end
else
SU.debug("pushback", { "discard", vbox.type })
SU.debug("pushback", "discard", vbox.type)
end
lastMargins = vbox.margins
-- self:debugState()
Expand Down
10 changes: 10 additions & 0 deletions tests/bug-1185.sil
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
\begin[papersize=a6]{document}
\script[src=packages/frametricks]
\font[size=15pt]
Foobarbazfoobarbaz foobarbazfoobarbaz foobarbazfoobarbaz foobarbazfoobarbaz foobarbazfoobarbaz

\noindent
\float[rightboundary=1spc,bottomboundary=1spc]{\font[size=3em]{F}}oobarbazfoobarbaz foobarbazfoobarbaz foobarbazfoobarbaz foobarbazfoobarbaz foobarbazfoobarbaz foobarbazfoobarbaz foobarbazfoobarbaz foobarbazfoobarbaz

Foobarbazfoobarbaz foobarbazfoobarbaz foobarbazfoobarbaz foobarbazfoobarbaz
\end{document}