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

Margin for inner binding (recto/verso margins) #383

Closed
rasusmilch opened this issue Dec 31, 2015 · 9 comments
Closed

Margin for inner binding (recto/verso margins) #383

rasusmilch opened this issue Dec 31, 2015 · 9 comments
Assignees

Comments

@rasusmilch
Copy link

Looking around through the theming website and bug tracker, I do not see a way to set an inner binding offset. I see a margin property that states it is the same as CSS, (eg, left, right, top and bottom.) I do see that the default book theme, asciidoctor-pdf -d book, alternates page numbers like a book, but the margins are still the same.

This is useful for books, or even reports, where some of the inner margin is lost due to the binding process (such as those report covers with the plastic rail, you easily lose a quarter inch or more.)

@mojavelinux
Copy link
Member

Could you describe more specifically where the inner margin would be applied? A reference to a similar feature in another system is sufficient.

@rasusmilch
Copy link
Author

In latex, specifically in the KOMA script , page 30-31, for BCOR option, (and other classes I believe, but I would need to look) you can set an additional offset for the inner margin. (I believe KOMA script is incorrect when they state "left" margin for BCOR and it really means "inside" margin. All my KOMA documents apply the BCOR to all pages correctly. The English documentation is translated from German, so there may be a misunderstanding.) The inner margin is where a spine is in a book. So if you are reading aright hand page in a book, the inner margin is on the left and disappears into the gutter, for a left hand page the inner margin is on the right.

Another way of looking at it is that the page numbers in a book (and within asciidoctor-pdf) appear on the outside of the book page, or outside margin. The inner (binding) margin is opposite the page numbers. As it stands now, asciidoctor-pdf applies the page numbers correctly to left and right hand pages, but I cannot adjust the inner margin as far as I can tell.

I believe it would be beneficial to allow an adjustment to this margin, much in the same way that KOMA script gives a class option for a binding correction. As mentioned above some cheap report covers chew up a lot of margin, and it would be beneficial to apply a correction to the inner margin to overcome that, else the page content is uncomfortably close to the binding side (where you have to pry the book apart to read the text.)

I have not looked at the code, but since most books consider the title page a right hand page, perhaps the convention could be to reterm the left and right margins as inside and outside margins. Then depending on the page when processed you apply the appropriate margin opposite the page number. I assume this code is already available since asciidoctor-pdf correctly places the page numbers in the correct margins. For a normally stapled report (left hand corner) or HTML, these margins could simply be set the same.

Understanding Book Layouts and Page Margins
Page Margins
Illogical Twoside Margins

EDIT: Clarified the page number in the documentation for KOMA script.

@mraible
Copy link

mraible commented Feb 7, 2016

In order to print my InfoQ mini-book with Lulu, they need us to add margins to the PDF. They want gutter/inside at least 35mm/1.38in and an outside margin at least 25mm/1in. Is it possible to do this with a PdfExtensions file?

@mojavelinux mojavelinux added this to the v1.5.0 milestone Feb 9, 2016
@mojavelinux
Copy link
Member

I hadn't yet implemented recto/verso margins because, at the time, we didn't have a theme system and the focus was on desktop viewing (not printing). However, now that we have a theme system, we could easily accommodate this customization using a theme key. I might even be able to make it work with a separate key in the same theme file that is activated using an AsciiDoc attribute (e.g., media-print). That would certainly keep things simple and DRY.

@mojavelinux
Copy link
Member

The inner margin is where a spine is in a book.

Aha! That's what I was looking for. So this request is for recto/verso margins for printing. I'll update the title accordingly.

@mojavelinux mojavelinux changed the title Margin for inner binding Margin for inner binding (recto/verso margins) Feb 9, 2016
@mojavelinux mojavelinux self-assigned this Feb 9, 2016
@mojavelinux
Copy link
Member

As it stands now, asciidoctor-pdf applies the page numbers correctly to left and right hand pages, but I cannot adjust the inner margin as far as I can tell.

That is correct. That is where we stand right now.

@mojavelinux
Copy link
Member

