Skip to content

Improve pdf styling#50

Draft
robredpath wants to merge 8 commits into
mainfrom
improve-pdf-styling
Draft

Improve pdf styling#50
robredpath wants to merge 8 commits into
mainfrom
improve-pdf-styling

Conversation

@robredpath

Copy link
Copy Markdown
Contributor

No description provided.

@robredpath
robredpath force-pushed the improve-pdf-styling branch from 39d115c to 17102df Compare July 13, 2026 15:03
@robredpath
robredpath force-pushed the improve-pdf-styling branch from 17102df to 786620e Compare July 14, 2026 14:07
@robredpath

Copy link
Copy Markdown
Contributor Author

iati-sphinx-theme.pdf

This is what the produced PDF looks like.

@emmajclegg - any feedback on how the PDF looks?

The code works, and I've refined a bit over running it a few times. I've only tested it in the devcontainer build. I had Claude write me a primer for LaTeX styling; I've read that and checked it in. I've not verified every detail, but it seems to track with what's in the document code.

I don't like how this solution currently checks in fonts and styling choices from the design system that may change. I'd like to explore if we can pull more of that stuff in at build time, maybe version-control it with the design system itself.

cc @IATI/devs for awareness

robredpath and others added 4 commits July 23, 2026 13:10
Sphinx's LaTeX builder only accepts PDF/PNG/JPEG images, so SVGs referenced
in docs were silently dropped from PDF downloads while PNG/JPEG rendered
fine.

Register sphinxcontrib.rsvgconverter in the theme's setup() so SVGs are
converted to PDF (as vectors, via rsvg-convert) during the LaTeX build. This
applies to every consumer site automatically, alongside the existing
config-inited LaTeX wiring - the converter is inert for HTML and importing it
can never break HTML builds. Add the converter as a theme dependency, and
install librsvg2-bin (which provides rsvg-convert) in the Read the Docs and
devcontainer build environments.

Add a vector SVG to the kitchen-sink docs to exercise the conversion in the
PDF build.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The kitchen-sink pages are copied in from sphinx-themes.org and may be
regenerated, which would drop anything added to them. Move the SVG example
that exercises SVG-to-PDF conversion into the theme's own docs: a new
examples/images page, with the asset in docs/_static (matching the videos
example). Restores docs/kitchen-sink/images.rst to its pristine vendored form.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The previous commit wired package.json's build to run this script but
never committed the file itself, so CI failed with MODULE_NOT_FOUND.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant