Skip to main content

tikz-sysml — SysML v2 notation in TikZ

Two things live here:

  1. sysml2tikz.sty — a notation layer over plain TikZ. It encodes the definition/usage distinction the way the OMG SysML v2 reference figures draw it, and gives you compartments, ports, item flows and the relationship arrowheads without hand-drawing any of it.
  2. gen/ — the pipeline: from_sysml.py (sysmlpy → IR), emit_tex.py (IR → .tex), layout_adapter.py (TeX-measured sizes → diagramboxes' orthogonal router → absolute coordinates), tools/verify.py (golden diff, compile, geometry gates). See PIPELINE.md.

Install

Two independent doors:

# LaTeX only — drop the .sty in your document's directory (or install it from CTAN
# once the package is accepted), then:
\usepackage{sysml2tikz}

# Python — the generator; the wheel carries the same .sty
pip install sysml2tikz
sysml2tikz emit model.json out.tex --copy-sty   # --copy-sty puts the .sty beside the output
tectonic out.tex

--copy-sty exists because tectonic resolves packages from its own bundle rather than from TEXINPUTS, and a plain TeX Live only finds sysml2tikz.sty after CTAN ships it. For a repo checkout the gen/*.py scripts are thin shims over src/sysml2tikz/*, so the commands in PIPELINE.md keep working with no install.

Optional extras: pip install "sysml2tikz[parse]" (sysmlpy, for SysML text input) and pip install "sysml2tikz[layout]" (diagramboxes, for routed layout).

Build

tectonic demo.tex                 # hand-authored API demo
cd gen && python3 emit_tex.py model.json out.tex && tectonic out.tex
pdftoppm -r 190 -png -singlefile out.pdf out      # review raster

No system TeX required: tectonic fetches only what a document uses.

Figures

All four are produced by this repo; the PNGs are 200 dpi rasters of the compiled PDFs.

Hand-authored macros — the definition/usage distinction in one picture (demo.tex): square «part def», rounded «part», compartments, ports, composition, «satisfy».

definition and usage

Same figure generated from a JSON notation IR (gen/model.json → gen/emit_tex.py) — nothing typed by hand:

generated from IR

Laid out automatically: TeX-measured box sizes → diagramboxes' orthogonal router → absolute coordinates and polyline edges (gen/laid_out.tex):

routed layout

End to end from SysML v2 text — examples/vehicle.sysml parsed by sysmlpy, projected, routed and rendered:

from sysml model

The distinction this package exists for

The corpus draws the two sides differently and the difference is semantic, not decoration:

definition usage
keyword «part def» «part»
box square corners rounded corners
header name only name : Type
compartment labels bare noun (attributes, ports, actions, states) verb + noun (perform actions, exhibit states)
rows max :> temperature cargoMass default 0 [kg], :>>Vehicle::cargoMass, dryMass=sum(partMasses)

Grounded in fig-57-Part-Definition-for-Vehicle.svg and fig-61-Part-Usage-for-vehicle_b.svg under ~/proj/third_party/SysML-v2-Release/doc/images/sysml/ — every other kind pair (attribute, port, item, requirement, action, state, calc, constraint, allocation, interface, view, viewpoint) has its own fig-NN-<Kind>-Definition-and-Usage.svg in that directory and is the acceptance criterion for extending the table.

API

\sysmldefnode[at={(0,0)}]{veh}{part def}{Vehicle}{%
  \sysmlcomp{attributes}
  brakePedalDepressed: Boolean\\
  \sysmlcomp{actions}
  \kw{perform} providePower\\
}
\sysmlusagenode[below=of veh]{vehb}{part}{vehicle\_b}{Vehicle}{%
  \sysmlcomp{attributes}
  cargoMass \kw{default} 0 [kg]\\
  \redefines{:>>Vehicle::cargoMass}\\
}
\sysmlport{veh}{east}{fuelIn}{above right}
\draw[sysml composition] (vehb) -- node[right, font=\scriptsize, pos=.5]{1} (veh);
\draw[sysml satisfy]     (vehb) -- node[right, font=\scriptsize, pos=.5]{«satisfy»} (req);
\draw[sysml itemflow]    (veh-p-east) to[out=0,in=0,looseness=1.15] (vehb-p-east);

Edge styles: sysml composition (filled diamond), sysml reference, sysml itemflow, sysml satisfy, sysml gen (hollow triangle).

Licence

sysml2tikz.sty is MPL-2.0 OR LPPL-1.3c (dual, your choice — LPPL is the branch CTAN/TeX Live can carry). The Python under gen/ and tools/ is MPL-2.0. SPDX identifiers are in every file; full texts and the reasoning are in LICENSES/.

Metadata

Release files for sysml2tikz 0.0.1

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

Source distribution (sdist)

Source distribution for sysml2tikz 0.0.1
File Size Uploaded Provenance Actions
sysml2tikz-0.0.1.tar.gz 371.1 kB With provenance Details for sysml2tikz-0.0.1.tar.gz

Built distribution (wheel)

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

Total release size: 388.5 kB

Release files / sysml2tikz-0.0.1.tar.gz

Download URL sysml2tikz-0.0.1.tar.gz
Size 371.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8a08376777e18de546244ab5be4ea7cc6cc37cd2c38466902b7025ef47ccff0b
BLAKE2b-256 checksum
How to use checksums
762805d62655ef8dc2eedde8990a59c2896b3cfe50121845c4614f07a4f20bcd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / sysml2tikz-0.0.1-py3-none-any.whl

Download URL sysml2tikz-0.0.1-py3-none-any.whl
Size 17.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f50d06a2a7e5b3701cad501221fcfc46d27a5ceef4b10d1e7d46724ca7cce448
BLAKE2b-256 checksum
How to use checksums
45e9ae3fbd98f2fa691c4b726b937197bf04e1885c99dffd7ac4785f3bcfa36d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Security for sysml2tikz 0.0.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sysml2tikz-0.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

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.0.1 This release

2 release files Full 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