I can't say for sure if this can be accomplished with an extension, but in theory it seems possible. We need to tap into the page create event in Prawn and change the margins on the page. (There's an on_page_create hook, but that might be too late to adjust margins. Another approach is to override the start_new_page method)

The Asciidoctor converter itself will be none the wiser since it doesn't really keep track of the dimensions of the page it's on. It just works with the canvas it has.

As with all things, I'm sure there are caveats we're going to have to address. Experimentation will reveal those challenges.

@mojavelinux
Copy link
Member

It's unfortunate that Prawn doesn't provide a nice API handle this requirement. But we can make it happen regardless.

@mojavelinux
Copy link
Member

mojavelinux commented Feb 9, 2016

I assume this code is already available since asciidoctor-pdf correctly places the page numbers in the correct margins.

That's a bit different since the running (header/footer) content is done in a separate pass working on pages that have already been laid down (using the repeater API).

mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Mar 27, 2016
- add support for recto/verso margins when attribute media=print
- add recto/verso support to running content
- insert blank page after cover page when media=print and doctype is book
- add page_margin helper
@mojavelinux mojavelinux modified the milestones: v1.5.0.beta.1, v1.5.0 Mar 27, 2016
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Mar 27, 2016
- add support for recto/verso margins when attribute media=print
- add recto/verso support to running content
- insert blank page after cover page when media=print and doctype is book
- add page_margin helper
- add page_side helper
@mojavelinux mojavelinux self-assigned this Mar 27, 2016
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 3, 2016
- add support for recto/verso margins when attribute media=print
- add recto/verso support to running content
- insert blank page after cover page when media=print and doctype is book
- add page_margin helper
- add page_side helper
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 5, 2016
- add support for recto/verso margins when attribute media=print
- add recto/verso support to running content
- insert blank page after cover page when media=print and doctype is book
- add page_margin helper
- add page_side helper
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 5, 2016
- add support for recto/verso margins when attribute media=print
- add recto/verso support to running content
- insert blank page after cover page when media=print and doctype is book
- add set_page_margin helper
- add page_margin helper
- add page_side helper
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 5, 2016
- add support for recto/verso margins when attribute media=print
- add recto/verso support to running content
- insert blank page after cover page when media=print and doctype is book
- add set_page_margin helper
- add page_margin helper
- add page_side helper
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 5, 2016
- add support for recto/verso margins when attribute media=print
- add recto/verso support to running content
- insert blank page after cover page when media=print and doctype is book
- add set_page_margin helper
- add page_margin helper
- add page_side helper
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 6, 2016
- add support for recto/verso margins when attribute media=press
- introduce page_margin_inner and page_margin_outer keys to theme
- calculate page margin for recto and verso pages automatically
- add recto/verso support to running content
- start title page, toc, and content on recto page when media=press and doctype=book
- add set_page_margin helper
- add page_margin helper
- add page_side helper
- add recto_page? and verso_page? helpers
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 6, 2016
- add support for recto/verso margins when attribute media=press
- introduce page_margin_inner and page_margin_outer keys to theme
- calculate page margin for recto and verso pages automatically
- add recto/verso support to running content
- start title page, toc, and content on recto page when media=press and doctype=book
- add set_page_margin helper
- add page_margin helper
- add page_side helper
- add recto_page? and verso_page? helpers
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 6, 2016
- add support for recto/verso margins when attribute media=press
- introduce page_margin_inner and page_margin_outer keys to theme
- calculate page margin for recto and verso pages automatically
- add recto/verso support to running content
- start title page, toc, and content on recto page when media=press and doctype=book
- add set_page_margin helper
- add page_margin helper
- add page_side helper
- add recto_page? and verso_page? helpers
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 6, 2016
- add support for recto/verso margins when attribute media=press
- introduce page_margin_inner and page_margin_outer keys to theme
- calculate page margin for recto and verso pages automatically
- add recto/verso support to running content
- start title page, toc, and content on recto page when media=press and doctype=book
- add set_page_margin helper
- add page_margin helper
- add page_side helper
- add recto_page? and verso_page? helpers
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 6, 2016
- add support for recto/verso margins when attribute media=press
- introduce page_margin_inner and page_margin_outer keys to theme
- calculate page margin for recto and verso pages automatically
- add recto/verso support to running content
- start title page, toc, and content on recto page when media=press and doctype=book
- add set_page_margin helper
- add page_margin helper
- add page_side helper
- add recto_page? and verso_page? helpers
- add page labels for all front matter pages to fix page numbering in outline
- simplify toc page nums calculation
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 6, 2016
- add support for recto/verso margins when attribute media=prepress
- introduce page_margin_inner and page_margin_outer keys to theme
- calculate page margin for recto and verso pages automatically
- add recto/verso support to running content
- start title page, toc, and content on recto page when media=prepress and doctype=book
- add set_page_margin helper
- add page_margin helper
- add page_side helper
- add recto_page? and verso_page? helpers
- add page labels for all front matter pages to fix page numbering in outline
- simplify toc page nums calculation
- document "prepress" publishing mode
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 6, 2016
- add support for recto/verso margins when attribute media=prepress
- introduce page_margin_inner and page_margin_outer keys to theme
- calculate page margin for recto and verso pages automatically
- add recto/verso support to running content
- start title page, toc, and content on recto page when media=prepress and doctype=book
- add set_page_margin helper
- add page_margin helper
- add page_side helper
- add recto_page? and verso_page? helpers
- add page labels for all front matter pages to fix page numbering in outline
- simplify toc page nums calculation
- document "prepress" publishing mode in theming guide
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 6, 2016
- add support for recto/verso margins when attribute media=prepress
- introduce page_margin_inner and page_margin_outer keys to theme
- calculate page margin for recto and verso pages automatically
- add recto/verso support to running content
- start title page, toc, and content on recto page when media=prepress and doctype=book
- add set_page_margin helper
- add page_margin helper
- add page_side helper
- add recto_page? and verso_page? helpers
- add page labels for all front matter pages to fix page numbering in outline
- simplify toc page nums calculation
- document "prepress" publishing mode in theming guide
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 6, 2016
- add support for recto/verso margins when attribute media=prepress
- introduce page_margin_inner and page_margin_outer keys to theme
- calculate page margin for recto and verso pages automatically
- add recto/verso support to running content
- start title page, toc, and content on recto page when media=prepress and doctype=book
- add set_page_margin helper
- add page_margin helper
- add page_side helper
- add recto_page? and verso_page? helpers
- add page labels for all front matter pages to fix page numbering in outline
- simplify toc page nums calculation
- document "prepress" publishing mode in theming guide
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 6, 2016
- add support for recto/verso margins when attribute media=prepress
- introduce page_margin_inner and page_margin_outer keys to theme
- calculate page margin for recto and verso pages automatically
- add recto/verso support to running content
- start title page, toc, and content on recto page when media=prepress and doctype=book
- add set_page_margin helper
- add page_margin helper
- add page_side helper
- add recto_page? and verso_page? helpers
- add page labels for all front matter pages to fix page numbering in outline
- simplify toc page nums calculation
- document "prepress" publishing mode in theming guide
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 6, 2016
- add support for recto/verso margins when attribute media=prepress
- introduce page_margin_inner and page_margin_outer keys to theme
- calculate page margin for recto and verso pages automatically
- add recto/verso support to running content
- start title page, toc, and content on recto page when media=prepress and doctype=book
- add set_page_margin helper
- add page_margin helper
- add page_side helper
- add recto_page? and verso_page? helpers
- resolve asciidoctor#458 add page labels for all front matter pages to fix page numbering in outline
- simplify toc page nums calculation
- document "prepress" publishing mode in theming guide
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 6, 2016
- add support for recto/verso margins when attribute media=prepress
- introduce page_margin_inner and page_margin_outer keys to theme
- calculate page margin for recto and verso pages automatically
- add recto/verso support to running content
- start title page, toc, and content on recto page when media=prepress and doctype=book
- add set_page_margin helper
- add page_margin helper
- add page_side helper
- add recto_page? and verso_page? helpers
- resolve asciidoctor#458 add page labels for all front matter pages to fix page numbering in outline
- simplify toc page nums calculation
- document "prepress" publishing mode in theming guide
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 9, 2016
- add support for recto/verso margins when attribute media=prepress
- introduce page_margin_inner and page_margin_outer keys to theme
- calculate page margin for recto and verso pages automatically
- add recto/verso support to running content
- start title page, toc, and content on recto page when media=prepress and doctype=book
- add set_page_margin helper
- add page_margin helper
- add page_side helper
- add recto_page? and verso_page? helpers
- resolve asciidoctor#458 add page labels for all front matter pages to fix page numbering in outline
- simplify toc page nums calculation
- document "prepress" publishing mode in theming guide
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 9, 2016
- add support for recto/verso margins when attribute media=prepress
- introduce page_margin_inner and page_margin_outer keys to theme
- calculate page margin for recto and verso pages automatically
- add recto/verso support to running content
- start title page, toc, and content on recto page when media=prepress and doctype=book
- add set_page_margin helper
- add page_margin helper
- add page_side helper
- add recto_page? and verso_page? helpers
- resolve asciidoctor#458 add page labels for all front matter pages to fix page numbering in outline
- simplify toc page nums calculation
- document "prepress" publishing mode in theming guide
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 9, 2016
- add support for recto/verso margins when attribute media=prepress
- introduce page_margin_inner and page_margin_outer keys to theme
- calculate page margin for recto and verso pages automatically
- add recto/verso support to running content
- start title page, toc, and content on recto page when media=prepress and doctype=book
- add set_page_margin helper
- add page_margin helper
- add page_side helper
- add recto_page? and verso_page? helpers
- resolve asciidoctor#458 add page labels for all front matter pages to fix page numbering in outline
- simplify toc page nums calculation
- document "prepress" publishing mode in theming guide
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 9, 2016
- add support for recto/verso margins when attribute media=prepress
- introduce page_margin_inner and page_margin_outer keys to theme
- calculate page margin for recto and verso pages automatically
- add recto/verso support to running content
- start title page, toc, and content on recto page when media=prepress and doctype=book
- add set_page_margin helper
- add page_margin helper
- add page_side helper
- add recto_page? and verso_page? helpers
- resolve asciidoctor#458 add page labels for all front matter pages to fix page numbering in outline
- simplify toc page nums calculation
- document "prepress" publishing mode in theming guide
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 9, 2016
- add support for recto/verso margins when attribute media=prepress
- introduce page_margin_inner and page_margin_outer keys to theme
- calculate page margin for recto and verso pages automatically
- add recto/verso support to running content
- start title page, toc, and content on recto page when media=prepress and doctype=book
- add set_page_margin helper
- add page_margin helper
- add page_side helper
- add recto_page? and verso_page? helpers
- resolve asciidoctor#458 add page labels for all front matter pages to fix page numbering in outline
- simplify toc page nums calculation
- document "prepress" publishing mode in theming guide
mojavelinux added a commit that referenced this issue Sep 16, 2016
- start parts and chapters on recto page unless nonfacing option is set on section
- don't put page break before Credits in chronicles example
- make Credits section in chronicles example an appendix
fapdash pushed a commit to vogellacompany/asciidoctor-pdf that referenced this issue Dec 13, 2016
…idoctor#415)

- add support for recto/verso margins when attribute media=prepress
- introduce page_margin_inner and page_margin_outer keys to theme
- calculate page margin for recto and verso pages automatically
- add recto/verso support to running content
- start title page, toc, and content on recto page when media=prepress and doctype=book
- add set_page_margin helper
- add page_margin helper
- add page_side helper
- add recto_page? and verso_page? helpers
- resolve asciidoctor#458 add page labels for all front matter pages to fix page numbering in outline
- simplify toc page nums calculation
- document "prepress" publishing mode in theming guide
- use term "periphery" instead of "position" to refer to running content region
- fix some formatting and wording in theming guide
fapdash pushed a commit to vogellacompany/asciidoctor-pdf that referenced this issue Dec 13, 2016
- start parts and chapters on recto page unless nonfacing option is set on section
- don't put page break before Credits in chronicles example
- make Credits section in chronicles example an appendix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants