-- Leo's gemini proxy

-- Connecting to republic.circumlunar.space:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

Exporting draw.io images to LaTeX


DATE: 2020-07-22

AUTHOR: John L. Godlee



I discovered and tweaked a nifty one-liner which allows me to take .drawio files generated by Draw.io[1] and export them as clean vector-based .pdf files which I can then include in a LaTeX document:


1: https://app.diagrams.net/


#!/usr/bin/env sh

find . -name *.drawio -exec rm -f ../img/{}.pdf \; -exec /Applications/draw.io.app/Contents/MacOS/./draw.io --crop -x -o ../img/{}.pdf {} \;

This finds all .drawio files in the current directory . and runs the draw.io executable on them to crop to the image and export as a .pdf to the directory where all my images are stored ../img/. \includegraphics{...} can then render the image in my LaTeX document. Note that this is on macOS, using the desktop version of draw.io, hence the funny executable.

-- Response ended

-- Page fetched on Sat May 18 15:18:48 2024