From 6d0e0aab928a13c1a2d8b8e83ef9a48b537fd3e2 Mon Sep 17 00:00:00 2001
From: Joseph Weston <joseph@weston.cloud>
Date: Thu, 2 May 2019 15:14:16 +0200
Subject: [PATCH] remove old tutorial script machinery

---
 doc/source/code/README                        |  42 --
 doc/source/code/figure/_defs.py               |  34 --
 doc/source/code/figure/ab_ring.py.diff        | 202 --------
 doc/source/code/figure/ab_ring_sketch.svg     | 140 -----
 doc/source/code/figure/ab_ring_sketch2.svg    | 319 ------------
 doc/source/code/figure/band_structure.py.diff |  67 ---
 doc/source/code/figure/closed_system.py.diff  | 168 ------
 doc/source/code/figure/discretize.py.diff     | 248 ---------
 doc/source/code/figure/faq.py.diff            | 483 ------------------
 doc/source/code/figure/graphene.py.diff       | 217 --------
 .../figure/kernel_polynomial_method.py.diff   | 374 --------------
 .../code/figure/magnetic_texture.py.diff      | 286 -----------
 doc/source/code/figure/plot_graphene.py.diff  | 141 -----
 doc/source/code/figure/plot_qahe.py.diff      |  78 ---
 .../code/figure/plot_zincblende.py.diff       |  71 ---
 doc/source/code/figure/quantum_well.py.diff   | 103 ----
 doc/source/code/figure/quantum_wire.py.diff   | 136 -----
 doc/source/code/figure/spin_orbit.py.diff     | 118 -----
 doc/source/code/figure/superconductor.py.diff | 148 ------
 .../superconductor_transport_sketch.svg       | 325 ------------
 .../code/include/quantum_wire_revisited.py    |  91 ----
 21 files changed, 3791 deletions(-)
 delete mode 100644 doc/source/code/README
 delete mode 100644 doc/source/code/figure/_defs.py
 delete mode 100644 doc/source/code/figure/ab_ring.py.diff
 delete mode 100644 doc/source/code/figure/ab_ring_sketch.svg
 delete mode 100644 doc/source/code/figure/ab_ring_sketch2.svg
 delete mode 100644 doc/source/code/figure/band_structure.py.diff
 delete mode 100644 doc/source/code/figure/closed_system.py.diff
 delete mode 100644 doc/source/code/figure/discretize.py.diff
 delete mode 100644 doc/source/code/figure/faq.py.diff
 delete mode 100644 doc/source/code/figure/graphene.py.diff
 delete mode 100644 doc/source/code/figure/kernel_polynomial_method.py.diff
 delete mode 100644 doc/source/code/figure/magnetic_texture.py.diff
 delete mode 100644 doc/source/code/figure/plot_graphene.py.diff
 delete mode 100644 doc/source/code/figure/plot_qahe.py.diff
 delete mode 100644 doc/source/code/figure/plot_zincblende.py.diff
 delete mode 100644 doc/source/code/figure/quantum_well.py.diff
 delete mode 100644 doc/source/code/figure/quantum_wire.py.diff
 delete mode 100644 doc/source/code/figure/spin_orbit.py.diff
 delete mode 100644 doc/source/code/figure/superconductor.py.diff
 delete mode 100644 doc/source/code/figure/superconductor_transport_sketch.svg
 delete mode 100644 doc/source/code/include/quantum_wire_revisited.py

