Source-linked AI summary

TikZ-Feynman: Feynman diagrams with TikZ

Joshua Ellis

arXiv:1601.05437v1hep-ph

TL;DR

Drawing Feynman diagrams in LaTeX can involve complicated syntax, steep learning curves, external programs, and processing outside LaTeX. TikZ-Feynman addresses this with clear extensible syntax, TikZ-based automated placement, and manual positioning for complex diagrams. The package provides a LaTeX-native workflow while retaining fine-grained control, subject to layout-algorithm and version-compatibility caveats.

  • Problem

    Existing Feynman-diagram tools have complicated syntax and steep learning curves, while some require external programs or processing outside LaTeX.

  • Method

    TikZ-Feynman provides a clear extensible LaTeX syntax built on TikZ, using graph-placement algorithms with manual and relative vertex positioning options.

  • Results

    TikZ-Feynman enables Feynman diagrams to be generated within LaTeX without external programs while supporting automated placement and fine-tuned positioning.

  • Takeaways & Limitations

    The package offers a LaTeX-native diagram workflow that combines automated layouts with extensibility and manual control for complex diagrams.

  • Takeaways & Limitations

    Layout behavior is not universally reliable: some algorithms can become confused, and layered layout depends on vertex declaration order.

Abstract

from arXiv · show

TikZ-Feynman is a LaTeX package allowing Feynman diagrams to be easily generated within LaTeX with minimal user instructions and without the need of external programs. It builds upon the TikZ package and leverages the graph placement algorithms from TikZ in order to automate the placement of many vertices. TikZ-Feynman still allows fine-tuned placement of vertices so that even complex diagrams can still be generated with ease.

1 Introduction

TikZ-Feynman introduces a clear, extensible LaTeX syntax for drawing Feynman diagrams without external programs, while automating vertex placement and supporting manual refinement.

  • TikZ-Feynman provides a new way to draw Feynman diagrams in LaTeX without relying on external programs.
  • Existing approaches include feynMF/feynMP and AxoDraw, with JaxoDraw providing a graphical front end for AxoDraw.
  • Both feynMF/feynMP and AxoDraw have complicated syntax, illustrated by code examples for an ℓℓ→ℓℓ scattering diagram.
  • Earlier workflows have steep learning curves, and feynMF/feynMP requires further processing outside LaTeX.
  • TikZ-Feynman uses graph-placement algorithms through TikZ, while its extensible syntax and relative or absolute positioning support complex diagrams.
  • The project is open source, distributed through CTAN and its project page, with bug and feature management on GitHub.

Licence

The documentation and package are distributed under separate open-source licenses, and the work is maintained without warranty.

  • The documentation may be redistributed or modified under the GNU General Public License, version 3 or later.
  • The package code may be distributed or modified under the LaTeX Project Public License, version 1.3 or later.
  • The work has LPPL maintenance status ‘maintained’ and lists Joshua Ellis as its current maintainer.
  • The package is distributed without warranties, including merchantability or fitness for a particular purpose.

2 Tutorial

The tutorial introduces TikZ-Feynman’s basic diagram syntax, styling, automatic and manual layout options, and practical constraints of its placement algorithms.

  • TikZ-Feynman loads in the preamble and recommends a compatibility setting to prevent unannounced output changes from newer versions.
  • The \feynmandiagram command creates diagrams using vertex sequences connected by styled edges and requires a terminating semicolon.
  • Edge styles such as fermion and photon, together with options for momentum arrows and particle labels, add diagram-specific notation.
  • By default, TikZ-Feynman uses a spring layout that spreads vertices apart and often produces satisfactory simpler diagrams.
  • Alternative algorithms can improve layouts in some cases, but layered layout depends on vertex declaration order.
  • Invisible edges influence vertex placement without being drawn, allowing selected states to remain closer together.
  • For complicated diagrams, vertices can be manually positioned with \vertex, using explicit coordinates or relative placement through TikZ’s positioning library.
  • After vertices are specified, \diagram* connects existing named vertices using a basic algorithm intended primarily for pre-positioned nodes.

3.1 Commands & Environments

TikZ-Feynman organizes diagram construction through TikZ-based environments and commands for configuring options, declaring vertices, and specifying graph structure.

  • Options are processed with \pgfkeys using /tikzfeynman as the default path and commonly appear as comma-separated key=value entries.
  • The commands create tikzpicture and feynman environments and place a \diagram using supplied diagram instructions and options.
  • The feynman environment enables TikZ-Feynman styles and commands such as \vertex and \diagram within a tikzpicture.
  • The \vertex command declares named vertices, optionally applies particle contents and styles, and requires a final semicolon.
  • The \diagram command begins a diagram using the spring layout and accepts general TikZ, graph-specific, and TikZ-Feynman keys.
  • Diagram instructions specify vertices, connect them with --, apply edge options in brackets, and separate sequences with commas or semicolons.
  • The \diagram* command uses a basic placement algorithm and is intended to connect vertices declared and positioned outside the command.

3.2 Keys & Styles

TikZ-Feynman keys control styling, alignment, sizing, vertex appearance, and graph layout. Users can extend or replace styles and choose algorithms or orientation constraints for diagrams.

  • Key conventions: Keys prefixed with /tikzfeynman define TikZ-Feynman options, while selected TikZ and graph-drawing keys are also documented.
  • Style customization: Users can append styles or define replacements, but predefined styles should be modified through every keys or append style rather than overwritten.
  • Scope: Diagram-wide styles apply inside diagram commands, whereas every feynman styles apply to feynman environments and their contained TikZ commands.
  • Alignment: Inline and baseline keys align diagrams to a specified node, with inline adding diagram-fitting styles and baseline leaving those additional styles out.
  • Layouts: Spring, spring electrical, Sugiyama, and tree layouts provide alternative vertex-placement strategies, while horizontal or vertical keys orient or mirror the result.
  • Sizing: Small, medium, and large keys change vertex separation and shape sizes; medium is default, small suits simple diagrams, and large suits illustrations.
  • Layouts: Layered layouts place the first vertex above the second and can force vertices onto the same layer, creating hierarchies useful for decays.
  • Vertex styles: Vertex styles include coordinate, empty dot, crossed dot, blob, dot, and square dot, with every vertex-shape keys enabling targeted customization.

4 Examples

The examples demonstrate practical diagram construction using custom vertices, edges, positioning, labels, decorations, and layout-related commands. The section also includes generated index entries and implementation examples.

  • Diagram construction: Practical examples combine fermion lines, half-left edges, same-layer constraints, edge labels, and explicitly named vertices.
  • Positioning: Custom vertices can be positioned geometrically, including at interpolated points or offsets between existing vertices.
  • Edges: Examples build multi-line diagrams by connecting named vertices with ordered fermion, boson, and gluon edges, including bends and fractional turns.
  • Documentation: The package documentation's index is automatically generated and explicitly described as incomplete because it lacks carefully selected keywords.
Loading 1601.05437v1…