-
Notifications
You must be signed in to change notification settings - Fork 499
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
Title problems when using doctype book #329
Comments
The page-break behavior you are observing is because the doctype book setting is literally attempting to layout the content as a book (where chapters start on a new page). This was done to fill a requirement of Asciidoctor PDF when it was created. There is an open issue to make this behavior configurable via the theme. See #74. Just so you are aware, it is possible to override the layout_chapter method if you are using the Asciidoctor PDF API. But that's a fairly advanced usage.
This is just how AsciiDoc / Asciidoctor works. This is a change that would need to happen in core and is being discussed there. See asciidoctor/asciidoctor#979. |
As a workaround for the page break issue, I recommend using the article doctype and ignoring the warning. The warning is actually harmless. |
Ah, I see. Thanks for the clarification. Parts were not in the original requirements for Asciidoctor PDF, so they didn't get implemented properly. But this still traces back to #74 that we need the correct page breaks and they need to be configurable. These issues are now linked, so it should be clear that we need to check all the levels. |
Just ran into this issue today when generating a PDF with I wouldn't need it to be configurable (#74) if it just does what's expected for a given doctype. |
I'm currently putting in manually <<< but it would be nice if "=" puts in automatically a page break. |
I'm going to move this issue up to 1.5.0.alpha.13 and just add the page break for parts when the doctype is book. That way, we get sane behavior right away, and pursue configurability via the theme in #74. |
- add part? method to Section - add part_or_chapter? method to Section - call start_new_part at the start of each part - call layout_part_title to layout part title - comments
Let me know what you think of the implementation. See #527. |
From what I can understand from reading the implementation: +2 |
@nathany Is this the behavior you were hoping to have? |
I can't tell by looking at the code -- and I'm not totally sure how to test it. |
@nathany I'm asking more about what your expectations are. As described above, I'm simply starting a new page at the beginning of a part (in addition to starting a new page at the beginning of a chapter). Does that match your expectations? Btw, if you wanted to test the gem, you'd need to follow the steps described in: https://github.com/asciidoctor/asciidoctor-pdf#development. You can download the zip of the PR from https://github.com/mojavelinux/asciidoctor-pdf/tree/issue-329. |
Yes, that's what I'm looking for. I also changed my Gemfile and tested it out. Works great! Thanks. - gem 'asciidoctor-pdf', '~> 1.5.0.alpha.12'
+ gem 'asciidoctor-pdf', github: 'mojavelinux/asciidoctor-pdf', branch: 'issue-329' |
👍 Then I'll proceed with merging.
Ah yes, that works too. I've noted down to document these steps more clearly in the README. |
Thank you Dan. |
- add part? method to Section - add part_or_chapter? method to Section - call start_new_part at the start of each part - call layout_part_title to layout part title - comments
…tor#527) - add part? method to Section - add part_or_chapter? method to Section - call start_new_part at the start of each part - call layout_part_title to layout part title - comments
When I use the doctype book attribute in a document, book parts (level 0 title) render on the same page as lower attributes (ie: immediately after). But level 1 titles have page breaks before them.
The problem causes book parts (level 0 sections) to be rendered on the same page as text from previous parts, but any following lower level titles are rendered on following pages. Also, chapter numbering completely ignores book parts, not resetting after them
But when the doctype is not set everything renders continuously and correctly, chapter numbers are reset after book parts and no weird page breaks are added, the only problem is that the "chapter" prefix is removed and the command prompt outputs an error reading "only book doctypes can contain level 0 sections", even though the PDF renders them correctly and correctly adds them to the TOC.
The text was updated successfully, but these errors were encountered: