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, option A — put the .sty beside your document
#   (from CTAN once the package is accepted, or copy it out of the Python package)

# LaTeX only, option B — install once into your TeX user tree, then it is found
# from every directory, no copying per document:
pip install sysml2tikz
sysml2tikz install-sty          # -> $TEXMFHOME/tex/latex/sysml2tikz/sysml2tikz.sty
kpsewhich sysml2tikz.sty        # sanity check

# Python — the generator; the wheel carries the same .sty
pip install sysml2tikz
sysml2tikz emit model.json out.tex --copy-sty   # portable: .sty lands beside the output
tectonic out.tex                                # or pdflatex/lualatex/latexmk

With TeX Live, install-sty needs the picture and extra packages present: texlive-pictures (pgf/TikZ) and texlive-latex-extra (standalone.cls, xstring). tectonic needs none of that — it fetches what a document uses.

--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.2

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.2
File Size Uploaded Provenance Actions
sysml2tikz-0.0.2.tar.gz 372.3 kB With provenance Details for sysml2tikz-0.0.2.tar.gz

Built distribution (wheel)

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

Total release size: 391.6 kB

Release files / sysml2tikz-0.0.2.tar.gz

Download URL sysml2tikz-0.0.2.tar.gz
Size 372.3 kB
Tags Source
SHA-256 checksum
How to use checksums
042798c4af18e4904f168ffcdde950c29dd2443d7247c445ed4f96adb9a55baa
BLAKE2b-256 checksum
How to use checksums
2ef607fe271a9c4042835e8156ad8364fbb5a09bdfbb9229a9dc65588ea42d48
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.2-py3-none-any.whl

Download URL sysml2tikz-0.0.2-py3-none-any.whl
Size 19.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
85825bbd2da31941d7a922934f849aeda82b21942a17b7d4be14a02ba18aa62d
BLAKE2b-256 checksum
How to use checksums
97b08f6d9b89bf847d7079cc4a7974d395cbe31d168d7421de5f761617428f13
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.2

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.2.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.2 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