Giter Site home page Giter Site logo

Comments (3)

1beb avatar 1beb commented on September 18, 2024 1

@neuwirthe I use the css page model combined with weasyprint on the html version. Here's some example css, that you would include in your yaml header:

output:
  tufte::tufte_html:
    css: your_file.css

It does the following:

  • prints in landscape
  • forced page break on h1, h2 (in markdown that's headings at # and ## levels)
  • forces figures to stay entirely on one page
  • adjusts the page sideways a little so that margin figures are displayed
  • adds a copyright notice and page numbering to every page, other than the first.
@media print {
  body {
    background-image: none;
    padding-left:0.75cm;
    width: 100%;
  }

  /* table {
    margin-top: 15px;
    width: auto;
    max-width: 100%;
  } */

  /* td {
    padding:0 3px;
  } */ 

  h1, h2 {
    margin:0 0 0.25cm 0;
    page-break-before: always;
  }

  .figure {
    page-break-inside: avoid;
  }

  @page {
    margin: 1cm 0.75cm 1cm 0.75cm;
  }

  @page :first{
    margin:0;
    @bottom-left {content: "";}
    @bottom-right {content: "";}
  }

  @page {
    size: landscape; 
    @bottom-left {
      content: "© My Special Company";
    }
    @bottom-right {
      content: counter(page);
    }
  }  
}

Step 1. Knit
Step 2. Review html
Step 3. python -m weasyprint your_file.html ~/path/to/pdf.pdf

from tufte.

yihui avatar yihui commented on September 18, 2024

I'd just use tufte::tufte_handout instead.

from tufte.

github-actions avatar github-actions commented on September 18, 2024

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

from tufte.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.