Skip to main content

Export SVG layers to create slideshows and presentations

Project description

General description

inklayers is a command line program that exports layers from an SVG file. It can be used to create slide shows by editing a single SVG file.

By default the exported files are in SVG format too. If Inkscape is found in the system, an automatic conversion of each single exported layer to Inkscape supported formats (png, pdf, ps, eps) can be done.

A project can be specified using a file format based on JSON, INI, or TOML formats. The project file allows to specify complex organizations of layers to be combined into "slides".

The program automatically generates the code to include the slides within a LaTeX presentation that uses the Beamer package.

If the content of an Inkscape session looks like the one in the following screenshot

the layers exported can be arranged in a slideshow, obtaining the following result:

Rationale

I developed inklayers as a tool to make it easier to work at graphical content that could be used to arrange "animated" content in LaTeX Beamer presentations.

I always used Inkscape for drawing pictures for my LaTeX presentations, after moving from the venerable XFig.

However, working with one file for each "slide" was really cumbersome, mainly because the slides typically contain very similar content (they are meant to compose a slideshow, after all...), and making changes to one slide often requires to propagate the changes to many other files, making the approach almost unfeasible.

With inklayers there is only one SVG files containing all the graphical material of the slideshow, and changes to one layer are automatically replicated to all the slides during the export.

Although the organization of a slideshow still requires some attention, it is much more affordable.

Compatibility

The extraction of layers in SVG format should work on any system. I tested it under Linux only.

The conversion with Inkscape was tested using Inkscape version 0.91 and 1.1.1 under Ubuntu 20.04.

Installing

From source:

git clone <repository>
cd <cloned-directory>
pip install -r requirements.txt
pip install --user .

Examples

After installing, to test an example:

cd examples

run

inklayers fishes2.json

The exported layers and their conversions are saved in output/ under the current directory.

Assuming that Imagemagick is installed in the system, the slideshow as animated GIF in the above example can be obtained with the following command:

convert -delay 75 -loop 0 output/*.png slideshow.gif

Reference to layers

Layers can be referenced by label or index (#0, #1, ...), or by layer's name. The first layer has index 0. Layer's interval is supported. Example format: #1-#9.

Layers can be selected for inclusion or exclusion. If include/exclude options collide, the latest prevails.

Project file format

An example project file look like the following:

{
  "input": {
    "filename": "fishes.svg"
  },
  "output": {
    "type": "pdf",
    "filename": "%b-%n.%e",
    "slides": [
      {"include": ["L0"]},
      {"include": ["L0", "L1"]},
      {"include": ["#0-#2"]},
      {"include": ["#0-#3"]},
      {"include": ["#0-#4"]},
      {"include": ["#0-#5"]},
      {"include": ["#0-#6"], "exclude": ["L5 msg:greetings"]},
      {"include": ["#0-#7"], "exclude": ["L5 msg:greetings"]},
      {"include": ["#0-#8"], "exclude": ["L5 msg:greetings"]},
      {"include": ["#0-#9"], "exclude": ["L5 msg:greetings"]},
      {"include": ["#0-#10"], "exclude": ["L5 msg:greetings"]},
      {"include": ["#0-#11"], "exclude": ["L5 msg:greetings"]},
      {"include": ["#0-#12"], "exclude": ["L5 msg:greetings"]},
      {"include": ["#0-#12"], "exclude": ["L5 msg:greetings", "L12 msg:reply"]}
    ]
  }
}

The project file allows to specify:

  • the input file name
  • the format of the generated slides (pdf, png, svg)
  • the format of the filenames of the slides (%b is the basename of the input file, %n is an increasing ordinal number, %e is the extension)
  • the list of slides

Each slide can be specified to include and/or exclude a set of layers.

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

inklayers-0.1.1.tar.gz (26.0 kB view details)

Uploaded Source

Built Distribution

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

inklayers-0.1.1-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

Details for the file inklayers-0.1.1.tar.gz.

File metadata

  • Download URL: inklayers-0.1.1.tar.gz
  • Upload date:
  • Size: 26.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/29.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.57.0 importlib-metadata/4.0.1 keyring/18.0.1 rfc3986/1.4.0 colorama/0.4.3 CPython/3.8.10

File hashes

Hashes for inklayers-0.1.1.tar.gz
Algorithm Hash digest
SHA256 baa4e600c797bf8628dff3067f4a8f0620e3139820ba304bbce0b1a6c2dbff55
MD5 140d6a6ee89ca6c662d28f72299c8846
BLAKE2b-256 8ed8cd7a1cc658648c53471eceeb8fb11424b493b7475f9a27a7e7f04ae753e5

See more details on using hashes here.

File details

Details for the file inklayers-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: inklayers-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 25.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/29.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.57.0 importlib-metadata/4.0.1 keyring/18.0.1 rfc3986/1.4.0 colorama/0.4.3 CPython/3.8.10

File hashes

Hashes for inklayers-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 70c090dfce8003283469680ea9820bc00996dfe66cbe81da5becc10e7597a609
MD5 a3b1f97c662f2c68b354b48ee3b6dc9b
BLAKE2b-256 0bb12e6a5524bae62a5e59d35d13448edb269d0cee64a45c5691ac4a40711ed0

See more details on using hashes here.

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