Skip to content

A fuss-free Jupyter Notebook to PDF converter with clean, spacious output

thecont1/jamboree-converter

Repository files navigation

πŸ“ Quickly Convert Jupyter Notebooks into PDFs

Here's why you're here: You have a a lengthy Jupyter Notebook (.ipynb file) that you want to turn into a PDF that makes for a visually pleasing (or at least bearable) document. And you're looking for a fuss-free tool that will get the job done.

In goes your notebook into jamboree_converter.py and out comes a PDF with a special size of A2 width and A0 height. Check out the included sample.

πŸš€ Quick Start

1. Install Miniconda (if you don't already have it)

anaconda.com/docs/getting-started/miniconda/install

The following commands are ought to be run from the command line of your terminal.

2. Create a new virtual environment and activate it:

Replace my-venv with whatever you want to call your environment.

conda create -n my-venv python=3.10
conda activate my-venv

3. Clone the jamboree-converter repo and switch to its directory:

git clone https://github.com/thecont1/jamboree-converter.git
cd jamboree-converter

4. Install required packages

pip install -r requirements.txt
playwright install chromium

5. Convert your first notebook

Replace your_notebook.ipynb with your actual notebook file. Include the full path if the file doesn't exist in your working directory.

Basic conversion (produces a nicely formatted PDF)

python jamboree_converter.py your_notebook.ipynb --size case_study --method playwright

For a cleaner output without code cells

python jamboree_converter.py your_notebook.ipynb --size case_study --method playwright --no-input

πŸ“ Available Page Sizes

Size Dimensions (mm) Best For
A4 210 Γ— 297 Standard documents, reports
A3 297 Γ— 420 Data analysis, charts
A2 420 Γ— 594 Large datasets, dashboards
A1 594 Γ— 841 Posters, presentations
A0 841 Γ— 1189 Large format posters
Letter 216 Γ— 279 US standard
Legal 216 Γ— 356 US legal documents
Tabloid 279 Γ— 432 Newspapers, large prints
case_study 420 Γ— 1189 Custom size for lengthy Jupyter Notebooks

🎯 Methods Available

1. WebPDF

Best for: Modern styling, complex layouts, interactive content

  • Uses Chromium browser engine
  • CSS-based page size control
  • Excellent rendering quality
  • Handles complex HTML/CSS
$ python jamboree_converter.py notebook.ipynb --size a3 --method webpdf

2. LaTeX PDF

Best for: Academic documents, mathematical content

  • Traditional LaTeX typesetting
  • High-quality equation rendering
  • Professional typography
  • Better for text-heavy documents
$ python jamboree_converter.py notebook.ipynb --size a3 --method latex

3. Playwright

Best for: Precise page control and modern web content

  • Direct browser automation
  • Excellent rendering consistency
  • Perfect for complex layouts
  • Handles dynamic content well
$ python jamboree_converter.py notebook.ipynb --size a3 --method playwright

4. Mercury

Best for: Interactive dashboards and sharing

  • Creates interactive web dashboards
  • Shareable via URL
  • Real-time updates
  • Great for collaborative work
$ python jamboree_converter.py notebook.ipynb --method mercury

πŸ“‹ Common Use Cases

Data Science Reports

# A3 portrait for standard data analysis
$ python jamboree_converter.py analysis.ipynb --size a3

# A2 landscape for wide visualizations
$ python jamboree_converter.py dashboard.ipynb --size a2 --orientation landscape

# Clean report without code
$ python jamboree_converter.py report.ipynb --size a3 --no-input

Academic Papers

# A4 with LaTeX for academic formatting
$ python jamboree_converter.py paper.ipynb --size a4 --method latex

# Remove prompts for cleaner look
$ python jamboree_converter.py paper.ipynb --size a4 --no-prompt

Presentations & Posters

# A1 landscape for poster
$ python jamboree_converter.py poster.ipynb --size a1 --orientation landscape

# A0 for large format
$ python jamboree_converter.py poster.ipynb --size a0

βš™οΈ Advanced Options

Custom Margins

# Larger margins
$ python jamboree_converter.py notebook.ipynb --size a3 --margins 30mm

# Different units
$ python jamboree_converter.py notebook.ipynb --size a3 --margins 1in
$ python jamboree_converter.py notebook.ipynb --size a3 --margins 2cm

Content Control

# Exclude code cells (report mode)
$ python jamboree_converter.py notebook.ipynb --size a3 --no-input

# Exclude input/output prompts
$ python jamboree_converter.py notebook.ipynb --size a3 --no-prompt

# Both (cleanest output)
$ python jamboree_converter.py notebook.ipynb --size a3 --no-input --no-prompt

Custom Output Names

# Custom filename
$ python jamboree_converter.py notebook.ipynb --size a3 --output final_report

# Will create: final_report.pdf

🎨 Page Size Recommendations

By Content Type

πŸ“Š Data Visualizations:

  • A3 Portrait: Standard charts, medium datasets
  • A2 Landscape: Wide charts, time series, correlation matrices
  • A1 Landscape: Large datasets, complex dashboards

πŸ“ Text Reports:

  • A4 Portrait: Standard reports, documentation
  • A3 Portrait: Reports with embedded charts
  • Legal: US-style reports

🎯 Presentations:

  • A3 Landscape: Slide-style layout
  • A2 Landscape: Large presentation format
  • Tabloid: Newspaper-style layout

πŸ”¬ Academic/Scientific:

  • A4 Portrait: Papers, articles (LaTeX method)
  • A3 Portrait: Lab reports with data
  • A1/A0: Conference posters

πŸ“ Size Comparison Visual

A0: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ (841Γ—1189mm)
A1: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ       (594Γ—841mm)
A2: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ           (420Γ—594mm)  
A3: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ              (297Γ—420mm)  ← Great for data science
A4: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ                (210Γ—297mm)  ← Standard
A5: β–ˆβ–ˆβ–ˆ                  (148Γ—210mm)

πŸ”§ Troubleshooting

Common Issues

WebPDF timeout:

# For very large notebooks, use LaTeX method
$ python jamboree_converter.py large_notebook.ipynb --size a3 --method latex

LaTeX errors:

# Use WebPDF method instead
$ python jamboree_converter.py notebook.ipynb --size a3 --method webpdf

Content too small:

# Reduce margins for more content space
$ python jamboree_converter.py notebook.ipynb --size a3 --margins 15mm

πŸ“„ File Organization

The converter automatically creates descriptive filenames:

notebook.ipynb β†’ notebook_webpdf_a3_portrait.pdf
notebook.ipynb β†’ notebook_latex_a2_landscape.pdf
notebook.ipynb β†’ custom_name.pdf (with --output)

About

A fuss-free Jupyter Notebook to PDF converter with clean, spacious output

Topics

Resources

Stars

Watchers

Forks