-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
Another approach to full bleed printing, paper/sheet size, and pdf refactoring #1853
Another approach to full bleed printing, paper/sheet size, and pdf refactoring #1853
Conversation
…g, cropmarks, background Decorrelate frame cursor position from actual outputter cursor. Add base class options (bleed, sheetsize) Move most of the direct low-level libtexpdf call to the outputter.
Erm:
Perhaps a bad move, esp. for bookmarks. I'll revert that bit. --> EDIT: Done |
d365af8
to
1d3d557
Compare
…ic to the outputter
1d3d557
to
6f8a022
Compare
Hey @jodros the conflicts here are due to the introduction of the landscape option. But with two or three page size related options in this proposal, I'm unsure how to interpret (Let's admit it, the most important option for me is |
BTW, I did mention #1892 that it would break here. I asked there for a discussion that never came. Thats's ok, but how do we move forward? I've no idea :) |
Hello, I took a brief look at your code, mostly the base class, so I'd like to know whether there are others conflicting parts besides the |
Well besides the coding, the question is that the PR proposes
With a single |
Well, I'm not sure whether I understood the problem, but here is what I tested right now:
In your example indeed there would be no need for that, as we can see: But what if the user just want to have this document with an But if we add the landscape option to sheet size
We'd have: This last one matches better with your purpose, right? |
Can you possibly post your diff? I could try and check. |
diff --git a/classes/base.lua b/classes/base.lua
index d73b5ac6..d013a579 100644
--- a/classes/base.lua
+++ b/classes/base.lua
@@ -85,9 +85,8 @@ function class:setOptions (options)
options.landscape = nil
self.options.papersize = options.papersize or "a4"
options.papersize = nil
- options.papersize = options.papersize or "a4"
options.bleed = options.bleed or "0"
-
+
for option, value in pairs(options) do
self.options[option] = value
end
@@ -152,7 +151,8 @@ function class:declareOptions ()
self:declareOption("sheetsize", function (_, size)
if size then
self.sheetsize = size
- SILE.documentState.sheetSize = SILE.papersize(size)
+ -- SILE.documentState.sheetSize = SILE.papersize(size)
+ SILE.documentState.sheetSize = SILE.papersize(size, self.options.landscape)
end
return self.sheetsize
end)
|
d7c491b
to
ff5f86f
Compare
I just took a stab at ⓐ resolving the merge conflicts to integrate the landscape option and ⓑ cleaning up a few tidbits I noticed in review. How are we looking? |
ff5f86f
to
8fd8be5
Compare
This does not actually close #902, but it does start down that road. I'm working on finishing that up in another branch. |
It should have, i had rotate, links etc. working in my "draft" HTML outputter with no problem. If I can help, let me know, perhaps indeed I didn't address the debug backend? |
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.
This all looks like a good start. There is some more refactoring I want to do to add hooks to the outputters so packages can do more, but also move more backend specific logic out of packages. But in messing with it I think it makes sense to just start with this and move on rather than trying to refactor these commits.
Freshly backported from Omikhleia/silex.sile#2 (you can see some new visuals there), proposed for inclusion upstream here1
This is a new take at #1439, reusing some of the ideas from my earlier attempt #1470 -- There are a few "slightly" breaking changes (notably on the cropmarks package), although nothing worse that in that previous attempt.
The main differences with the previous attempt are that the frames are not impacted in this solution, and the frames coordinates are de-correlated from those used by the outputter.
Another (minor) differences is that I went for different base class options (which sound much better, I think, and less intrusive in the existing code base).
Achievements:
-b debug
(or another outputter) does work now. 👍Other details and fixes:
ClosesStarts addressing Setup pdf package to work with other backends #902 - pdf package now delegates to the outputter3-d hboxes
is used, the debug hbox could be misplacedOther noteworthy comments:
Footnotes
Is it a reasonable request to ask for it to be considered for 0.15? Note by the way the deprecation warning in the cropmarks package currently assuming it. I'd be happy if 0.15 could also bring some cool typography features (such as this one and the automated italic correction). ↩
In PDF, we may eventually want to consider filling the CropBox, TrimBox, BleedBox etc. properties (but the current libtexpdf wrappers only sets the MediaBox). In other outputters, the concept might not be meaningful and be ignored. In debug outputter, the frame coordinates remain unchanged, relative to the page, which is best IMHO. ↩
Except for the seldom used
\pdf:literal
command, I have annotated the rationale in the code. ↩I have some understanding why the issue occurs, but this is far beyond my current reach to address it. ↩