Skip to content

Commit

Permalink
Merge pull request #18 from JP-Ellis/develop
Browse files Browse the repository at this point in the history
Merge v1.1.0 into master.
  • Loading branch information
JP-Ellis committed Feb 5, 2016
2 parents a43386e + 5f22ee1 commit 8d18590
Show file tree
Hide file tree
Showing 14 changed files with 1,440 additions and 280 deletions.
12 changes: 12 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/.gitmodules export-ignore
/.latexmkrc export-ignore
/.tlmgr-dep export-ignore
/.travis.yml export-ignore
/images export-ignore
/pages export-ignore
/pgfmanual-en-macros.tex export-ignore
/push-pages.sh export-ignore
/tests.tex export-ignore
/texlive.profile export-ignore
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,3 @@ _region_.*
# Ignore backup files and temporary files
*~
*#

# Ignore pages
/pages/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "pages"]
path = pages
url = https://github.com/JP-Ellis/tikz-feynman.git
1 change: 1 addition & 0 deletions .tlmgr-dep
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ newtx
oberdiek
pdftex-def
pgf
pgfopts
siunitx
substr
textpos
Expand Down
10 changes: 10 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
This documentation may be redistributed and/or modified under the terms of the
GNU General Public License as published by the Free Software Foundation, either
version 3 of the License, or (at your option) any later version.

The code of this package may be distributed and/or modified under the conditions
of the LaTeX Project Public License, either version 1.3 of this license or (at
your option) any later version.

A copy of both licenses are included hereunder:

################################################################################

