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

Floating frames inhibit leaving hmode at end of paragraph #491

Open
alerque opened this issue Oct 11, 2017 · 1 comment
Open

Floating frames inhibit leaving hmode at end of paragraph #491

alerque opened this issue Oct 11, 2017 · 1 comment
Labels
bug Software bug issue

Comments

@alerque
Copy link
Member

alerque commented Oct 11, 2017

I just went to rebuild a book we published in January and got a layout problem that wasn't an issue with the same code run on whatever SILE version I had in January.

Here is an MWE:

\begin[papersize=a6]{document}
\nofolios
\noindent
\script[src=packages/lorem]
\script[src=packages/frametricks]
\float[bottomboundary=1.3ex,rightboundary=2spc]{\font[family=Symbola,size=3em]{✛}}Sadly this pagragraph is going to eat the following one for lunch. In a perfect world this paragraph would wrap its respectable 6 or so lines and then let the typesetter leave hmode. But no, without an extra \\par command it doesn't break right and just runs into the next paragraph — awkwardly with the pagragraph indent space inline.

\indent
This should be a stand alone paragraph indented starting on a fresh line.
\end{document}

And I get something like this:

selection_418

Explicitly adding what should be a duplicate paragraph break by adding \par at the end of the first paragraph fixes this up:

selection_419

But that explicit second break shouldn't be necessary and in the case of auto-applied styles like catching the first paragraph of chapters, almost impossible to code.

Incidentally, adding an explicit call to leaveHmode() anywhere in the paragraph after the frame breaks will also enable the natural paragraph break to work as expected (but introduces spacing issues of its own of course).

@alerque
Copy link
Member Author

alerque commented Oct 11, 2017

I was able to make my document behave by hacking an extra leaveHmode() into the typesetter's endline() function:

local endline = SILE.typesetter.endline
SILE.typesetter.endline = function  (self)
  self:leaveHmode()
  return endline(self)
end

I would patch this into the core but it just doesn't make sense and it seems like there might be a bug elsewhere. There is already one call to leaveHmode() in the endline() function so why it would need two to work is a mystery to me right now. Maybe after more coffee?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Software bug issue
Projects
None yet
Development

No branches or pull requests

2 participants