-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
Command \center now has an option to center its content vertically #1898
base: master
Are you sure you want to change the base?
Conversation
…sile-typesetter#1894) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
a0e8827
to
e051952
Compare
I'm unsure whether I should write the following after the settings:temporarily block if SU.boolean(options.vertical) and then
SILE.call("eject")
end |
e051952
to
0e7ea06
Compare
if #SILE.typesetter.state.nodes ~= 0 then | ||
SU.warn("\\center environment started after other nodes in a paragraph, may not center as expected") | ||
end | ||
if SU.boolean(options.vertical) then | ||
SILE.call("hbox") | ||
SILE.call("vfill") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A vfill won't push the content middle of the page, unless if it is a final page automatically vfill'ed (such as the final page of your example) or explicitly \eject
'ed. Then another vfill is currently automatically added at the end of the page, resulting in centering.
Personally:
- I don't think that horizontal centering and vertical centering should be the same command
- I don' think the vfill added on final pages or via eject is actually good :)
EDIT: Oh, and by the way, the empty hbox is no innocuous. It introduces an empty line. With the default typesetter, this is nearly innocuous, as it has a height of 0. With any other linespacing strategy (from the eponymous package, broken, IMHO) or grid, it becomes messy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @Omikhleia is right here, writing direction (linewise) centering and advance direction (framewise) are very different operations and don't belong in the same command. In fact any sort of advance direction centering (absolute to page?, relative to frame), fill available remaining space?) is so complicated and the interactions with line spacing, start-of-frame and end-of-frame queues, and so forth is so complicated that this should go in a dedicated package and even if all possible modes are not implemented at first, some thought should be given to the command names(s) so that the rest of the scenarios can be implemented without stepping all over existing documents.
I don think that some centering handlers are sufficiently basic enough and used as building blocks for other commands that this is something the core distribution should provide, so adding a package in this repo is probably warranted.
2819867
to
0e7ea06
Compare
I found this command was lacking an option to do the centering vertically (like asked here #475).