Level Up Your Presentations: Embrace Slides as Code

Create your slideshows with Marp, Python, and Quarto! 🚀
Apr, 2025

Jesus L. Monroy
Economist & Data Scientist

Introduction

Tired of wrestling with drag-and-drop interfaces and endless formatting tweaks for your presentations? Ready to embrace the power of version control and reproducible results for your slides?

Then it's time to dive into the exciting world of Slides as Code! This approach treats your presentation content and styling as code, offering a more efficient, collaborative, and maintainable workflow, by using Markdown, Python, and Quarto.

What's the Magic Behind Slides as Code?

Instead of directly manipulating visual elements, you define your slides using a lightweight markup language (like Markdown) and potentially sprinkle in code for dynamic content or visualizations. This offers several key advantages:

  • Version Control

    Track changes, collaborate seamlessly with Git, and easily revert to previous versions. Say goodbye to accidental deletions and confusing "final_final_v3" files!

  • Reproducibility

    Ensure your presentations are consistent and can be easily recreated. No more wondering how you achieved that specific layout or chart.

  • Efficiency

    Focus on your content rather than tedious formatting. Write in a clean, text-based format and let the tools handle the presentation rendering.

  • Automation

    Generate slides programmatically using Python, pulling data from various sources or creating dynamic visualizations.

  • Platform Agnostic

    Often, the output formats are widely compatible (HTML, PDF, etc.), making sharing and viewing easy.

Meet the Dream Team

Markdown

A lightweight markup language with plain text formatting syntax. Think of it as a simplified way to add basic formatting (like bolding, italics, headings, lists, etc.) to your text using simple symbols. Instead of using complex word processors with menus and buttons, you use characters you already know on your keyboard

Python

The workhorse for data manipulation, analysis, and generating dynamic content. You can use Python scripts to fetch data, create charts with libraries like Matplotlib or Seaborn, and then seamlessly integrate these outputs into your Marp slides.

Quarto

This powerful open-source scientific and technical publishing system ties everything together. Quarto can render Marp Markdown into beautiful presentations, and it also provides excellent support for embedding Python code chunks directly within your Markdown.

How They Work Together?

  • Content Creation (Markdown)

    You write your presentation content in a .md file using Marp's Markdown syntax. You define slide breaks using —, apply themes, and add basic formatting.

  • Dynamic Content (Python)

    If you need to include data visualizations or dynamic information, you write Python code snippets within your Quarto document (which can include your Marp Markdown). These code chunks can:

    • Read data from files or APIs.
    • Perform calculations and analysis.
    • Generate plots and charts using Python libraries.
  • Rendering (Quarto)

    Quarto takes your .md file (with embedded Python if any) and renders it into a polished presentation in your desired format (e.g., HTML reveal.js slides, PDF beamer slides). Quarto handles the execution of your Python code and seamlessly integrates the output into your Marp presentation.

Conclusions

Slides as code is the future! The Benefits are Clear. Embracing Slides as Code with Markdown, Python, and Quarto can significantly improve your presentation workflow. You'll gain better control, enhance collaboration, and create more dynamic and reproducible presentations.

Ready to ditch the traditional slide editors and unlock the power of code for your presentations?

Contact

Jesus L. Monroy
Economist & Data Scientist

Linkedin | Medium | Twitter


© 2025