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

Can you add a page break tag? #30

Closed
neuwirthe opened this issue Aug 7, 2015 · 9 comments
Closed

Can you add a page break tag? #30

neuwirthe opened this issue Aug 7, 2015 · 9 comments

Comments

@neuwirthe
Copy link

I would like to force pagebreaks when I print a web page with this style.
I tried a few suggestions, e.g.
http://www.htmlgoodies.com/beyond/css/article.php/3470341/CSS-and-Printing.htm

But I could not make any of these work.
Could you consider adding such a style tag?

@ghost
Copy link

ghost commented Aug 7, 2015

Have you tried https://stackoverflow.com/a/21270036

@neuwirthe
Copy link
Author

This does not work as it should.
This might be related to the dynamically defined font sizes.

On 07 Aug 2015, at 12:08, Nic notifications@github.com wrote:

Have you tried https://stackoverflow.com/a/21270036 https://stackoverflow.com/a/21270036

Reply to this email directly or view it on GitHub #30 (comment).

@ghost
Copy link

ghost commented Aug 7, 2015

Works great for me. I just tested it.

@ghost
Copy link

ghost commented Aug 7, 2015

Here is a gist to demonstrate how to do it: https://gist.github.com/xHN35RQ/c9cd616acc4b9bfb93ac

@daveliepmann
Copy link
Contributor

Thanks for that gist, @xhn35rq.

I'd like to add this functionality to tufte.css, and an example to index.html, but for me to feel OK doing so we'd need to also fix some other considerations for print. For instance, revert to pure black for text and pure white for the background. I'm tagging this help-wanted for anyone who wants to do that work; I don't have the desire to do the necessary testing right now.

@ghost
Copy link

ghost commented Aug 7, 2015

I don't see any reason to add this. If you want to print to physical printer or to PDF, then you're much better off using pandoc's Tufte template and writing your content in Latex, Markdown, or any other input that pandoc accepts. tufte.css should probably remain a web centric project. Otherwise you're re-inventing the wheel.

Here's an example of using Pandoc to convert from Multi-Markdown to PDF using Tufte Latex to create Tufte styled PDF's - http://plaintextadventure.com/blog/instant-pdfs-via-right-click.html

Much better option than printing HTML/CSS from web browser.

@ghost ghost mentioned this issue Aug 7, 2015
@daveliepmann
Copy link
Contributor

All excellent points.

@ghost
Copy link

ghost commented Aug 7, 2015

👍

@neuwirthe
Copy link
Author

It turns out the problem was with Safari. Somehow, Safari does not get the correct information about the page size of the printer. Things work nicely with Firefox.

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

2 participants