👩‍💼
Your context
Meera — finance analyst at Razorpay, Pune

It's month-end Thursday. You've spent the past three days in Jupyter — 30 cells of analysis, charts, pivot tables, fraud insights. Your CFO needs (1) a 12-page PDF she'll read on her Friday morning flight to Mumbai, and (2) a 6-slide deck for the board review that afternoon. You have one notebook, two deadlines, three formats (PDF, slides, maybe HTML). Manually copy-pasting is out. You'll learn to publish once and output many: nbconvert for PDFs, Papermill to parameterize runs by merchant category, python-pptx to build the board deck, and when to reach for each tool.

📥
Sample dataset included
2,500 Razorpay merchants, 6 months of GMV, fraud, txn data by category & state

The Problem: Copy-Paste Hell

Imagine your workflow today. You finish analysis in a Jupyter notebook. Then:

  • Export the notebook as HTML, open in browser, screenshot charts.
  • Manually format tables in Google Slides or PowerPoint.
  • Update one number upstream? Start over — re-run cells, re-screenshot, re-paste.
  • Your CEO wants the same report for Retail instead of Food & Beverage? 30 cells by hand.

The Solution: Publish Once, Output Many

One notebook → four output formats. Change one parameter, regenerate all.
Notebook publishing workflow diagram
What you'll master: A single parameterized notebook (Jupyter + Papermill) that feeds into four pipelines: PDF (nbconvert + LaTeX), HTML (nbconvert), Slides (Reveal.js), and PowerPoint (python-pptx). Change a parameter, run once, output four artifacts. No manual intervention.

Output Matrix: When to Use Each Format

PDF (nbconvert)

12-page report for executives. Print-ready, portable, no dependencies.

Use when: CEO reads on a plane, audit trail required, static reference needed.

HTML (nbconvert)

Interactive, shareable via email or link. Charts stay interactive if you embed Plotly.

Use when: Stakeholders want to hover-inspect data, need no installation.

Slides (nbconvert + Reveal.js)

6-slide deck for live presentation. One cell = one slide. Navigate with arrow keys.

Use when: Board meeting, investor pitch, live walkthrough needed.

PowerPoint (python-pptx)

Editable .pptx for further customization. Images + KPIs + shapes.

Use when: Marketing needs to edit slides, company brand guidelines strict.

nbconvert Basics: CLI & Flags

Jupyter's built-in export tool. No extra setup if you have Jupyter installed.

Export to PDF

Bash / Terminal
What happens: Jupyter runs all cells (if not already run), uses nbconvert's PDF exporter (which calls LaTeX behind the scenes), saves merchant_report.pdf in the same directory. File size ~2–5 MB depending on chart resolution.

Export to HTML

Bash / Terminal

Key flags for production PDFs

Advanced nbconvert flags
Key insight: --no-input is your friend. Executive PDFs don't show code — only titles, descriptions, and outputs. A 30-cell notebook becomes a 12-page business report.

Common pitfall: Missing LaTeX

If you see xelatex not found, install TeX Live (Linux) or MacTeX (Mac):

Install LaTeX (one-time setup)

Making Charts Report-Ready: DPI, Size, Format

A screenshot chart in a Jupyter notebook is 96 DPI. A printed PDF needs 300 DPI. Learn to save images at production quality.

Save at 300 DPI with matplotlib

Python code in your notebook
Why DPI matters: Screen display needs 96–150 DPI (what you see in Jupyter). Print PDFs need 300 DPI. At 300 DPI, text and lines stay crisp on a 12-page printed report. Set dpi=300 in savefig() — the dpi=100 in plt.subplots(figsize=...) is your working canvas; save DPI is the export quality.

Named axes & no legends = professional look

Professional chart best practices
Travel category rebound: 39% month-on-month growth in latest month.
Travel GMV growth over 6 months

Parameterizing with Papermill: Run Once Per Category

Papermill lets you run a notebook with different parameter values. Write your analysis once, execute it for F&B, Retail, Travel, Education — get four PDFs.

Add a parameters cell at the top of your notebook

Notebook cell 1: Mark as "parameters"

Use parameters throughout your notebook

Downstream cells use the parameters

Execute with Papermill from Python

Python script to generate all 4 PDFs at once
What just happened: One notebook, four parameter sets, four executed notebooks, four PDFs — all automated. Meera runs the script, goes for coffee, and returns to find report_food_and_beverage.pdf, report_retail.pdf, etc. in her directory.

Slides: Reveal.js via nbconvert

One notebook cell per slide. Tag cells to control slide breaks, speaker notes, and layout.

Export to Reveal.js slides

Bash / Terminal

Control slides with cell metadata

In Jupyter, set slide type in Cell → Slide Type menu

Embed charts in slides

Notebook cell for a slide with chart
Report cover mockup: what your final PDF looks like.
PDF report cover preview

PowerPoint with python-pptx: Full Control

When nbconvert slides aren't enough. python-pptx lets you build a .pptx file from Python: insert images, text, shapes, set fonts & colors.

Install & create a basic deck

Bash / Terminal
Python: Build a 3-slide deck
Why python-pptx? You control every pixel. Logos, brand colors, custom fonts, image placement. Perfect when marketing says "Use our template with the blue footer." You write once, generate in seconds.

The Polish Pass: Metadata, Numbering, Summary

A notebook exported as-is feels rough: cells numbered 1, 8, 3 (execution order), no page numbers, plain Arial font. Polish it for executives.

Add a markdown title block

Notebook cell 1 (markdown)

Hide code cells in PDF export

Bash / Terminal — export with --no-input

Add page numbers & footer

nbconvert PDFs don't have page numbers by default. Use a post-processing step with PyPDF2:

Python: Add page numbers to PDF

Common Pitfalls & Solutions

1. Enormous PDF file size (50+ MB)

Cause: Charts saved at 96 DPI in Jupyter, then embedded as-is. Each high-res PNG can be 2–5 MB.

Fix: Save charts as SVG (vector, scales infinitely, ~200 KB). Or compress PNGs:

Python: Compress PNG before nbconvert

2. Charts cut off at page edge

Cause: Figure size too wide for A4 page width. nbconvert's default margins + default fig width = overflow.

Fix: Use bbox_inches='tight' and set figsize to 8.5 inches max:

Python: Size for print

3. Missing fonts in PDF

Cause: Matplotlib uses a font not embedded in the PDF.

Fix: Embed all fonts or use a standard font:

Python: Ensure fonts are embedded
Fraud rate by category: Education stands out at 0.45%, others ~0.15%.
Fraud rate comparison by merchant category

Quick Reference: Export Commands

Format Command Best For Notes
PDF jupyter nbconvert --to pdf --no-input notebook.ipynb Executive read, print, archive Requires LaTeX or pyppeteer
HTML jupyter nbconvert --to html notebook.ipynb Web share, interactive (if Plotly) Can embed videos, code
Slides jupyter nbconvert --to slides notebook.ipynb Live presentation, board meeting Use cell metadata to control breaks
PowerPoint from pptx import Presentation; prs.save('deck.pptx') Custom branding, further editing Full control, ~20 lines of code per slide
Parameterized pm.execute_notebook(..., parameters={...}) Batch reports (one per category, region, etc.) Install: pip install papermill
📝
Knowledge Check (6 questions)
You have a notebook that takes 10 minutes to run. The CFO wants the same report for 5 merchant categories. What's the best approach?
Your PDF exported from nbconvert is 85 MB. What's the most likely cause?
Which format is best for your CFO to read on a plane?
You want to hide all code cells from your PDF export. What flag do you use?
When should you use python-pptx instead of nbconvert slides?
What's the recommended DPI for saving matplotlib charts that will be embedded in a PDF?
Africa & India's Best AI Academy
🤖 AI-first 🎓 Placement Assistance

Ready to go further?

Join the Best AI Program: The AI-Era Analyst — 5 months, fully online, with placement assistance. Week 1 is free.

Explore The AI-Era Analyst →