Skip to main content

embedpaper

Embed full PDF papers into a Typst document, preserving selectable text and links.

Typst 0.15's native image() can embed PDF pages full-width with selectable text, but it drops link annotations. embedpaper restores them: a Typst function places each page and records where it landed, and a small CLI re-creates the source PDF's citation, cross-reference, and URI links on the compiled output.

Install

uvx embedpaper --help

Requires uv and the Typst CLI on your PATH.

Usage

  1. Import embedpaper.typ and call it inside a page for each PDF you want to embed:

    #import "embedpaper.typ": embedpaper
    
    #page[
      #embedpaper("papers/example.pdf", 12)
    ]
    

    pages is the PDF's page count (Typst can't query it, so pass it explicitly). Pass width: to scale the paper against the page width (default 100%).

  2. Compile, then run embedpaper to restore the links:

    typst compile document.typ
    uvx embedpaper document.typ
    

    This reads the placement metadata Typst embedded during compilation and incrementally saves document.pdf with each source link remapped onto its embedded page.

  3. Optionally, verify the result:

    uvx embedpaper document.typ --audit
    

    The audit re-derives where every link should point from the source PDFs and checks the compiled document against it — link count parity, correct destinations, and "Figure N" / "Table N" cross-references — exiting non-zero on any mismatch.

How it works

  • embedpaper.typ places each source page as an image and emits <__paperlink> metadata (filename, source page, output page, and placement rectangle) for every embedded page.
  • embedpaper embed queries that metadata with typst query, then uses PyMuPDF to copy each source page's links onto the matching output page, scaling coordinates and remapping internal destinations to their new page.

Metadata

Release files for embedpaper 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for embedpaper 0.1.0
File Size Uploaded Provenance Actions
embedpaper-0.1.0.tar.gz 6.6 kB Without provenance Details for embedpaper-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for embedpaper 0.1.0
File Interpreter ABI Platform Actions
embedpaper-0.1.0-py3-none-any.whl Python 3 none any Details for embedpaper-0.1.0-py3-none-any.whl

Total release size: 15.2 kB

Release files / embedpaper-0.1.0.tar.gz

Download URL embedpaper-0.1.0.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0f6bc222ee6117020a9c7d92b630e06bee1ace1404682f36531259ef6e9258fd
BLAKE2b-256 checksum
How to use checksums
0c251a3b7d713140b53bcf189414ee1b3cddf7c0a694a7190e9d860a296a1785
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / embedpaper-0.1.0-py3-none-any.whl

Download URL embedpaper-0.1.0-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b1cd2d409820dfb637246ab1fcdb3dabfcb44eb4e7e3020bd690a4c39a736b74
BLAKE2b-256 checksum
How to use checksums
554fbcd67066de13aedc24c1a2f00ec432d83ce8f34e842cd735d68ac96f582e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for embedpaper 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page