Skip to main content

Extract text from SVG figures into editable Typst overlays while preserving the original vector graphics.

Project description

vec2typst

Extract text from SVG figures into editable Typst overlays while preserving the original vector graphics. A Typst equivalent of Inkscape's PDF+LaTeX SVG export.

[!NOTE] vec2typst is still in an early stage. Future versions may also support PDF-based workflows.

Why not just use image()?

SVG figures can already be embedded directly in Typst with image(). However, the text inside the SVG remains part of the original graphic and cannot participate in Typst's typesetting system.

vec2typst extracts SVG text into editable Typst overlays while preserving the original vector graphics.

The goal is to preserve the original SVG rendering as closely as possible while allowing figure texts to become native Typst content. This makes it possible to:

  • use native Typst content inside figure texts, including math, styling
  • adjust text styling with set text(...)

Installation

uv tool install vec2typst

Usage

vec2typst figure.svg

This generates:

  • figure.typ
  • figure_notext.svg

To include the figure in your document:

#figure(
  {
    import "figure.typ": fig
    set text(size: .75em)   // adjustment
    fig(width: 50%)
  },
  caption: [Caption.],
) <fig>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vec2typst-0.2.0.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vec2typst-0.2.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file vec2typst-0.2.0.tar.gz.

File metadata

  • Download URL: vec2typst-0.2.0.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vec2typst-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1af8670da03b4e0dff8d2644d526d769b49d4cf7bcdec71aa203ff3710fb5d0d
MD5 eb1aef3531928882691c6ffe903d7a28
BLAKE2b-256 b6ffb2d94ba7acf89c32a634b06a2ff3d94c1c3217df53deaf84d32835efa02d

See more details on using hashes here.

Provenance

The following attestation bundles were made for vec2typst-0.2.0.tar.gz:

Publisher: publish.yml on yuanxun-yx/vec2typst

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vec2typst-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: vec2typst-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vec2typst-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c00ce5ad487b177ed65ddb6ac51760b8e59aeaeca968cd4e0f60074e18d00f2f
MD5 f8fe5da4413ae3a96b5aa6d33a009db6
BLAKE2b-256 dc2d964ed4a49d1b0f640b984270c21da809b23179c228b090a2677d61883865

See more details on using hashes here.

Provenance

The following attestation bundles were made for vec2typst-0.2.0-py3-none-any.whl:

Publisher: publish.yml on yuanxun-yx/vec2typst

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page