GNU GENERAL PUBLIC LICENSE
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[Ti*k*Z-Feynman](http://www.jpellis.me/projects/tikz-feynman) [![ctan.org](https://img.shields.io/ctan/v/tikz-feynman.svg)](https://ctan.org/pkg/tikz-feynman) [![Travis](https://img.shields.io/travis/JP-Ellis/tikz-feynman.svg)](https://travis-ci.org/JP-Ellis/tikz-feynman)
[Ti*k*Z-Feynman](http://www.jpellis.me/projects/tikz-feynman) [![ctan.org](https://img.shields.io/ctan/v/tikz-feynman.svg)](https://ctan.org/pkg/tikz-feynman) [![Travis](https://img.shields.io/travis/JP-Ellis/tikz-feynman/master.svg)](https://travis-ci.org/JP-Ellis/tikz-feynman)
=============================================================

Ti*k*Z-Feynman is a LaTeX package allowing Feynman diagrams to be easily
Expand Down
1 change: 1 addition & 0 deletions pages
Submodule pages added at 61578d
12 changes: 11 additions & 1 deletion references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ @article{hu2005
@article{eades1991,
author = "Peter,Eades and Kozo,Sugiyama",
title = "How to Draw a Directed Graph",
journal = "Journal of Information Processing ",
journal = "Journal of Information Processing",
year = 1991,
volume = 13,
number = 4,
Expand Down Expand Up @@ -111,3 +111,13 @@ @article{PhysRev.76.769
doi = {10.1103/PhysRev.76.769},
url = {http://link.aps.org/doi/10.1103/PhysRev.76.769}
}

@article{tikz-feynman,
title = {Tik{Z}-{F}eynman: {F}eynman diagrams with {T}ik{Z}},
author = {Ellis, Joshua},
archivePrefix = {arXiv},
year = 2016,
eprint = {1601.05437},
primaryClass = {hep-ph},
url = {http://arxiv.org/abs/1601.05437},
}
5 changes: 3 additions & 2 deletions tikz-feynman.sty
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def\tikzfeynman@date{2016/01/19}
\def\tikzfeynman@date{2016/02/05}
\def\tikzfeynman@version@major{1}
\def\tikzfeynman@version@minor{0}
\def\tikzfeynman@version@minor{1}
\def\tikzfeynman@version@patch{0}
\edef\tikzfeynman@version{\tikzfeynman@version@major.\tikzfeynman@version@minor.\tikzfeynman@version@patch}

\ProvidesPackage{tikz-feynman}[\tikzfeynman@date v\tikzfeynman@version Feynman diagrams with TikZ]

\RequirePackage{tikz}[2013/12/13] % v3.0.0
\RequirePackage{ifluatex}
\RequirePackage{pgfopts}

\usetikzlibrary{feynman}

Expand Down
130 changes: 86 additions & 44 deletions tikz-feynman.tex
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@
%% Page breaks can be avoided at particular places by using \\*
\allowdisplaybreaks[2]

\DeclarePairedDelimiter{\angles}{\langle}{\rangle}

%% Tables
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Expand Down Expand Up @@ -158,9 +160,12 @@
%% hyperref should be loaded first
\usepackage[
backend=biber,
autocite=inline,
style=phys,
autocite=inline,
biblabel=brackets,
eprint=true,
doi=true,
isbn=true,
]{biblatex}
\addbibresource{references.bib}
Expand Down Expand Up @@ -351,7 +356,7 @@
the need of external programs. It builds upon the \tikzname{} package and
leverages the graph placement algorithms from \tikzname{} in order to automate
the placement of many vertices. \tikzfeynmanname{} still allows fine-tuned
placement of vertices so that even complex diagrams can still be generated with
placement of vertices so that even complex diagrams can be generated with
ease.
\end{abstract}
\fi
Expand All @@ -362,6 +367,13 @@ \section{Introduction}
\tikzfeynmanname{} provides a new way to draw Feynman diagrams in \LaTeX{} that
does not rely on external programs and uses a clear extensible syntax.
\ifarxiv\else
If you use \tikzfeynmanname{} in an academic setting, please cite:
\begin{quote}
\fullcite{tikz-feynman}
\end{quote}
\fi
Feynman diagrams provide a description of interactions of subatomic particles in
a form that is clearer and more succinct than the corresponding mathematical
description. They were introduced by \citeauthor{PhysRev.76.769} and first
Expand Down Expand Up @@ -446,9 +458,10 @@ \section{Introduction}
backwards compatible. Finally, changes in the first number (|1.0.0| to |2.0.0|)
indicates a major change in the package and code written for |1.0.0| is not
guaranteed to work on |2.0.0|. The intended version of this package to use
should be indicated in the preamble with |\tikzfeynmanset{compat=x.y.z}| so the
user may be informed of any discrepancy. If needed, earlier versions may be
downloaded from the \href{http://www.jpellis.me/projects/tikz-feynman}{project
should be indicated when the package is loaded with
|\usepackage[compat=x.y.z]{tikz-feynman}| so the user may be informed of any
discrepancyx. If needed, earlier versions may be downloaded from the
\href{http://www.jpellis.me/projects/tikz-feynman}{project
page}\footnote{\url{http://www.jpellis.me/projects/tikz-feynman}}.
\subsection*{Licence}
Expand Down Expand Up @@ -485,9 +498,10 @@ \subsection{Loading the Package}
After installing the package, the \tikzfeynmanname{} package can be loaded with
|\usepackage{tikz-feynman}| in the preamble. It is recommend that you also
place |\tikzfeynmanset{compat=1.0.0}| in the preamble to ensure that a new
versions of \tikzfeynmanname{} do not produce any undesirable changes without
warning.
specify the version of \tikzfeynmanname{} to use with the optional package
argument |compat|: |\usepackage[compat=1.1.0]{tikz-feynman}|. This ensures that
any new versions of \tikzfeynmanname{} do not produce any undesirable changes
without warning.
\subsection{A First Diagram}
\label{subsec:a_first_diagram}
Expand Down Expand Up @@ -552,6 +566,12 @@ \subsection{A First Diagram}
};
\end{codeexample}
As a final remark, the calculation of where vertices should be placed is usually
done through an algorithm written in Lua. As a result, \LuaTeX{} is required in
order to make use of these algorithms. If \LuaTeX{} is not used,
\tikzfeynmanname{} will default to a more rudimentary algorithm and will warn
the user instead.
\subsection{Adding Styles}
\label{subsec:adding_styles}
Expand Down Expand Up @@ -582,6 +602,16 @@ \subsection{Adding Styles}
For a list of all the various styles that \tikzname{} provides, have a look at
the \pgfmanual; it is extremely thorough and provides many usage examples.
\tikzfeynmanname{} also supports combining styles together which can be useful
in certain new models such as supersymmetry:
\begin{codeexample}[]
\feynmandiagram [horizontal=a to b] {
i1 [particle=\(\tilde W\)] -- [plain, boson] a -- [anti fermion] i2 [particle=\(q\)],
a -- [charged scalar, edge label=\(\tilde q\)] b,
f1 [particle=\(\tilde g\)] -- [plain, gluon] b -- [fermion] [particle=\(q\)],
};
\end{codeexample}
\subsection{When the Algorithm Isn't Enough}
\label{subsec:when_the_algorithm_isnt_enough}
Expand Down Expand Up @@ -870,14 +900,14 @@ \subsection{Keys \emph{\&} Styles}
prefixed with |/tikz| or |/graph drawing|. Please refer to the \pgfmanual{} for
a more in thorough documentation of the \tikzname{} keys.
If you wish to modify the default \tikzfeynmanname{} styles, the best way to do
this is to use \meta{key}|/.append style={...}|. For example, to make every
diagram red except for small diagrams which remain black, one would add to the
preamble:
\tikzfeynmanname{} provides many |every |\meta{key} which allow every instance
of \meta{key} to be modified. For example, to make every diagram red except for
small diagrams which should be blue, then one would add to the preamble:
\begin{codeexample}[execute code=false]
\tikzfeynmanset{
every diagram/.append style={red},
small/.append style={black},
every diagram={red},
every small={blue},
}
\end{codeexample}
If you are completely unhappy with a particular inbuilt style, you can define
Expand All @@ -888,17 +918,11 @@ \subsection{Keys \emph{\&} Styles}
myblob/.style={
shape=circle,
draw=blue,
fill=red}
fill=red,
}
}
\end{codeexample}
All the |every |\meta{key} keys documented here are initially empty, so it is up
to you whether you use \meta{key}|/.append style| or \meta{key}|/.style|. The
predefined style keys (such as |small|, |particle|, |fermion|, etc.) should
\emph{never} by modified with \meta{key}|/.style| as that will overwrite the
style entirely. Instead, modify the appropriate |every |\meta{key} if available
or use \meta{key}|/.append style|.
All the keys defined here are made available inside the |{feynman}| environment
and inside |\feynmandiagram|; but if you wish to access them outside of this
(say, in a regular |{tikzpicture}| environment), you will need to specify the
Expand All @@ -914,22 +938,22 @@ \subsubsection{Feynman Keys}
environment.
\end{keylist}
\begin{stylekey}{/tikzfeynman/every feynman}
\begin{key}{/tikzfeynman/every feynman=\meta{styles}}
Set of styles which are applied to every |{feynman}| environments (and
consequently, every apply inside all |\feynmandiagram| too). The style also
applies to regular \tikzname{} commands used inside the |{feynman}|
environment.
\begin{codeexample}[]
\tikzfeynmanset{every feynman/.append style={red}}
\tikzfeynmanset{every feynman={red}}
\begin{tikzpicture}
\node at (0, 0.5) {This is not red};
\begin{feynman}
\node at (0, -0.5) {This is red};
\end{feynman}
\end{tikzpicture}
\end{codeexample}
\end{stylekey}
\end{key}
\begin{stylekey}{/tikzfeynman/inline=\meta{node}}
A style used to display a Feynman diagram inline (typically in an equation),
Expand Down Expand Up @@ -1022,19 +1046,19 @@ \subsubsection{Feynman Keys}
\subsubsection{Diagram Keys}
\label{subsubsec:diagram_keys}
\begin{stylekey}{/tikzfeynman/every diagram}
\begin{key}{/tikzfeynman/every diagram=\meta{styles}}
Set of styles which are applied to every diagram; that is, to everything
inside the |\feynmandiagram|, |\diagram| and |\diagram*| commands but not the
general |{feynman}| environment (see \cref{subsubsec:feynman_keys} for that).
\begin{codeexample}[]
\tikzfeynmanset{every diagram/.append style={red}}
\tikzfeynmanset{every diagram={red}}
\feynmandiagram [small, horizontal=d to b] {
a -- [fermion] b -- [fermion] c,
b -- [boson] d,
};
\end{codeexample}
\end{stylekey}
\end{key}
\begin{keylist}{%
/tikzfeynman/small,
Expand Down Expand Up @@ -1068,7 +1092,10 @@ \subsubsection{Diagram Keys}
all provided within the |graph drawing| library from \tikzname. Below are
listed a few of these layouts which are more relevant for drawing Feynman
diagrams. For a more complete description of how these algorithm work, please
refer to the \pgfmanual{}.
refer to the \pgfmanual{}. Please note that most graph drawing algorithms are
implemented in Lua and thus require \LuaTeX{} in order to work. If \LuaTeX{} is
not used, \tikzfeynmanname{} will default to a more rudimentary algorithm and
will warn the user instead.
\begin{key}{/graph drawing/spring layout=\opt{\meta{string}}}
Uses Hu's spring layout \cite{hu2005} as implemented by Pohlmann
Expand Down Expand Up @@ -1162,24 +1189,24 @@ \subsubsection{Vertex Keys}
that is, a null shape with no size or width.
\end{key}
\begin{stylekey}{/tikzfeynman/every \meta{vertex shape} (initially \normalfont empty)}
\begin{key}{/tikzfeynman/every \meta{vertex shape}=\meta{styles}}
The style of specific vertices can be modified by changing the appropriate
|every |\meta{vertex shape} key. For example, in order to change the style of
every |dot|-styled vertex, you can modify the |every dot| key, or to modify
every vertex globally, the |every vertex| key can be modified.
\begin{codeexample}[]
\tikzfeynmanset{
every vertex/.style={red, dot},
every particle/.style={blue},
every blob/.style={draw=green!40!black, pattern color=green!40!black},
every vertex={red, dot},
every particle={blue},
every blob={draw=green!40!black, pattern color=green!40!black},
}
\feynmandiagram [horizontal=a to b] {
a [particle={\(\gamma, Z\)}] -- [boson] b [blob],
c -- [fermion] b -- [fermion] d,
};
\end{codeexample}
\end{stylekey}
\end{key}
\begin{key}{/tikzfeynman/dot}
Modifies the vertex so that it has a small filled circle.
Expand Down Expand Up @@ -1258,32 +1285,47 @@ \subsubsection{Edge Keys}
Just like with the various vertex keys, each edge type has a corresponding
|every |\meta{edge type}; however, due to the existence of very similar keys
such as |scalar|, |charged scalar| and |anti charged scalar|, more specific keys
inherit styles from less specific ones. For example, styles in
|every charged scalar| will apply to |charged scalar| and |anti charged scalar|
but not |scalar| whilst styles in |every scalar| will apply to all three.
inherit styles from less specific ones. For example, styles in |every scalar|
will apply to |charged scalar| and |anti charged scalar|.
The edge styles do not override each other and instead stack. This means that
an edge styled with both |boson| and |fermion| will consist of a straight line
with a wavy line on top and an error. If not styles are provided, then a simple
solid line is drawn.
\begin{stylekey}{/tikzfeynman/every edge (initially \normalfont empty)}
\begin{key}{/tikzfeynman/every edge=\meta{styles}}
A style to apply to every edge initially.
\end{stylekey}
\end{key}
\begin{stylekey}{/tikzfeynman/every \meta{edge style} (initially \normalfont empty)}
\begin{stylekey}{/tikzfeynman/every \meta{edge style}=\meta{styles}}
The style of specific edges can be modified by changing the appropriate
|every |\meta{edge style} key. For example, in order to make a global change
to every |boson|, you can modify the |every boson| key.
\begin{codeexample}[]
\tikzfeynmanset{
every edge/.style={fermion},
every boson/.style={red},
every photon/.style={blue},
every edge={green},
every boson={red},
every photon={blue},
}
\feynmandiagram [small] {
a [particle=\(a\)] -- [boson] o -- [photon] b [particle=\(b\)],
f1 [particle=\(c\)] -- o -- f2 [particle=\(d\)],
f1 [particle=\(c\)] -- [fermion] o -- [scalar] f2 [particle=\(d\)],
};
\end{codeexample}
\end{stylekey}
\begin{key}{/tikzfeynman/plain}
Draws a simple solid line. This style is identical to the default style
applied if no other style is used, but is provided so that it can be combined
with other styles.
\begin{codeexample}[]
\feynmandiagram [horizontal=a to b] {a -- [plain] b};
\feynmandiagram [horizontal=a to b] {a -- [plain, gluon] b};
\end{codeexample}
\end{key}
\begin{key}{/tikzfeynman/boson}
Draws a sinusoidal line to denote a boson.
Expand Down
Loading

0 comments on commit 8d18590

Please sign in to comment.