Directory graphics/pgf/contrib/moeptikz
moepTikZ - a library for typesetting computer networks
Version 1.1, 2026/11/15
Overview
The moepTikZ package provides TikZ shapes for typesetting computer networks, e.g. shapes for hubs, switches, routers, and more. It has been in use since 2012 for the lecture materials of an introductory course in computer networks due to shortcomings of some commercial products and (at that time) the lack of meaningful alternatives.
The package currently provides the following shapes, styles and commands:
hub,switch,mlswitch(multilayer switch),router,fwrouter(router with firewall),fw(firewall),nuc(aliasap),modem,wlanmodemclient,notebook,smartphone,server,rack,db(database),internetuser,usergroup,messageclosed,messageopen,key,keyholewaves(wireless links)\tikzextractx,\tikzextracty,\moeptikzset
Like ordinary TikZ nodes, the shapes have compass and angle anchors; the compass anchors lie on the outline in their direction, e.g. north east is the same point as the angle anchor 45 (internet keeps the anchors of PGF's cloud). The anchor base lies on the baseline of the node text and mid .5ex above it, with east and west variants as for TikZ's rectangle; a matrix of nodes aligns the texts.
fill=<color> changes the color of a shape and minimum size=<length> its size; draw=<color> changes the arrows of hub, switch, mlswitch, router and fwrouter and the lines of messageopen, messageclosed and internet. The shape names take no value: put these options after the shape name, as in \node[router,minimum size=2cm,fill=red]; in front of it, the defaults of the shape may override them.
Requirements
moepTikZ needs LaTeX 2020-10-01 or newer and TikZ. It loads keyval, tikz and the TikZ libraries shapes.symbols and decorations.markings by itself. It is tested with TeX Live 2026 (PGF 3.1.11a) and works with pdfLaTeX, XeLaTeX and LuaLaTeX.
Installation
The package is the single file moeptikz.sty. If your TeX distribution does not provide it, copy it next to your document or into your personal texmf tree, e.g. TEXMFHOME/tex/latex/moeptikz/ (kpsewhich -var-value TEXMFHOME shows where TEXMFHOME is), and load it with
\usepackage{moeptikz}
By default the nodes are shaded; the package option noshading fills them with a flat color instead.
Usage
\documentclass{article}
\usepackage{moeptikz}
\begin{document}
\begin{tikzpicture}
\node[client] (c) at (0,0) {PC};
\node[switch] (s) at (2.5,0) {Switch};
\node[router] (r) at (5,0) {Router};
\node[internet] (i) at (8,0) {Internet};
\draw (c) -- (s) -- (r) -- (i);
\end{tikzpicture}
\end{document}
The node text appears below the shape, or inside the cloud for internet.
Known incompatibilities
Some keys of moepTikZ have the names of keys or shapes of other packages, and only one of them can take effect; moepTikZ warns about these clashes at \begin{document}.
- circuitikz defines the key
switch(a switch in a circuit) and the shapewaves. Whichever of moepTikZ and circuitikz is loaded last wins the keyswitch; with moepTikZ loaded last,to[closing switch]still draws the switch of circuitikz. circuitikz's optioncompatibilityavoids this clash: its switch is then*switch. The path stylewavesof moepTikZ hides the shapewavesof circuitikz; writeshape=wavesfor the latter.- tikz-feynman and the graph drawing library of TikZ use the key
horizontal, as inhorizontal=a to b: write/graph drawing/horizontal=a to bin the options of a picture, scope or diagram, and/tikz/horizontalfor a firewall inside\graph(see the section on firewalls in the documentation). Without LuaTeX (pdfLaTeX, XeLaTeX, latex with dvips), load tikz-feynman before moepTikZ; otherwisehorizontalonly warns that it needs LuaTeX.
- tikz-feynman and the graph drawing library of TikZ use the key
To hide the warnings, load the silence package and write \WarningsOff[moeptikz].
Documentation
The file moeptikz-doc.pdf shows all shapes and explains the options and commands; texdoc moeptikz opens it if your TeX distribution provides moepTikZ. To rebuild it from moeptikz-doc.tex, run
make
in the package directory (the auxiliary files go to build/; make fresh rebuilds everything from scratch), or run pdflatex moeptikz-doc.tex twice. Besides moepTikZ the documentation uses KOMA-Script, geometry, siunitx and inconsolata.
Changes
Version 1.1
- Shadings now respect beamer's covered overlays: with
\setbeamercovered{transparent}, covered nodes and the arrows of hub, switch, mlswitch, router and fwrouter fade like other covered material; before, the first use of a color decided for all nodes of that color.paper colorofmessageopenalso takes color expressions such asred!60.notebookis drawn about six times faster.- moepTikZ warns at
\begin{document}about key clashes with circuitikz (switch,waves), tikz-feynman and the graph drawing library of TikZ (horizontal); see "Known incompatibilities" above. - The documentation is now
moeptikz-doc.pdf, named after the package as CTAN recommends, and the README is nowREADME.md.
Version 1.0
Documents written for the earlier versions without a version number may need small changes:
- The compass anchors (
north,north east, ...) ofserver,client,hub,switch,mlswitch,router,fwrouter,nuc,apandmessageclosednow lie on the outline like those of the other shapes. Nodes placed with these anchors, withanchor=, positioning (above=of, ...) orfitmay move by a few points.- The shape names take no value: write
server,minimum size=2cm,fill=redinstead ofserver={2cm}{red}, androuter,fill=red,draw=blueinstead ofrouter={1cm,red,blue}. - The TikZ keys
get stroke colorandreplace fill by stroke colorare gone; they were meant for internal use.
- The shape names take no value: write
Bug reports and feature requests
Both are highly welcome. Please open an issue at https://github.com/moepinet/moeptikz/issues or write to <moepi@moepi.net>, and mention the version from the line Package: moeptikz ... in the log file of your document.
License
Copyright 2015-2026 Stephan M. Günther
moepTikZ may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this license or (at your option) any later version. The file LICENSE contains version 1.3c; the latest version is at https://www.latex-project.org/lppl.txt.
The work consists of the files moeptikz.sty, moeptikz-doc.tex, README.md and Makefile and the derived file moeptikz-doc.pdf. It has the LPPL maintenance status "maintained"; the Current Maintainer is Stephan M. Günther.
Download the contents of this package in one zip archive (343.3k).
moepTikZ – TikZ shapes for computer network diagrams
moepTikZ provides TikZ shapes for typesetting computer networks: hubs, switches, multilayer switches, routers, firewalls, access points, modems, clients, notebooks, smartphones, servers, racks, databases, the internet as a cloud, users, user groups, open and closed messages, keys and keyholes, and a path style for wireless links.
The shapes have compass and angle anchors on their outline and base and mid anchors at the node text, take custom colors and work with Beamer overlays. The package has been in use for lecture materials since 2012.
| Package | moepTikZ |
| Bug tracker | |
| Repository | |
| Version | 1.1 |
| Licenses | The LaTeX Project Public License 1.3c |
| Copyright | 2015–2026 Stephan M. Guenther |
| Maintainer | Stephan Günther |
| Contained in | TeX Live as moeptikz |
| Topics | Diagrams PGF TikZ Computer science |
| See also | tikzPackets |