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

page-break control using HTML classes #35

Merged
merged 2 commits into from
Jul 20, 2017
Merged

Conversation

dhimmel
Copy link
Member

@dhimmel dhimmel commented Jul 20, 2017

Works for both print output and wkhtmltopdf.

@dhimmel
Copy link
Member Author

dhimmel commented Jul 20, 2017

I'm going to merge cause I want to use this feature downstream immediately, but revisions welcome.

@dhimmel dhimmel merged commit d08d0bf into manubot:master Jul 20, 2017
@dhimmel dhimmel deleted the pagebreak branch July 20, 2017 13:04
dhimmel added a commit that referenced this pull request Jul 20, 2017
This build is based on
d08d0bf.

This commit was created by the following Travis CI build and job:
https://travis-ci.org/greenelab/manubot-rootstock/builds/255655530
https://travis-ci.org/greenelab/manubot-rootstock/jobs/255655531

[ci skip]

The full commit message that triggered this build is copied below:

page-break control using HTML classes (#35)

Refs wkhtmltopdf/wkhtmltopdf#2982 (comment)
dhimmel added a commit that referenced this pull request Jul 20, 2017
This build is based on
d08d0bf.

This commit was created by the following Travis CI build and job:
https://travis-ci.org/greenelab/manubot-rootstock/builds/255655530
https://travis-ci.org/greenelab/manubot-rootstock/jobs/255655531

[ci skip]

The full commit message that triggered this build is copied below:

page-break control using HTML classes (#35)

Refs wkhtmltopdf/wkhtmltopdf#2982 (comment)
@agitter
Copy link
Member

agitter commented Jul 20, 2017

Nice feature. What elements are supported? Is it primarily to be used alongside markdown headers?

@dhimmel
Copy link
Member Author

dhimmel commented Jul 20, 2017

Haven't tested it out too extensively, but any HTML element where pandoc accepts the {.page_break_before} syntax for should work. I tried adding .page_break_inside_avoid to image attributes to force the caption to be on the same page as the image, but the class only ended up being applied to the image and not the image+caption element.

@agitter
Copy link
Member

agitter commented Jul 20, 2017

For the example manuscript, would it work to add {.page_break_after} to the abstract instead of {.page_break_before} to the equations? I expect that is one of the most common uses, and it will persist even if someone deletes 02.equations.md.

@dhimmel
Copy link
Member Author

dhimmel commented Jul 20, 2017

would it work to add {.page_break_after} to the abstract instead of {.page_break_before} to the equations?

That doesn't appear to work, but the following does appear to work:

<div class="page_break_after"></div>

@agitter
Copy link
Member

agitter commented Jul 20, 2017

Thanks for testing. We can leave it as is in that case. I think that HTML in the markdown files should be avoided as much as possible.

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

Successfully merging this pull request may close these issues.

None yet

2 participants