diff --git a/doc/source/code/README b/doc/source/code/README
deleted file mode 100644
index 896e658a..00000000
--- a/doc/source/code/README
+++ /dev/null
@@ -1,42 +0,0 @@
-This directory contains the code examples from the documentation.
-Most scripts are present in three related but different versions that
-correspond to three different usages.
-
-* Subdirectory 'figure': scripts used for figure generation.  Figures
-  are not displayed but saved to disk.
-
-* Subdirectory 'include': scripts that display figures on screen.
-  They contain commented marks for including snippets in the
-  documentation.
-
-* Subdirectory 'download': complete scripts to be offered for download
-  by readers.  Like 'include' but with the include marks removed.
-
-Most scripts are extracted from corresponding '*.py.diff' files inside
-'figure/'.  These are patches from the 'include' version to the
-'figure' version.  The patches include complete context and as such
-can be used to recreate both files.  It's these patches that are kept
-under version control.
-
-running 'make html' or 'make latex' inside '/doc' will automatically
-update all these scripts according to the following scheme:
-
-            ---->------------->------
-           /                         \
-          /         download/x.py     \
-figure/x.py.diff         ^             \
-     ^           \       |              \
-     |            -> include/x.py ---(patch)---> figure/x.py
-     |                   |                          |
-     |                   |                          |
-      \                  v                         /
-       ----<----------(diff)--------------<--------
-
-Thus, it is possible to update figure/x.py.diff, include/x.py or
-figure/x.py and any changes will be propagated automatically when
-'make' is run.  (Only download/x.py is a dead end.)  The user will be
-informed about any conflicts.  The makefile will only update files
-that are older than their sources and is careful to propagate time
-stamps in order to avoid infinite loops.
-
-Editing only figure/x.py.diff is a sure way to avoid any conflicts.
diff --git a/doc/source/code/figure/_defs.py b/doc/source/code/figure/_defs.py
deleted file mode 100644
index 985e2e9a..00000000
--- a/doc/source/code/figure/_defs.py
+++ /dev/null
@@ -1,34 +0,0 @@
-################################################################
-# Make matplotlib work without X11
-################################################################
-import matplotlib
-matplotlib.use('Agg')
-
-################################################################
-# Prepend Kwant's build directory to sys.path
-################################################################
-import sys
-from distutils.util import get_platform
-sys.path.insert(0, "../../../../build/lib.{0}-{1}.{2}".format(
-        get_platform(), *sys.version_info[:2]))
-
-################################################################
-# Define constants for plotting
-################################################################
-pt_to_in = 1. / 72.
-
-# Default width of figures in pts
-figwidth_pt = 600
-figwidth_in = figwidth_pt * pt_to_in
-
-# Width for smaller figures
-figwidth_small_pt = 400
-figwidth_small_in = figwidth_small_pt * pt_to_in
-
-# Sizes for matplotlib figures
-mpl_width_in = figwidth_pt * pt_to_in
-mpl_label_size = None  # font sizes in points
-mpl_tick_size = None
-
-# dpi for conversion from inches
-dpi = 90
diff --git a/doc/source/code/figure/ab_ring.py.diff b/doc/source/code/figure/ab_ring.py.diff
deleted file mode 100644
index c4fb178b..00000000
--- a/doc/source/code/figure/ab_ring.py.diff
+++ /dev/null
@@ -1,202 +0,0 @@
-@@ -1,127 +1,196 @@
- # Tutorial 2.3.3. Nontrivial shapes
- # =================================
- #
- # Physics background
- # ------------------
- #  Flux-dependent transmission through a quantum ring
- #
- # Kwant features highlighted
- # --------------------------
- #  - More complex shapes with lattices
- #  - Allows for discussion of subtleties of `attach_lead` (not in the
- #    example, but in the tutorial main text)
- #  - Modifcations of hoppings/sites after they have been added
- 
-+import _defs
- from cmath import exp
- from math import pi
- 
- import kwant
- 
- # For plotting
- from matplotlib import pyplot
- 
- 
- #HIDDEN_BEGIN_eusz
- def make_system(a=1, t=1.0, W=10, r1=10, r2=20):
-     # Start with an empty tight-binding system and a single square lattice.
-     # `a` is the lattice constant (by default set to 1 for simplicity).
- 
-     lat = kwant.lattice.square(a)
- 
-     syst = kwant.Builder()
- 
-     #### Define the scattering region. ####
-     # Now, we aim for a more complex shape, namely a ring (or annulus)
-     def ring(pos):
-         (x, y) = pos
-         rsq = x ** 2 + y ** 2
-         return (r1 ** 2 < rsq < r2 ** 2)
- #HIDDEN_END_eusz
- 
-     # and add the corresponding lattice points using the `shape`-function
- #HIDDEN_BEGIN_lcak
-     syst[lat.shape(ring, (0, r1 + 1))] = 4 * t
-     syst[lat.neighbors()] = -t
- #HIDDEN_END_lcak
- 
-     # In order to introduce a flux through the ring, we introduce a phase on
-     # the hoppings on the line cut through one of the arms.  Since we want to
-     # change the flux without modifying the Builder instance repeatedly, we
-     # define the modified hoppings as a function that takes the flux as its
-     # parameter phi.
- #HIDDEN_BEGIN_lvkt
-     def hopping_phase(site1, site2, phi):
-         return -t * exp(1j * phi)
- 
-     def crosses_branchcut(hop):
-         ix0, iy0 = hop[0].tag
- 
-         # builder.HoppingKind with the argument (1, 0) below
-         # returns hoppings ordered as ((i+1, j), (i, j))
-         return iy0 < 0 and ix0 == 1  # ix1 == 0 then implied
- 
-     # Modify only those hopings in x-direction that cross the branch cut
-     def hops_across_cut(syst):
-         for hop in kwant.builder.HoppingKind((1, 0), lat, lat)(syst):
-             if crosses_branchcut(hop):
-                 yield hop
-     syst[hops_across_cut] = hopping_phase
- #HIDDEN_END_lvkt
- 
-     #### Define the leads. ####
-     # left lead
- #HIDDEN_BEGIN_qwgr
-     sym_lead = kwant.TranslationalSymmetry((-a, 0))
-     lead = kwant.Builder(sym_lead)
- 
-     def lead_shape(pos):
-         (x, y) = pos
-         return (-W / 2 < y < W / 2)
- 
-     lead[lat.shape(lead_shape, (0, 0))] = 4 * t
-     lead[lat.neighbors()] = -t
- #HIDDEN_END_qwgr
- 
-     #### Attach the leads and return the system. ####
- #HIDDEN_BEGIN_skbz
-     syst.attach_lead(lead)
-     syst.attach_lead(lead.reversed())
- #HIDDEN_END_skbz
- 
-     return syst
- 
- 
-+def make_system_note1(a=1, t=1.0, W=10, r1=10, r2=20):
-+    lat = kwant.lattice.square(a)
-+    syst = kwant.Builder()
-+    def ring(pos):
-+        (x, y) = pos
-+        rsq = x**2 + y**2
-+        return ( r1**2 < rsq < r2**2)
-+    syst[lat.shape(ring, (0, 11))] = 4 * t
-+    syst[lat.neighbors()] = -t
-+    sym_lead0 = kwant.TranslationalSymmetry((-a, 0))
-+    lead0 = kwant.Builder(sym_lead0)
-+    def lead_shape(pos):
-+        (x, y) = pos
-+        return (-1 < x < 1) and ( 0.5 * W < y < 1.5 * W )
-+    lead0[lat.shape(lead_shape, (0, W))] = 4 * t
-+    lead0[lat.neighbors()] = -t
-+    lead1 = lead0.reversed()
-+    syst.attach_lead(lead0)
-+    syst.attach_lead(lead1)
-+    return syst
-+
-+
-+def make_system_note2(a=1, t=1.0, W=10, r1=10, r2=20):
-+    lat = kwant.lattice.square(a)
-+    syst = kwant.Builder()
-+    def ring(pos):
-+        (x, y) = pos
-+        rsq = x**2 + y**2
-+        return ( r1**2 < rsq < r2**2)
-+    syst[lat.shape(ring, (0, 11))] = 4 * t
-+    syst[lat.neighbors()] = -t
-+    sym_lead0 = kwant.TranslationalSymmetry((-a, 0))
-+    lead0 = kwant.Builder(sym_lead0)
-+    def lead_shape(pos):
-+        (x, y) = pos
-+        return (-1 < x < 1) and ( -W/2 < y < W/2  )
-+    lead0[lat.shape(lead_shape, (0, 0))] = 4 * t
-+    lead0[lat.neighbors()] = -t
-+    lead1 = lead0.reversed()
-+    syst.attach_lead(lead0)
-+    syst.attach_lead(lead1, lat(0, 0))
-+    return syst
-+
-+
- def plot_conductance(syst, energy, fluxes):
-     # compute conductance
- 
-     normalized_fluxes = [flux / (2 * pi) for flux in fluxes]
-     data = []
-     for flux in fluxes:
-         smatrix = kwant.smatrix(syst, energy, params=dict(phi=flux))
-         data.append(smatrix.transmission(1, 0))
- 
--    pyplot.figure()
-+    fig = pyplot.figure()
-     pyplot.plot(normalized_fluxes, data)
--    pyplot.xlabel("flux [flux quantum]")
--    pyplot.ylabel("conductance [e^2/h]")
--    pyplot.show()
-+    pyplot.xlabel("flux [flux quantum]",
-+                 fontsize=_defs.mpl_label_size)
-+    pyplot.ylabel("conductance [e^2/h]",
-+                 fontsize=_defs.mpl_label_size)
-+    pyplot.setp(fig.get_axes()[0].get_xticklabels(),
-+               fontsize=_defs.mpl_tick_size)
-+    pyplot.setp(fig.get_axes()[0].get_yticklabels(),
-+               fontsize=_defs.mpl_tick_size)
-+    fig.set_size_inches(_defs.mpl_width_in, _defs.mpl_width_in * 3. / 4.)
-+    fig.subplots_adjust(left=0.15, right=0.95, top=0.95, bottom=0.15)
-+    fig.savefig("ab_ring_result.pdf")
-+    fig.savefig("ab_ring_result.png", dpi=_defs.dpi)
- 
- 
- def main():
-     syst = make_system()
- 
-     # Check that the system looks as intended.
--    kwant.plot(syst)
-+    size = (_defs.figwidth_in, _defs.figwidth_in)
-+    for extension in ('pdf', 'png'):
-+        kwant.plot(syst, file="ab_ring_syst." + extension,
-+                   fig_size=size, dpi=_defs.dpi)
-+
- 
-     # Finalize the system.
-     syst = syst.finalized()
- 
-     # We should see a conductance that is periodic with the flux quantum
-     plot_conductance(syst, energy=0.15, fluxes=[0.01 * i * 3 * 2 * pi
-                                                 for i in range(100)])
- 
- 
-+    # Finally, some plots needed for the notes
-+    syst = make_system_note1()
-+    for extension in ('pdf', 'png'):
-+        kwant.plot(syst, file="ab_ring_note1." + extension,
-+                   fig_size=size, dpi=_defs.dpi)
-+    syst = make_system_note2()
-+    for extension in ('pdf', 'png'):
-+        kwant.plot(syst, file="ab_ring_note2." + extension,
-+                   fig_size=size, dpi=_defs.dpi)
-+
-+
- # Call the main function if the script gets executed (as opposed to imported).
- # See <http://docs.python.org/library/__main__.html>.
- if __name__ == '__main__':
-     main()
diff --git a/doc/source/code/figure/ab_ring_sketch.svg b/doc/source/code/figure/ab_ring_sketch.svg
deleted file mode 100644
index 0b2e9428..00000000
--- a/doc/source/code/figure/ab_ring_sketch.svg
+++ /dev/null
@@ -1,140 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
-   xmlns:dc="http://purl.org/dc/elements/1.1/"
-   xmlns:cc="http://creativecommons.org/ns#"
-   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-   xmlns:svg="http://www.w3.org/2000/svg"
-   xmlns="http://www.w3.org/2000/svg"
-   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
-   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
-   width="250"
-   height="205"
-   id="svg2"
-   sodipodi:version="0.32"
-   inkscape:version="0.47 r22583"
-   sodipodi:docname="tutorial2c_sketch.svg"
-   inkscape:output_extension="org.inkscape.output.svg.inkscape"
-   version="1.0">
-  <defs
-     id="defs4">
-    <inkscape:perspective
-       sodipodi:type="inkscape:persp3d"
-       inkscape:vp_x="0 : 526.18109 : 1"
-       inkscape:vp_y="0 : 1000 : 0"
-       inkscape:vp_z="744.09448 : 526.18109 : 1"
-       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
-       id="perspective3026" />
-    <inkscape:perspective
-       id="perspective3635"
-       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
-       inkscape:vp_z="1 : 0.5 : 1"
-       inkscape:vp_y="0 : 1000 : 0"
-       inkscape:vp_x="0 : 0.5 : 1"
-       sodipodi:type="inkscape:persp3d" />
-  </defs>
-  <sodipodi:namedview
-     id="base"
-     pagecolor="#ffffff"
-     bordercolor="#666666"
-     borderopacity="1.0"
-     inkscape:pageopacity="0.0"
-     inkscape:pageshadow="2"
-     inkscape:zoom="2.5106232"
-     inkscape:cx="54.499548"
-     inkscape:cy="102.0132"
-     inkscape:document-units="mm"
-     inkscape:current-layer="layer1"
-     showgrid="true"
-     inkscape:object-nodes="true"
-     inkscape:grid-points="true"
-     gridtolerance="1.3"
-     objecttolerance="0.8"
-     gridanglex="8.4666669mm"
-     gridanglez="8.4666669mm"
-     grid_units="mm"
-     inkscape:window-width="1399"
-     inkscape:window-height="974"
-     inkscape:window-x="57"
-     inkscape:window-y="0"
-     inkscape:window-maximized="0"
-     units="pt">
-    <inkscape:grid
-       id="GridFromPre046Settings"
-       type="xygrid"
-       originx="0px"
-       originy="0px"
-       spacingx="2mm"
-       spacingy="2mm"
-       color="#0000ff"
-       empcolor="#ff0400"
-       opacity="0.2"
-       empopacity="0.37647059"
-       empspacing="5"
-       units="mm"
-       visible="true"
-       enabled="true"
-       snapvisiblegridlinesonly="true" />
-  </sodipodi:namedview>
-  <metadata
-     id="metadata7">
-    <rdf:RDF>
-      <cc:Work
-         rdf:about="">
-        <dc:format>image/svg+xml</dc:format>
-        <dc:type
-           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title />
-      </cc:Work>
-    </rdf:RDF>
-  </metadata>
-  <g
-     inkscape:label="Ebene 1"
-     inkscape:groupmode="layer"
-     id="layer1"
-     transform="translate(-114.19886,19.255464)">
-    <path
-       style="fill:none;stroke:#000000;stroke-width:2.91644573;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
-       d="m 292.43863,75.559443 c 0,29.083897 -23.60435,52.688207 -52.68822,52.688207 -29.08392,0 -52.68818,-23.60431 -52.68818,-52.688207 0,-29.083901 23.60426,-52.688202 52.68818,-52.688202 29.08391,0 52.68822,23.604301 52.68822,52.688202 z"
-       id="path37307" />
-    <g
-       id="g38103"
-       style="fill:none;stroke:#000000;stroke-width:0.625;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-       transform="matrix(4.6663129,0,0,4.6663129,-1242.7479,-57.338034)">
-      <path
-         id="path38105"
-         style="fill:none;stroke:#000000;stroke-width:0.625;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-         d="m 291.10885,24.772314 6.48497,0.02214 c 3.35206,-13.407233 11.42324,-16.3201141 20.32977,-16.3207844 8.90637,-6.702e-4 16.34147,2.3839234 19.96964,16.3207844 l 6.16611,0.03299 m -0.0331,6.854657 -6.1677,-0.03489 c -3.36971,13.202794 -11.16975,17.013197 -20.07612,17.012527 -8.90653,-6.7e-4 -16.67166,-3.363359 -20.32977,-17.012527 l -6.27014,-0.02403"
-         sodipodi:nodetypes="ccsccccscc" />
-    </g>
-    <path
-       sodipodi:type="arc"
-       style="opacity:0.95;fill:#ff0000;fill-opacity:1;stroke:none"
-       id="path3602"
-       sodipodi:cx="64.400978"
-       sodipodi:cy="74.404541"
-       sodipodi:rx="0.98904526"
-       sodipodi:ry="0.98904526"
-       d="m 65.390023,74.404541 c 0,0.546235 -0.44281,0.989045 -0.989045,0.989045 -0.546235,0 -0.989045,-0.44281 -0.989045,-0.989045 0,-0.546235 0.44281,-0.989045 0.989045,-0.989045 0.546235,0 0.989045,0.44281 0.989045,0.989045 z"
-       transform="matrix(4.6663129,0,0,4.6663129,-62.675572,-272.11353)" />
-    <path
-       style="fill:none;stroke:#ff0000;stroke-width:2.33315659;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:4.66631287, 2.33315643;stroke-dashoffset:0"
-       d="M 237.70766,74.685746 237.44391,183.60434"
-       id="path3604"
-       sodipodi:nodetypes="cc" />
-    <g
-       transform="matrix(1.2202792,0,0,-1.2202792,244.56422,79.414671)"
-       inkscape:label="phi"
-       id="g3637">
-      <g
-         transform="scale(0.1,0.1)"
-         id="g3639">
-        <path
-           id="path3641"
-           style="fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:none"
-           d="m 125.012,52.4102 c 55.929,4.3203 96,37.7695 96,74.1018 0,37.41 -41.153,70.136 -96,74.476 l 0,19.934 c 0,12.098 0,17.09 34.136,17.09 l 11.864,0 0,11 c -12.91,-1.071 -45.91,-1.071 -60.614,-1.071 -14.7066,0 -48.0582,0 -60.9683,1.071 l 0,-11 11.75,0 c 33.832,0 33.832,-4.633 33.832,-17.09 l 0,-19.934 C 40.2812,195.57 2.01172,162.48 2.01172,126.871 2.01172,89.8203 41.6992,57.8086 95.0117,52.4102 l 0,-20.1407 C 95.0117,20.0391 95.0117,15 61.1797,15 l -11.75,0 0,-11 c 12.9101,1.07031 45.9101,1.07031 60.6093,1.07031 14.711,0 48.063,0 60.973,-1.07031 l 0,11 -11.864,0 c -34.136,0 -34.136,4.6797 -34.136,17.2695 l 0,20.1407 z M 95,60 c -50.5781,6.8789 -56.9883,43.84 -56.9883,66.301 0,18.84 3.5586,59.418 56.9883,66.687 L 95,60 z m 30.012,132.988 C 174.871,187.219 185,154.059 185,126.672 185,105.051 179.57,66.4805 125.012,60" />
-      </g>
-    </g>
-  </g>
-</svg>
diff --git a/doc/source/code/figure/ab_ring_sketch2.svg b/doc/source/code/figure/ab_ring_sketch2.svg
deleted file mode 100644
index 2bf7bf06..00000000
--- a/doc/source/code/figure/ab_ring_sketch2.svg
+++ /dev/null
@@ -1,319 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
-   xmlns:dc="http://purl.org/dc/elements/1.1/"
-   xmlns:cc="http://creativecommons.org/ns#"
-   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-   xmlns:svg="http://www.w3.org/2000/svg"
-   xmlns="http://www.w3.org/2000/svg"
-   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
-   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
-   width="800"
-   height="213"
-   id="svg2"
-   sodipodi:version="0.32"
-   inkscape:version="0.47 r22583"
-   sodipodi:docname="tutorial2c_sketch2.svg"
-   inkscape:output_extension="org.inkscape.output.svg.inkscape"
-   version="1.0">
-  <defs
-     id="defs4">
-    <marker
-       inkscape:stockid="Arrow2Mend"
-       orient="auto"
-       refY="0"
-       refX="0"
-       id="Arrow2Mend"
-       style="overflow:visible">
-      <path
-         id="path3770"
-         style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
-         d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
-         transform="scale(-0.6,-0.6)" />
-    </marker>
-    <marker
-       inkscape:stockid="Arrow1Send"
-       orient="auto"
-       refY="0"
-       refX="0"
-       id="Arrow1Send"
-       style="overflow:visible">
-      <path
-         id="path3758"
-         d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
-         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none"
-         transform="matrix(-0.2,0,0,-0.2,-1.2,0)" />
-    </marker>
-    <marker
-       inkscape:stockid="Arrow2Lend"
-       orient="auto"
-       refY="0"
-       refX="0"
-       id="Arrow2Lend"
-       style="overflow:visible">
-      <path
-         id="path3764"
-         style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
-         d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
-         transform="matrix(-1.1,0,0,-1.1,-1.1,0)" />
-    </marker>
-    <inkscape:perspective
-       sodipodi:type="inkscape:persp3d"
-       inkscape:vp_x="0 : 526.18109 : 1"
-       inkscape:vp_y="0 : 1000 : 0"
-       inkscape:vp_z="744.09448 : 526.18109 : 1"
-       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
-       id="perspective3026" />
-    <inkscape:perspective
-       id="perspective3635"
-       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
-       inkscape:vp_z="1 : 0.5 : 1"
-       inkscape:vp_y="0 : 1000 : 0"
-       inkscape:vp_x="0 : 0.5 : 1"
-       sodipodi:type="inkscape:persp3d" />
-    <inkscape:perspective
-       id="perspective2871"
-       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
-       inkscape:vp_z="1 : 0.5 : 1"
-       inkscape:vp_y="0 : 1000 : 0"
-       inkscape:vp_x="0 : 0.5 : 1"
-       sodipodi:type="inkscape:persp3d" />
-    <inkscape:perspective
-       id="perspective3667"
-       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
-       inkscape:vp_z="1 : 0.5 : 1"
-       inkscape:vp_y="0 : 1000 : 0"
-       inkscape:vp_x="0 : 0.5 : 1"
-       sodipodi:type="inkscape:persp3d" />
-    <inkscape:perspective
-       id="perspective3701"
-       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
-       inkscape:vp_z="1 : 0.5 : 1"
-       inkscape:vp_y="0 : 1000 : 0"
-       inkscape:vp_x="0 : 0.5 : 1"
-       sodipodi:type="inkscape:persp3d" />
-    <inkscape:perspective
-       id="perspective3701-2"
-       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
-       inkscape:vp_z="1 : 0.5 : 1"
-       inkscape:vp_y="0 : 1000 : 0"
-       inkscape:vp_x="0 : 0.5 : 1"
-       sodipodi:type="inkscape:persp3d" />
-    <inkscape:perspective
-       id="perspective4576"
-       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
-       inkscape:vp_z="1 : 0.5 : 1"
-       inkscape:vp_y="0 : 1000 : 0"
-       inkscape:vp_x="0 : 0.5 : 1"
-       sodipodi:type="inkscape:persp3d" />
-    <marker
-       inkscape:stockid="Arrow2Mend"
-       orient="auto"
-       refY="0"
-       refX="0"
-       id="Arrow2Mend-0"
-       style="overflow:visible">
-      <path
-         id="path3770-5"
-         style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
-         d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
-         transform="scale(-0.6,-0.6)" />
-    </marker>
-  </defs>
-  <sodipodi:namedview
-     id="base"
-     pagecolor="#ffffff"
-     bordercolor="#666666"
-     borderopacity="1.0"
-     inkscape:pageopacity="0.0"
-     inkscape:pageshadow="2"
-     inkscape:zoom="1.96"
-     inkscape:cx="391.07137"
-     inkscape:cy="106.28166"
-     inkscape:document-units="mm"
-     inkscape:current-layer="layer1"
-     showgrid="true"
-     inkscape:object-nodes="true"
-     inkscape:grid-points="true"
-     gridtolerance="1.3"
-     objecttolerance="0.8"
-     gridanglex="8.4666669mm"
-     gridanglez="8.4666669mm"
-     grid_units="mm"
-     inkscape:window-width="1680"
-     inkscape:window-height="960"
-     inkscape:window-x="0"
-     inkscape:window-y="0"
-     inkscape:window-maximized="0" />
-  <metadata
-     id="metadata7">
-    <rdf:RDF>
-      <cc:Work
-         rdf:about="">
-        <dc:format>image/svg+xml</dc:format>
-        <dc:type
-           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title />
-      </cc:Work>
-    </rdf:RDF>
-  </metadata>
-  <g
-     inkscape:label="Ebene 1"
-     inkscape:groupmode="layer"
-     id="layer1"
-     transform="translate(199.8724,26.246742)">
-    <rect
-       style="opacity:0.95;fill:#9c9c9c;fill-opacity:1;stroke:none"
-       id="rect3734"
-       width="20.276669"
-       height="41.462551"
-       x="-45.860664"
-       y="59.196667" />
-    <g
-       id="g3681"
-       transform="matrix(3.8946736,0,0,5.5523606,-554.05901,-371.33435)"
-       style="stroke:#c4c4c4;stroke-width:0.59557372;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none">
-      <path
-         sodipodi:nodetypes="cc"
-         id="path3657"
-         d="m 200.95336,77.53144 72.03134,0"
-         style="fill:none;stroke:#c4c4c4;stroke-width:0.59557372;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
-      <path
-         sodipodi:nodetypes="cc"
-         id="path3657-9"
-         d="m 200.87605,84.852566 72.03134,0"
-         style="fill:none;stroke:#c4c4c4;stroke-width:0.59557372;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
-    </g>
-    <path
-       style="fill:none;stroke:#000000;stroke-width:2.76955438;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
-       d="m 406.39299,-24.861965 c -57.92207,0 -104.89686,46.974867 -104.89686,104.896874 0,57.922011 46.97479,104.896891 104.89686,104.896891 57.92192,0 104.89689,-46.97488 104.89689,-104.896891 0,-57.922007 -46.97486,-104.896874 -104.89689,-104.896874 z m 0,42.408802 c 34.52383,0 62.48808,27.964263 62.48808,62.488072 0,34.523811 -27.9643,62.661171 -62.48808,62.661171 -34.52381,0 -62.48806,-28.13736 -62.48806,-62.661171 0,-34.523809 27.96425,-62.488072 62.48806,-62.488072 z"
-       id="path37307" />
-    <path
-       style="fill:none;stroke:#000000;stroke-width:2.76955438;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-       d="m 509.44175,59.196676 34.11393,0 39.97331,0"
-       id="path3657-8"
-       sodipodi:nodetypes="ccc" />
-    <path
-       style="fill:none;stroke:#000000;stroke-width:2.76955438;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-       d="m 509.36221,99.749189 74.08724,0"
-       id="path3657-9-0"
-       sodipodi:nodetypes="cc" />
-    <g
-       id="g3681-4"
-       transform="matrix(-4.9045266,0,0,5.5391089,1140.3731,-370.25841)"
-       style="stroke-width:0.53136313;stroke-miterlimit:4;stroke-dasharray:none">
-      <path
-         sodipodi:nodetypes="cc"
-         id="path3657-83"
-         d="m 200.95336,77.53144 72.03134,0"
-         style="fill:none;stroke:#000000;stroke-width:0.53136313;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
-      <path
-         sodipodi:nodetypes="cc"
-         id="path3657-9-9"
-         d="m 200.87605,84.852566 72.03134,0"
-         style="fill:none;stroke:#000000;stroke-width:0.53136313;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
-    </g>
-    <path
-       style="fill:none;stroke:#000000;stroke-width:4.15433168;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-end:url(#Arrow2Mend)"
-       d="m -33.937237,79.776421 56.83818,0"
-       id="path3738"
-       sodipodi:nodetypes="cc" />
-    <path
-       style="fill:none;stroke:#000000;stroke-width:4.15433168;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-end:url(#Arrow2Mend)"
-       d="m 537.78747,79.080327 56.83819,0"
-       id="path3738-2"
-       sodipodi:nodetypes="cc" />
-    <g
-       style="font-size:3px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Times;-inkscape-font-specification:Times"
-       id="text4596"
-       transform="matrix(5.5391089,0,0,5.5391089,-908.40072,-363.2872)">
-      <path
-         d="m 151.33955,86.880928 0,-0.993164 0.26954,0 0,0.98291 c -1e-5,0.155274 0.0303,0.271973 0.0908,0.350098 0.0605,0.07715 0.15136,0.115723 0.27246,0.115722 0.1455,10e-7 0.26025,-0.04639 0.34423,-0.13916 0.085,-0.09277 0.12744,-0.219237 0.12745,-0.379394 l 0,-0.930176 0.26953,0 0,1.640625 -0.26953,0 0,-0.251953 c -0.0654,0.09961 -0.14161,0.173828 -0.22852,0.222656 -0.0859,0.04785 -0.18604,0.07178 -0.30029,0.07178 -0.18848,0 -0.33155,-0.05859 -0.4292,-0.175781 -0.0977,-0.117187 -0.14649,-0.288574 -0.14649,-0.51416"
-         id="path3652" />
-      <path
-         d="m 154.63545,86.538155 0,0.990234 -0.26953,0 0,-0.981445 c 0,-0.155273 -0.0303,-0.271483 -0.0908,-0.348633 -0.0606,-0.07715 -0.15137,-0.115721 -0.27246,-0.115723 -0.14551,2e-6 -0.26025,0.04639 -0.34424,0.13916 -0.084,0.09277 -0.12598,0.21924 -0.12598,0.379395 l 0,0.927246 -0.27099,0 0,-1.640625 0.27099,0 0,0.254883 c 0.0645,-0.09863 0.14014,-0.172362 0.22706,-0.221192 0.0879,-0.04883 0.18896,-0.07324 0.30322,-0.07324 0.18847,2e-6 0.33105,0.0586 0.42773,0.175781 0.0967,0.116213 0.14502,0.287599 0.14502,0.514161"
-         id="path3654" />
-      <path
-         d="m 155.17598,85.887764 0.26953,0 0,1.640625 -0.26953,0 0,-1.640625 m 0,-0.638672 0.26953,0 0,0.341309 -0.26953,0 0,-0.341309"
-         id="path3656" />
-      <path
-         d="m 156.27461,85.421944 0,0.46582 0.55518,0 0,0.209473 -0.55518,0 0,0.890625 c 0,0.133789 0.0181,0.219727 0.0542,0.257812 0.0371,0.03809 0.11182,0.05713 0.22412,0.05713 l 0.27686,0 0,0.225586 -0.27686,0 c -0.20801,0 -0.35156,-0.03857 -0.43066,-0.115723 -0.0791,-0.07812 -0.11865,-0.219726 -0.11865,-0.424804 l 0,-0.890625 -0.19776,0 0,-0.209473 0.19776,0 0,-0.46582 0.27099,0"
-         id="path3658" />
-      <path
-         d="m 159.32149,85.950752 0,0.251953 c -0.0762,-0.04199 -0.15284,-0.07324 -0.22998,-0.09375 -0.0762,-0.02148 -0.15332,-0.03222 -0.23145,-0.03223 -0.1748,10e-7 -0.31055,0.05567 -0.40722,0.166992 -0.0967,0.110353 -0.14502,0.265626 -0.14502,0.46582 0,0.200196 0.0483,0.355958 0.14502,0.467285 0.0967,0.110352 0.23242,0.165528 0.40722,0.165528 0.0781,0 0.15527,-0.01025 0.23145,-0.03076 0.0771,-0.02148 0.1538,-0.05322 0.22998,-0.09522 l 0,0.249024 c -0.0752,0.03516 -0.15332,0.06152 -0.23438,0.0791 -0.0801,0.01758 -0.16553,0.02637 -0.25635,0.02637 -0.24707,0 -0.44336,-0.07764 -0.58886,-0.23291 -0.14551,-0.155273 -0.21826,-0.364745 -0.21826,-0.628418 0,-0.267577 0.0732,-0.478026 0.21972,-0.631347 0.14746,-0.153319 0.34912,-0.229979 0.60498,-0.229981 0.083,2e-6 0.16406,0.0088 0.24317,0.02637 0.0791,0.0166 0.15576,0.04199 0.22998,0.07617"
-         id="path3660" />
-      <path
-         d="m 161.19063,86.640694 0,0.131836 -1.23926,0 c 0.0117,0.185547 0.0674,0.327148 0.16699,0.424804 0.10059,0.09668 0.24024,0.14502 0.41895,0.14502 0.10351,0 0.20361,-0.01269 0.30029,-0.03809 0.0977,-0.02539 0.19434,-0.06348 0.29004,-0.114258 l 0,0.254883 c -0.0967,0.04102 -0.1958,0.07227 -0.29736,0.09375 -0.10157,0.02148 -0.20459,0.03223 -0.30909,0.03223 -0.26172,0 -0.46923,-0.07617 -0.62255,-0.228515 -0.15235,-0.152344 -0.22852,-0.358398 -0.22852,-0.618164 0,-0.268554 0.0723,-0.481444 0.2168,-0.638672 0.1455,-0.158202 0.3413,-0.237303 0.5874,-0.237305 0.2207,2e-6 0.39502,0.07129 0.52295,0.213867 0.1289,0.141603 0.19336,0.334474 0.19336,0.578614 m -0.26953,-0.0791 c -0.002,-0.14746 -0.0435,-0.265135 -0.12451,-0.353027 -0.0801,-0.08789 -0.18653,-0.131835 -0.31934,-0.131836 -0.15039,1e-6 -0.271,0.04248 -0.36182,0.127441 -0.0898,0.08496 -0.1416,0.204591 -0.15527,0.358887 l 0.96094,-0.0015"
-         id="path3662" />
-      <path
-         d="m 161.62715,85.249092 0.26953,0 0,2.279297 -0.26953,0 0,-2.279297"
-         id="path3664" />
-      <path
-         d="m 162.45918,85.249092 0.26953,0 0,2.279297 -0.26953,0 0,-2.279297"
-         id="path3666" />
-    </g>
-    <g
-       style="font-size:3px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Times;-inkscape-font-specification:Times"
-       id="text4600"
-       transform="matrix(5.5391089,0,0,5.5391089,-908.40072,-363.2872)">
-      <path
-         d="m 170.44072,79.012825 0,0.46582 0.55518,0 0,0.209473 -0.55518,0 0,0.890625 c 0,0.133789 0.0181,0.219727 0.0542,0.257812 0.0371,0.03809 0.11181,0.05713 0.22412,0.05713 l 0.27686,0 0,0.225586 -0.27686,0 c -0.20801,0 -0.35156,-0.03857 -0.43066,-0.115722 -0.0791,-0.07813 -0.11866,-0.219727 -0.11866,-0.424805 l 0,-0.890625 -0.19775,0 0,-0.209473 0.19775,0 0,-0.46582 0.271,0"
-         id="path3669" />
-      <path
-         d="m 172.30254,79.730598 c -0.0303,-0.01758 -0.0635,-0.03027 -0.0996,-0.03808 -0.0352,-0.0088 -0.0742,-0.01318 -0.11719,-0.01318 -0.15235,10e-7 -0.26953,0.04981 -0.35156,0.149414 -0.0811,0.09863 -0.12159,0.240724 -0.12159,0.42627 l 0,0.864257 -0.27099,0 0,-1.640625 0.27099,0 0,0.254883 c 0.0566,-0.09961 0.13038,-0.173338 0.2212,-0.221191 0.0908,-0.04883 0.20117,-0.07324 0.33105,-0.07324 0.0186,1e-6 0.0391,0.0015 0.0615,0.0044 0.0225,0.002 0.0474,0.0054 0.0747,0.01025 l 0.001,0.276855"
-         id="path3671" />
-      <path
-         d="m 173.33379,80.294563 c -0.21778,10e-7 -0.36866,0.0249 -0.45264,0.07471 -0.084,0.04981 -0.12598,0.134767 -0.12598,0.254883 0,0.0957 0.0312,0.171875 0.0937,0.228516 0.0635,0.05566 0.14942,0.0835 0.25782,0.0835 0.14941,0 0.26904,-0.05273 0.35888,-0.158203 0.0908,-0.106445 0.13623,-0.247558 0.13623,-0.42334 l 0,-0.06006 -0.26806,0 m 0.53759,-0.111328 0,0.936035 -0.26953,0 0,-0.249023 c -0.0615,0.09961 -0.13818,0.17334 -0.22998,0.221191 -0.0918,0.04687 -0.2041,0.07031 -0.33691,0.07031 -0.16797,0 -0.30176,-0.04687 -0.40137,-0.140625 -0.0986,-0.09473 -0.14795,-0.221191 -0.14795,-0.379395 0,-0.184569 0.0615,-0.323729 0.18457,-0.41748 0.12402,-0.09375 0.30859,-0.140624 0.55371,-0.140625 l 0.37793,0 0,-0.02637 c 0,-0.124023 -0.041,-0.219726 -0.12304,-0.28711 -0.0811,-0.06836 -0.19532,-0.102537 -0.34278,-0.102539 -0.0937,2e-6 -0.18506,0.01123 -0.27392,0.03369 -0.0889,0.02246 -0.17432,0.05615 -0.25635,0.101074 l 0,-0.249024 c 0.0986,-0.03808 0.19433,-0.0664 0.28711,-0.08496 0.0928,-0.01953 0.1831,-0.02929 0.27099,-0.0293 0.23731,1e-6 0.41455,0.06153 0.53174,0.18457 0.11719,0.123048 0.17578,0.309571 0.17578,0.55957"
-         id="path3673" />
-      <path
-         d="m 175.79765,80.129036 0,0.990234 -0.26953,0 0,-0.981445 c 0,-0.155272 -0.0303,-0.271483 -0.0908,-0.348633 -0.0606,-0.07715 -0.15137,-0.115721 -0.27246,-0.115722 -0.14551,1e-6 -0.26025,0.04639 -0.34424,0.13916 -0.084,0.09277 -0.12597,0.219239 -0.12597,0.379394 l 0,0.927246 -0.271,0 0,-1.640625 0.271,0 0,0.254883 c 0.0645,-0.09863 0.14013,-0.172362 0.22705,-0.221191 0.0879,-0.04883 0.18896,-0.07324 0.30322,-0.07324 0.18847,10e-7 0.33105,0.0586 0.42773,0.175781 0.0967,0.116212 0.14502,0.287599 0.14502,0.51416"
-         id="path3675" />
-      <path
-         d="m 177.38408,79.526985 0,0.254883 c -0.0762,-0.03906 -0.15528,-0.06836 -0.23731,-0.08789 -0.082,-0.01953 -0.16699,-0.0293 -0.25488,-0.0293 -0.13379,2e-6 -0.23437,0.02051 -0.30176,0.06152 -0.0664,0.04102 -0.0996,0.10254 -0.0996,0.18457 0,0.0625 0.0239,0.111818 0.0718,0.147949 0.0479,0.03516 0.14404,0.06885 0.28858,0.101075 l 0.0923,0.02051 c 0.19141,0.04102 0.32715,0.09912 0.40723,0.174317 0.0811,0.07422 0.12158,0.178223 0.12158,0.312012 0,0.152344 -0.0606,0.272949 -0.18164,0.361816 -0.12012,0.08887 -0.28565,0.133301 -0.49658,0.133301 -0.0879,0 -0.17969,-0.0088 -0.27539,-0.02637 -0.0947,-0.0166 -0.19483,-0.04199 -0.3003,-0.07617 l 0,-0.278321 c 0.0996,0.05176 0.19776,0.09082 0.29444,0.117188 0.0967,0.02539 0.19238,0.03809 0.28711,0.03809 0.12695,0 0.2246,-0.02148 0.29297,-0.06445 0.0684,-0.04395 0.10253,-0.105469 0.10253,-0.184571 0,-0.07324 -0.0249,-0.129394 -0.0747,-0.168457 -0.0488,-0.03906 -0.15674,-0.07666 -0.32373,-0.112793 l -0.0937,-0.02197 c -0.167,-0.03516 -0.2876,-0.08887 -0.36182,-0.161133 -0.0742,-0.07324 -0.11133,-0.173339 -0.11133,-0.300293 0,-0.154296 0.0547,-0.273436 0.16406,-0.357422 0.10938,-0.08398 0.26465,-0.125975 0.46582,-0.125976 0.0996,10e-7 0.19336,0.0073 0.28125,0.02197 0.0879,0.01465 0.16895,0.03662 0.24317,0.06592"
-         id="path3677" />
-      <path
-         d="m 177.90263,78.839973 0.26953,0 0,2.279297 -0.26953,0 0,-2.279297"
-         id="path3679" />
-      <path
-         d="m 179.48027,80.294563 c -0.21777,10e-7 -0.36865,0.0249 -0.45264,0.07471 -0.084,0.04981 -0.12597,0.134767 -0.12597,0.254883 0,0.0957 0.0312,0.171875 0.0937,0.228516 0.0635,0.05566 0.14941,0.0835 0.25781,0.0835 0.14941,0 0.26904,-0.05273 0.35889,-0.158203 0.0908,-0.106445 0.13623,-0.247558 0.13623,-0.42334 l 0,-0.06006 -0.26807,0 m 0.5376,-0.111328 0,0.936035 -0.26953,0 0,-0.249023 c -0.0615,0.09961 -0.13819,0.17334 -0.22998,0.221191 -0.0918,0.04687 -0.20411,0.07031 -0.33692,0.07031 -0.16797,0 -0.30176,-0.04687 -0.40136,-0.140625 -0.0986,-0.09473 -0.14795,-0.221191 -0.14795,-0.379395 0,-0.184569 0.0615,-0.323729 0.18457,-0.41748 0.12402,-0.09375 0.30859,-0.140624 0.55371,-0.140625 l 0.37793,0 0,-0.02637 c 0,-0.124023 -0.041,-0.219726 -0.12305,-0.28711 -0.0811,-0.06836 -0.19531,-0.102537 -0.34277,-0.102539 -0.0937,2e-6 -0.18506,0.01123 -0.27393,0.03369 -0.0889,0.02246 -0.17432,0.05615 -0.25635,0.101074 l 0,-0.249024 c 0.0986,-0.03808 0.19434,-0.0664 0.28711,-0.08496 0.0928,-0.01953 0.18311,-0.02929 0.271,-0.0293 0.2373,1e-6 0.41455,0.06153 0.53174,0.18457 0.11718,0.123048 0.17578,0.309571 0.17578,0.55957"
-         id="path3681" />
-      <path
-         d="m 180.84697,79.012825 0,0.46582 0.55518,0 0,0.209473 -0.55518,0 0,0.890625 c 0,0.133789 0.0181,0.219727 0.0542,0.257812 0.0371,0.03809 0.11181,0.05713 0.22412,0.05713 l 0.27686,0 0,0.225586 -0.27686,0 c -0.20801,0 -0.35156,-0.03857 -0.43066,-0.115722 -0.0791,-0.07813 -0.11866,-0.219727 -0.11866,-0.424805 l 0,-0.890625 -0.19775,0 0,-0.209473 0.19775,0 0,-0.46582 0.271,0"
-         id="path3683" />
-      <path
-         d="m 181.7581,79.478645 0.26953,0 0,1.640625 -0.26953,0 0,-1.640625 m 0,-0.638672 0.26953,0 0,0.341309 -0.26953,0 0,-0.341309"
-         id="path3685" />
-      <path
-         d="m 183.22588,79.66761 c -0.14454,2e-6 -0.25879,0.05664 -0.34278,0.169922 -0.084,0.112306 -0.12597,0.266603 -0.12597,0.462891 0,0.196289 0.0415,0.351074 0.12451,0.464355 0.084,0.112305 0.19873,0.168457 0.34424,0.168457 0.14355,0 0.25732,-0.05664 0.3413,-0.169922 0.084,-0.11328 0.12598,-0.267577 0.12598,-0.46289 0,-0.194335 -0.042,-0.348144 -0.12598,-0.461426 -0.084,-0.114257 -0.19775,-0.171385 -0.3413,-0.171387 m 0,-0.228515 c 0.23437,1e-6 0.41845,0.07617 0.55224,0.228515 0.13379,0.152345 0.20068,0.363283 0.20069,0.632813 -1e-5,0.268555 -0.0669,0.479492 -0.20069,0.632812 -0.13379,0.152344 -0.31787,0.228516 -0.55224,0.228516 -0.23536,0 -0.41993,-0.07617 -0.55372,-0.228516 -0.13281,-0.15332 -0.19921,-0.364257 -0.19921,-0.632812 0,-0.26953 0.0664,-0.480468 0.19921,-0.632813 0.13379,-0.152342 0.31836,-0.228514 0.55372,-0.228515"
-         id="path3687" />
-      <path
-         d="m 185.78789,80.129036 0,0.990234 -0.26953,0 0,-0.981445 c -1e-5,-0.155272 -0.0303,-0.271483 -0.0908,-0.348633 -0.0606,-0.07715 -0.15137,-0.115721 -0.27246,-0.115722 -0.14551,1e-6 -0.26026,0.04639 -0.34424,0.13916 -0.084,0.09277 -0.12598,0.219239 -0.12598,0.379394 l 0,0.927246 -0.271,0 0,-1.640625 0.271,0 0,0.254883 c 0.0645,-0.09863 0.14014,-0.172362 0.22705,-0.221191 0.0879,-0.04883 0.18896,-0.07324 0.30322,-0.07324 0.18848,10e-7 0.33106,0.0586 0.42774,0.175781 0.0967,0.116212 0.14502,0.287599 0.14502,0.51416"
-         id="path3689" />
-      <path
-         d="m 187.07402,80.294563 c -0.21777,10e-7 -0.36865,0.0249 -0.45264,0.07471 -0.084,0.04981 -0.12597,0.134767 -0.12597,0.254883 0,0.0957 0.0312,0.171875 0.0937,0.228516 0.0635,0.05566 0.14941,0.0835 0.25781,0.0835 0.14941,0 0.26904,-0.05273 0.35889,-0.158203 0.0908,-0.106445 0.13623,-0.247558 0.13623,-0.42334 l 0,-0.06006 -0.26807,0 m 0.5376,-0.111328 0,0.936035 -0.26953,0 0,-0.249023 c -0.0615,0.09961 -0.13819,0.17334 -0.22998,0.221191 -0.0918,0.04687 -0.20411,0.07031 -0.33692,0.07031 -0.16797,0 -0.30176,-0.04687 -0.40136,-0.140625 -0.0986,-0.09473 -0.14795,-0.221191 -0.14795,-0.379395 0,-0.184569 0.0615,-0.323729 0.18457,-0.41748 0.12402,-0.09375 0.30859,-0.140624 0.55371,-0.140625 l 0.37793,0 0,-0.02637 c 0,-0.124023 -0.041,-0.219726 -0.12305,-0.28711 -0.0811,-0.06836 -0.19531,-0.102537 -0.34277,-0.102539 -0.0937,2e-6 -0.18506,0.01123 -0.27393,0.03369 -0.0889,0.02246 -0.17432,0.05615 -0.25635,0.101074 l 0,-0.249024 c 0.0986,-0.03808 0.19434,-0.0664 0.28711,-0.08496 0.0928,-0.01953 0.18311,-0.02929 0.271,-0.0293 0.2373,1e-6 0.41455,0.06153 0.53174,0.18457 0.11718,0.123048 0.17578,0.309571 0.17578,0.55957"
-         id="path3691" />
-      <path
-         d="m 188.17412,78.839973 0.26953,0 0,2.279297 -0.26953,0 0,-2.279297"
-         id="path3693" />
-      <path
-         d="m 189.76787,79.478645 0.28564,0 0.5127,1.376953 0.51269,-1.376953 0.28565,0 -0.61524,1.640625 -0.36621,0 -0.61523,-1.640625"
-         id="path3695" />
-      <path
-         d="m 193.13994,80.231575 0,0.131836 -1.23926,0 c 0.0117,0.185547 0.0674,0.327149 0.16699,0.424805 0.10059,0.09668 0.24024,0.145019 0.41895,0.145019 0.10351,0 0.20361,-0.01269 0.30029,-0.03809 0.0977,-0.02539 0.19434,-0.06348 0.29004,-0.114258 l 0,0.254883 c -0.0967,0.04102 -0.1958,0.07227 -0.29736,0.09375 -0.10157,0.02148 -0.20459,0.03223 -0.30909,0.03223 -0.26171,0 -0.46923,-0.07617 -0.62255,-0.228516 -0.15235,-0.152343 -0.22852,-0.358398 -0.22852,-0.618164 0,-0.268554 0.0723,-0.481444 0.2168,-0.638672 0.1455,-0.158201 0.34131,-0.237303 0.5874,-0.237304 0.2207,10e-7 0.39502,0.07129 0.52295,0.213867 0.1289,0.141603 0.19336,0.334474 0.19336,0.578613 m -0.26953,-0.0791 c -0.002,-0.147459 -0.0435,-0.265135 -0.12451,-0.353027 -0.0801,-0.08789 -0.18653,-0.131834 -0.31934,-0.131836 -0.15039,2e-6 -0.271,0.04248 -0.36182,0.127442 -0.0898,0.08496 -0.1416,0.204591 -0.15527,0.358886 l 0.96094,-0.0015"
-         id="path3697" />
-      <path
-         d="m 194.75713,79.541634 0,0.251953 c -0.0762,-0.04199 -0.15284,-0.07324 -0.22998,-0.09375 -0.0762,-0.02148 -0.15333,-0.03222 -0.23145,-0.03223 -0.17481,2e-6 -0.31055,0.05567 -0.40723,0.166992 -0.0967,0.110353 -0.14502,0.265626 -0.14502,0.465821 0,0.200196 0.0483,0.355957 0.14502,0.467285 0.0967,0.110352 0.23242,0.165527 0.40723,0.165527 0.0781,0 0.15527,-0.01025 0.23145,-0.03076 0.0771,-0.02148 0.1538,-0.05322 0.22998,-0.09521 l 0,0.249023 c -0.0752,0.03516 -0.15333,0.06152 -0.23438,0.0791 -0.0801,0.01758 -0.16553,0.02637 -0.25635,0.02637 -0.24707,0 -0.44336,-0.07764 -0.58886,-0.23291 -0.14551,-0.155273 -0.21827,-0.364746 -0.21827,-0.628418 0,-0.267577 0.0733,-0.478026 0.21973,-0.631348 0.14746,-0.153319 0.34912,-0.229979 0.60498,-0.22998 0.083,10e-7 0.16406,0.0088 0.24317,0.02637 0.0791,0.0166 0.15576,0.04199 0.22998,0.07617"
-         id="path3699" />
-      <path
-         d="m 195.48955,79.012825 0,0.46582 0.55517,0 0,0.209473 -0.55517,0 0,0.890625 c 0,0.133789 0.0181,0.219727 0.0542,0.257812 0.0371,0.03809 0.11181,0.05713 0.22412,0.05713 l 0.27685,0 0,0.225586 -0.27685,0 c -0.20801,0 -0.35156,-0.03857 -0.43067,-0.115722 -0.0791,-0.07813 -0.11865,-0.219727 -0.11865,-0.424805 l 0,-0.890625 -0.19775,0 0,-0.209473 0.19775,0 0,-0.46582 0.271,0"
-         id="path3701" />
-      <path
-         d="m 197.03642,79.66761 c -0.14453,2e-6 -0.25879,0.05664 -0.34277,0.169922 -0.084,0.112306 -0.12598,0.266603 -0.12598,0.462891 0,0.196289 0.0415,0.351074 0.12451,0.464355 0.084,0.112305 0.19873,0.168457 0.34424,0.168457 0.14356,0 0.25733,-0.05664 0.34131,-0.169922 0.084,-0.11328 0.12598,-0.267577 0.12598,-0.46289 0,-0.194335 -0.042,-0.348144 -0.12598,-0.461426 -0.084,-0.114257 -0.19775,-0.171385 -0.34131,-0.171387 m 0,-0.228515 c 0.23438,1e-6 0.41846,0.07617 0.55225,0.228515 0.13379,0.152345 0.20068,0.363283 0.20068,0.632813 0,0.268555 -0.0669,0.479492 -0.20068,0.632812 -0.13379,0.152344 -0.31787,0.228516 -0.55225,0.228516 -0.23535,0 -0.41992,-0.07617 -0.55371,-0.228516 -0.13281,-0.15332 -0.19922,-0.364257 -0.19922,-0.632812 0,-0.26953 0.0664,-0.480468 0.19922,-0.632813 0.13379,-0.152342 0.31836,-0.228514 0.55371,-0.228515"
-         id="path3703" />
-      <path
-         d="m 199.18535,79.730598 c -0.0303,-0.01758 -0.0635,-0.03027 -0.0996,-0.03808 -0.0352,-0.0088 -0.0742,-0.01318 -0.11719,-0.01318 -0.15234,10e-7 -0.26953,0.04981 -0.35156,0.149414 -0.0811,0.09863 -0.12158,0.240724 -0.12158,0.42627 l 0,0.864257 -0.271,0 0,-1.640625 0.271,0 0,0.254883 c 0.0566,-0.09961 0.13037,-0.173338 0.22119,-0.221191 0.0908,-0.04883 0.20117,-0.07324 0.33105,-0.07324 0.0186,1e-6 0.0391,0.0015 0.0615,0.0044 0.0225,0.002 0.0474,0.0054 0.0747,0.01025 l 10e-4,0.276855"
-         id="path3705" />
-    </g>
-  </g>
-</svg>
diff --git a/doc/source/code/figure/band_structure.py.diff b/doc/source/code/figure/band_structure.py.diff
deleted file mode 100644
index 8a265207..00000000
--- a/doc/source/code/figure/band_structure.py.diff
+++ /dev/null
@@ -1,67 +0,0 @@
-@@ -1,52 +1,62 @@
- # Tutorial 2.4.1. Band structure calculations
- # ===========================================
- #
- # Physics background
- # ------------------
- #  band structure of a simple quantum wire in tight-binding approximation
- #
- # Kwant features highlighted
- # --------------------------
- #  - Computing the band structure of a finalized lead.
- 
-+import _defs
- import kwant
- 
- # For plotting.
- from matplotlib import pyplot
- 
- #HIDDEN_BEGIN_zxip
- def make_lead(a=1, t=1.0, W=10):
-     # Start with an empty lead with a single square lattice
-     lat = kwant.lattice.square(a)
- 
-     sym_lead = kwant.TranslationalSymmetry((-a, 0))
-     lead = kwant.Builder(sym_lead)
- 
-     # build up one unit cell of the lead, and add the hoppings
-     # to the next unit cell
-     for j in range(W):
-         lead[lat(0, j)] = 4 * t
- 
-         if j > 0:
-             lead[lat(0, j), lat(0, j - 1)] = -t
- 
-         lead[lat(1, j), lat(0, j)] = -t
- 
-     return lead
- #HIDDEN_END_zxip
- 
- 
- #HIDDEN_BEGIN_pejz
- def main():
-     lead = make_lead().finalized()
--    kwant.plotter.bands(lead, show=False)
--    pyplot.xlabel("momentum [(lattice constant)^-1]")
--    pyplot.ylabel("energy [t]")
--    pyplot.show()
-+    fig = kwant.plotter.bands(lead, show=False)
-+    pyplot.xlabel("momentum [(lattice constant)^-1]",
-+                 fontsize=_defs.mpl_label_size)
-+    pyplot.ylabel("energy [t]", fontsize=_defs.mpl_label_size)
-+    pyplot.setp(fig.get_axes()[0].get_xticklabels(),
-+               fontsize=_defs.mpl_tick_size)
-+    pyplot.setp(fig.get_axes()[0].get_yticklabels(),
-+               fontsize=_defs.mpl_tick_size)
-+    fig.set_size_inches(_defs.mpl_width_in, _defs.mpl_width_in * 3. / 4.)
-+    fig.subplots_adjust(left=0.15, right=0.95, top=0.95, bottom=0.15)
-+    for extension in ('pdf', 'png'):
-+        fig.savefig("band_structure_result." + extension, dpi=_defs.dpi)
-+
- #HIDDEN_END_pejz
- 
- 
- # Call the main function if the script gets executed (as opposed to imported).
- # See <http://docs.python.org/library/__main__.html>.
- if __name__ == '__main__':
-     main()
diff --git a/doc/source/code/figure/closed_system.py.diff b/doc/source/code/figure/closed_system.py.diff
deleted file mode 100644
index 748e9eca..00000000
--- a/doc/source/code/figure/closed_system.py.diff
+++ /dev/null
@@ -1,168 +0,0 @@
-@@ -1,144 +1,161 @@
- # Tutorial 2.4.2. Closed systems
- # ==============================
- #
- # Physics background
- # ------------------
- #  Fock-darwin spectrum of a quantum dot (energy spectrum in
- #  as a function of a magnetic field)
- #
- # Kwant features highlighted
- # --------------------------
- #  - Use of `hamiltonian_submatrix` in order to obtain a Hamiltonian
- #    matrix.
- 
-+import _defs
- from cmath import exp
- import numpy as np
- import kwant
- 
- # For eigenvalue computation
- #HIDDEN_BEGIN_tibv
- import scipy.sparse.linalg as sla
- #HIDDEN_END_tibv
- 
- # For plotting
- from matplotlib import pyplot
- 
- 
- def make_system(a=1, t=1.0, r=10):
-     # Start with an empty tight-binding system and a single square lattice.
-     # `a` is the lattice constant (by default set to 1 for simplicity).
- 
- #HIDDEN_BEGIN_qlyd
-     lat = kwant.lattice.square(a, norbs=1)
- 
-     syst = kwant.Builder()
- 
-     # Define the quantum dot
-     def circle(pos):
-         (x, y) = pos
-         rsq = x ** 2 + y ** 2
-         return rsq < r ** 2
- 
-     def hopx(site1, site2, B):
-         # The magnetic field is controlled by the parameter B
-         y = site1.pos[1]
-         return -t * exp(-1j * B * y)
- 
-     syst[lat.shape(circle, (0, 0))] = 4 * t
-     # hoppings in x-direction
-     syst[kwant.builder.HoppingKind((1, 0), lat, lat)] = hopx
-     # hoppings in y-directions
-     syst[kwant.builder.HoppingKind((0, 1), lat, lat)] = -t
- 
-     # It's a closed system for a change, so no leads
-     return syst
- #HIDDEN_END_qlyd
- 
- 
- #HIDDEN_BEGIN_yvri
- def plot_spectrum(syst, Bfields):
- 
-     energies = []
-     for B in Bfields:
-         # Obtain the Hamiltonian as a sparse matrix
-         ham_mat = syst.hamiltonian_submatrix(params=dict(B=B), sparse=True)
- 
-         # we only calculate the 15 lowest eigenvalues
-         ev = sla.eigsh(ham_mat.tocsc(), k=15, sigma=0,
-                        return_eigenvectors=False)
- 
-         energies.append(ev)
- 
--    pyplot.figure()
-+    fig = pyplot.figure()
-     pyplot.plot(Bfields, energies)
--    pyplot.xlabel("magnetic field [arbitrary units]")
--    pyplot.ylabel("energy [t]")
--    pyplot.show()
-+    pyplot.xlabel("magnetic field [arbitrary units]",
-+                  fontsize=_defs.mpl_label_size)
-+    pyplot.ylabel("energy [t]", fontsize=_defs.mpl_label_size)
-+    pyplot.setp(fig.get_axes()[0].get_xticklabels(),
-+                fontsize=_defs.mpl_tick_size)
-+    pyplot.setp(fig.get_axes()[0].get_yticklabels(),
-+                fontsize=_defs.mpl_tick_size)
-+    fig.set_size_inches(_defs.mpl_width_in, _defs.mpl_width_in * 3. / 4.)
-+    fig.subplots_adjust(left=0.15, right=0.95, top=0.95, bottom=0.15)
-+    for extension in ('pdf', 'png'):
-+        fig.savefig("closed_system_result." + extension, dpi=_defs.dpi)
- #HIDDEN_END_yvri
- 
- def sorted_eigs(ev):
-     evals, evecs = ev
-     evals, evecs = map(np.array, zip(*sorted(zip(evals, evecs.transpose()))))
-     return evals, evecs.transpose()
- 
- #HIDDEN_BEGIN_wave
- def plot_wave_function(syst, B=0.001):
-+    size = (_defs.figwidth_in, _defs.figwidth_in)
-+
-     # Calculate the wave functions in the system.
-     ham_mat = syst.hamiltonian_submatrix(sparse=True, params=dict(B=B))
-     evals, evecs = sorted_eigs(sla.eigsh(ham_mat.tocsc(), k=20, sigma=0))
- 
-     # Plot the probability density of the 10th eigenmode.
--    kwant.plotter.map(syst, np.abs(evecs[:, 9])**2,
--                      colorbar=False, oversampling=1)
-+    for extension in ('pdf', 'png'):
-+        kwant.plotter.map(
-+            syst, np.abs(evecs[:, 9])**2, colorbar=False, oversampling=1,
-+            file="closed_system_eigenvector." + extension,
-+            fig_size=size, dpi=_defs.dpi)
- #HIDDEN_END_wave
- 
- 
- #HIDDEN_BEGIN_current
- def plot_current(syst, B=0.001):
-+    size = (_defs.figwidth_in, _defs.figwidth_in)
-+
-     # Calculate the wave functions in the system.
-     ham_mat = syst.hamiltonian_submatrix(sparse=True, params=dict(B=B))
-     evals, evecs = sorted_eigs(sla.eigsh(ham_mat.tocsc(), k=20, sigma=0))
- 
-     # Calculate and plot the local current of the 10th eigenmode.
-     J = kwant.operator.Current(syst)
-     current = J(evecs[:, 9], params=dict(B=B))
--    kwant.plotter.current(syst, current, colorbar=False)
-+    for extension in ('pdf', 'png'):
-+        kwant.plotter.current(
-+            syst, current, colorbar=False,
-+            file="closed_system_current." + extension,
-+            fig_size=size, dpi=_defs.dpi)
- #HIDDEN_END_current
- 
- 
- def main():
-     syst = make_system()
- 
--    # Check that the system looks as intended.
--    kwant.plot(syst)
--
-     # Finalize the system.
-     syst = syst.finalized()
- 
-     # The following try-clause can be removed once SciPy 0.9 becomes uncommon.
-     try:
-         # We should observe energy levels that flow towards Landau
-         # level energies with increasing magnetic field.
-         plot_spectrum(syst, [iB * 0.002 for iB in range(100)])
- 
-         # Plot an eigenmode of a circular dot. Here we create a larger system for
-         # better spatial resolution.
-         syst = make_system(r=30).finalized()
-         plot_wave_function(syst)
-         plot_current(syst)
-     except ValueError as e:
-         if e.message == "Input matrix is not real-valued.":
-             print("The calculation of eigenvalues failed because of a bug in SciPy 0.9.")
-             print("Please upgrade to a newer version of SciPy.")
-         else:
-             raise
- 
- 
- # Call the main function if the script gets executed (as opposed to imported).
- # See <http://docs.python.org/library/__main__.html>.
- if __name__ == '__main__':
-     main()
diff --git a/doc/source/code/figure/discretize.py.diff b/doc/source/code/figure/discretize.py.diff
deleted file mode 100644
index aebaf3e0..00000000
--- a/doc/source/code/figure/discretize.py.diff
+++ /dev/null
@@ -1,248 +0,0 @@
-@@ -1,225 +1,239 @@
- # Tutorial 2.9. Processing continuum Hamiltonians with discretize
- # ===============================================================
- #
- # Physics background
- # ------------------
- #  - tight-binding approximation of continuous Hamiltonians
- #
- # Kwant features highlighted
- # --------------------------
- #  - kwant.continuum.discretize
- 
-+import _defs
- 
- import kwant
- #HIDDEN_BEGIN_import
- import kwant.continuum
- #HIDDEN_END_import
- import scipy.sparse.linalg
- import scipy.linalg
- import numpy as np
- 
- # For plotting
- import matplotlib as mpl
- from matplotlib import pyplot as plt
- 
- 
-+def save_figure(file_name):
-+    if not file_name:
-+        return
-+    for extension in ('pdf', 'png'):
-+        plt.savefig('.'.join((file_name,extension)),
-+                    dpi=_defs.dpi, bbox_inches='tight')
-+
-+
- def stadium_system(L=20, W=20):
- #HIDDEN_BEGIN_template
-     hamiltonian = "k_x**2 + k_y**2 + V(x, y)"
-     template = kwant.continuum.discretize(hamiltonian)
--    print(template)
-+    with open('discretizer_verbose.txt', 'w') as f:
-+        print(template, file=f)
- #HIDDEN_END_template
- 
- #HIDDEN_BEGIN_fill
-     def stadium(site):
-         (x, y) = site.pos
-         x = max(abs(x) - 20, 0)
-         return x**2 + y**2 < 30**2
- 
-     syst = kwant.Builder()
-     syst.fill(template, stadium, (0, 0));
-     syst = syst.finalized()
- #HIDDEN_END_fill
-     return syst
- 
- 
- #HIDDEN_BEGIN_plot_eigenstate
- def plot_eigenstate(syst, n=2, Vx=.0003, Vy=.0005):
- 
-     def potential(x, y):
-         return Vx * x + Vy * y
- 
-     ham = syst.hamiltonian_submatrix(params=dict(V=potential), sparse=True)
-     evecs = scipy.sparse.linalg.eigsh(ham, k=10, which='SM')[1]
-     kwant.plotter.map(syst, abs(evecs[:, n])**2, show=False)
- #HIDDEN_END_plot_eigenstate
--    plt.show()
-+    save_figure('discretizer_gs')
- 
- 
- def qsh_system(a=20, L=2000, W=1000):
- #HIDDEN_BEGIN_define_qsh
-     hamiltonian = """
-        + C * identity(4) + M * kron(sigma_0, sigma_z)
-        - B * (k_x**2 + k_y**2) * kron(sigma_0, sigma_z)
-        - D * (k_x**2 + k_y**2) * kron(sigma_0, sigma_0)
-        + A * k_x * kron(sigma_z, sigma_x)
-        - A * k_y * kron(sigma_0, sigma_y)
-     """
- 
-     template = kwant.continuum.discretize(hamiltonian, grid=a)
- #HIDDEN_END_define_qsh
- 
- #HIDDEN_BEGIN_define_qsh_build
-     def shape(site):
-         (x, y) = site.pos
-         return (0 <= y < W and 0 <= x < L)
- 
-     def lead_shape(site):
-         (x, y) = site.pos
-         return (0 <= y < W)
- 
-     syst = kwant.Builder()
-     syst.fill(template, shape, (0, 0))
- 
-     lead = kwant.Builder(kwant.TranslationalSymmetry([-a, 0]))
-     lead.fill(template, lead_shape, (0, 0))
- 
-     syst.attach_lead(lead)
-     syst.attach_lead(lead.reversed())
- 
-     syst = syst.finalized()
- #HIDDEN_END_define_qsh_build
-     return syst
- 
- 
- def analyze_qsh():
-     params = dict(A=3.65, B=-68.6, D=-51.1, M=-0.01, C=0)
-     syst = qsh_system()
- 
- #HIDDEN_BEGIN_plot_qsh_band
-     kwant.plotter.bands(syst.leads[0], params=params,
-                         momenta=np.linspace(-0.3, 0.3, 201), show=False)
- #HIDDEN_END_plot_qsh_band
- 
-     plt.grid()
-     plt.xlim(-.3, 0.3)
-     plt.ylim(-0.05, 0.05)
-     plt.xlabel('momentum [1/A]')
-     plt.ylabel('energy [eV]')
--    plt.show()
-+    save_figure('discretizer_qsh_band')
- #HIDDEN_BEGIN_plot_qsh_wf
-+
-     # get scattering wave functions at E=0
-     wf = kwant.wave_function(syst, energy=0, params=params)
- 
-     # prepare density operators
-     sigma_z = np.array([[1, 0], [0, -1]])
-     prob_density = kwant.operator.Density(syst, np.eye(4))
-     spin_density = kwant.operator.Density(syst, np.kron(sigma_z, np.eye(2)))
- 
-     # calculate expectation values and plot them
-     wf_sqr = sum(prob_density(psi) for psi in wf(0))  # states from left lead
-     rho_sz = sum(spin_density(psi) for psi in wf(0))  # states from left lead
- 
-     fig, (ax1, ax2) = plt.subplots(1, 2, sharey=True, figsize=(16, 4))
-     kwant.plotter.map(syst, wf_sqr, ax=ax1)
-     kwant.plotter.map(syst, rho_sz, ax=ax2)
- #HIDDEN_END_plot_qsh_wf
-     ax = ax1
-     im = [obj for obj in ax.get_children()
-           if isinstance(obj, mpl.image.AxesImage)][0]
-     fig.colorbar(im, ax=ax)
- 
-     ax = ax2
-     im = [obj for obj in ax.get_children()
-           if isinstance(obj, mpl.image.AxesImage)][0]
-     fig.colorbar(im, ax=ax)
- 
-     ax1.set_title('Probability density')
-     ax2.set_title('Spin density')
--    plt.show()
-+    save_figure('discretizer_qsh_wf')
- 
- 
- def lattice_spacing():
- #HIDDEN_BEGIN_ls_def
-     hamiltonian = "k_x**2 * identity(2) + alpha * k_x * sigma_y"
-     params = dict(alpha=.5)
- #HIDDEN_END_ls_def
- 
-     def plot(ax, a=1):
- #HIDDEN_BEGIN_ls_hk_cont
-         h_k = kwant.continuum.lambdify(hamiltonian, locals=params)
-         k_cont = np.linspace(-4, 4, 201)
-         e_cont = [scipy.linalg.eigvalsh(h_k(k_x=ki)) for ki in k_cont]
- #HIDDEN_END_ls_hk_cont
- 
- #HIDDEN_BEGIN_ls_hk_tb
-         template = kwant.continuum.discretize(hamiltonian, grid=a)
-         syst = kwant.wraparound.wraparound(template).finalized()
- 
-         def h_k(k_x):
-             p = dict(k_x=k_x, **params)
-             return syst.hamiltonian_submatrix(params=p)
- 
-         k_tb = np.linspace(-np.pi/a, np.pi/a, 201)
-         e_tb = [scipy.linalg.eigvalsh(h_k(k_x=a*ki)) for ki in k_tb]
- #HIDDEN_END_ls_hk_tb
- 
-         ax.plot(k_cont, e_cont, 'r-')
-         ax.plot(k_tb, e_tb, 'k-')
- 
-         ax.plot([], [], 'r-', label='continuum')
-         ax.plot([], [], 'k-', label='tight-binding')
- 
-         ax.set_xlim(-4, 4)
-         ax.set_ylim(-1, 14)
-         ax.set_title('a={}'.format(a))
- 
-         ax.set_xlabel('momentum [a.u.]')
-         ax.set_ylabel('energy [a.u.]')
-         ax.grid()
-         ax.legend()
- 
-     _, (ax1, ax2) = plt.subplots(1, 2, sharey=True, figsize=(12, 4))
- 
-     plot(ax1, a=1)
-     plot(ax2, a=.25)
--    plt.show()
-+    save_figure('discretizer_lattice_spacing')
- 
- 
- def substitutions():
- #HIDDEN_BEGIN_subs_1
-     sympify = kwant.continuum.sympify
-     subs = {'sx': [[0, 1], [1, 0]], 'sz': [[1, 0], [0, -1]]}
- 
-     e = (
-         sympify('[[k_x**2, alpha * k_x], [k_x * alpha, -k_x**2]]'),
-         sympify('k_x**2 * sigma_z + alpha * k_x * sigma_x'),
-         sympify('k_x**2 * sz + alpha * k_x * sx', locals=subs),
-     )
- 
--    print(e[0] == e[1] == e[2])
-+    with open('discretizer_subs_1.txt', 'w') as f:
-+        print(e[0] == e[1] == e[2], file=f)
- #HIDDEN_END_subs_1
- 
- #HIDDEN_BEGIN_subs_2
-     subs = {'A': 'A(x) + B', 'V': 'V(x) + V_0', 'C': 5}
--    print(sympify('k_x * A * k_x + V + C', locals=subs))
-+    with open('discretizer_subs_2.txt', 'w') as f:
-+        print(sympify('k_x * A * k_x + V + C', locals=subs), file=f)
- #HIDDEN_END_subs_2
- 
- 
- def main():
- #HIDDEN_BEGIN_symbolic_discretization
-     template = kwant.continuum.discretize('k_x * A(x) * k_x')
--    print(template)
-+    with open('discretizer_intro_verbose.txt', 'w') as f:
-+        print(template, file=f)
- #HIDDEN_END_symbolic_discretization
- 
-     syst = stadium_system()
-     plot_eigenstate(syst)
- 
-     analyze_qsh()
-     lattice_spacing()
-     substitutions()
- 
- # Call the main function if the script gets executed (as opposed to imported).
- # See <http://docs.python.org/library/__main__.html>.
- if __name__ == '__main__':
-     main()
diff --git a/doc/source/code/figure/faq.py.diff b/doc/source/code/figure/faq.py.diff
deleted file mode 100644
index 7c8889dc..00000000
--- a/doc/source/code/figure/faq.py.diff
+++ /dev/null
@@ -1,483 +0,0 @@
-@@ -1,450 +1,479 @@
- # Frequently asked questions
- #
- # This script is a disorganized collection of code snippets.  As a whole, it is
- # not meant as an example of good programming practice.
- 
-+import _defs
- import kwant
- import numpy as np
- import tinyarray
- import matplotlib
- from matplotlib import pyplot as plt
- matplotlib.rcParams['figure.figsize'] = (3.5, 3.5)
- 
- 
-+def save_figure(file_name):
-+    for extension in ('pdf', 'png'):
-+        plt.savefig('.'.join((file_name, extension)),
-+                    dpi=_defs.dpi, bbox_inches='tight')
-+
-+
- #### What is a Site?
- 
- #HIDDEN_BEGIN_site
- a = 1
- lat = kwant.lattice.square(a)
- syst = kwant.Builder()
- 
- syst[lat(1, 0)] = 4
- syst[lat(1, 1)] = 4
- 
- kwant.plot(syst)
-+save_figure("faq_site")
- #HIDDEN_END_site
- 
- 
- #### What is a hopping?
- 
- a = 1
- lat = kwant.lattice.square(a)
- syst = kwant.Builder()
- 
- syst[lat(1, 0)] = 4
- syst[lat(1, 1)] = 4
- #HIDDEN_BEGIN_hopping
- syst[(lat(1, 0), lat(1, 1))] = 1j
- #HIDDEN_END_hopping
- 
- kwant.plot(syst)
-+save_figure("faq_hopping")
- 
- 
- #### What is a lattice?
- 
- #HIDDEN_BEGIN_lattice_monatomic
- # Two monatomic lattices
- primitive_vectors = [(1, 0), (0, 1)]
- lat_a = kwant.lattice.Monatomic(primitive_vectors, offset=(0, 0))
- lat_b = kwant.lattice.Monatomic(primitive_vectors, offset=(0.5, 0.5))
- # lat1 is equivalent to kwant.lattice.square()
- 
- syst = kwant.Builder()
- 
- syst[lat_a(0, 0)] = 4
- syst[lat_b(0, 0)] = 4
- 
- kwant.plot(syst)
-+save_figure("faq_lattice")
- #HIDDEN_END_lattice_monatomic
- 
- #HIDDEN_BEGIN_lattice_polyatomic
- # One polyatomic lattice containing two sublattices
- lat = kwant.lattice.Polyatomic([(1, 0), (0, 1)], [(0, 0), (0.5, 0.5)])
- sub_a, sub_b = lat.sublattices
- #HIDDEN_END_lattice_polyatomic
- 
- #### How to make a hole in a system?
- 
- #HIDDEN_BEGIN_hole
- # Define the lattice and the (empty) system
- a = 2
- lat = kwant.lattice.cubic(a)
- syst = kwant.Builder()
- 
- L = 10
- W = 10
- H = 2
- 
- # Add sites to the system in a cuboid
- 
- syst[(lat(i, j, k) for i in range(L) for j in range(W) for k in range(H))] = 4
- kwant.plot(syst)
-+save_figure("faq_hole1")
- 
- # Delete sites to create a hole
- 
- def in_hole(site):
-     x, y, z = site.pos / a - (L/2, W/2, H/2)  # position relative to centre
-     return abs(x) < L / 4 and abs(y) < W / 4
- 
- for site in filter(in_hole, list(syst.sites())):
-     del syst[site]
- 
- kwant.plot(syst)
-+save_figure("faq_hole2")
- #HIDDEN_END_hole
- 
- 
- #### How can we get access to the sites of our system?
- 
- builder = kwant.Builder()
- lat = kwant.lattice.square()
- builder[(lat(i, j) for i in range(3) for j in range(3))] = 4
- #HIDDEN_BEGIN_sites1
- # Before finalizing the system
- 
- sites = list(builder.sites())  # sites() doe *not* return a list
- #HIDDEN_END_sites1
- #HIDDEN_BEGIN_sites2
- # After finalizing the system
- syst = builder.finalized()
- sites = syst.sites  # syst.sites is an actual list
- #HIDDEN_END_sites2
- #HIDDEN_BEGIN_sites3
- i = syst.id_by_site[lat(0, 2)]  # we want the id of the site lat(0, 2)
- #HIDDEN_END_sites3
- 
- 
- #### How to plot a polyatomic lattice with different colors?
- 
- #HIDDEN_BEGIN_colors1
- lat = kwant.lattice.kagome()
- syst = kwant.Builder()
- 
- a, b, c = lat.sublattices  # The kagome lattice has 3 sublattices
- #HIDDEN_END_colors1
- 
- #HIDDEN_BEGIN_colors2
- # Plot sites from different families in different colors
- def family_color(site):
-     if site.family == a:
-         return 'red'
-     if site.family == b:
-         return 'green'
-     else:
-         return 'blue'
- 
- def plot_system(syst):
-     kwant.plot(syst, site_lw=0.1, site_color=family_color)
- 
- ## Add sites and hoppings.
- for i in range(4):
-     for j in range (4):
-         syst[a(i, j)] = 4
-         syst[b(i, j)] = 4
-         syst[c(i, j)] = 4
- 
- syst[lat.neighbors()] = -1
- 
- ## Plot the system.
- plot_system(syst)
-+save_figure("faq_colors")
- #HIDDEN_END_colors2
- 
--
- #### How to create all hoppings in a given direction using Hoppingkind?
- 
- # Monatomic lattice
- 
- #HIDDEN_BEGIN_direction1
- # Create hopping between neighbors with HoppingKind
- a = 1
- syst = kwant.Builder()
- lat = kwant.lattice.square(a)
- syst[ (lat(i, j) for i in range(5) for j in range(5)) ] = 4
- 
- syst[kwant.builder.HoppingKind((1, 0), lat)] = -1
- kwant.plot(syst)
-+save_figure("faq_direction1")
- #HIDDEN_END_direction1
- 
- # Polyatomic lattice
- 
- lat = kwant.lattice.kagome()
- syst = kwant.Builder()
- 
- a, b, c = lat.sublattices  # The kagome lattice has 3 sublattices
- 
- def family_color(site):
-     if site.family == a:
-         return 'red'
-     if site.family == b:
-         return 'green'
-     else:
-         return 'blue'
- 
- def plot_system(syst):
-     kwant.plot(syst, site_size=0.15, site_lw=0.05, site_color=family_color)
- 
- 
- for i in range(4):
-     for j in range (4):
-         syst[a(i, j)] = 4
-         syst[b(i, j)] = 4
-         syst[c(i, j)] = 4
- 
- 
- #HIDDEN_BEGIN_direction2
- # equivalent to syst[kwant.builder.HoppingKind((0, 1), b)] = -1
- syst[kwant.builder.HoppingKind((0, 1), b, b)] = -1
- #HIDDEN_END_direction2
- plot_system(syst)
-+save_figure("faq_direction2")
- # Delete the hoppings previously created
- del syst[kwant.builder.HoppingKind((0, 1), b, b)]
- #HIDDEN_BEGIN_direction3
- syst[kwant.builder.HoppingKind((0, 0), a, b)] = -1
- syst[kwant.builder.HoppingKind((0, 0), a, c)] = -1
- syst[kwant.builder.HoppingKind((0, 0), c, b)] = -1
- #HIDDEN_END_direction3
- plot_system(syst)
-+save_figure("faq_direction3")
- 
- 
- #### How to create the hoppings between adjacent sites?
- 
- # Monatomic lattice
- 
- #HIDDEN_BEGIN_adjacent1
- # Create hoppings with lat.neighbors()
- syst = kwant.Builder()
- lat = kwant.lattice.square()
- syst[(lat(i, j) for i in range(3) for j in range(3))] = 4
- 
- syst[lat.neighbors()] = -1  # Equivalent to lat.neighbors(1)
- kwant.plot(syst)
-+save_figure("faq_adjacent1")
- 
- del syst[lat.neighbors()]  # Delete all nearest-neighbor hoppings
- syst[lat.neighbors(2)] = -1
- 
- kwant.plot(syst)
-+save_figure("faq_adjacent2")
- #HIDDEN_END_adjacent1
- 
- # Polyatomic lattice
- 
- #HIDDEN_BEGIN_FAQ6
- 
- # Hoppings using .neighbors()
- #HIDDEN_BEGIN_adjacent2
- # Create the system
- lat = kwant.lattice.kagome()
- syst = kwant.Builder()
- a, b, c = lat.sublattices  # The kagome lattice has 3 sublattices
- 
- for i in range(4):
-     for j in range (4):
-         syst[a(i, j)] = 4  # red
-         syst[b(i, j)] = 4  # green
-         syst[c(i, j)] = 4  # blue
- 
- syst[lat.neighbors()] = -1
- #HIDDEN_END_adjacent2
- plot_system(syst)
-+save_figure("faq_adjacent3")
- del syst[lat.neighbors()]  # Delete the hoppings previously created
- #HIDDEN_BEGIN_adjacent3
- syst[a.neighbors()] = -1
- #HIDDEN_END_adjacent3
- plot_system(syst)
-+save_figure("faq_adjacent4")
- del syst[a.neighbors()]  # Delete the hoppings previously created
- 
- 
- syst[lat.neighbors(2)] = -1
- plot_system(syst)
- del syst[lat.neighbors(2)]
- 
- 
- #### How to create a lead with a lattice different from the scattering region?
- 
- # Plot sites from different families in different colors
- 
- def plot_system(syst):
- 
-     def family_color(site):
-         if site.family == subA:
-             return 'blue'
-         if site.family == subB:
-             return 'yellow'
-         else:
-             return 'green'
- 
-     kwant.plot(syst, site_lw=0.1, site_color=family_color)
- 
- 
- #HIDDEN_BEGIN_different_lattice1
- # Define the scattering Region
- L = 5
- W = 5
- 
- lat = kwant.lattice.honeycomb()
- subA, subB = lat.sublattices
- 
- syst = kwant.Builder()
- syst[(subA(i, j) for i in range(L) for j in range(W))] = 4
- syst[(subB(i, j) for i in range(L) for j in range(W))] = 4
- syst[lat.neighbors()] = -1
- #HIDDEN_END_different_lattice1
- plot_system(syst)
-+save_figure("faq_different_lattice1")
- 
- #HIDDEN_BEGIN_different_lattice2
- # Create a lead
- lat_lead = kwant.lattice.square()
- sym_lead1 = kwant.TranslationalSymmetry((0, 1))
- 
- lead1 = kwant.Builder(sym_lead1)
- lead1[(lat_lead(i, 0) for i in range(2, 7))] = 4
- lead1[lat_lead.neighbors()] = -1
- #HIDDEN_END_different_lattice2
- plot_system(lead1)
-+save_figure("faq_different_lattice2")
- 
- #HIDDEN_BEGIN_different_lattice3
- syst[(lat_lead(i, 5) for i in range(2, 7))] = 4
- syst[lat_lead.neighbors()] = -1
- 
- # Manually attach sites from graphene to square lattice
- syst[((lat_lead(i+2, 5), subB(i, 4)) for i in range(5))] = -1
- #HIDDEN_END_different_lattice3
- plot_system(syst)
-+save_figure("faq_different_lattice3")
- 
- #HIDDEN_BEGIN_different_lattice4
- syst.attach_lead(lead1)
- #HIDDEN_END_different_lattice4
- plot_system(syst)
-+save_figure("faq_different_lattice4")
- 
- 
- #### How to cut a finite system out of a system with translationnal symmetries?
- 
- #HIDDEN_BEGIN_fill1
- # Create 3d model.
- cubic = kwant.lattice.cubic()
- sym_3d = kwant.TranslationalSymmetry([1, 0, 0], [0, 1, 0], [0, 0, 1])
- model = kwant.Builder(sym_3d)
- model[cubic(0, 0, 0)] = 4
- model[cubic.neighbors()] = -1
- #HIDDEN_END_fill1
- 
- #HIDDEN_BEGIN_fill2
- # Build scattering region (white).
- def cuboid_shape(site):
-     x, y, z = abs(site.pos)
-     return x < 4 and y < 10 and z < 3
- 
- cuboid = kwant.Builder()
- cuboid.fill(model, cuboid_shape, (0, 0, 0));
- #HIDDEN_END_fill2
- kwant.plot(cuboid);
-+save_figure("faq_fill2")
- 
- #HIDDEN_BEGIN_fill3
- # Build electrode (black).
- def electrode_shape(site):
-     x, y, z = site.pos - (0, 5, 2)
-     return y**2 + z**2 < 2.3**2
- 
- electrode = kwant.Builder(kwant.TranslationalSymmetry([1, 0, 0]))
- electrode.fill(model, electrode_shape, (0, 5, 2))  # lead
- 
- # Scattering region
- cuboid.fill(electrode, lambda s: abs(s.pos[0]) < 7, (0, 5, 4))
- 
- cuboid.attach_lead(electrode)
- #HIDDEN_END_fill3
- kwant.plot(cuboid);
-+save_figure("faq_fill3")
- 
- 
- #### How does Kwant order the propagating modes of a lead?
- 
- #HIDDEN_BEGIN_pm
- lat = kwant.lattice.square()
- 
- lead = kwant.Builder(kwant.TranslationalSymmetry((-1, 0)))
- lead[(lat(0, i) for i in range(3))] = 4
- lead[lat.neighbors()] = -1
- 
- flead = lead.finalized()
- 
- E = 2.5
- prop_modes, _ = flead.modes(energy=E)
- #HIDDEN_END_pm
- 
- def plot_and_label_modes(lead, E):
-     # Plot the different modes
-     pmodes, _ = lead.modes(energy=E)
-     kwant.plotter.bands(lead, show=False)
-     for i, k in enumerate(pmodes.momenta):
-         plt.plot(k, E, 'ko')
-         plt.annotate(str(i), xy=(k, E), xytext=(-5, 8),
-                      textcoords='offset points',
-                      bbox=dict(boxstyle='round,pad=0.1',fc='white', alpha=0.7))
-     plt.plot([-3, 3], [E, E], 'r--')
-     plt.ylim(E-1, E+1)
-     plt.xlim(-2, 2)
-     plt.xlabel("momentum")
-     plt.ylabel("energy")
-     plt.show()
- 
- plot_and_label_modes(flead, E)
-+save_figure('faq_pm1')
- 
- # More involved example
- 
- s0 = np.eye(2)
- sz = np.array([[1, 0], [0, -1]])
- 
- lead2 = kwant.Builder(kwant.TranslationalSymmetry((-1, 0)))
- 
- lead2[(lat(0, i) for i in range(2))] = np.diag([1.8, -1])
- lead2[lat.neighbors()] = -1 * sz
- 
- flead2 = lead2.finalized()
- 
- plot_and_label_modes(flead2, 1)
-+save_figure('faq_pm2')
- 
- 
- #### How does Kwant order components of an individual wavefunction?
- def circle(R):
-     return lambda r: np.linalg.norm(r) < R
- 
- 
- def make_system(lat):
-     norbs = lat.norbs
-     syst = kwant.Builder()
-     syst[lat.shape(circle(3), (0, 0))] = 4 * np.eye(norbs)
-     syst[lat.neighbors()] = -1 * np.eye(norbs)
- 
-     lead = kwant.Builder(kwant.TranslationalSymmetry((-1, 0)))
-     lead[(lat(0, i) for i in range(-1, 2))] = 4 * np.eye(norbs)
-     lead[lat.neighbors()] = -1 * np.eye(norbs)
- 
-     syst.attach_lead(lead)
-     syst.attach_lead(lead.reversed())
- 
-     return syst.finalized()
- 
- 
- #HIDDEN_BEGIN_ord1
- lat = kwant.lattice.square(norbs=1)
- syst = make_system(lat)
- scattering_states = kwant.wave_function(syst, energy=1)
- wf = scattering_states(0)[0]  # scattering state from lead 0 incoming in mode 0
- 
- idx = syst.id_by_site[lat(0, 0)]  # look up index of site
- 
--print('wavefunction on lat(0, 0): ', wf[idx])
-+with open('faq_ord1.txt', 'w') as f:
-+    print('wavefunction on lat(0, 0): ', wf[idx], file=f)
- #HIDDEN_END_ord1
- 
- #HIDDEN_BEGIN_ord2
- lat = kwant.lattice.square(norbs=2)
- syst = make_system(lat)
- scattering_states = kwant.wave_function(syst, energy=1)
- wf = scattering_states(0)[0]  # scattering state from lead 0 incoming in mode 0
- 
- idx = syst.id_by_site[lat(0, 0)]  # look up index of site
- 
- # Group consecutive degrees of freedom from 'wf' together; these correspond
- # to degrees of freedom on the same site.
- wf = wf.reshape(-1, 2)
- 
--print('wavefunction on lat(0, 0): ', wf[idx])
-+with open('faq_ord2.txt', 'w') as f:
-+    print('wavefunction on lat(0, 0): ', wf[idx], file=f)
- #HIDDEN_END_ord2
diff --git a/doc/source/code/figure/graphene.py.diff b/doc/source/code/figure/graphene.py.diff
deleted file mode 100644
index 1352ed27..00000000
--- a/doc/source/code/figure/graphene.py.diff
+++ /dev/null
@@ -1,217 +0,0 @@
-@@ -1,179 +1,203 @@
- # Tutorial 2.5. Beyond square lattices: graphene
- # ==============================================
- #
- # Physics background
- # ------------------
- #  Transport through a graphene quantum dot with a pn-junction
- #
- # Kwant features highlighted
- # --------------------------
- #  - Application of all the aspects of tutorials 1-3 to a more complicated
- #    lattice, namely graphene
- 
-+import _defs
- from math import pi, sqrt, tanh
- 
- import kwant
- 
- # For computing eigenvalues
- import scipy.sparse.linalg as sla
- 
- # For plotting
- from matplotlib import pyplot
- 
- 
- # Define the graphene lattice
- sin_30, cos_30 = (1 / 2, sqrt(3) / 2)
- #HIDDEN_BEGIN_hnla
- graphene = kwant.lattice.general([(1, 0), (sin_30, cos_30)],
-                                  [(0, 0), (0, 1 / sqrt(3))])
- a, b = graphene.sublattices
- #HIDDEN_END_hnla
- 
- 
- #HIDDEN_BEGIN_shzy
- def make_system(r=10, w=2.0, pot=0.1):
- 
-     #### Define the scattering region. ####
-     # circular scattering region
-     def circle(pos):
-         x, y = pos
-         return x ** 2 + y ** 2 < r ** 2
- 
-     syst = kwant.Builder()
- 
-     # w: width and pot: potential maximum of the p-n junction
-     def potential(site):
-         (x, y) = site.pos
-         d = y * cos_30 + x * sin_30
-         return pot * tanh(d / w)
- 
-     syst[graphene.shape(circle, (0, 0))] = potential
- #HIDDEN_END_shzy
- 
-     # specify the hoppings of the graphene lattice in the
-     # format expected by builder.HoppingKind
- #HIDDEN_BEGIN_hsmc
-     hoppings = (((0, 0), a, b), ((0, 1), a, b), ((-1, 1), a, b))
- #HIDDEN_END_hsmc
- #HIDDEN_BEGIN_bfwb
-     syst[[kwant.builder.HoppingKind(*hopping) for hopping in hoppings]] = -1
- #HIDDEN_END_bfwb
- 
-     # Modify the scattering region
- #HIDDEN_BEGIN_efut
-     del syst[a(0, 0)]
-     syst[a(-2, 1), b(2, 2)] = -1
- #HIDDEN_END_efut
- 
-     #### Define the leads. ####
- #HIDDEN_BEGIN_aakh
-     # left lead
-     sym0 = kwant.TranslationalSymmetry(graphene.vec((-1, 0)))
- 
-     def lead0_shape(pos):
-         x, y = pos
-         return (-0.4 * r < y < 0.4 * r)
- 
-     lead0 = kwant.Builder(sym0)
-     lead0[graphene.shape(lead0_shape, (0, 0))] = -pot
-     lead0[[kwant.builder.HoppingKind(*hopping) for hopping in hoppings]] = -1
- 
-     # The second lead, going to the top right
-     sym1 = kwant.TranslationalSymmetry(graphene.vec((0, 1)))
- 
-     def lead1_shape(pos):
-         v = pos[1] * sin_30 - pos[0] * cos_30
-         return (-0.4 * r < v < 0.4 * r)
- 
-     lead1 = kwant.Builder(sym1)
-     lead1[graphene.shape(lead1_shape, (0, 0))] = pot
-     lead1[[kwant.builder.HoppingKind(*hopping) for hopping in hoppings]] = -1
- #HIDDEN_END_aakh
- 
- #HIDDEN_BEGIN_kmmw
-     return syst, [lead0, lead1]
- #HIDDEN_END_kmmw
- 
- 
- #HIDDEN_BEGIN_zydk
- def compute_evs(syst):
-     # Compute some eigenvalues of the closed system
-     sparse_mat = syst.hamiltonian_submatrix(sparse=True)
- 
-     evs = sla.eigs(sparse_mat, 2)[0]
-     print(evs.real)
- #HIDDEN_END_zydk
- 
- 
- def plot_conductance(syst, energies):
-     # Compute transmission as a function of energy
-     data = []
-     for energy in energies:
-         smatrix = kwant.smatrix(syst, energy)
-         data.append(smatrix.transmission(0, 1))
- 
--    pyplot.figure()
-+    fig = pyplot.figure()
-     pyplot.plot(energies, data)
--    pyplot.xlabel("energy [t]")
--    pyplot.ylabel("conductance [e^2/h]")
--    pyplot.show()
-+    pyplot.xlabel("energy [t]",
-+                 fontsize=_defs.mpl_label_size)
-+    pyplot.ylabel("conductance [e^2/h]",
-+                 fontsize=_defs.mpl_label_size)
-+    pyplot.setp(fig.get_axes()[0].get_xticklabels(),
-+               fontsize=_defs.mpl_tick_size)
-+    pyplot.setp(fig.get_axes()[0].get_yticklabels(),
-+               fontsize=_defs.mpl_tick_size)
-+    fig.set_size_inches(_defs.mpl_width_in, _defs.mpl_width_in * 3. / 4.)
-+    fig.subplots_adjust(left=0.15, right=0.95, top=0.95, bottom=0.15)
-+    for extension in ('pdf', 'png'):
-+        fig.savefig("graphene_result." + extension, dpi=_defs.dpi)
- 
- 
- def plot_bandstructure(flead, momenta):
-     bands = kwant.physics.Bands(flead)
-     energies = [bands(k) for k in momenta]
- 
--    pyplot.figure()
-+    fig = pyplot.figure()
-     pyplot.plot(momenta, energies)
--    pyplot.xlabel("momentum [(lattice constant)^-1]")
--    pyplot.ylabel("energy [t]")
--    pyplot.show()
-+    pyplot.xlabel("momentum [(lattice constant)^-1]",
-+                 fontsize=_defs.mpl_label_size)
-+    pyplot.ylabel("energy [t]",
-+                 fontsize=_defs.mpl_label_size)
-+    pyplot.setp(fig.get_axes()[0].get_xticklabels(),
-+               fontsize=_defs.mpl_tick_size)
-+    pyplot.setp(fig.get_axes()[0].get_yticklabels(),
-+               fontsize=_defs.mpl_tick_size)
-+    fig.set_size_inches(_defs.mpl_width_in, _defs.mpl_width_in * 3. / 4.)
-+    fig.subplots_adjust(left=0.15, right=0.95, top=0.95, bottom=0.15)
-+    for extension in ('pdf', 'png'):
-+        fig.savefig("graphene_bs." + extension, dpi=_defs.dpi)
- 
- 
- #HIDDEN The part of the following code block which begins with family_colors
- #HIDDEN is included verbatim in the tutorial text because nested code examples
- #HIDDEN are not supported.  Remember to update the tutorial text when you
- #HIDDEN modify this block.
- #HIDDEN_BEGIN_itkk
- def main():
-     pot = 0.1
-     syst, leads = make_system(pot=pot)
- 
-     # To highlight the two sublattices of graphene, we plot one with
-     # a filled, and the other one with an open circle:
-     def family_colors(site):
-         return 0 if site.family == a else 1
- 
--    # Plot the closed system without leads.
--    kwant.plot(syst, site_color=family_colors, site_lw=0.1, colorbar=False)
-+    size = (_defs.figwidth_in, _defs.figwidth_in)
-+    for extension in ('pdf', 'png'):
-+        kwant.plot(syst, site_color=family_colors, site_lw=0.1, colorbar=False,
-+                   file="graphene_syst1." + extension,
-+                   fig_size=size, dpi=_defs.dpi)
- #HIDDEN_END_itkk
- 
-     # Compute some eigenvalues.
- #HIDDEN_BEGIN_jmbi
-     compute_evs(syst.finalized())
- #HIDDEN_END_jmbi
- 
-     # Attach the leads to the system.
-     for lead in leads:
-         syst.attach_lead(lead)
- 
--    # Then, plot the system with leads.
--    kwant.plot(syst, site_color=family_colors, site_lw=0.1,
--               lead_site_lw=0, colorbar=False)
-+    size = (_defs.figwidth_in, 0.9 * _defs.figwidth_in)
-+    for extension in ('pdf', 'png'):
-+        kwant.plot(syst, site_color=family_colors, colorbar=False, site_lw=0.1,
-+                   file="graphene_syst2." + extension,
-+                   fig_size=size, dpi=_defs.dpi, lead_site_lw=0)
- 
-     # Finalize the system.
-     syst = syst.finalized()
- 
-     # Compute the band structure of lead 0.
-     momenta = [-pi + 0.02 * pi * i for i in range(101)]
-     plot_bandstructure(syst.leads[0], momenta)
- 
-     # Plot conductance.
-     energies = [-2 * pot + 4. / 50. * pot * i for i in range(51)]
-     plot_conductance(syst, energies)
- 
- 
- # Call the main function if the script gets executed (as opposed to imported).
- # See <http://docs.python.org/library/__main__.html>.
- if __name__ == '__main__':
-     main()
diff --git a/doc/source/code/figure/kernel_polynomial_method.py.diff b/doc/source/code/figure/kernel_polynomial_method.py.diff
deleted file mode 100644
index 3ac53251..00000000
--- a/doc/source/code/figure/kernel_polynomial_method.py.diff
+++ /dev/null
@@ -1,374 +0,0 @@
-@@ -1,219 +1,242 @@
- # Tutorial 2.8. Calculating spectral density with the Kernel Polynomial Method
- # ============================================================================
- #
- # Physics background
- # ------------------
- #  - Chebyshev polynomials, random trace approximation, spectral densities.
- #
- # Kwant features highlighted
- # --------------------------
- #  - kpm module,kwant operators.
- 
- import scipy
- 
-+import _defs
-+from contextlib import redirect_stdout
-+
- # For plotting
- from matplotlib import pyplot as plt
- 
- #HIDDEN_BEGIN_sys1
- # necessary imports
- import kwant
- import numpy as np
- 
- 
- # define the system
- def make_syst(r=30, t=-1, a=1):
-     syst = kwant.Builder()
-     lat = kwant.lattice.honeycomb(a, norbs=1)
- 
-     def circle(pos):
-         x, y = pos
-         return x ** 2 + y ** 2 < r ** 2
- 
-     syst[lat.shape(circle, (0, 0))] = 0.
-     syst[lat.neighbors()] = t
-     syst.eradicate_dangling()
- 
-     return syst
- #HIDDEN_END_sys1
- 
- #HIDDEN_BEGIN_sys2
- # define a Haldane system
- def make_syst_topo(r=30, a=1, t=1, t2=0.5):
-     syst = kwant.Builder()
-     lat = kwant.lattice.honeycomb(a, norbs=1, name=['a', 'b'])
- 
-     def circle(pos):
-         x, y = pos
-         return x ** 2 + y ** 2 < r ** 2
- 
-     syst[lat.shape(circle, (0, 0))] = 0.
-     syst[lat.neighbors()] = t
-     # add second neighbours hoppings
-     syst[lat.a.neighbors()] = 1j * t2
-     syst[lat.b.neighbors()] = -1j * t2
-     syst.eradicate_dangling()
- 
-     return lat, syst.finalized()
- #HIDDEN_END_sys2
- 
- 
- #HIDDEN_BEGIN_sys3
- # define the system
- def make_syst_staggered(r=30, t=-1, a=1, m=0.1):
-     syst = kwant.Builder()
-     lat = kwant.lattice.honeycomb(a, norbs=1)
- 
-     def circle(pos):
-         x, y = pos
-         return x ** 2 + y ** 2 < r ** 2
- 
-     syst[lat.a.shape(circle, (0, 0))] = m
-     syst[lat.b.shape(circle, (0, 0))] = -m
-     syst[lat.neighbors()] = t
-     syst.eradicate_dangling()
- 
-     return syst
- #HIDDEN_END_sys3
- 
- # Plot several density of states curves on the same axes.
--def plot_dos(labels_to_data):
-+def plot_dos(labels_to_data, file_name=None, ylabel="DoS [a.u.]"):
-     plt.figure(figsize=(5,4))
-     for label, (x, y) in labels_to_data:
-         plt.plot(x, y.real, label=label, linewidth=2)
-     plt.legend(loc=2, framealpha=0.5)
-     plt.xlabel("energy [t]")
-     plt.ylabel(ylabel)
--    plt.show()
-+    save_figure(file_name)
-     plt.clf()
- 
- 
- # Plot fill density of states plus curves on the same axes.
--def plot_dos_and_curves(dos labels_to_data):
-+def plot_dos_and_curves(dos, labels_to_data, file_name=None, ylabel="DoS [a.u.]"):
-     plt.figure(figsize=(5,4))
-     plt.fill_between(dos[0], dos[1], label="DoS [a.u.]",
-                      alpha=0.5, color='gray')
-     for label, (x, y) in labels_to_data:
-         plt.plot(x, y, label=label, linewidth=2)
-     plt.legend(loc=2, framealpha=0.5)
-     plt.xlabel("energy [t]")
-     plt.ylabel(ylabel)
--    plt.show()
-+    save_figure(file_name)
-     plt.clf()
- 
- def site_size_conversion(densities):
-     return 3 * np.abs(densities) / max(densities)
- 
- 
- # Plot several local density of states maps in different subplots
- def plot_ldos(syst, densities, file_name=None):
-     fig, axes = plt.subplots(1, len(densities), figsize=(7*len(densities), 7))
-     for ax, (title, rho) in zip(axes, densities):
-         kwant.plotter.density(syst, rho.real, ax=ax)
-         ax.set_title(title)
-         ax.set(adjustable='box', aspect='equal')
--    plt.show()
-+    save_figure(file_name)
-     plt.clf()
- 
-+def save_figure(file_name):
-+    if not file_name:
-+        return
-+    for extension in ('pdf', 'png'):
-+        plt.savefig('.'.join((file_name,extension)),
-+                    dpi=_defs.dpi, bbox_inches='tight')
-+
-+
- def simple_dos_example():
- #HIDDEN_BEGIN_kpm1
-     fsyst = make_syst().finalized()
- 
-     spectrum = kwant.kpm.SpectralDensity(fsyst)
- #HIDDEN_END_kpm1
- 
- #HIDDEN_BEGIN_kpm2
-     energies, densities = spectrum()
- #HIDDEN_END_kpm2
- 
- #HIDDEN_BEGIN_kpm3
-     energy_subset = np.linspace(0, 2)
-     density_subset = spectrum(energy_subset)
- #HIDDEN_END_kpm3
- 
-     plot_dos([
-         ('densities', (energies, densities)),
-         ('density subset', (energy_subset, density_subset)),
--    ])
-+     ],
-+     file_name='kpm_dos'
-+    )
- 
- 
- def dos_integrating_example(fsyst):
-     spectrum = kwant.kpm.SpectralDensity(fsyst)
- 
- #HIDDEN_BEGIN_int1
--    print('identity resolution:', spectrum.integrate())
-+    with open('kpm_normalization.txt', 'w') as f:
-+        with redirect_stdout(f):
-+            print('identity resolution:', spectrum.integrate())
- #HIDDEN_END_int1
- 
- #HIDDEN_BEGIN_int2
-     # Fermi energy 0.1 and temperature 0.2
-     fermi = lambda E: 1 / (np.exp((E - 0.1) / 0.2) + 1)
- 
--    print('number of filled states:', spectrum.integrate(fermi))
-+    with open('kpm_total_states.txt', 'w') as f:
-+        with redirect_stdout(f):
-+            print('number of filled states:', spectrum.integrate(fermi))
- #HIDDEN_END_int2
- 
- 
- def increasing_accuracy_example(fsyst):
-     spectrum = kwant.kpm.SpectralDensity(fsyst)
-     original_dos = spectrum()  # get unaltered DoS
- 
- #HIDDEN_BEGIN_acc1
-     spectrum.add_moments(energy_resolution=0.03)
- #HIDDEN_END_acc1
- 
-     increased_resolution_dos = spectrum()
- 
-     plot_dos([
-         ('density', original_dos),
-         ('higher energy resolution', increased_resolution_dos),
--    ])
-+     ],
-+     file_name='kpm_dos_acc'
-+    )
- 
- #HIDDEN_BEGIN_acc2
-     spectrum.add_moments(100)
-     spectrum.add_vectors(5)
- #HIDDEN_END_acc2
- 
-     increased_moments_dos = spectrum()
- 
-     plot_dos([
-         ('density', original_dos),
-         ('higher number of moments', increased_moments_dos),
--    ])
-+     ],
-+     file_name='kpm_dos_r'
-+    )
- 
- 
- def operator_example(fsyst):
- #HIDDEN_BEGIN_op1
-     # identity matrix
-     matrix_op = scipy.sparse.eye(len(fsyst.sites))
-     matrix_spectrum = kwant.kpm.SpectralDensity(fsyst, operator=matrix_op)
- #HIDDEN_END_op1
- 
- #HIDDEN_BEGIN_op2
-     # 'sum=True' means we sum over all the sites
-     kwant_op = kwant.operator.Density(fsyst, sum=True)
-     operator_spectrum = kwant.kpm.SpectralDensity(fsyst, operator=kwant_op)
- #HIDDEN_END_op2
- 
-     plot_dos([
-         ('identity matrix', matrix_spectrum()),
-         ('kwant.operator.Density', operator_spectrum()),
-     ])
- 
- 
- def ldos_example(fsyst):
- #HIDDEN_BEGIN_op3
-     # 'sum=False' is the default, but we include it explicitly here for clarity.
-     kwant_op = kwant.operator.Density(fsyst, sum=False)
-     local_dos = kwant.kpm.SpectralDensity(fsyst, operator=kwant_op)
- #HIDDEN_END_op3
- 
- #HIDDEN_BEGIN_op4
-     zero_energy_ldos = local_dos(energy=0)
-     finite_energy_ldos = local_dos(energy=1)
-     plot_ldos(fsyst, [
-         ('energy = 0', zero_energy_ldos),
-         ('energy = 1', finite_energy_ldos)
--    ])
-+     ],
-+     file_name='kpm_ldos'
-+    )
- #HIDDEN_END_op4
- 
- 
- def ldos_sites_example():
-     fsyst = make_syst_staggered().finalized()
- #HIDDEN_BEGIN_op5
-     # find 'A' and 'B' sites in the unit cell at the center of the disk
-     center_tag = np.array([0, 0])
-     where = lambda s: s.tag == center_tag
-     # make local vectors
-     vector_factory = kwant.kpm.LocalVectors(fsyst, where)
- #HIDDEN_END_op5
- 
- #HIDDEN_BEGIN_op6
-     # 'num_vectors' can be unspecified when using 'LocalVectors'
-     local_dos = kwant.kpm.SpectralDensity(fsyst, num_vectors=None,
-                                           vector_factory=vector_factory,
-                                           mean=False)
-     energies, densities = local_dos()
-     plot_dos([
-         ('A sublattice', (energies, densities[:, 0])),
-         ('B sublattice', (energies, densities[:, 1])),
--    ])
-+     ],
-+     file_name='kpm_ldos_sites'
-+    )
- #HIDDEN_END_op6
- 
- 
- def vector_factory_example(fsyst):
-     spectrum = kwant.kpm.SpectralDensity(fsyst)
- #HIDDEN_BEGIN_fact1
-     # construct a generator of vectors with n random elements -1 or +1.
-     n = fsyst.hamiltonian_submatrix(sparse=True).shape[0]
-     def binary_vectors():
-         while True:
-            yield np.rint(np.random.random_sample(n)) * 2 - 1
- 
-     custom_factory = kwant.kpm.SpectralDensity(fsyst,
-                                                vector_factory=binary_vectors())
- #HIDDEN_END_fact1
-     plot_dos([
-         ('default vector factory', spectrum()),
-         ('binary vector factory', custom_factory()),
-     ])
- 
- 
- def bilinear_map_operator_example(fsyst):
- #HIDDEN_BEGIN_blm
-     rho = kwant.operator.Density(fsyst, sum=True)
- 
-     # sesquilinear map that does the same thing as `rho`
-     def rho_alt(bra, ket):
-         return np.vdot(bra, ket)
- 
-     rho_spectrum = kwant.kpm.SpectralDensity(fsyst, operator=rho)
-     rho_alt_spectrum = kwant.kpm.SpectralDensity(fsyst, operator=rho_alt)
- #HIDDEN_END_blm
- 
-     plot_dos([
-         ('kwant.operator.Density', rho_spectrum()),
-         ('bilinear operator', rho_alt_spectrum()),
-     ])
- 
- def conductivity_example():
- #HIDDEN_BEGIN_cond
-     # construct the Haldane model
-     lat, fsyst = make_syst_topo()
-     # find 'A' and 'B' sites in the unit cell at the center of the disk
-     where = lambda s: np.linalg.norm(s.pos) < 1
- 
-     # component 'xx'
-     s_factory = kwant.kpm.LocalVectors(fsyst, where)
-     cond_xx = kwant.kpm.conductivity(fsyst, alpha='x', beta='x', mean=True,
-                                      num_vectors=None, vector_factory=s_factory)
-     # component 'xy'
-     s_factory = kwant.kpm.LocalVectors(fsyst, where)
-     cond_xy = kwant.kpm.conductivity(fsyst, alpha='x', beta='y', mean=True,
-                                      num_vectors=None, vector_factory=s_factory)
- 
-     energies = cond_xx.energies
-     cond_array_xx = np.array([cond_xx(e, temperature=0.01) for e in energies])
-     cond_array_xy = np.array([cond_xy(e, temperature=0.01) for e in energies])
- 
-     # area of the unit cell per site
-     area_per_site = np.abs(np.cross(*lat.prim_vecs)) / len(lat.sublattices)
-     cond_array_xx /= area_per_site
-     cond_array_xy /= area_per_site
- #HIDDEN_END_cond
-     # ldos
-     s_factory = kwant.kpm.LocalVectors(fsyst, where)
-     spectrum = kwant.kpm.SpectralDensity(fsyst, num_vectors=None,
-                                          vector_factory=s_factory)
- 
-     plot_dos_and_curves(
-     (spectrum.energies, spectrum.densities * 8),
-     [
-         (r'Longitudinal conductivity $\sigma_{xx} / 4$',
-          (energies, cond_array_xx / 4)),
-         (r'Hall conductivity $\sigma_{xy}$',
-          (energies, cond_array_xy))],
-         ylabel=r'$\sigma [e^2/h]$',
-         file_name='kpm_cond'
-     )
- 
- 
- def main():
-     simple_dos_example()
- 
-     fsyst = make_syst().finalized()
- 
-     dos_integrating_example(fsyst)
-     increasing_accuracy_example(fsyst)
-     operator_example(fsyst)
-     ldos_example(fsyst)
-     ldos_sites_example()
-     vector_factory_example(fsyst)
-     bilinear_map_operator_example(fsyst)
-     conductivity_example()
- 
- 
- # Call the main function if the script gets executed (as opposed to imported).
- # See <http://docs.python.org/library/__main__.html>.
- if __name__ == '__main__':
-     main()
diff --git a/doc/source/code/figure/magnetic_texture.py.diff b/doc/source/code/figure/magnetic_texture.py.diff
deleted file mode 100644
index a29a458e..00000000
--- a/doc/source/code/figure/magnetic_texture.py.diff
+++ /dev/null
@@ -1,286 +0,0 @@
-@@ -1,245 +1,268 @@
- # Tutorial 2.7. Spin textures
- # ===========================
- #
- # Physics background
- # ------------------
- #  - Spin textures
- #  - Skyrmions
- #
- # Kwant features highlighted
- # --------------------------
- #  - operators
- #  - plotting vector fields
- 
-+import _defs
-+from contextlib import redirect_stdout
-+
- from math import sin, cos, tanh, pi
- import itertools
- import numpy as np
- import tinyarray as ta
- import matplotlib.pyplot as plt
- 
- import kwant
- 
- sigma_0 = ta.array([[1, 0], [0, 1]])
- sigma_x = ta.array([[0, 1], [1, 0]])
- sigma_y = ta.array([[0, -1j], [1j, 0]])
- sigma_z = ta.array([[1, 0], [0, -1]])
- 
- # vector of Pauli matrices σ_αiβ where greek
- # letters denote spinor indices
- sigma = np.rollaxis(np.array([sigma_x, sigma_y, sigma_z]), 1)
- 
- #HIDDEN_BEGIN_model
- def field_direction(pos, r0, delta):
-     x, y = pos
-     r = np.linalg.norm(pos)
-     r_tilde = (r - r0) / delta
-     theta = (tanh(r_tilde) - 1) * (pi / 2)
- 
-     if r == 0:
-         m_i = [0, 0, -1]
-     else:
-         m_i = [
-             (x / r) * sin(theta),
-             (y / r) * sin(theta),
-             cos(theta),
-         ]
- 
-     return np.array(m_i)
- 
- 
- def scattering_onsite(site, r0, delta, J):
-     m_i = field_direction(site.pos, r0, delta)
-     return J * np.dot(m_i, sigma)
- 
- 
- def lead_onsite(site, J):
-     return J * sigma_z
- #HIDDEN_END_model
- 
- 
- #HIDDEN_BEGIN_syst
- lat = kwant.lattice.square(norbs=2)
- 
- def make_system(L=80):
- 
-     syst = kwant.Builder()
- 
-     def square(pos):
-         return all(-L/2 < p < L/2 for p in pos)
- 
-     syst[lat.shape(square, (0, 0))] = scattering_onsite
-     syst[lat.neighbors()] = -sigma_0
- 
-     lead = kwant.Builder(kwant.TranslationalSymmetry((-1, 0)),
-                          conservation_law=-sigma_z)
- 
-     lead[lat.shape(square, (0, 0))] = lead_onsite
-     lead[lat.neighbors()] = -sigma_0
- 
-     syst.attach_lead(lead)
-     syst.attach_lead(lead.reversed())
- 
-     return syst
- #HIDDEN_END_syst
- 
- 
--def plot_vector_field(syst, params):
-+def save_plot(fname):
-+    for extension in ('.pdf', '.png'):
-+        plt.savefig(fname + extension,
-+                    dpi=_defs.dpi, bbox_inches='tight')
-+
-+
-+def plot_vector_field(syst, params, fname=None):
-     xmin, ymin = min(s.tag for s in syst.sites)
-     xmax, ymax = max(s.tag for s in syst.sites)
-     x, y = np.meshgrid(np.arange(xmin, xmax+1), np.arange(ymin, ymax+1))
- 
-     m_i = [field_direction(p, **params) for p in zip(x.flat, y.flat)]
-     m_i = np.reshape(m_i, x.shape + (3,))
-     m_i = np.rollaxis(m_i, 2, 0)
- 
--    fig, ax = plt.subplots(1, 1)
-+    fig, ax = plt.subplots(1, 1, figsize=(9, 7))
-     im = ax.quiver(x, y, *m_i, pivot='mid', scale=75)
-     fig.colorbar(im)
--    plt.show()
-+    if fname:
-+        save_plot(fname)
-+    else:
-+        plt.show()
- 
- 
--def plot_densities(syst, densities):
--    fig, axes = plt.subplots(1, len(densities))
-+def plot_densities(syst, densities, fname=None):
-+    fig, axes = plt.subplots(1, len(densities), figsize=(7*len(densities), 7))
-     for ax, (title, rho) in zip(axes, densities):
-         kwant.plotter.map(syst, rho, ax=ax, a=4)
-         ax.set_title(title)
--    plt.show()
-+    if fname:
-+        save_plot(fname)
-+    else:
-+        plt.show()
- 
- 
--def plot_currents(syst, currents):
--    fig, axes = plt.subplots(1, len(currents))
-+
-+def plot_currents(syst, currents, fname=None):
-+    fig, axes = plt.subplots(1, len(currents), figsize=(7*len(currents), 7))
-     if not hasattr(axes, '__len__'):
-         axes = (axes,)
-     for ax, (title, current) in zip(axes, currents):
-         kwant.plotter.current(syst, current, ax=ax, colorbar=False)
-         ax.set_title(title)
--    plt.show()
-+    if fname:
-+        save_plot(fname)
-+    else:
-+        plt.show()
- 
- 
- def main():
-     syst = make_system().finalized()
- 
- #HIDDEN_BEGIN_wavefunction
-     params = dict(r0=20, delta=10, J=1)
-     wf = kwant.wave_function(syst, energy=-1, params=params)
-     psi = wf(0)[0]
- #HIDDEN_END_wavefunction
- 
--    plot_vector_field(syst, dict(r0=20, delta=10))
-+    plot_vector_field(syst, dict(r0=20, delta=10), fname='mag_field_direction')
- 
- #HIDDEN_BEGIN_ldos
-     # even (odd) indices correspond to spin up (down)
-     up, down = psi[::2], psi[1::2]
-     density = np.abs(up)**2 + np.abs(down)**2
- #HIDDEN_END_ldos
- 
- #HIDDEN_BEGIN_lsdz
-     # spin down components have a minus sign
-     spin_z = np.abs(up)**2 - np.abs(down)**2
- #HIDDEN_END_lsdz
- 
- #HIDDEN_BEGIN_lsdy
-     # spin down components have a minus sign
-     spin_y = 1j * (down.conjugate() * up - up.conjugate() * down)
- #HIDDEN_END_lsdy
- 
- #HIDDEN_BEGIN_lden
-     rho = kwant.operator.Density(syst)
-     rho_sz = kwant.operator.Density(syst, sigma_z)
-     rho_sy = kwant.operator.Density(syst, sigma_y)
- 
-     # calculate the expectation values of the operators with 'psi'
-     density = rho(psi)
-     spin_z = rho_sz(psi)
-     spin_y = rho_sy(psi)
- #HIDDEN_END_lden
- 
-     plot_densities(syst, [
-         ('$σ_0$', density),
-         ('$σ_z$', spin_z),
-         ('$σ_y$', spin_y),
--    ])
-+    ], fname='spin_densities')
- 
- #HIDDEN_BEGIN_current
-     J_0 = kwant.operator.Current(syst)
-     J_z = kwant.operator.Current(syst, sigma_z)
-     J_y = kwant.operator.Current(syst, sigma_y)
- 
-     # calculate the expectation values of the operators with 'psi'
-     current = J_0(psi)
-     spin_z_current = J_z(psi)
-     spin_y_current = J_y(psi)
- #HIDDEN_END_current
- 
-     plot_currents(syst, [
-         ('$J_{σ_0}$', current),
-         ('$J_{σ_z}$', spin_z_current),
-         ('$J_{σ_y}$', spin_y_current),
--    ])
-+    ], fname='spin_currents')
- 
- #HIDDEN_BEGIN_following
-     def following_m_i(site, r0, delta):
-         m_i = field_direction(site.pos, r0, delta)
-         return np.dot(m_i, sigma)
- 
-     J_m = kwant.operator.Current(syst, following_m_i)
- 
-     # evaluate the operator
-     m_current = J_m(psi, params=dict(r0=25, delta=10))
- #HIDDEN_END_following
- 
-     plot_currents(syst, [
-         (r'$J_{\mathbf{m}_i}$', m_current),
-         ('$J_{σ_z}$', spin_z_current),
--    ])
-+    ], fname='spin_current_comparison')
- 
- 
- #HIDDEN_BEGIN_density_cut
-     def circle(site):
-         return np.linalg.norm(site.pos) < 20
- 
-     rho_circle = kwant.operator.Density(syst, where=circle, sum=True)
- 
-     all_states = np.vstack((wf(0), wf(1)))
-     dos_in_circle = sum(rho_circle(p) for p in all_states) / (2 * pi)
--    print('density of states in circle:', dos_in_circle)
-+    with open('circle_dos.txt', 'w') as f:
-+        with redirect_stdout(f):
-+            print('density of states in circle:', dos_in_circle)
- #HIDDEN_END_density_cut
- 
- #HIDDEN_BEGIN_current_cut
-     def left_cut(site_to, site_from):
-         return site_from.pos[0] <= -39 and site_to.pos[0] > -39
- 
-     def right_cut(site_to, site_from):
-         return site_from.pos[0] < 39 and site_to.pos[0] >= 39
- 
-     J_left = kwant.operator.Current(syst, where=left_cut, sum=True)
-     J_right = kwant.operator.Current(syst, where=right_cut, sum=True)
- 
-     Jz_left = kwant.operator.Current(syst, sigma_z, where=left_cut, sum=True)
-     Jz_right = kwant.operator.Current(syst, sigma_z, where=right_cut, sum=True)
- 
--    print('J_left:', J_left(psi), ' J_right:', J_right(psi))
--    print('Jz_left:', Jz_left(psi), ' Jz_right:', Jz_right(psi))
-+    with open('current_cut.txt', 'w') as f:
-+        with redirect_stdout(f):
-+            print('J_left:', J_left(psi), ' J_right:', J_right(psi))
-+            print('Jz_left:', Jz_left(psi), ' Jz_right:', Jz_right(psi))
- #HIDDEN_END_current_cut
- 
- #HIDDEN_BEGIN_bind
-     J_m = kwant.operator.Current(syst, following_m_i)
-     J_z = kwant.operator.Current(syst, sigma_z)
- 
-     J_m_bound = J_m.bind(params=dict(r0=25, delta=10, J=1))
-     J_z_bound = J_z.bind(params=dict(r0=25, delta=10, J=1))
- 
-     # Sum current local from all scattering states on the left at energy=-1
-     wf_left = wf(0)
-     J_m_left = sum(J_m_bound(p) for p in wf_left)
-     J_z_left = sum(J_z_bound(p) for p in wf_left)
- #HIDDEN_END_bind
- 
-     plot_currents(syst, [
-         (r'$J_{\mathbf{m}_i}$ (from left)', J_m_left),
-         (r'$J_{σ_z}$ (from left)', J_z_left),
--    ])
-+    ], fname='bound_current')
- 
- 
- if __name__ == '__main__':
-     main()
diff --git a/doc/source/code/figure/plot_graphene.py.diff b/doc/source/code/figure/plot_graphene.py.diff
deleted file mode 100644
index 82c75554..00000000
--- a/doc/source/code/figure/plot_graphene.py.diff
+++ /dev/null
@@ -1,141 +0,0 @@
-@@ -1,112 +1,130 @@
- # Tutorial 2.8.1. 2D example: graphene quantum dot
- # ================================================
- #
- # Physics background
- # ------------------
- #  - graphene edge states
- #
- # Kwant features highlighted
- # --------------------------
- #  - demonstrate different ways of plotting
- 
-+import _defs
- import kwant
- from matplotlib import pyplot
- 
- #HIDDEN_BEGIN_makesyst
- lat = kwant.lattice.honeycomb()
- a, b = lat.sublattices
- 
- def make_system(r=8, t=-1, tp=-0.1):
- 
-     def circle(pos):
-         x, y = pos
-         return x**2 + y**2 < r**2
- 
-     syst = kwant.Builder()
--    syst[lat.shape(circle, (0, 0))] = 0
-+    syst[lat.shape(circle, (0,0))] = 0
-     syst[lat.neighbors()] = t
-     syst.eradicate_dangling()
-     if tp:
-         syst[lat.neighbors(2)] = tp
- 
-     return syst
- #HIDDEN_END_makesyst
- 
- 
- #HIDDEN_BEGIN_plotsyst1
- def plot_system(syst):
--    kwant.plot(syst)
- #HIDDEN_END_plotsyst1
--    # the standard plot is ok, but not very intelligible. One can do
--    # better by playing wioth colors and linewidths
-+    # standard plot - not very intelligible for this particular situation
-+    size = (_defs.figwidth_in, _defs.figwidth_in)
-+    for extension in ('pdf', 'png'):
-+        kwant.plot(syst, file="plot_graphene_syst1." + extension,
-+                   fig_size=size, dpi=_defs.dpi)
- 
-     # use color and linewidths to get a better plot
- #HIDDEN_BEGIN_plotsyst2
-     def family_color(site):
-         return 'black' if site.family == a else 'white'
- 
-     def hopping_lw(site1, site2):
-         return 0.04 if site1.family == site2.family else 0.1
- 
--    kwant.plot(syst, site_lw=0.1, site_color=family_color, hop_lw=hopping_lw)
-+    size = (_defs.figwidth_in, _defs.figwidth_in)
-+    for extension in ('pdf', 'png'):
-+        kwant.plot(syst, site_lw=0.1, site_color=family_color,
-+                   hop_lw=hopping_lw, file="plot_graphene_syst2." + extension,
-+                   fig_size=size, dpi=_defs.dpi)
- #HIDDEN_END_plotsyst2
- 
- 
- #HIDDEN_BEGIN_plotdata1
- def plot_data(syst, n):
-     import scipy.linalg as la
- 
-     syst = syst.finalized()
-     ham = syst.hamiltonian_submatrix()
-     evecs = la.eigh(ham)[1]
- 
-     wf = abs(evecs[:, n])**2
- #HIDDEN_END_plotdata1
- 
-     # the usual - works great in general, looks just a bit crufty for
-     # small systems
- 
- #HIDDEN_BEGIN_plotdata2
--    kwant.plotter.map(syst, wf, oversampling=10, cmap='gist_heat_r')
-+    size = (_defs.figwidth_in, _defs.figwidth_in)
-+    for extension in ('pdf', 'png'):
-+        kwant.plotter.map(syst, wf, oversampling=10, cmap='gist_heat_r',
-+                          file="plot_graphene_data1." + extension,
-+                          fig_size=size, dpi=_defs.dpi)
- #HIDDEN_END_plotdata2
- 
-     # use two different sort of triangles to cleanly fill the space
- #HIDDEN_BEGIN_plotdata3
-     def family_shape(i):
-         site = syst.sites[i]
-         return ('p', 3, 180) if site.family == a else ('p', 3, 0)
- 
-     def family_color(i):
-         return 'black' if syst.sites[i].family == a else 'white'
- 
--    kwant.plot(syst, site_color=wf, site_symbol=family_shape,
--               site_size=0.5, hop_lw=0, cmap='gist_heat_r')
-+    size = (_defs.figwidth_in, _defs.figwidth_in)
-+    for extension in ('pdf', 'png'):
-+        kwant.plot(syst, site_color=wf, site_symbol=family_shape,
-+                   site_size=0.5, hop_lw=0, cmap='gist_heat_r',
-+                   file="plot_graphene_data2." + extension,
-+                   fig_size=size, dpi=_defs.dpi)
- #HIDDEN_END_plotdata3
- 
-     # plot by changing the symbols itself
- #HIDDEN_BEGIN_plotdata4
-     def site_size(i):
-         return 3 * wf[i] / wf.max()
- 
--    kwant.plot(syst, site_size=site_size, site_color=(0, 0, 1, 0.3),
--               hop_lw=0.1)
-+    size = (_defs.figwidth_in, _defs.figwidth_in)
-+    for extension in ('pdf', 'png'):
-+        kwant.plot(syst, site_size=site_size, site_color=(0,0,1,0.3),
-+                   hop_lw=0.1, file="plot_graphene_data3." + extension,
-+                   fig_size=size, dpi=_defs.dpi)
- #HIDDEN_END_plotdata4
- 
- 
- def main():
-     # plot the graphene system in different styles
-     syst = make_system()
- 
-     plot_system(syst)
- 
-     # compute a wavefunction (number 225) and plot it in different
-     # styles
-     syst = make_system(tp=0)
- 
-     plot_data(syst, 225)
- 
- 
- # Call the main function if the script gets executed (as opposed to imported).
- # See <http://docs.python.org/library/__main__.html>.
- if __name__ == '__main__':
-     main()
diff --git a/doc/source/code/figure/plot_qahe.py.diff b/doc/source/code/figure/plot_qahe.py.diff
deleted file mode 100644
index 1788f677..00000000
--- a/doc/source/code/figure/plot_qahe.py.diff
+++ /dev/null
@@ -1,78 +0,0 @@
-@@ -1,72 +1,76 @@
- # Comprehensive example: quantum anomalous Hall effect
- # ====================================================
- #
- # Physics background
- # ------------------
- # + Quantum anomalous Hall effect
- #
- # Features highlighted
- # --------------------
- # + Use of `kwant.continuum` to discretize a continuum Hamiltonian
- # + Use of `kwant.operator` to compute local current
- # + Use of `kwant.plotter.current` to plot local current
- 
-+import _defs
- import math
- import matplotlib.pyplot
- import kwant
- import kwant.continuum
- 
- 
- # 2 band model exhibiting quantum anomalous Hall effect
- #HIDDEN_BEGIN_model
- def make_model(a):
-     ham = ("alpha * (k_x * sigma_x - k_y * sigma_y)"
-            "+ (m + beta * kk) * sigma_z"
-            "+ (gamma * kk + U) * sigma_0")
-     subs = {"kk": "k_x**2 + k_y**2"}
-     return kwant.continuum.discretize(ham, locals=subs, grid=a)
- #HIDDEN_END_model
- 
- 
- def make_system(model, L):
-     def lead_shape(site):
-         x, y = site.pos / L
-         return abs(y) < 0.5
- 
-     # QPC shape: a rectangle with 2 gaussians
-     # etched out of the top and bottom edge.
-     def central_shape(site):
-         x, y = site.pos / L
-         return abs(x) < 3/5 and abs(y) < 0.5 - 0.4 * math.exp(-40 * x**2)
- 
-     lead = kwant.Builder(kwant.TranslationalSymmetry(
-         model.lattice.vec((-1, 0))))
-     lead.fill(model, lead_shape, (0, 0))
- 
-     syst = kwant.Builder()
-     syst.fill(model, central_shape, (0, 0))
-     syst.attach_lead(lead)
-     syst.attach_lead(lead.reversed())
- 
-     return syst.finalized()
- 
- 
- def main():
-     # Set up our model and system, and define the model parameters.
-     params = dict(alpha=0.365, beta=0.686, gamma=0.512, m=-0.01, U=0)
-     model = make_model(1)
-     syst = make_system(model, 70)
-     kwant.plot(syst)
- 
-     # Calculate the scattering states at energy 'm' coming from the left
-     # lead, and the associated particle current.
-     psi = kwant.wave_function(syst, energy=params['m'], params=params)(0)
- #HIDDEN_BEGIN_current
-     J = kwant.operator.Current(syst).bind(params=params)
-     current = sum(J(p) for p in psi)
--    kwant.plotter.current(syst, current)
-+    for extension in ('pdf', 'png'):
-+        kwant.plotter.current(syst, current,
-+                              file="plot_qahe_current." + extension,
-+                              dpi=_defs.dpi)
- #HIDDEN_END_current
- 
- 
- if __name__ == '__main__':
-     main()
diff --git a/doc/source/code/figure/plot_zincblende.py.diff b/doc/source/code/figure/plot_zincblende.py.diff
deleted file mode 100644
index ad500787..00000000
--- a/doc/source/code/figure/plot_zincblende.py.diff
+++ /dev/null
@@ -1,71 +0,0 @@
-@@ -1,59 +1,67 @@
- # Tutorial 2.8.2. 3D example: zincblende structure
- # ================================================
- #
- # Physical background
- # -------------------
- #  - 3D Bravais lattices
- #
- # Kwant features highlighted
- # --------------------------
- #  - demonstrate different ways of plotting in 3D
- 
-+import _defs
- import kwant
- from matplotlib import pyplot
- 
- #HIDDEN_BEGIN_zincblende1
- lat = kwant.lattice.general([(0, 0.5, 0.5), (0.5, 0, 0.5), (0.5, 0.5, 0)],
-                             [(0, 0, 0), (0.25, 0.25, 0.25)])
- a, b = lat.sublattices
- #HIDDEN_END_zincblende1
- 
- #HIDDEN_BEGIN_zincblende2
- def make_cuboid(a=15, b=10, c=5):
-     def cuboid_shape(pos):
-         x, y, z = pos
-         return 0 <= x < a and 0 <= y < b and 0 <= z < c
- 
-     syst = kwant.Builder()
-     syst[lat.shape(cuboid_shape, (0, 0, 0))] = None
-     syst[lat.neighbors()] = None
- 
-     return syst
- #HIDDEN_END_zincblende2
- 
- 
- def main():
-     # the standard plotting style for 3D is mainly useful for
-     # checking shapes:
- #HIDDEN_BEGIN_plot1
-     syst = make_cuboid()
- 
--    kwant.plot(syst)
-+    size = (_defs.figwidth_in, _defs.figwidth_in)
-+    for extension in ('pdf', 'png'):
-+        kwant.plot(syst, file="plot_zincblende_syst1." + extension,
-+                   fig_size=size, dpi=_defs.dpi)
- #HIDDEN_END_plot1
- 
-     # visualize the crystal structure better for a very small system
- #HIDDEN_BEGIN_plot2
-     syst = make_cuboid(a=1.5, b=1.5, c=1.5)
- 
-     def family_colors(site):
-         return 'r' if site.family == a else 'g'
- 
--    kwant.plot(syst, site_size=0.18, site_lw=0.01, hop_lw=0.05,
--               site_color=family_colors)
-+    size = (_defs.figwidth_in, _defs.figwidth_in)
-+    for extension in ('pdf', 'png'):
-+        kwant.plot(syst, site_size=0.18, site_lw=0.01, hop_lw=0.05,
-+                   site_color=family_colors,
-+                   file="plot_zincblende_syst2." + extension,
-+                   fig_size=size, dpi=_defs.dpi)
- #HIDDEN_END_plot2
- 
- 
- # Call the main function if the script gets executed (as opposed to imported).
- # See <http://docs.python.org/library/__main__.html>.
- if __name__ == '__main__':
-     main()
diff --git a/doc/source/code/figure/quantum_well.py.diff b/doc/source/code/figure/quantum_well.py.diff
deleted file mode 100644
index 8b1be4bb..00000000
--- a/doc/source/code/figure/quantum_well.py.diff
+++ /dev/null
@@ -1,103 +0,0 @@
-@@ -1,88 +1,95 @@
- # Tutorial 2.3.2. Spatially dependent values through functions
- # ============================================================
- #
- # Physics background
- # ------------------
- #  transmission through a quantum well
- #
- # Kwant features highlighted
- # --------------------------
- #  - Functions as values in Builder
- 
-+import _defs
- import kwant
- 
- # For plotting
- from matplotlib import pyplot
- 
- 
- #HIDDEN_BEGIN_ehso
- def make_system(a=1, t=1.0, W=10, L=30, L_well=10):
-     # Start with an empty tight-binding system and a single square lattice.
-     # `a` is the lattice constant (by default set to 1 for simplicity.
-     lat = kwant.lattice.square(a)
- 
-     syst = kwant.Builder()
- 
-     #### Define the scattering region. ####
-     # Potential profile
-     def potential(site, pot):
-         (x, y) = site.pos
-         if (L - L_well) / 2 < x < (L + L_well) / 2:
-             return pot
-         else:
-             return 0
- #HIDDEN_END_ehso
- 
- #HIDDEN_BEGIN_coid
-     def onsite(site, pot):
-         return 4 * t + potential(site, pot)
- 
-     syst[(lat(x, y) for x in range(L) for y in range(W))] = onsite
-     syst[lat.neighbors()] = -t
- #HIDDEN_END_coid
- 
-     #### Define and attach the leads. ####
-     lead = kwant.Builder(kwant.TranslationalSymmetry((-a, 0)))
-     lead[(lat(0, j) for j in range(W))] = 4 * t
-     lead[lat.neighbors()] = -t
-     syst.attach_lead(lead)
-     syst.attach_lead(lead.reversed())
- 
-     return syst
- 
- 
- def plot_conductance(syst, energy, welldepths):
- #HIDDEN_BEGIN_sqvr
- 
-     # Compute conductance
-     data = []
-     for welldepth in welldepths:
-         smatrix = kwant.smatrix(syst, energy, params=dict(pot=-welldepth))
-         data.append(smatrix.transmission(1, 0))
- 
--    pyplot.figure()
-+    fig = pyplot.figure()
-     pyplot.plot(welldepths, data)
--    pyplot.xlabel("well depth [t]")
--    pyplot.ylabel("conductance [e^2/h]")
--    pyplot.show()
-+    pyplot.xlabel("well depth [t]",
-+                 fontsize=_defs.mpl_label_size)
-+    pyplot.ylabel("conductance [e^2/h]",
-+                 fontsize=_defs.mpl_label_size)
-+    pyplot.setp(fig.get_axes()[0].get_xticklabels(),
-+               fontsize=_defs.mpl_tick_size)
-+    pyplot.setp(fig.get_axes()[0].get_yticklabels(),
-+               fontsize=_defs.mpl_tick_size)
-+    fig.set_size_inches(_defs.mpl_width_in, _defs.mpl_width_in * 3. / 4.)
-+    fig.subplots_adjust(left=0.15, right=0.95, top=0.95, bottom=0.15)
-+    for extension in ('pdf', 'png'):
-+        fig.savefig("quantum_well_result." + extension, dpi=_defs.dpi)
- #HIDDEN_END_sqvr
- 
- 
- def main():
-     syst = make_system()
- 
--    # Check that the system looks as intended.
--    kwant.plot(syst)
--
-     # Finalize the system.
-     syst = syst.finalized()
- 
-     # We should see conductance steps.
-     plot_conductance(syst, energy=0.2,
-                      welldepths=[0.01 * i for i in range(100)])
- 
- 
- # Call the main function if the script gets executed (as opposed to imported).
- # See <http://docs.python.org/library/__main__.html>.
- if __name__ == '__main__':
-     main()
diff --git a/doc/source/code/figure/quantum_wire.py.diff b/doc/source/code/figure/quantum_wire.py.diff
deleted file mode 100644
index 396ab255..00000000
--- a/doc/source/code/figure/quantum_wire.py.diff
+++ /dev/null
@@ -1,136 +0,0 @@
-@@ -1,121 +1,130 @@
- # Tutorial 2.2.2. Transport through a quantum wire
- # ================================================
- #
- # Physics background
- # ------------------
- #  Conductance of a quantum wire; subbands
- #
- # Kwant features highlighted
- # --------------------------
- #  - Builder for setting up transport systems easily
- #  - Making scattering region and leads
- #  - Using the simple sparse solver for computing Landauer conductance
- 
-+import _defs
- from matplotlib import pyplot
- #HIDDEN_BEGIN_dwhx
- import kwant
- #HIDDEN_END_dwhx
- 
- # First, define the tight-binding system
- 
- #HIDDEN_BEGIN_goiq
- syst = kwant.Builder()
- #HIDDEN_END_goiq
- 
- # Here, we are only working with square lattices
- #HIDDEN_BEGIN_suwo
- a = 1
- lat = kwant.lattice.square(a)
- #HIDDEN_END_suwo
- 
- #HIDDEN_BEGIN_zfvr
- t = 1.0
- W = 10
- L = 30
- 
- # Define the scattering region
- 
- for i in range(L):
-     for j in range(W):
-         # On-site Hamiltonian
-         syst[lat(i, j)] = 4 * t
- 
-         # Hopping in y-direction
-         if j > 0:
-             syst[lat(i, j), lat(i, j - 1)] = -t
- 
-         # Hopping in x-direction
-         if i > 0:
-             syst[lat(i, j), lat(i - 1, j)] = -t
- #HIDDEN_END_zfvr
- 
- # Then, define and attach the leads:
- 
- # First the lead to the left
- # (Note: TranslationalSymmetry takes a real-space vector)
- #HIDDEN_BEGIN_xcmc
- sym_left_lead = kwant.TranslationalSymmetry((-a, 0))
- left_lead = kwant.Builder(sym_left_lead)
- #HIDDEN_END_xcmc
- 
- #HIDDEN_BEGIN_ndez
- for j in range(W):
-     left_lead[lat(0, j)] = 4 * t
-     if j > 0:
-         left_lead[lat(0, j), lat(0, j - 1)] = -t
-     left_lead[lat(1, j), lat(0, j)] = -t
- #HIDDEN_END_ndez
- 
- #HIDDEN_BEGIN_fskr
- syst.attach_lead(left_lead)
- #HIDDEN_END_fskr
- 
- # Then the lead to the right
- #HIDDEN_BEGIN_xhqc
- sym_right_lead = kwant.TranslationalSymmetry((a, 0))
- right_lead = kwant.Builder(sym_right_lead)
- 
- for j in range(W):
-     right_lead[lat(0, j)] = 4 * t
-     if j > 0:
-         right_lead[lat(0, j), lat(0, j - 1)] = -t
-     right_lead[lat(1, j), lat(0, j)] = -t
- 
- syst.attach_lead(right_lead)
- #HIDDEN_END_xhqc
- 
- # Plot it, to make sure it's OK
- #HIDDEN_BEGIN_wsgh
--kwant.plot(syst)
-+size = (_defs.figwidth_in, 0.3 * _defs.figwidth_in)
-+for extension in ('pdf', 'png'):
-+    kwant.plot(syst, file="quantum_wire_syst." + extension,
-+               fig_size=size, dpi=_defs.dpi)
- #HIDDEN_END_wsgh
- 
- # Finalize the system
- #HIDDEN_BEGIN_dngj
- syst = syst.finalized()
- #HIDDEN_END_dngj
- 
- # Now that we have the system, we can compute conductance
- #HIDDEN_BEGIN_buzn
- energies = []
- data = []
- for ie in range(100):
-     energy = ie * 0.01
- 
-     # compute the scattering matrix at a given energy
-     smatrix = kwant.smatrix(syst, energy)
- 
-     # compute the transmission probability from lead 0 to
-     # lead 1
-     energies.append(energy)
-     data.append(smatrix.transmission(1, 0))
- #HIDDEN_END_buzn
- 
- # Use matplotlib to write output
- # We should see conductance steps
- #HIDDEN_BEGIN_lliv
--pyplot.figure()
-+fig = pyplot.figure()
- pyplot.plot(energies, data)
--pyplot.xlabel("energy [t]")
--pyplot.ylabel("conductance [e^2/h]")
--pyplot.show()
-+pyplot.xlabel("energy [t]", fontsize=_defs.mpl_label_size)
-+pyplot.ylabel("conductance [e^2/h]", fontsize=_defs.mpl_label_size)
-+pyplot.setp(fig.get_axes()[0].get_xticklabels(), fontsize=_defs.mpl_tick_size)
-+pyplot.setp(fig.get_axes()[0].get_yticklabels(), fontsize=_defs.mpl_tick_size)
-+fig.set_size_inches(_defs.mpl_width_in, _defs.mpl_width_in * 3. / 4.)
-+fig.subplots_adjust(left=0.15, right=0.95, top=0.95, bottom=0.15)
-+for extension in ('pdf', 'png'):
-+    fig.savefig("quantum_wire_result." + extension, dpi=_defs.dpi)
- #HIDDEN_END_lliv
diff --git a/doc/source/code/figure/spin_orbit.py.diff b/doc/source/code/figure/spin_orbit.py.diff
deleted file mode 100644
index 794c1b5b..00000000
--- a/doc/source/code/figure/spin_orbit.py.diff
+++ /dev/null
@@ -1,118 +0,0 @@
-@@ -1,104 +1,110 @@
- # Tutorial 2.3.1. Matrix structure of on-site and hopping elements
- # ================================================================
- #
- # Physics background
- # ------------------
- #  Gaps in quantum wires with spin-orbit coupling and Zeeman splititng,
- #  as theoretically predicted in
- #   http://prl.aps.org/abstract/PRL/v90/i25/e256601
- #  and (supposedly) experimentally oberved in
- #   http://www.nature.com/nphys/journal/v6/n5/abs/nphys1626.html
- #
- # Kwant features highlighted
- # --------------------------
- #  - Numpy matrices as values in Builder
- 
-+import _defs
- import kwant
- 
- # For plotting
- from matplotlib import pyplot
- 
- # For matrix support
- #HIDDEN_BEGIN_xumz
- import tinyarray
- #HIDDEN_END_xumz
- 
- # define Pauli-matrices for convenience
- #HIDDEN_BEGIN_hwbt
- sigma_0 = tinyarray.array([[1, 0], [0, 1]])
- sigma_x = tinyarray.array([[0, 1], [1, 0]])
- sigma_y = tinyarray.array([[0, -1j], [1j, 0]])
- sigma_z = tinyarray.array([[1, 0], [0, -1]])
- #HIDDEN_END_hwbt
- 
- 
- def make_system(t=1.0, alpha=0.5, e_z=0.08, W=10, L=30):
-     # Start with an empty tight-binding system and a single square lattice.
-     # `a` is the lattice constant (by default set to 1 for simplicity).
-     lat = kwant.lattice.square()
- 
-     syst = kwant.Builder()
- 
-     #### Define the scattering region. ####
- #HIDDEN_BEGIN_uxrm
-     syst[(lat(x, y) for x in range(L) for y in range(W))] = \
-         4 * t * sigma_0 + e_z * sigma_z
-     # hoppings in x-direction
-     syst[kwant.builder.HoppingKind((1, 0), lat, lat)] = \
-         -t * sigma_0 + 1j * alpha * sigma_y / 2
-     # hoppings in y-directions
-     syst[kwant.builder.HoppingKind((0, 1), lat, lat)] = \
-         -t * sigma_0 - 1j * alpha * sigma_x / 2
- #HIDDEN_END_uxrm
- 
-     #### Define the left lead. ####
-     lead = kwant.Builder(kwant.TranslationalSymmetry((-1, 0)))
- 
- #HIDDEN_BEGIN_yliu
-     lead[(lat(0, j) for j in range(W))] = 4 * t * sigma_0 + e_z * sigma_z
-     # hoppings in x-direction
-     lead[kwant.builder.HoppingKind((1, 0), lat, lat)] = \
-         -t * sigma_0 + 1j * alpha * sigma_y / 2
-     # hoppings in y-directions
-     lead[kwant.builder.HoppingKind((0, 1), lat, lat)] = \
-         -t * sigma_0 - 1j * alpha * sigma_x / 2
- #HIDDEN_END_yliu
- 
-     #### Attach the leads and return the finalized system. ####
-     syst.attach_lead(lead)
-     syst.attach_lead(lead.reversed())
- 
-     return syst
- 
- 
- def plot_conductance(syst, energies):
-     # Compute conductance
-     data = []
-     for energy in energies:
-         smatrix = kwant.smatrix(syst, energy)
-         data.append(smatrix.transmission(1, 0))
- 
--    pyplot.figure()
-+    fig = pyplot.figure()
-     pyplot.plot(energies, data)
--    pyplot.xlabel("energy [t]")
--    pyplot.ylabel("conductance [e^2/h]")
--    pyplot.show()
-+    pyplot.xlabel("energy [t]", fontsize=_defs.mpl_label_size)
-+    pyplot.ylabel("conductance [e^2/h]",
-+                 fontsize=_defs.mpl_label_size)
-+    pyplot.setp(fig.get_axes()[0].get_xticklabels(),
-+               fontsize=_defs.mpl_tick_size)
-+    pyplot.setp(fig.get_axes()[0].get_yticklabels(),
-+               fontsize=_defs.mpl_tick_size)
-+    fig.set_size_inches(_defs.mpl_width_in, _defs.mpl_width_in * 3. / 4.)
-+    fig.subplots_adjust(left=0.15, right=0.95, top=0.95, bottom=0.15)
-+    for extension in ('pdf', 'png'):
-+        fig.savefig("spin_orbit_result." + extension, dpi=_defs.dpi)
- 
- 
- def main():
-     syst = make_system()
- 
--    # Check that the system looks as intended.
--    kwant.plot(syst)
--
-     # Finalize the system.
-     syst = syst.finalized()
- 
-     # We should see non-monotonic conductance steps.
-     plot_conductance(syst, energies=[0.01 * i - 0.3 for i in range(100)])
- 
- 
- # Call the main function if the script gets executed (as opposed to imported).
- # See <http://docs.python.org/library/__main__.html>.
- if __name__ == '__main__':
-     main()
diff --git a/doc/source/code/figure/superconductor.py.diff b/doc/source/code/figure/superconductor.py.diff
deleted file mode 100644
index 75d9b061..00000000
--- a/doc/source/code/figure/superconductor.py.diff
+++ /dev/null
@@ -1,148 +0,0 @@
-@@ -1,132 +1,141 @@
- # Tutorial 2.6. "Superconductors": orbitals, conservation laws and symmetries
- # ===========================================================================
- #
- # Physics background
- # ------------------
- # - conductance of a NS-junction (Andreev reflection, superconducting gap)
- #
- # Kwant features highlighted
- # --------------------------
- # - Implementing electron and hole ("orbital") degrees of freedom
- #   using conservation laws.
- # - Use of discrete symmetries to relate scattering states.
- 
-+import _defs
- import kwant
- 
- import tinyarray
- import numpy as np
- 
- # For plotting
- from matplotlib import pyplot
-+from contextlib import redirect_stdout
- 
- tau_x = tinyarray.array([[0, 1], [1, 0]])
- tau_y = tinyarray.array([[0, -1j], [1j, 0]])
- tau_z = tinyarray.array([[1, 0], [0, -1]])
- 
- #HIDDEN_BEGIN_nbvn
- def make_system(a=1, W=10, L=10, barrier=1.5, barrierpos=(3, 4),
-                 mu=0.4, Delta=0.1, Deltapos=4, t=1.0):
-     # Start with an empty tight-binding system. On each site, there
-     # are now electron and hole orbitals, so we must specify the
-     # number of orbitals per site. The orbital structure is the same
-     # as in the Hamiltonian.
-     lat = kwant.lattice.square(norbs=2)
-     syst = kwant.Builder()
- 
-     #### Define the scattering region. ####
-     # The superconducting order parameter couples electron and hole orbitals
-     # on each site, and hence enters as an onsite potential.
-     # The pairing is only included beyond the point 'Deltapos' in the scattering region.
-     syst[(lat(x, y) for x in range(Deltapos) for y in range(W))] = (4 * t - mu) * tau_z
-     syst[(lat(x, y) for x in range(Deltapos, L) for y in range(W))] = (4 * t - mu) * tau_z + Delta * tau_x
- 
-     # The tunnel barrier
-     syst[(lat(x, y) for x in range(barrierpos[0], barrierpos[1])
-          for y in range(W))] = (4 * t + barrier - mu) * tau_z
- 
-     # Hoppings
-     syst[lat.neighbors()] = -t * tau_z
- #HIDDEN_END_nbvn
- #HIDDEN_BEGIN_ttth
-     #### Define the leads. ####
-     # Left lead - normal, so the order parameter is zero.
-     sym_left = kwant.TranslationalSymmetry((-a, 0))
-     # Specify the conservation law used to treat electrons and holes separately.
-     # We only do this in the left lead, where the pairing is zero.
-     lead0 = kwant.Builder(sym_left, conservation_law=-tau_z, particle_hole=tau_y)
-     lead0[(lat(0, j) for j in range(W))] = (4 * t - mu) * tau_z
-     lead0[lat.neighbors()] = -t * tau_z
- #HIDDEN_END_ttth
- #HIDDEN_BEGIN_zuuw
-     # Right lead - superconducting, so the order parameter is included.
-     sym_right = kwant.TranslationalSymmetry((a, 0))
-     lead1 = kwant.Builder(sym_right)
-     lead1[(lat(0, j) for j in range(W))] = (4 * t - mu) * tau_z + Delta * tau_x
-     lead1[lat.neighbors()] = -t * tau_z
- 
-     #### Attach the leads and return the system. ####
-     syst.attach_lead(lead0)
-     syst.attach_lead(lead1)
- 
-     return syst
- #HIDDEN_END_zuuw
- 
- #HIDDEN_BEGIN_jbjt
- def plot_conductance(syst, energies):
-     # Compute conductance
-     data = []
-     for energy in energies:
-         smatrix = kwant.smatrix(syst, energy)
-         # Conductance is N - R_ee + R_he
-         data.append(smatrix.submatrix((0, 0), (0, 0)).shape[0] -
-                     smatrix.transmission((0, 0), (0, 0)) +
-                     smatrix.transmission((0, 1), (0, 0)))
- #HIDDEN_END_jbjt
--    pyplot.figure()
-+    fig = pyplot.figure()
-     pyplot.plot(energies, data)
-     pyplot.xlabel("energy [t]")
-     pyplot.ylabel("conductance [e^2/h]")
--    pyplot.show()
-+    pyplot.setp(fig.get_axes()[0].get_xticklabels(),
-+                fontsize=_defs.mpl_tick_size)
-+    pyplot.setp(fig.get_axes()[0].get_yticklabels(),
-+                fontsize=_defs.mpl_tick_size)
-+    fig.set_size_inches(_defs.mpl_width_in, _defs.mpl_width_in * 3. / 4.)
-+    fig.subplots_adjust(left=0.15, right=0.95, top=0.95, bottom=0.15)
-+    for extension in ('pdf', 'png'):
-+        fig.savefig("superconductor_transport_result." + extension,
-+                    dpi=_defs.dpi)
- 
- #HIDDEN_BEGIN_pqmp
- def check_PHS(syst):
-     # Scattering matrix
-     s = kwant.smatrix(syst, energy=0)
-     # Electron to electron block
-     s_ee = s.submatrix((0,0), (0,0))
-     # Hole to hole block
-     s_hh = s.submatrix((0,1), (0,1))
-     print('s_ee: \n', np.round(s_ee, 3))
-     print('s_hh: \n', np.round(s_hh[::-1, ::-1], 3))
-     print('s_ee - s_hh^*: \n',
-           np.round(s_ee - s_hh[::-1, ::-1].conj(), 3), '\n')
-     # Electron to hole block
-     s_he = s.submatrix((0,1), (0,0))
-     # Hole to electron block
-     s_eh = s.submatrix((0,0), (0,1))
-     print('s_he: \n', np.round(s_he, 3))
-     print('s_eh: \n', np.round(s_eh[::-1, ::-1], 3))
-     print('s_he + s_eh^*: \n',
-           np.round(s_he + s_eh[::-1, ::-1].conj(), 3))
- #HIDDEN_END_pqmp
- 
- def main():
-     syst = make_system(W=10)
- 
--    # Check that the system looks as intended.
--    kwant.plot(syst)
--
-     # Finalize the system.
-     syst = syst.finalized()
- 
-     # Check particle-hole symmetry of the scattering matrix
--    check_PHS(syst)
-+    with open('check_PHS_out.txt', 'w') as f:
-+        with redirect_stdout(f):
-+            check_PHS(syst)
- 
-     # Compute and plot the conductance
-     plot_conductance(syst, energies=[0.002 * i for i in range(-10, 100)])
- 
- 
- # Call the main function if the script gets executed (as opposed to imported).
- # See <http://docs.python.org/library/__main__.html>.
- if __name__ == '__main__':
-     main()
diff --git a/doc/source/code/figure/superconductor_transport_sketch.svg b/doc/source/code/figure/superconductor_transport_sketch.svg
deleted file mode 100644
index 35f087cd..00000000
--- a/doc/source/code/figure/superconductor_transport_sketch.svg
+++ /dev/null
@@ -1,325 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
-   xmlns:dc="http://purl.org/dc/elements/1.1/"
-   xmlns:cc="http://creativecommons.org/ns#"
-   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-   xmlns:svg="http://www.w3.org/2000/svg"
-   xmlns="http://www.w3.org/2000/svg"
-   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
-   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
-   width="236.85225"
-   height="102.88937"
-   id="svg2"
-   sodipodi:version="0.32"
-   inkscape:version="0.47 r22583"
-   sodipodi:docname="tutorial5b_sketch.svg"
-   inkscape:output_extension="org.inkscape.output.svg.inkscape"
-   version="1.0">
-  <defs
-     id="defs4">
-    <marker
-       inkscape:stockid="Arrow1Mend"
-       orient="auto"
-       refY="0"
-       refX="0"
-       id="Arrow1Mend"
-       style="overflow:visible">
-      <path
-         id="path5182"
-         d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
-         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none"
-         transform="matrix(-0.4,0,0,-0.4,-4,0)" />
-    </marker>
-    <pattern
-       inkscape:stockid="Stripes 1:2"
-       id="Strips1_2"
-       patternTransform="matrix(0.93049189,-0.87551382,1.8365019,1.9518254,0,0)"
-       height="1"
-       width="3"
-       patternUnits="userSpaceOnUse"
-       inkscape:collect="always">
-      <rect
-         id="rect4444"
-         height="2"
-         width="1"
-         y="-0.5"
-         x="0"
-         style="fill:black;stroke:none" />
-    </pattern>
-    <inkscape:perspective
-       sodipodi:type="inkscape:persp3d"
-       inkscape:vp_x="0 : 526.18109 : 1"
-       inkscape:vp_y="0 : 1000 : 0"
-       inkscape:vp_z="744.09448 : 526.18109 : 1"
-       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
-       id="perspective3026" />
-    <inkscape:perspective
-       id="perspective3635"
-       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
-       inkscape:vp_z="1 : 0.5 : 1"
-       inkscape:vp_y="0 : 1000 : 0"
-       inkscape:vp_x="0 : 0.5 : 1"
-       sodipodi:type="inkscape:persp3d" />
-    <inkscape:perspective
-       id="perspective3695"
-       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
-       inkscape:vp_z="1 : 0.5 : 1"
-       inkscape:vp_y="0 : 1000 : 0"
-       inkscape:vp_x="0 : 0.5 : 1"
-       sodipodi:type="inkscape:persp3d" />
-  </defs>
-  <sodipodi:namedview
-     id="base"
-     pagecolor="#ffffff"
-     bordercolor="#666666"
-     borderopacity="1.0"
-     inkscape:pageopacity="0.0"
-     inkscape:pageshadow="2"
-     inkscape:zoom="2.5106232"
-     inkscape:cx="34.418931"
-     inkscape:cy="46.021777"
-     inkscape:document-units="mm"
-     inkscape:current-layer="layer1"
-     showgrid="true"
-     inkscape:object-nodes="true"
-     inkscape:grid-points="true"
-     gridtolerance="1.3"
-     objecttolerance="0.8"
-     gridanglex="8.4666669mm"
-     gridanglez="8.4666669mm"
-     grid_units="mm"
-     inkscape:window-width="1399"
-     inkscape:window-height="974"
-     inkscape:window-x="57"
-     inkscape:window-y="0"
-     inkscape:window-maximized="0"
-     units="pt"
-     inkscape:snap-bbox="true">
-    <inkscape:grid
-       id="GridFromPre046Settings"
-       type="xygrid"
-       originx="0px"
-       originy="0px"
-       spacingx="2mm"
-       spacingy="2mm"
-       color="#0000ff"
-       empcolor="#ff0400"
-       opacity="0.2"
-       empopacity="0.37647059"
-       empspacing="5"
-       units="mm"
-       visible="true"
-       enabled="true"
-       snapvisiblegridlinesonly="true" />
-  </sodipodi:namedview>
-  <metadata
-     id="metadata7">
-    <rdf:RDF>
-      <cc:Work
-         rdf:about="">
-        <dc:format>image/svg+xml</dc:format>
-        <dc:type
-           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title></dc:title>
-      </cc:Work>
-    </rdf:RDF>
-  </metadata>
-  <g
-     inkscape:label="Ebene 1"
-     inkscape:groupmode="layer"
-     id="layer1"
-     transform="translate(-127.3091,-26.863735)">
-    <rect
-       style="opacity:0.95;fill:#858585;fill-opacity:1;stroke:none"
-       id="rect2911"
-       width="113.38583"
-       height="56.692913"
-       x="248.84453"
-       y="44.012253" />
-    <path
-       style="fill:none;stroke:#000000;stroke-width:2.12598419;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-       d="m 248.0315,63.267717 -233.858272,0"
-       id="path3685"
-       transform="translate(114.19886,-19.255464)"
-       sodipodi:nodetypes="cc" />
-    <path
-       style="fill:none;stroke:#000000;stroke-width:2.12598419;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-       d="m 363.09835,100.70517 -233.85827,0"
-       id="path3685-7"
-       sodipodi:nodetypes="cc" />
-    <rect
-       style="opacity:0.95;fill:url(#Strips1_2);fill-opacity:1;stroke:none"
-       id="rect3709"
-       width="15.135684"
-       height="55.763046"
-       x="220.49808"
-       y="44.012253" />
-    <g
-       style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Times;-inkscape-font-specification:Times"
-       id="text5156">
-      <path
-         d="m 133.86818,32.019985 0,3.960938 -1.07813,0 0,-3.925782 c 0,-0.621089 -0.12109,-1.085932 -0.36328,-1.394531 -0.24219,-0.308588 -0.60547,-0.462885 -1.08984,-0.46289 -0.58204,5e-6 -1.04102,0.185552 -1.37695,0.55664 -0.33594,0.371099 -0.50391,0.876958 -0.50391,1.517578 l 0,3.708985 -1.08398,0 0,-6.5625 1.08398,0 0,1.019531 c 0.25781,-0.394525 0.56054,-0.689447 0.9082,-0.884766 0.35156,-0.195306 0.75586,-0.292962 1.21289,-0.292968 0.7539,6e-6 1.32422,0.234381 1.71094,0.703125 0.38671,0.464849 0.58007,1.150395 0.58008,2.05664"
-         style=""
-         id="path5623" />
-      <path
-         d="m 138.57326,30.174282 c -0.57813,6e-6 -1.03516,0.226568 -1.3711,0.679688 -0.33594,0.449223 -0.5039,1.06641 -0.5039,1.851562 0,0.785159 0.16601,1.404299 0.49804,1.857422 0.33594,0.44922 0.79492,0.673829 1.37696,0.673828 0.57421,1e-6 1.02929,-0.226561 1.36523,-0.679687 0.33593,-0.453124 0.5039,-1.07031 0.50391,-1.851563 -1e-5,-0.77734 -0.16798,-1.392573 -0.50391,-1.845703 -0.33594,-0.457026 -0.79102,-0.685541 -1.36523,-0.685547 m 0,-0.914062 c 0.93749,6e-6 1.67382,0.304693 2.20898,0.914062 0.53515,0.60938 0.80273,1.453129 0.80274,2.53125 -1e-5,1.074221 -0.26759,1.91797 -0.80274,2.53125 -0.53516,0.609375 -1.27149,0.914062 -2.20898,0.914063 -0.94141,-10e-7 -1.67969,-0.304688 -2.21485,-0.914063 -0.53125,-0.61328 -0.79687,-1.457029 -0.79687,-2.53125 0,-1.078121 0.26562,-1.92187 0.79687,-2.53125 0.53516,-0.609369 1.27344,-0.914056 2.21485,-0.914062"
-         style=""
-         id="path5625" />
-      <path
-         d="m 147.16896,30.426235 c -0.1211,-0.07031 -0.25391,-0.121088 -0.39844,-0.152344 -0.14063,-0.03515 -0.29688,-0.05273 -0.46875,-0.05273 -0.60938,6e-6 -1.07812,0.199224 -1.40625,0.597656 -0.32422,0.394536 -0.48633,0.962895 -0.48633,1.705078 l 0,3.457032 -1.08398,0 0,-6.5625 1.08398,0 0,1.019531 c 0.22657,-0.398432 0.52149,-0.693353 0.88477,-0.884766 0.36328,-0.195306 0.80468,-0.292962 1.32422,-0.292968 0.0742,6e-6 0.15624,0.0059 0.24609,0.01758 0.0898,0.0078 0.18945,0.02149 0.29883,0.04101 l 0.006,1.107422"
-         style=""
-         id="path5627" />
-      <path
-         d="m 153.20998,30.678188 c 0.26952,-0.484369 0.59179,-0.84179 0.96679,-1.072265 0.375,-0.230462 0.8164,-0.345697 1.32422,-0.345703 0.68359,6e-6 1.21093,0.24024 1.58203,0.720703 0.37109,0.476568 0.55663,1.156255 0.55664,2.039062 l 0,3.960938 -1.08398,0 0,-3.925782 c -1e-5,-0.628901 -0.11134,-1.095698 -0.33399,-1.40039 -0.22266,-0.304682 -0.5625,-0.457026 -1.01953,-0.457031 -0.5586,5e-6 -1,0.185552 -1.32422,0.55664 -0.32422,0.371099 -0.48633,0.876958 -0.48632,1.517578 l 0,3.708985 -1.08399,0 0,-3.925782 c 0,-0.632807 -0.11133,-1.099604 -0.33398,-1.40039 -0.22266,-0.304682 -0.56641,-0.457026 -1.03125,-0.457031 -0.55079,5e-6 -0.98829,0.187505 -1.3125,0.5625 -0.32422,0.371098 -0.48633,0.875004 -0.48633,1.511718 l 0,3.708985 -1.08398,0 0,-6.5625 1.08398,0 0,1.019531 c 0.24609,-0.402338 0.54101,-0.699213 0.88477,-0.890625 0.34374,-0.1914 0.75194,-0.287103 1.2246,-0.287109 0.47656,6e-6 0.88086,0.1211 1.2129,0.363281 0.33593,0.242193 0.58397,0.593756 0.74414,1.054687"
-         style=""
-         id="path5629" />
-      <path
-         d="m 162.7549,32.682095 c -0.8711,3e-6 -1.47461,0.09961 -1.81055,0.298828 -0.33594,0.199221 -0.50391,0.539065 -0.50391,1.019531 0,0.382814 0.125,0.687501 0.375,0.914062 0.25391,0.222658 0.59766,0.333986 1.03125,0.333985 0.59766,1e-6 1.07617,-0.210937 1.43555,-0.632813 0.36328,-0.425779 0.54492,-0.990232 0.54492,-1.693359 l 0,-0.240234 -1.07226,0 m 2.15039,-0.445313 0,3.744141 -1.07813,0 0,-0.996094 c -0.24609,0.398438 -0.55274,0.69336 -0.91992,0.884766 -0.36719,0.187499 -0.81641,0.281249 -1.34765,0.28125 -0.67188,-10e-7 -1.20704,-0.1875 -1.60547,-0.5625 -0.39454,-0.378906 -0.5918,-0.884765 -0.5918,-1.517579 0,-0.738278 0.24609,-1.294918 0.73828,-1.669921 0.49609,-0.374996 1.23437,-0.562496 2.21484,-0.5625 l 1.51172,0 0,-0.105469 c 0,-0.496089 -0.16406,-0.878901 -0.49218,-1.148438 -0.32423,-0.273432 -0.78126,-0.41015 -1.3711,-0.410156 -0.375,6e-6 -0.74023,0.04493 -1.0957,0.134766 -0.35547,0.08985 -0.69727,0.224615 -1.02539,0.404297 l 0,-0.996094 c 0.39453,-0.152338 0.77734,-0.265619 1.14844,-0.339844 0.37109,-0.07812 0.73241,-0.117181 1.08398,-0.117187 0.94921,6e-6 1.6582,0.2461 2.12695,0.738281 0.46875,0.492193 0.70312,1.238286 0.70313,2.238281"
-         style=""
-         id="path5631" />
-      <path
-         d="m 167.15529,26.863735 1.07812,0 0,9.117188 -1.07812,0 0,-9.117188"
-         style=""
-         id="path5633" />
-      <path
-         d="m 174.30373,26.863735 1.07812,0 0,9.117188 -1.07812,0 0,-9.117188"
-         style=""
-         id="path5635" />
-      <path
-         d="m 183.24513,32.430141 0,0.527344 -4.95703,0 c 0.0469,0.74219 0.26953,1.308596 0.66797,1.699219 0.40234,0.38672 0.96093,0.580079 1.67578,0.580078 0.41406,1e-6 0.81445,-0.05078 1.20117,-0.152344 0.39062,-0.101561 0.77734,-0.253905 1.16016,-0.457031 l 0,1.019531 c -0.38673,0.164063 -0.78321,0.289063 -1.18945,0.375 -0.40626,0.08594 -0.81837,0.128906 -1.23633,0.128907 -1.04688,-10e-7 -1.87696,-0.304688 -2.49024,-0.914063 -0.60937,-0.609374 -0.91406,-1.433591 -0.91406,-2.472656 0,-1.074215 0.28906,-1.925776 0.86719,-2.554688 0.58203,-0.632806 1.36523,-0.949212 2.34961,-0.949218 0.88281,6e-6 1.58007,0.285162 2.09179,0.855468 0.51562,0.566412 0.77344,1.337895 0.77344,2.314453 m -1.07812,-0.316406 c -0.008,-0.589839 -0.17384,-1.060542 -0.49805,-1.412109 -0.32032,-0.351557 -0.7461,-0.527338 -1.27734,-0.527344 -0.60157,6e-6 -1.08399,0.169928 -1.44727,0.509766 -0.35938,0.339848 -0.56641,0.818364 -0.62109,1.435547 l 3.84375,-0.0059"
-         style=""
-         id="path5637" />
-      <path
-         d="m 187.97365,32.682095 c -0.8711,3e-6 -1.47461,0.09961 -1.81055,0.298828 -0.33594,0.199221 -0.50391,0.539065 -0.50391,1.019531 0,0.382814 0.125,0.687501 0.375,0.914062 0.25391,0.222658 0.59766,0.333986 1.03125,0.333985 0.59766,1e-6 1.07617,-0.210937 1.43555,-0.632813 0.36328,-0.425779 0.54492,-0.990232 0.54492,-1.693359 l 0,-0.240234 -1.07226,0 m 2.15039,-0.445313 0,3.744141 -1.07813,0 0,-0.996094 c -0.24609,0.398438 -0.55274,0.69336 -0.91992,0.884766 -0.36719,0.187499 -0.81641,0.281249 -1.34765,0.28125 -0.67188,-10e-7 -1.20704,-0.1875 -1.60547,-0.5625 -0.39454,-0.378906 -0.5918,-0.884765 -0.5918,-1.517579 0,-0.738278 0.24609,-1.294918 0.73828,-1.669921 0.49609,-0.374996 1.23437,-0.562496 2.21484,-0.5625 l 1.51172,0 0,-0.105469 c 0,-0.496089 -0.16406,-0.878901 -0.49218,-1.148438 -0.32423,-0.273432 -0.78126,-0.41015 -1.3711,-0.410156 -0.375,6e-6 -0.74023,0.04493 -1.0957,0.134766 -0.35547,0.08985 -0.69727,0.224615 -1.02539,0.404297 l 0,-0.996094 c 0.39453,-0.152338 0.77734,-0.265619 1.14844,-0.339844 0.37109,-0.07812 0.73241,-0.117181 1.08398,-0.117187 0.94921,6e-6 1.6582,0.2461 2.12695,0.738281 0.46875,0.492193 0.70312,1.238286 0.70313,2.238281"
-         style=""
-         id="path5639" />
-      <path
-         d="m 196.6924,30.414516 0,-3.550781 1.07812,0 0,9.117188 -1.07812,0 0,-0.984375 c -0.22657,0.390625 -0.51368,0.681641 -0.86133,0.873047 -0.34375,0.187499 -0.75782,0.281249 -1.24219,0.28125 -0.79297,-10e-7 -1.43945,-0.316407 -1.93945,-0.949219 -0.4961,-0.632811 -0.74414,-1.464842 -0.74414,-2.496094 0,-1.031246 0.24804,-1.863276 0.74414,-2.496094 0.5,-0.632806 1.14648,-0.949212 1.93945,-0.949218 0.48437,6e-6 0.89844,0.09571 1.24219,0.287109 0.34765,0.187506 0.63476,0.476568 0.86133,0.867187 m -3.67383,2.291016 c 0,0.792971 0.16211,1.416018 0.48633,1.869141 0.32812,0.449219 0.77734,0.673829 1.34765,0.673828 0.57031,1e-6 1.01953,-0.224609 1.34766,-0.673828 0.32812,-0.453123 0.49218,-1.07617 0.49219,-1.869141 -1e-5,-0.792965 -0.16407,-1.414058 -0.49219,-1.863281 -0.32813,-0.45312 -0.77735,-0.679682 -1.34766,-0.679688 -0.57031,6e-6 -1.01953,0.226568 -1.34765,0.679688 -0.32422,0.449223 -0.48633,1.070316 -0.48633,1.863281"
-         style=""
-         id="path5641" />
-    </g>
-    <g
-       style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Times;-inkscape-font-specification:Times"
-       id="text5160">
-      <path
-         d="m 272.46338,30.556499 0,1.019532 c -0.30469,-0.156245 -0.6211,-0.273432 -0.94922,-0.351563 -0.32813,-0.07812 -0.66797,-0.117181 -1.01953,-0.117187 -0.53516,6e-6 -0.9375,0.08204 -1.20703,0.246093 -0.26563,0.164068 -0.39844,0.410162 -0.39844,0.738282 0,0.250004 0.0957,0.44727 0.28711,0.591797 0.1914,0.140629 0.57617,0.275394 1.1543,0.404296 l 0.36914,0.08203 c 0.76562,0.164066 1.30859,0.396487 1.6289,0.697265 0.32422,0.296878 0.48633,0.712893 0.48633,1.248047 0,0.609376 -0.24219,1.091798 -0.72656,1.447266 -0.48047,0.355469 -1.14258,0.533203 -1.98633,0.533203 -0.35156,0 -0.71875,-0.03516 -1.10156,-0.105469 -0.37891,-0.06641 -0.7793,-0.167968 -1.20117,-0.304687 l 0,-1.113282 c 0.39843,0.207033 0.79101,0.363283 1.17773,0.46875 0.38672,0.101564 0.76953,0.152345 1.14844,0.152344 0.50781,10e-7 0.89843,-0.08594 1.17187,-0.257812 0.27344,-0.17578 0.41015,-0.421874 0.41016,-0.738282 -10e-6,-0.292966 -0.0996,-0.517575 -0.29883,-0.673828 -0.19532,-0.156247 -0.62696,-0.306638 -1.29492,-0.451172 l -0.375,-0.08789 c -0.66797,-0.140622 -1.15039,-0.355466 -1.44727,-0.644531 -0.29687,-0.292965 -0.44531,-0.693355 -0.44531,-1.201172 0,-0.617182 0.21875,-1.093744 0.65625,-1.429688 0.4375,-0.335931 1.05859,-0.503899 1.86328,-0.503906 0.39844,7e-6 0.77344,0.0293 1.125,0.08789 0.35156,0.0586 0.67578,0.14649 0.97266,0.263671"
-         style=""
-         id="path5644" />
-      <path
-         d="m 274.42627,34.335796 0,-3.972656 1.07812,0 0,3.931641 c 0,0.621095 0.1211,1.087892 0.36329,1.40039 0.24218,0.308595 0.60546,0.462892 1.08984,0.462891 0.58203,10e-7 1.04101,-0.185546 1.37695,-0.556641 0.33984,-0.371092 0.50976,-0.876951 0.50977,-1.517578 l 0,-3.720703 1.07812,0 0,6.5625 -1.07812,0 0,-1.007812 c -0.26173,0.398438 -0.56641,0.695312 -0.91406,0.890625 -0.34376,0.191406 -0.74415,0.287109 -1.20118,0.287109 -0.7539,0 -1.32617,-0.234375 -1.71679,-0.703125 -0.39063,-0.468749 -0.58594,-1.154295 -0.58594,-2.056641"
-         style=""
-         id="path5646" />
-      <path
-         d="m 283.19775,35.941265 0,3.480469 -1.08398,0 0,-9.058594 1.08398,0 0,0.996094 c 0.22656,-0.390619 0.51172,-0.679681 0.85547,-0.867188 0.34766,-0.191399 0.76172,-0.287102 1.24219,-0.287109 0.79687,7e-6 1.44335,0.316413 1.93945,0.949219 0.5,0.632817 0.75,1.464848 0.75,2.496093 0,1.031253 -0.25,1.863283 -0.75,2.496094 -0.4961,0.632813 -1.14258,0.949219 -1.93945,0.949219 -0.48047,0 -0.89453,-0.09375 -1.24219,-0.28125 -0.34375,-0.191406 -0.62891,-0.482421 -0.85547,-0.873047 m 3.66797,-2.291016 c 0,-0.792964 -0.16407,-1.414057 -0.49218,-1.863281 -0.32423,-0.453119 -0.77149,-0.679681 -1.3418,-0.679687 -0.57032,6e-6 -1.01954,0.226568 -1.34766,0.679687 -0.32422,0.449224 -0.48633,1.070317 -0.48633,1.863281 0,0.792972 0.16211,1.416018 0.48633,1.869141 0.32812,0.44922 0.77734,0.673829 1.34766,0.673828 0.57031,10e-7 1.01757,-0.224608 1.3418,-0.673828 0.32811,-0.453123 0.49218,-1.076169 0.49218,-1.869141"
-         style=""
-         id="path5648" />
-      <path
-         d="m 295.38525,33.374859 0,0.527344 -4.95703,0 c 0.0469,0.742189 0.26953,1.308595 0.66797,1.699218 0.40234,0.38672 0.96094,0.580079 1.67578,0.580078 0.41406,10e-7 0.81445,-0.05078 1.20117,-0.152343 0.39062,-0.101562 0.77734,-0.253905 1.16016,-0.457032 l 0,1.019532 c -0.38672,0.164062 -0.78321,0.289062 -1.18945,0.375 -0.40626,0.08594 -0.81837,0.128906 -1.23633,0.128906 -1.04688,0 -1.87696,-0.304687 -2.49023,-0.914063 -0.60938,-0.609373 -0.91407,-1.433591 -0.91407,-2.472656 0,-1.074214 0.28906,-1.925776 0.86719,-2.554687 0.58203,-0.632806 1.36523,-0.949212 2.34961,-0.949219 0.88281,7e-6 1.58007,0.285163 2.0918,0.855469 0.51561,0.566411 0.77343,1.337895 0.77343,2.314453 m -1.07812,-0.316406 c -0.008,-0.58984 -0.17383,-1.060542 -0.49805,-1.41211 -0.32032,-0.351557 -0.7461,-0.527338 -1.27734,-0.527344 -0.60157,6e-6 -1.08399,0.169928 -1.44727,0.509766 -0.35937,0.339849 -0.56641,0.818364 -0.62109,1.435547 l 3.84375,-0.0059"
-         style=""
-         id="path5650" />
-      <path
-         d="m 300.93408,31.370953 c -0.1211,-0.07031 -0.25391,-0.121088 -0.39844,-0.152344 -0.14062,-0.03515 -0.29687,-0.05273 -0.46875,-0.05274 -0.60937,6e-6 -1.07812,0.199225 -1.40625,0.597657 -0.32422,0.394536 -0.48633,0.962895 -0.48632,1.705078 l 0,3.457031 -1.08399,0 0,-6.5625 1.08399,0 0,1.019531 c 0.22656,-0.398431 0.52148,-0.693353 0.88476,-0.884765 0.36328,-0.195306 0.80469,-0.292962 1.32422,-0.292969 0.0742,7e-6 0.15625,0.0059 0.24609,0.01758 0.0898,0.0078 0.18945,0.02149 0.29883,0.04102 l 0.006,1.107422"
-         style=""
-         id="path5652" />
-      <path
-         d="m 306.5415,30.615093 0,1.007813 c -0.30469,-0.167964 -0.61133,-0.292963 -0.91992,-0.375 -0.30469,-0.08593 -0.61328,-0.128901 -0.92578,-0.128907 -0.69922,6e-6 -1.24219,0.222662 -1.62891,0.667969 -0.38672,0.441411 -0.58008,1.062504 -0.58007,1.863281 -1e-5,0.800784 0.19335,1.42383 0.58007,1.869141 0.38672,0.441407 0.92969,0.66211 1.62891,0.662109 0.3125,10e-7 0.62109,-0.04101 0.92578,-0.123046 0.30859,-0.08594 0.61523,-0.21289 0.91992,-0.38086 l 0,0.996094 c -0.30078,0.140625 -0.61328,0.246094 -0.9375,0.316406 -0.32031,0.07031 -0.66211,0.105469 -1.02539,0.105469 -0.98828,0 -1.77344,-0.310547 -2.35547,-0.931641 -0.58203,-0.621092 -0.87304,-1.458982 -0.87304,-2.513672 0,-1.070308 0.29297,-1.912104 0.8789,-2.52539 0.58985,-0.613275 1.39649,-0.919915 2.41993,-0.919922 0.33202,7e-6 0.65624,0.03516 0.97265,0.105469 0.3164,0.06641 0.62304,0.167975 0.91992,0.304687"
-         style=""
-         id="path5654" />
-      <path
-         d="m 310.94775,31.118999 c -0.57812,6e-6 -1.03515,0.226569 -1.37109,0.679688 -0.33594,0.449223 -0.50391,1.06641 -0.50391,1.851562 0,0.785159 0.16602,1.404299 0.49805,1.857422 0.33594,0.44922 0.79492,0.673829 1.37695,0.673828 0.57422,10e-7 1.0293,-0.226561 1.36524,-0.679687 0.33593,-0.453123 0.5039,-1.07031 0.5039,-1.851563 0,-0.777339 -0.16797,-1.392573 -0.5039,-1.845703 -0.33594,-0.457025 -0.79102,-0.685541 -1.36524,-0.685547 m 0,-0.914062 c 0.9375,7e-6 1.67383,0.304694 2.20899,0.914062 0.53515,0.609381 0.80273,1.45313 0.80273,2.53125 0,1.074221 -0.26758,1.917971 -0.80273,2.53125 -0.53516,0.609376 -1.27149,0.914063 -2.20899,0.914063 -0.94141,0 -1.67969,-0.304687 -2.21484,-0.914063 -0.53125,-0.613279 -0.79688,-1.457029 -0.79687,-2.53125 -10e-6,-1.07812 0.26562,-1.921869 0.79687,-2.53125 0.53515,-0.609368 1.27343,-0.914055 2.21484,-0.914062"
-         style=""
-         id="path5656" />
-      <path
-         d="m 321.1958,32.964703 0,3.960937 -1.07812,0 0,-3.925781 c -1e-5,-0.621089 -0.1211,-1.085933 -0.36329,-1.394531 -0.24219,-0.308589 -0.60547,-0.462885 -1.08984,-0.462891 -0.58203,6e-6 -1.04102,0.185552 -1.37695,0.556641 -0.33594,0.371098 -0.50391,0.876957 -0.50391,1.517578 l 0,3.708984 -1.08398,0 0,-6.5625 1.08398,0 0,1.019531 c 0.25781,-0.394525 0.56055,-0.689447 0.9082,-0.884765 0.35156,-0.195306 0.75586,-0.292962 1.2129,-0.292969 0.7539,7e-6 1.32421,0.234381 1.71093,0.703125 0.38672,0.464849 0.58007,1.150395 0.58008,2.056641"
-         style=""
-         id="path5658" />
-      <path
-         d="m 327.67627,31.359234 0,-3.550781 1.07812,0 0,9.117187 -1.07812,0 0,-0.984375 c -0.22657,0.390626 -0.51368,0.681641 -0.86133,0.873047 -0.34375,0.1875 -0.75781,0.28125 -1.24219,0.28125 -0.79297,0 -1.43945,-0.316406 -1.93945,-0.949219 -0.49609,-0.632811 -0.74414,-1.464841 -0.74414,-2.496094 0,-1.031245 0.24805,-1.863276 0.74414,-2.496093 0.5,-0.632806 1.14648,-0.949212 1.93945,-0.949219 0.48438,7e-6 0.89844,0.09571 1.24219,0.287109 0.34765,0.187507 0.63476,0.476569 0.86133,0.867188 m -3.67383,2.291015 c 0,0.792972 0.16211,1.416018 0.48633,1.869141 0.32812,0.44922 0.77734,0.673829 1.34766,0.673828 0.5703,10e-7 1.01952,-0.224608 1.34765,-0.673828 0.32812,-0.453123 0.49218,-1.076169 0.49219,-1.869141 -10e-6,-0.792964 -0.16407,-1.414057 -0.49219,-1.863281 -0.32813,-0.453119 -0.77735,-0.679681 -1.34765,-0.679687 -0.57032,6e-6 -1.01954,0.226568 -1.34766,0.679687 -0.32422,0.449224 -0.48633,1.070317 -0.48633,1.863281"
-         style=""
-         id="path5660" />
-      <path
-         d="m 330.86377,34.335796 0,-3.972656 1.07812,0 0,3.931641 c 0,0.621095 0.1211,1.087892 0.36329,1.40039 0.24218,0.308595 0.60546,0.462892 1.08984,0.462891 0.58203,10e-7 1.04101,-0.185546 1.37695,-0.556641 0.33984,-0.371092 0.50976,-0.876951 0.50977,-1.517578 l 0,-3.720703 1.07812,0 0,6.5625 -1.07812,0 0,-1.007812 c -0.26173,0.398438 -0.56641,0.695312 -0.91406,0.890625 -0.34376,0.191406 -0.74415,0.287109 -1.20118,0.287109 -0.7539,0 -1.32617,-0.234375 -1.71679,-0.703125 -0.39063,-0.468749 -0.58594,-1.154295 -0.58594,-2.056641"
-         style=""
-         id="path5662" />
-      <path
-         d="m 343.31494,30.615093 0,1.007813 c -0.30469,-0.167964 -0.61133,-0.292963 -0.91992,-0.375 -0.30469,-0.08593 -0.61329,-0.128901 -0.92578,-0.128907 -0.69922,6e-6 -1.24219,0.222662 -1.62891,0.667969 -0.38672,0.441411 -0.58008,1.062504 -0.58008,1.863281 0,0.800784 0.19336,1.42383 0.58008,1.869141 0.38672,0.441407 0.92969,0.66211 1.62891,0.662109 0.31249,10e-7 0.62109,-0.04101 0.92578,-0.123046 0.30859,-0.08594 0.61523,-0.21289 0.91992,-0.38086 l 0,0.996094 c -0.30079,0.140625 -0.61329,0.246094 -0.9375,0.316406 -0.32032,0.07031 -0.66211,0.105469 -1.02539,0.105469 -0.98828,0 -1.77344,-0.310547 -2.35547,-0.931641 -0.58203,-0.621092 -0.87305,-1.458982 -0.87304,-2.513672 -10e-6,-1.070308 0.29296,-1.912104 0.8789,-2.52539 0.58984,-0.613275 1.39648,-0.919915 2.41992,-0.919922 0.33203,7e-6 0.65625,0.03516 0.97266,0.105469 0.3164,0.06641 0.62304,0.167975 0.91992,0.304687"
-         style=""
-         id="path5664" />
-      <path
-         d="m 346.24463,28.499859 0,1.863281 2.2207,0 0,0.837891 -2.2207,0 0,3.5625 c 0,0.535158 0.0723,0.878907 0.2168,1.03125 0.14843,0.152344 0.44726,0.228516 0.89648,0.228515 l 1.10742,0 0,0.902344 -1.10742,0 c -0.83203,0 -1.40625,-0.154297 -1.72266,-0.462891 -0.3164,-0.312499 -0.47461,-0.878904 -0.47461,-1.699218 l 0,-3.5625 -0.79101,0 0,-0.837891 0.79101,0 0,-1.863281 1.08399,0"
-         style=""
-         id="path5666" />
-      <path
-         d="m 352.43213,31.118999 c -0.57813,6e-6 -1.03516,0.226569 -1.37109,0.679688 -0.33594,0.449223 -0.50391,1.06641 -0.50391,1.851562 0,0.785159 0.16601,1.404299 0.49805,1.857422 0.33593,0.44922 0.79491,0.673829 1.37695,0.673828 0.57421,10e-7 1.02929,-0.226561 1.36523,-0.679687 0.33594,-0.453123 0.5039,-1.07031 0.50391,-1.851563 -10e-6,-0.777339 -0.16797,-1.392573 -0.50391,-1.845703 -0.33594,-0.457025 -0.79102,-0.685541 -1.36523,-0.685547 m 0,-0.914062 c 0.93749,7e-6 1.67382,0.304694 2.20898,0.914062 0.53515,0.609381 0.80273,1.45313 0.80274,2.53125 -10e-6,1.074221 -0.26759,1.917971 -0.80274,2.53125 -0.53516,0.609376 -1.27149,0.914063 -2.20898,0.914063 -0.94141,0 -1.67969,-0.304687 -2.21484,-0.914063 -0.53126,-0.613279 -0.79688,-1.457029 -0.79688,-2.53125 0,-1.07812 0.26562,-1.921869 0.79688,-2.53125 0.53515,-0.609368 1.27343,-0.914055 2.21484,-0.914062"
-         style=""
-         id="path5668" />
-      <path
-         d="m 361.02783,31.370953 c -0.1211,-0.07031 -0.25391,-0.121088 -0.39844,-0.152344 -0.14062,-0.03515 -0.29687,-0.05273 -0.46875,-0.05274 -0.60937,6e-6 -1.07812,0.199225 -1.40625,0.597657 -0.32422,0.394536 -0.48633,0.962895 -0.48632,1.705078 l 0,3.457031 -1.08399,0 0,-6.5625 1.08399,0 0,1.019531 c 0.22656,-0.398431 0.52148,-0.693353 0.88476,-0.884765 0.36328,-0.195306 0.80469,-0.292962 1.32422,-0.292969 0.0742,7e-6 0.15625,0.0059 0.24609,0.01758 0.0898,0.0078 0.18945,0.02149 0.29883,0.04102 l 0.006,1.107422"
-         style=""
-         id="path5670" />
-    </g>
-    <g
-       style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Times;-inkscape-font-specification:Times"
-       id="text5164">
-      <path
-         d="m 185.30331,121.15741 0,1.86328 2.22071,0 0,0.83789 -2.22071,0 0,3.5625 c 0,0.53516 0.0723,0.87891 0.2168,1.03125 0.14844,0.15235 0.44726,0.22852 0.89649,0.22852 l 1.10742,0 0,0.90234 -1.10742,0 c -0.83204,0 -1.40626,-0.1543 -1.72266,-0.46289 -0.31641,-0.3125 -0.47461,-0.8789 -0.47461,-1.69922 l 0,-3.5625 -0.79102,0 0,-0.83789 0.79102,0 0,-1.86328 1.08398,0"
-         style=""
-         id="path5673" />
-      <path
-         d="m 188.83652,126.99335 0,-3.97266 1.07812,0 0,3.93164 c 0,0.6211 0.12109,1.08789 0.36328,1.40039 0.24219,0.3086 0.60547,0.46289 1.08985,0.46289 0.58202,0 1.04101,-0.18554 1.37695,-0.55664 0.33984,-0.37109 0.50976,-0.87695 0.50977,-1.51758 l 0,-3.7207 1.07812,0 0,6.5625 -1.07812,0 0,-1.00781 c -0.26173,0.39844 -0.56642,0.69531 -0.91407,0.89062 -0.34375,0.19141 -0.74414,0.28711 -1.20117,0.28711 -0.75391,0 -1.32617,-0.23437 -1.7168,-0.70312 -0.39062,-0.46875 -0.58593,-1.1543 -0.58593,-2.05664"
-         style=""
-         id="path5675" />
-      <path
-         d="m 202.02011,125.62225 0,3.96094 -1.07812,0 0,-3.92578 c -1e-5,-0.62109 -0.1211,-1.08593 -0.36329,-1.39453 -0.24219,-0.30859 -0.60547,-0.46289 -1.08984,-0.46289 -0.58203,0 -1.04102,0.18555 -1.37695,0.55664 -0.33594,0.3711 -0.50391,0.87696 -0.50391,1.51758 l 0,3.70898 -1.08398,0 0,-6.5625 1.08398,0 0,1.01953 c 0.25781,-0.39452 0.56055,-0.68944 0.9082,-0.88476 0.35156,-0.19531 0.75586,-0.29297 1.2129,-0.29297 0.7539,0 1.32421,0.23438 1.71093,0.70312 0.38672,0.46485 0.58007,1.1504 0.58008,2.05664"
-         style=""
-         id="path5677" />
-      <path
-         d="m 209.6373,125.62225 0,3.96094 -1.07813,0 0,-3.92578 c 0,-0.62109 -0.1211,-1.08593 -0.36328,-1.39453 -0.24219,-0.30859 -0.60547,-0.46289 -1.08984,-0.46289 -0.58204,0 -1.04102,0.18555 -1.37695,0.55664 -0.33594,0.3711 -0.50391,0.87696 -0.50391,1.51758 l 0,3.70898 -1.08399,0 0,-6.5625 1.08399,0 0,1.01953 c 0.25781,-0.39452 0.56054,-0.68944 0.9082,-0.88476 0.35156,-0.19531 0.75586,-0.29297 1.21289,-0.29297 0.7539,0 1.32422,0.23438 1.71094,0.70312 0.38671,0.46485 0.58007,1.1504 0.58008,2.05664"
-         style=""
-         id="path5679" />
-      <path
-         d="m 217.41269,126.03241 0,0.52734 -4.95703,0 c 0.0469,0.74219 0.26953,1.3086 0.66797,1.69922 0.40234,0.38672 0.96093,0.58008 1.67578,0.58008 0.41406,0 0.81445,-0.0508 1.20117,-0.15234 0.39062,-0.10156 0.77734,-0.25391 1.16016,-0.45703 l 0,1.01953 c -0.38673,0.16406 -0.78321,0.28906 -1.18946,0.375 -0.40625,0.0859 -0.81836,0.1289 -1.23633,0.1289 -1.04687,0 -1.87695,-0.30468 -2.49023,-0.91406 -0.60938,-0.60937 -0.91406,-1.43359 -0.91406,-2.47266 0,-1.07421 0.28906,-1.92577 0.86719,-2.55468 0.58202,-0.63281 1.36523,-0.94922 2.3496,-0.94922 0.88281,0 1.58008,0.28516 2.0918,0.85547 0.51562,0.56641 0.77343,1.33789 0.77344,2.31445 m -1.07813,-0.31641 c -0.008,-0.58984 -0.17383,-1.06054 -0.49804,-1.41211 -0.32032,-0.35155 -0.7461,-0.52733 -1.27735,-0.52734 -0.60156,1e-5 -1.08398,0.16993 -1.44726,0.50977 -0.35938,0.33984 -0.56641,0.81836 -0.6211,1.43554 l 3.84375,-0.006"
-         style=""
-         id="path5681" />
-      <path
-         d="m 219.15878,120.466 1.07813,0 0,9.11719 -1.07813,0 0,-9.11719"
-         style=""
-         id="path5683" />
-      <path
-         d="m 231.01816,126.3078 c -1e-5,-0.79296 -0.16407,-1.41406 -0.49219,-1.86328 -0.32422,-0.45312 -0.77149,-0.67968 -1.3418,-0.67969 -0.57031,1e-5 -1.01953,0.22657 -1.34765,0.67969 -0.32422,0.44922 -0.48633,1.07032 -0.48633,1.86328 0,0.79297 0.16211,1.41602 0.48633,1.86914 0.32812,0.44922 0.77734,0.67383 1.34765,0.67383 0.57031,0 1.01758,-0.22461 1.3418,-0.67383 0.32812,-0.45312 0.49218,-1.07617 0.49219,-1.86914 m -3.66797,-2.29102 c 0.22656,-0.39061 0.51172,-0.67968 0.85547,-0.86718 0.34765,-0.1914 0.76171,-0.28711 1.24219,-0.28711 0.79687,0 1.44335,0.31641 1.93945,0.94922 0.49999,0.63281 0.74999,1.46484 0.75,2.49609 -1e-5,1.03125 -0.25001,1.86328 -0.75,2.49609 -0.4961,0.63282 -1.14258,0.94922 -1.93945,0.94922 -0.48048,0 -0.89454,-0.0937 -1.24219,-0.28125 -0.34375,-0.1914 -0.62891,-0.48242 -0.85547,-0.87304 l 0,0.98437 -1.08399,0 0,-9.11719 1.08399,0 0,3.55078"
-         style=""
-         id="path5685" />
-      <path
-         d="m 236.90683,126.28436 c -0.8711,10e-6 -1.47461,0.0996 -1.81055,0.29883 -0.33594,0.19922 -0.50391,0.53907 -0.5039,1.01953 -1e-5,0.38282 0.12499,0.6875 0.375,0.91406 0.2539,0.22266 0.59765,0.33399 1.03125,0.33399 0.59765,0 1.07616,-0.21094 1.43554,-0.63281 0.36328,-0.42578 0.54492,-0.99024 0.54493,-1.69336 l 0,-0.24024 -1.07227,0 m 2.15039,-0.44531 0,3.74414 -1.07812,0 0,-0.99609 c -0.2461,0.39844 -0.55274,0.69336 -0.91993,0.88476 -0.36719,0.1875 -0.81641,0.28125 -1.34765,0.28125 -0.67188,0 -1.20704,-0.1875 -1.60547,-0.5625 -0.39453,-0.3789 -0.5918,-0.88476 -0.5918,-1.51758 0,-0.73827 0.24609,-1.29491 0.73828,-1.66992 0.49609,-0.37499 1.23438,-0.56249 2.21485,-0.5625 l 1.51172,0 0,-0.10547 c -10e-6,-0.49608 -0.16407,-0.8789 -0.49219,-1.14843 -0.32423,-0.27344 -0.78126,-0.41015 -1.3711,-0.41016 -0.375,1e-5 -0.74023,0.0449 -1.0957,0.13477 -0.35547,0.0898 -0.69727,0.22461 -1.02539,0.40429 l 0,-0.99609 c 0.39453,-0.15234 0.77734,-0.26562 1.14844,-0.33984 0.37109,-0.0781 0.73242,-0.11719 1.08398,-0.11719 0.94922,0 1.6582,0.2461 2.12696,0.73828 0.46874,0.49219 0.70311,1.23829 0.70312,2.23828"
-         style=""
-         id="path5687" />
-      <path
-         d="m 245.10995,124.0285 c -0.12109,-0.0703 -0.25391,-0.12108 -0.39843,-0.15234 -0.14063,-0.0352 -0.29688,-0.0527 -0.46875,-0.0527 -0.60938,0 -1.07813,0.19922 -1.40625,0.59765 -0.32422,0.39454 -0.48633,0.9629 -0.48633,1.70508 l 0,3.45703 -1.08399,0 0,-6.5625 1.08399,0 0,1.01953 c 0.22656,-0.39843 0.52148,-0.69335 0.88476,-0.88476 0.36328,-0.19531 0.80469,-0.29297 1.32422,-0.29297 0.0742,0 0.15625,0.006 0.2461,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10742"
-         style=""
-         id="path5689" />
-      <path
-         d="m 249.84433,124.0285 c -0.1211,-0.0703 -0.25391,-0.12108 -0.39844,-0.15234 -0.14063,-0.0352 -0.29688,-0.0527 -0.46875,-0.0527 -0.60938,0 -1.07813,0.19922 -1.40625,0.59765 -0.32422,0.39454 -0.48633,0.9629 -0.48633,1.70508 l 0,3.45703 -1.08398,0 0,-6.5625 1.08398,0 0,1.01953 c 0.22656,-0.39843 0.52149,-0.69335 0.88477,-0.88476 0.36328,-0.19531 0.80468,-0.29297 1.32422,-0.29297 0.0742,0 0.15624,0.006 0.24609,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10742"
-         style=""
-         id="path5691" />
-      <path
-         d="m 250.98691,123.02069 1.07812,0 0,6.5625 -1.07812,0 0,-6.5625 m 0,-2.55469 1.07812,0 0,1.36524 -1.07812,0 0,-1.36524"
-         style=""
-         id="path5693" />
-      <path
-         d="m 259.92831,126.03241 0,0.52734 -4.95703,0 c 0.0469,0.74219 0.26953,1.3086 0.66797,1.69922 0.40234,0.38672 0.96094,0.58008 1.67578,0.58008 0.41406,0 0.81445,-0.0508 1.20117,-0.15234 0.39062,-0.10156 0.77734,-0.25391 1.16016,-0.45703 l 0,1.01953 c -0.38672,0.16406 -0.78321,0.28906 -1.18945,0.375 -0.40626,0.0859 -0.81837,0.1289 -1.23633,0.1289 -1.04688,0 -1.87696,-0.30468 -2.49023,-0.91406 -0.60938,-0.60937 -0.91407,-1.43359 -0.91407,-2.47266 0,-1.07421 0.28906,-1.92577 0.86719,-2.55468 0.58203,-0.63281 1.36523,-0.94922 2.34961,-0.94922 0.88281,0 1.58007,0.28516 2.0918,0.85547 0.51562,0.56641 0.77343,1.33789 0.77343,2.31445 m -1.07812,-0.31641 c -0.008,-0.58984 -0.17383,-1.06054 -0.49805,-1.41211 -0.32032,-0.35155 -0.7461,-0.52733 -1.27734,-0.52734 -0.60157,1e-5 -1.08399,0.16993 -1.44727,0.50977 -0.35937,0.33984 -0.56641,0.81836 -0.62109,1.43554 l 3.84375,-0.006"
-         style=""
-         id="path5695" />
-      <path
-         d="m 265.47714,124.0285 c -0.1211,-0.0703 -0.25391,-0.12108 -0.39844,-0.15234 -0.14062,-0.0352 -0.29687,-0.0527 -0.46875,-0.0527 -0.60937,0 -1.07812,0.19922 -1.40625,0.59765 -0.32422,0.39454 -0.48633,0.9629 -0.48632,1.70508 l 0,3.45703 -1.08399,0 0,-6.5625 1.08399,0 0,1.01953 c 0.22656,-0.39843 0.52148,-0.69335 0.88476,-0.88476 0.36328,-0.19531 0.80469,-0.29297 1.32422,-0.29297 0.0742,0 0.15625,0.006 0.24609,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10742"
-         style=""
-         id="path5697" />
-    </g>
-    <path
-       style="fill:none;stroke:#000000;stroke-width:1.41732287;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-end:url(#Arrow1Mend)"
-       d="M 99.212598,136.49111 109.53456,122.94866"
-       id="path5168"
-       transform="translate(114.19886,-19.255464)" />
-  </g>
-</svg>
diff --git a/doc/source/code/include/quantum_wire_revisited.py b/doc/source/code/include/quantum_wire_revisited.py
deleted file mode 100644
index 60add478..00000000
--- a/doc/source/code/include/quantum_wire_revisited.py
+++ /dev/null
@@ -1,91 +0,0 @@
-# Tutorial 2.2.3. Building the same system with less code
-# =======================================================
-#
-# Physics background
-# ------------------
-#  Conductance of a quantum wire; subbands
-#
-# Kwant features highlighted
-# --------------------------
-#  - Using iterables and builder.HoppingKind for making systems
-#  - introducing `reversed()` for the leads
-#
-# Note: Does the same as tutorial1a.py, but using other features of Kwant.
-
-#HIDDEN_BEGIN_xkzy
-import kwant
-
-# For plotting
-from matplotlib import pyplot
-
-
-def make_system(a=1, t=1.0, W=10, L=30):
-    # Start with an empty tight-binding system and a single square lattice.
-    # `a` is the lattice constant (by default set to 1 for simplicity.
-    lat = kwant.lattice.square(a)
-
-    syst = kwant.Builder()
-#HIDDEN_END_xkzy
-
-    #### Define the scattering region. ####
-#HIDDEN_BEGIN_vvjt
-    syst[(lat(x, y) for x in range(L) for y in range(W))] = 4 * t
-#HIDDEN_END_vvjt
-#HIDDEN_BEGIN_nooi
-    syst[lat.neighbors()] = -t
-#HIDDEN_END_nooi
-
-    #### Define and attach the leads. ####
-    # Construct the left lead.
-#HIDDEN_BEGIN_iepx
-    lead = kwant.Builder(kwant.TranslationalSymmetry((-a, 0)))
-    lead[(lat(0, j) for j in range(W))] = 4 * t
-    lead[lat.neighbors()] = -t
-#HIDDEN_END_iepx
-
-    # Attach the left lead and its reversed copy.
-#HIDDEN_BEGIN_yxot
-    syst.attach_lead(lead)
-    syst.attach_lead(lead.reversed())
-
-    return syst
-#HIDDEN_END_yxot
-
-
-#HIDDEN_BEGIN_ayuk
-def plot_conductance(syst, energies):
-    # Compute conductance
-    data = []
-    for energy in energies:
-        smatrix = kwant.smatrix(syst, energy)
-        data.append(smatrix.transmission(1, 0))
-
-    pyplot.figure()
-    pyplot.plot(energies, data)
-    pyplot.xlabel("energy [t]")
-    pyplot.ylabel("conductance [e^2/h]")
-    pyplot.show()
-#HIDDEN_END_ayuk
-
-
-#HIDDEN_BEGIN_cjel
-def main():
-    syst = make_system()
-
-    # Check that the system looks as intended.
-    kwant.plot(syst)
-
-    # Finalize the system.
-    syst = syst.finalized()
-
-    # We should see conductance steps.
-    plot_conductance(syst, energies=[0.01 * i for i in range(100)])
-#HIDDEN_END_cjel
-
-
-# Call the main function if the script gets executed (as opposed to imported).
-# See <http://docs.python.org/library/__main__.html>.
-#HIDDEN_BEGIN_ypbj
-if __name__ == '__main__':
-    main()
-#HIDDEN_END_ypbj
-- 
GitLab