Metadata-Version: 2.4
Name: beampptx
Version: 1.1.0
Summary: Convert LaTeX Beamer slides to PowerPoint with vector graphics and video support.
Author-email: Viktor Kocur <kocurvik@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/kocurvik/beampptx
Project-URL: Repository, https://github.com/kocurvik/beampptx
Project-URL: Issues, https://github.com/kocurvik/beampptx/issues
Keywords: beamer,latex,powerpoint,pptx,presentation,converter,svg
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Multimedia :: Graphics :: Presentation
Classifier: Topic :: Text Processing :: Markup :: LaTeX
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: python-pptx>=0.6.21
Requires-Dist: pymupdf>=1.23
Requires-Dist: lxml>=4.6
Dynamic: license-file

# beampptx

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![GitHub stars](https://img.shields.io/github/stars/kocurvik/beampptx)](https://github.com/kocurvik/beampptx/stargazers)
[![PyPI](https://img.shields.io/pypi/v/beampptx)](https://pypi.org/project/beampptx/)
[![Python Version](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)

Convert LaTeX Beamer slides to PowerPoint presentations with **flawless vector graphics** and **embedded video support**. Mostly vibe-coded using claude-cli and gemini-cli.

## Why beampptx?

Converting Beamer slides to PowerPoint often results in blurry images or lost functionality. `beampptx` solves this by:
- **Vector Fidelity**: Every slide is embedded as a full-bleed SVG vector graphic, ensuring perfect sharpness at any zoom level.
- **Dynamic Overlays**: Supports Beamer transitions (`\pause`, `\alt`, `<1->`, etc.) by expanding them into individual static slides.
- **Clickable Navigation**: Preserves internal Beamer links such as `\hyperlink{target}{\beamergotobutton{Go}}` as PowerPoint slide navigation.
- **Native Video**: Automatically extracts videos included via the `movie15` package's `\includemovie` or the `multimedia` package's `\movie` command and embeds them as native PowerPoint video shapes with support for autoplay, looping, and volume.
- **Bibliography Support**: Handles complex LaTeX compilation passes (including `biber` and `bibtex`).

## Installation

### From PyPI (Recommended)

```bash
pip install beampptx
```

### From GitHub
To install the latest development state directly from the repository:

```bash
pip install git+https://github.com/kocurvik/beampptx.git
```

### Local Development
If you have the repository cloned:

```bash
pip install -e .
```

### System Requirements
- **Python**: 3.10+
- **LaTeX**: A working distribution (MiKTeX, TeX Live) with `pdflatex` (default), `xelatex`, or `lualatex`.
- **Tools**: `biber` or `bibtex` if using bibliographies.

## Usage

Once installed, use the `beampptx` command:

### Basic Conversion
```bash
beampptx presentation.tex
```

### Convert from PDF directly
If you already have a compiled PDF:
```bash
beampptx presentation.pdf
```
Note that for this option, the videos will not be embedded correctly, but the rest of the content should be exported as vector graphics.


### Advanced Options
```bash
# Specify output filename
beampptx presentation.tex -o final_talk.pptx

# Use a different LaTeX engine
beampptx presentation.tex --latex-engine xelatex

# Keep the temporary build files for debugging
beampptx presentation.tex --keep-build

# Skip internal navigation links
beampptx presentation.tex --no-links

# Build in a specific directory instead of a temp dir (never auto-deleted)
beampptx presentation.tex --build-dir ./build

# Run LaTeX from a different working directory than the .tex file
beampptx presentation.tex --latex-cwd ./src

# Show the installed version
beampptx --version
```

`--build-dir` implies `--keep-build`: the directory is created if missing and is
never removed automatically, which makes it the easiest way to inspect the
intermediate PDF and SVGs after a failed run. `--latex-cwd` controls how relative
`\input`, `\includegraphics`, and `\bibliography` paths in the source resolve —
it defaults to the directory containing the `.tex` file.

`beampptx` can also be run as a module: `python -m beampptx presentation.tex`.

## Examples

The repository includes a `test/` folder with several examples demonstrating different features. To try them out, clone the repository and run:

```bash
# Basic features (math, lists, etc.)
beampptx test/example.tex

# Overlays and transitions (\pause, \alt, etc.)
beampptx test/example_transitions.tex

# Image inclusion (PNG, JPEG, PDF)
beampptx test/example_images.tex

# Bibliography support (biblatex/biber)
beampptx test/example_bib.tex

# Internal navigation links (\hyperlink + \beamergotobutton) with video
beampptx test/example_links.tex

# Video with the movie15 package (\includemovie)
beampptx test/example_video.tex

# Multiple videos on a single slide
beampptx test/example_multi_video.tex

# Video with the multimedia package (\movie)
beampptx test/example_movie.tex

# Multiple videos on the same slide with the multimedia package (\movie)
beampptx test/example_multimedia.tex
```

## Features in Detail

### Beamer Overlays
`beampptx` detects frames with multiple slides (e.g., from `\pause` or `<1->`) and creates a separate PowerPoint slide for each state. This preserves the feeling of "animations" when clicking through the presentation.

### Internal Beamer Navigation
Internal PDF destinations generated by Beamer are converted into PowerPoint click actions. For example, a button created with `\hyperlink{details}{\beamergotobutton{Details}}` will jump to the frame labelled `details` in slideshow mode. This also preserves internal links introduced by Beamer themes.

Note that themes drawing a navigation bar (`Warsaw`, `Berlin`, ...) emit one link
per entry on *every* slide, which adds up to a lot of shapes on a long deck. Pass
`--no-links` to skip the conversion entirely, or suppress the bar in the source
with `\beamertemplatenavigationsymbolsempty`.

### Videos
Two LaTeX packages are supported for video inclusion — pick whichever your
source already uses.  In both cases `beampptx` finds the call in your `.tex`
source, locates the corresponding annotation in the compiled PDF, and
embeds the video file directly into the `.pptx` as a native PowerPoint
movie shape.

**`movie15` — `\includemovie`:**

```latex
\usepackage{movie15}
...
\includemovie[autoplay, poster=image.png, repeat, volume=0.5]
              {width}{height}{video.mp4}
```

**`multimedia` — `\movie` (ships with Beamer):**

```latex
\usepackage{multimedia}
...
\movie[width=8cm, height=4.5cm, autostart, loop]
      {\includegraphics[width=8cm]{poster.png}}
      {video.mp4}
```

Recognised options:

| Behaviour          | `movie15`               | `multimedia`          |
| ------------------ | ----------------------- | --------------------- |
| Auto-play          | `autoplay`              | `autostart`           |
| Loop               | `repeat` / `palindrome` | `loop` / `palindrome` |
| Initial volume     | `volume=0.0..1.0`       | *(not supported by the package)* |
| Poster image       | `poster=file`           | first arg (`\includegraphics{file}`) |

Note that currently, using pdfs for poster images is not supported. Likewise, the autoplay option requires activating the "next" slide for the videos to run. The palindrome option will just loop the video normally instead of reversing it for even playtroughs.

## Release Notes

### 1.1.0

- **Available on PyPI**: `beampptx` can now be installed with `pip install beampptx`
  instead of only from GitHub.
- **Proper package layout**: the code moved from a top-level `generate_pptx.py`
  module into a `beampptx` package. The `beampptx` command is unchanged, the
  converter can now also be run as `python -m beampptx`, and installing no longer
  places a generic `generate_pptx` module on your import path.
- **Preserved internal Beamer navigation**: internal PDF destinations become
  PowerPoint click actions, contributed by
  [@mefilippin](https://github.com/mefilippin) in
  [#1](https://github.com/kocurvik/beampptx/pull/1). Added `--no-links` to skip
  the conversion for themes that draw a navigation bar.
- **Requires Python 3.10+**: this was always true of the code; the metadata
  previously claimed 3.6+.
- Added `--version`, and fixed console output crashing on Windows when redirected
  to a file or pipe.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
