title: minimal example of how to export a jupyter notebook to pdf using nbconvert and PDFExporter()
body: <p>I am trying to export a pdf copy of a jupyter notebook using <code>nbconvert</code> from within a notebook cell. I have read the <a href="http://nbconvert.readthedocs.io/en/latest/nbconvert_library.html" rel="nofollow">documentation</a>, but I just cannot find some basic code to actually execute the nbconvert command and export to pdf.</p>
  
  <p>I was able to get this far, but I was hoping that someone could just fill in the final gaps.</p>
  
  <pre><code>from nbconvert import PDFExporter
  notebook_pdf = PDFExporter()
  notebook_pdf.template_file = '../print_script/pdf_nocode.tplx'
  </code></pre>
  
  <p>Note sure how to get from here to actually getting the pdf created.</p>
  
  <p>Any help would be appreciated.</p>