jp-ellis / tikz-feynman Goto Github PK
View Code? Open in Web Editor NEWFeynman Diagrams with TikZ
Home Page: http://www.jpellis.me/projects/tikz-feynman
License: Other
Feynman Diagrams with TikZ
Home Page: http://www.jpellis.me/projects/tikz-feynman
License: Other
In some diagrams such as a box diagram, we have
\feynmandiagram[horizontal=i1 to f1,layered layout,inline=(d.base)]{
i1 -- [fermion] a -- [fermion] b -- [fermion] f1,
i2 -- [fermion] c -- [fermion] d -- [fermion] f2,
{ [same layer] a -- [photon] c},
{ [same layer] b-- [photon] d},
};
but as you can see, there's no node in the center (i.e. in the middle of a and c), so how can I set the baseline in there? Do you have any idea?
Thanks a lot.
For hadron physics, I could use some pion propagators. Those are usually double lines. I think the rationale is that those are compound particles. These are a couple of examples I could find quickly:
Would it be possible to have some double-line (and then perhaps also triple-line) style for tikz-feynman
?
I am trying to generate a mu \to e \gamma diagram with an effective operator at the vertex. My current code for the diagram is
\begin{feynman}
\vertex (a1) {\(\mu\)};
\vertex[right=1.5cm of a1, blob] (a2);
\vertex[right=1.5cm of a2] (a3) {\(e\)};
\vertex[above=1cm of a3] (p){\(\gamma \)};
\diagram* {
(a1) -- [fermion, momentum' = \( p \)] (a2) -- [fermion, momentum' = \(p-q\)] (a3),
(a2) -- [photon, momentum = \(q\)] (p)
};
\end{feynman}
However it does not generate the blob (it generates the rest of the diagram just fine).
I cannot figure out why not - any ideas?
Thanks for the awesome package !
However, I got some problem with the plots.
When I follow the examples, the diagrams are all squeezed to the left.
Which looks like
Untitled.pdf
How should I adjust the package to make it normal ?
Hi again,
I am trying to create this equation with a feynman diagram in it. I can't use \feynmandiagram as I can't seem to get two loops from independent vertices (or from the same vertex for that matter) so I have decided to do this:
\begin{equation}
Z = 1 + U
\begin{tikzpicture}
\begin{feynman}
\vertex[dot] (a) {};
\draw (a) arc [start angle=270, end angle=-90, radius=0.3cm];
\draw (a) arc [start angle=90, end angle=-270, radius=0.3cm];
\end{feynman}
\end{tikzpicture}
+ \ldots
\end{equation}
However, I can't get the equation to line up with the vertex using either \begin{feynman}[inline=(a)]
or \begin{feynman}[baseline=(a)]
. I understood that the same arguments to \feynmandiagram are applicable to the feynman environment. Am I mistaken?
Thanks again!
I realize that for now the package contains a "double" type edge which is purely plain double line, but is there doubled fermion (with arrows) or doubled photon (i.e. graviton in corresponding EFT) line? If not, do you have plans on those?
The default above/below spacing between labelled vertexes (~0.5cm for 12pt font size) is appended to the distance specified by users. This leads to imprecise distances between vertexes and results in unpredictable vertex placement when font sizes are varied.
\begin{feynman}
\vertex (a1) {\(b\)};
\vertex[right=1.5cm of a1] (a2);
\vertex[right=1.5cm of a2] (a3);
\vertex[right=1.5cm of a3] (a4) {\(s\)};
\vertex[below=1.5cm of a2] (b1);
\vertex[below=1.5cm of a3] (b2);
\vertex[below=1.0cm of a4] (b3) {\(\nu\)};
\vertex[below=0.75cm of b1] (c1);
\vertex[below=0.25cm of b3] (c2) {\(\bar{\nu}\)};
\diagram* {
{[edges=fermion]
(a1) -- (a2) -- [edge label=\(t\)] (a3) -- (a4),
},
(a2) -- [boson, edge label'=\(W\)] (b1),
(a3) -- [boson, edge label=\(W\)] (b2),
(b1) -- [fermion, edge label=\(l^{-}\)] (b2) -- [fermion] (b3),
(b1) -- [half right, looseness=2.0] (c1) -- [anti fermion] (c2)
};
\end{feynman}
Specifying labelled vertexes relative to unlabelled vertexes.
In the example above changing the lines
\vertex[below=1.0cm of a4] (b3) {\(\nu\)};
\vertex[below=0.25cm of b3] (c2) {\(\bar{\nu}\)};
to contain
\vertex[right=1.5cm of b2] (b3) {\(\nu\)};
\vertex[right=3.0cm of c1] (c2) {\(\bar{\nu}\)};
creates precisely horizontal lines.
Changing the spacing to be the user specified distance from the centre of the relative vertex when a nonzero distance is set, such that the lines
\vertex[below=1.5cm of a4] (b3) {\(\nu\)};
\vertex[below=0.75cm of b3] (c2) {\(\bar{\nu}\)};
would produce horizontal lines in the aforementioned example.
Leaving the current default spacing between labelled vertexes when no distance or 0cm is specified would make sense as a relative distance of 0cm is trivially the same vertex.
Hello,
Thanks for the package, it is great!
I am trying to create a very simple bubble diagram where I wish to give the (internal) vertices labels that appear below a dot. However, I can't seem to get this to work. I can get either the dot, or the label name in place of the dot (which, as you point out in the notes, breaks the lines).
I have tried both of the following thinking this API seemed reasonable:
\feynmandiagram [layered layout, horizontal=a to b] {
a [particle={$t_1$},dot] -- [fermion, half left] b [dot]
-- [fermion, half left] a,
};
\begin{tikzpicture}
\begin{feynman}
\vertex[dot] (a) {$t_1$};
\vertex[right= of a, dot] (b) {$t_2$};
\diagram* {
(a) -- [fermion, half left] (b),
(b) -- [fermion, half left] (a),
};
\end{feynman}
\end{tikzpicture}
However, neither works. In the second example, the dot simply becomes bigger. Is there a way to do this?
Thanks!
I realize that for now the package contains a "double" type edge which is purely plain double line, but is there doubled fermion (with arrows) or doubled photon (i.e. graviton in corresponding EFT) line? If not, do you have plans on those?
Hi, I am trying to shrink the length of a momentum arrow for a loop, it works fine when the shrink factor is not big, but when it is big, say, 0.7, the momentum arrow is even flipped. For example, the arrow shorten for vertex (b) is where the problem arises
\begin{figure}[H]
\begin{center}
\begin{tikzpicture}
\begin{feynman}
\vertex (a1);
\vertex[right=1.5cm of a1] (a2);
\vertex[right=3cm of a1] (a3);
\vertex[above=1cm of a2] (b);
\diagram*{
(a2) -- [double, out=150, in=180, momentum={[arrow shorten=0.3, arrow style=blue]$k'$}] (b),
(b) -- [double, out=0, in=30, momentum={[arrow shorten=0.7, arrow style=blue]$k'$}] (a2),
(a1) -- [momentum'={[arrow shorten=0.25]$k$}] (a2) -- [momentum'={[arrow shorten=0.25]$k$}] (a3),
};
\end{feynman}
\end{tikzpicture}
\end{center}
\end{figure}
Thanks!
I'm likely doing this incorrectly as I am still becoming ever more versed in latex so bear with me if this is a silly question.
I'm trying to make a simple loop graph equal to some equation. My code is
\begin{equation}
\feynmandiagram [baseline=(c), horizontal=b to c] {
a [particle=\(\phi\)] -- [scalar] b
-- [fermion, half left, looseness=1.5, edge label=\(\bar{\psi}\)] c
-- [fermion, half left, looseness=1.5, edge label=\(\psi\)] b,
c -- [scalar] d [particle=\(\phi\)],
};
= \Delta m^2
\end{equation}
I can use layered layout
but the =
is not inline with the scalar horizontal. If I use the above I get an out put inline but the scalar lines are angled off the horizontal (looks like /O/).
I am trying to use tikz-feynman but I have problems with pgfkeys. If I compile with pdflatex the example
\documentclass[border=10pt]{standalone}
\usepackage{tikz-feynman}
\usetikzlibrary{intersections}
\begin{document}
\feynmandiagram [horizontal=a to b] {
i1 -- [fermion] a -- [fermion] i2,
a -- [photon] b,
f1 -- [fermion] b -- [fermion] f2,
};
\end{document}
I obtain a series of errors:
Errors:
./feyn.tex:6: Package pgfkeys Error: I do not know the key '/tikz/horizontal', to which you passed 'a to b', and I am going to ignore it. Perhaps you misspelled it. [\feynmandiagram [horizontal=a to b] {]
./feyn.tex:6: Package pgfkeys Error: I do not know the key '/graph drawing/node distance', to which you passed '1.9cm', and I am going to ignore it. Perhaps you misspelled it. [\feynmandiagram [horizontal=a to b] {]
./feyn.tex:6: Package pgfkeys Error: I do not know the key '/graph drawing/level distance', to which you passed '1.5cm', and I am going to ignore it. Perhaps you misspelled it. [\feynmandiagram [horizontal=a to b] {]
./feyn.tex:6: Package pgfkeys Error: I do not know the key '/graph drawing/sibling distance', to which you passed '2.25cm', and I am going to ignore it. Perhaps you misspelled it. [\feynmandiagram [horizontal=a to b] {]
./feyn.tex:6: Package pgfkeys Error: I do not know the key '/tikz/graphs/spring layout' and I am going to ignore it. Perhaps you misspelled it. [\feynmandiagram [horizontal=a to b] {]
./feyn.tex:6: Package pgfkeys Error: I do not know the key '/tikz/horizontal', to which you passed 'a to b', and I am going to ignore it. Perhaps you misspelled it. [\feynmandiagram [horizontal=a to b] {]
Warnings:
./feyn.tex:4: Package tikz-feynman Warning: LuaTeX is required if you wish to have vertices automatically placed. You can disable this warning by setting /tikzfeynman/warn luatex=false on input line 4.
./feyn.tex:4: Package tikz-feynman Warning: Consider adding \tikzfeynmanset{compat=1.0.0} to your preamble so that you can be warned if TikZ-Feynman changes. on input line 4.
Add the ability to customize the tension of edges individually.
Based on this reply on Reddit.
Hi,
I must say this package is amazing! It makes things much easier than other packages.
I have several nodes and I want to put them on a horizontal line. If there are only two, I know I can use the option horizontal=a to b
. But I actually have more than 2. Is there any easy way to handle this?
Thank you,
Wei
When I draw a diagram with specific line widths for the edges and a momentum arrow alongside, I notice that the size of the arrow tip increases together with that line width, as shown in the example below. I guess this behaviour is not intended, is it?
\documentclass[tikz]{standalone}
\usepackage[compat=1.1.0]{tikz-feynman}
\begin{document}
\begin{tikzpicture}
\begin{feynman}
\diagram {
f1 -- [fermion, momentum'=$p_1$, ultra thin] v1;
f2 -- [anti fermion, momentum=$p_2$, ultra thick] v1;
p1 -- [photon, momentum=$p_3$, line width=3pt] v1;
};
\end{feynman}
\end{tikzpicture}
\end{document}
I like to split the optional arguments over multiple lines, like in this minimal (non-)working example:
\documentclass{scrartcl}
\usepackage{tikz-feynman}
\begin{document}
\feynmandiagram[
horizontal=a to b,
]
{
a -- b;
};
\end{document}
That works with most packages, here I get the following error:
! Package pgfkeys Error: I do not know the key '/tikz/ horizontal', to which yo
u passed 'a to b', and I am going to ignore it. Perhaps you misspelled it.
It is fixed then I use a percent sign right after the opening square bracket, like so:
\feynmandiagram[%
I am not sure why it works with other packages and not with this one, but I find it slightly irritating.
Thank you again for this great package, I made so many Feynman diagrams with it so far and I will continue to point out that tikz-feynman
does not destroy the gray value of your page like feynmp
does to everybody who does not believe that tikz-feynman
is the way to go!
This code
\documentclass[tikz]{standalone}
\usepackage{tikz-feynman}
\tikzfeynmanset{
every fermion/.style={blue},
}
\begin{document}
\begin{tikzpicture}
\begin{feynman}
\diagram [vertical=a to b]{
i1 [particle=\(\textup{e}^{-}\)] -- [fermion] a,
i2 [particle=\(\textup{e}^{-}\)] -- [anti fermion] a,
a -- [photon,edge label'=\(\gamma\)] b,
b -- [anti fermion] f1 [particle=\(\textup{e}^{-}\)],
b -- [fermion] f2 [particle=\(\textup{e}^{-}\)],
};
\draw[red,thick] ($(a)!0.5!(b)$) circle (1.85);
\end{feynman}
\end{tikzpicture}
\end{document}
used to give this output (see http://tex.stackexchange.com/a/290874/31416)
With version 1.0.0 I get
every fermion/.style={blue}
doesn't seem to have effect and the \gamma
label to the photon line probably changed position (I'm not 100% sure about the last point, it's possible that to produce the old picture I used edge label
).
just started to use your package (and I find it extremely wonderful), but i am quite annoyed with all the warnings saying that key "X" is ignored because I am not using LuaTex. I don't have time now to move to LuaTex (or to make work the code you gave on your blog), so it would be nice to have an option to disable the warnings. I have placed manually all vertices and the result looks good.
E.g. \feynmandiagram [large] { .. }
doesn't work when compiling with pdflatex
/xelatex
.
I don't know if this is a bug at all, as the Lua algorithms for node placement obviously isn't used when not compiling with lualatex
, but thought I'd report it anyway. I just skimmed the manual, but it isn't immediately obvious that the size changing keys shouldn't work with pdflatex
.
Hi! I already have an issue with the very first diagram. I am just trying to copy paste
\feynmandiagram [horizontal=a to b]
{ i1 -- [fermion] a -- [fermion] i2, a -- [photon] b,
f1 -- [fermion] b -- [fermion] f2,
};
But instead of a-b being horizontal I always get i1-a-i2 horizontal. Substituting horizontal with vertical or with horizontal' gives the exact same diagram. I don't know what I could possibly be doing wrong at this point.
It would nice if the compat=1.0.0 could alternatively be used in the optional argument of the package declaration, e.g., \usepackage[compat=1.0.0]{tikz-feynman}
Unless used else where, it would be logical to have version
as an alias to compat
I am trying to create a penguin diagram similar to
but i find myself unable to place a vertex in the middle of the curve. So far, considering only the b quark part, I have
\begin{tikzpicture}
\begin{feynman}
\vertex (a) {$b$};
\vertex [right=of a] (b);
\vertex [right=of b] (c);
\vertex [right=of c] (d) {$d$};
\diagram* {
(a) -- [fermion] (b) -- [fermion, edge label={$u,c,t$}] (c) -- [fermion] (d),
(b) -- [boson, half right] (c)
};
\end{feynman}
\end{tikzpicture}
but all attempts at adding the extra vertex have failed. Am I misunderstanding the manual or is this case not foreseen?
PS: Using arc
hasn't helped either...
I want to build a Feynman diagram with a scalar vertex correction in first order. It does look kind of okay:
There a couple of things that I'd like to improve:
label distance
to something like 15em
and nothing changed. How can I give those labels more space?Is there something I can change in my code? If not, could you perhaps improve the otherwise very promising package?
My code:
\begin{tikzpicture}
\graph[feynman, horizontal=v1 to v2]{
a
-- [fermion, momentum={$\four p$}] h1
-- [fermion, momentum'={$\four k$}] v1
-- [fermion, momentum'={$\four k' = \four k + \four q$}] h2
-- [fermion, momentum={$\four p'$}] b
;
h1 -- [scalar, semi-left, momentum={$\four p - \four k$}] h2;
v2 -- [photon, momentum={$\four q$}] v1;
};
\end{tikzpicture}
The \four
is some fancy four-vector using boldmath but should not break anything. The snippet is in my homework solutions project.
Hi sir, thanks very much for the great package.
I got a problem about the opacity
when using TikZ-Feynman package,
for example
\feynmandiagram{
v1 --[double distance=1.5pt,edge label=$n$] e4[particle=$n$],
v1 --[double distance=1.5pt,edge label=$l$] e2[particle=$l$],
e1 --[opacity=0] v1,
};
the line connecting vertex e1
and v1
should not be visible, but the output looks like this one:
Thanks again!
Many users like to indicate that two propagator lines cross only on paper
(without any physical interaction) by drawing one line as interrupted,
such that one propagator appears to run ON TOP of the other.
One possibility to implement this is via a "top" style option in the keys-file:
every top@@/.style={
/tikz/preaction={draw=\feynhandtopsepcolor,line width=\feynhandtopsep}
},
every top/.style={/tikzfeynhand/every top@@/.append style={#1}},
top/.style={
/tikzfeynhand/every top@@,
},
The preaction draws the propagator with color \feynhandtopsepcolor (default: white)
and width \feynhandtopsep (default: 2mm) across any earlier propagators.
After this, the propagator is drawn again with the usual style attributes.
You might want to use something more Tikz-like than a LaTex length and newcommand...
Anyway, the preaction should be practical both for manual and automatic drawing mode.
I'm trying to add red dots in the vertices but, for a certain reason they don't appear. I'm compiling with lualatex on overleaf.
\documentclass[a4paper,12pt]{article}
\usepackage[compat=1.1.0]{tikz-feynman}
\begin{document}
\begin{tikzpicture}
\draw [decoration={markings,mark=at position 1 with
{\arrow[scale=3,>=stealth]{>}}},postaction={decorate}] (5,1) -- (6.5,1);
\begin{feynman}
\vertex (a1) {\( b\)};
\vertex[right=1.5cm of a1, dot, red] (a2);
\vertex[above right=1cm of a2] (a3);
\vertex[below right=1cm of a3, dot, red] (a4);
\vertex[right=1cm of a4] (a5) {\( s\)};
\vertex[above=1cm of a5] (c1) {\(\ell ^+\)};
\vertex[above=1cm of c1] (c3) {\(\ell ^-\)};
\vertex[dot, red] at ($(c1)!0.5!(c3) - (1.5cm, 0)$) (c2);
%\vertex[above=1.5cm of a5] (c2);
\vertex[right=3cm of a5] (a1p) {\( b\)};
\vertex[right=2cm of a1p, dot, red] (a2p);
\vertex[right=2cm of a2p] (a5p) {\( s\)};
\vertex[above=1cm of a5p] (c1p) {\(\ell ^+\)};
\vertex[above=1cm of c1p] (c3p) {\(\ell ^-\)};
%\vertex[above=1.5cm of a5] (c2);
\diagram* {
{
{[edges=fermion]
(a1) -- (a2) -- [quarter left,edge label=\(t\),green!50!black](a3) -- [quarter left,edge label=\(t\),green!50!black] (a4) -- (a5)},
},
(c3) -- [fermion] (c2) -- [fermion] (c1),
(a3) -- [photon, bend left,edge label=\(Z\),green!50!black] (c2),
(a2) -- [boson, out=-60, in=240, looseness=1.50, edge label'=\(W^{+}\),green!50!black] (a4),
{
{[edges=fermion]
(a1p) -- (a2p) -- (a5p)},
},
(c3p) -- [fermion] (a2p) -- [fermion] (c1p)
};
\end{feynman}
\end{tikzpicture}
\end{document}
Hi!
Sorry again for more issues, I just started using the package (amazing, by the way) and I'm finding some problems.
The issue is I cannot use every vertex/.style
because I get the error
! Package pgfkeys Error: I do not know the key '/tikz/dot' and I am going to ig nore it. Perhaps you misspelled it.
I think I followed the manual, but maybe I misunderstood. If that's the case, I'll be happy to submit a pull request to make the wording clearer.
MWE follows:
\documentclass[a4paper]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usepackage{tikz-feynman}
\tikzfeynmanset{every vertex/.style={dot}}
\title{MWE}
\author{Albert Puig}
\date{}
\begin{document}
\begin{tikzpicture}
\begin{feynman}
\vertex (b1) {$i$};
\vertex [right=of b1] (b2);
\vertex [right=of b2] (b3) {$o$};
\diagram* {
(b1) -- [fermion] (b2) -- [fermion] (b3),
};
\end{feynman}
\end{tikzpicture}
\end{document}
Thanks a lot!
Charged ghosts need to be added.
Hi,
When I try to add momentum labels to an arc, it creates a label at every quarter of a circle:
\begin{tikzpicture}
\begin{feynman}
\vertex (a1);
\vertex[right=2cm of a1] (a2);
\vertex[right=2cm of a2] (a3);
\draw [scalar, momentum'=\(k\)] (a1) -- (a2);
\draw [scalar] (a2) -- (a3);
\draw [scalar, momentum'=\(p\)] (a2) arc [start angle=-90, end angle=270, radius=0.7cm];
\end{feynman}
\end{tikzpicture}
Is there anyway to control the labelling?
Thanks!
Is there a way to manually overlay a momentum arrow upon a scalar line, for example? I understand that double fermion line might have to wait, but I'm wondering if there's a workaround like this?
I intend to draw a tadpole diagram, i.e. a propagator from one vertex to itself. I'd find it straight forward to do this with \feynmandiagram{ i1 -- [gluon] v1, v1 -- [gluon] v1;};
but the loop is not drawn. Of course a workaround is to add a second vertex
\feynmandiagram{ i1 -- [gluon] v1, v1 -- [gluon, half left] v2, v2 -- [gluon, half left] v1; };
but that looks rather unpleasant in the case of gluons. If there is another way, I'd be happy to hear about it.
For a few days I'm intermittently trying to get this to work on a Ubuntu latex machine without luck and no solution in sight on the internets. Downloaded the latest pgf package and it keeps complaining about missing tikzlibraryarrows.meta.code.tex
. I have pgflibraryarrows.meta.code.tex
and tikzlibraryarrows.code.tex
on my system, but not the right combination.
Any ideas how to fix this?
Consider
\feynmandiagram[baseline=(v.base), vertical=v to w]{
ei [particle=$e^-$] -- [fermion] q -- [fermion] v -- [fermion] r -- [fermion] ef [particle=$e^-$],
pi [particle=$p$] -- [fermion] w -- [fermion] pf [particle=$p$],
q -- [photon] r,
v -- [photon] w,
};
This renders to the following with version 1.1.0 (coming from MacTeX 2016)
The fermion lines in the bottom are the mirror image of what they should be, aren't they? Or the fermion lines in the top are the mirror image of what they should be.
This is in reference to https://tex.stackexchange.com/questions/377299/tikz-feynman-asymmetry-between-particle-and-antiparticle-lines/410367#410367
Should the xshift
of the node
in with reversed arrow
have the opposite sign as that in with arrow
? Currently both with arrow
:
tikz-feynman/tikzfeynman.keys.code.tex
Line 295 in 8d18590
and with reversed arrow
:
tikz-feynman/tikzfeynman.keys.code.tex
Line 313 in 8d18590
do xshift=-0.5mm
, causing the asymmetry mentioned in that TeX.SX post.
Hello,
I am willing to use a double plain line in a Feynman diagram, but in https://jpellis.me/projects/tikz-feynman/tikz-feynman/tikz-feynman.pdf I didn't find a way to do it easily. See for example table 1 dbl_plain of http://www.pd.infn.it/TeX/doc/latex/feynmf/manual.pdf
Did I miss something?
Thanks a lot!
Hi JP! I need some help with my code. I'm trying to recreate Fig. 1 from the following paper: https://arxiv.org/pdf/1801.08627.pdf
A past group member made the images without using tikz feynman so I'm trying to recreate them using the package. I have the following:
\begin{tikzpicture}
\begin{feynman}
\vertex (a) {\(p_1\)};
\vertex[below right=of a](a1);
\vertex[below=1in of a1](b1);
\vertex[below left=of b1](b){\(p_2\)};
\vertex[right=1in of a1](c1);
\vertex[above right=of c1](c){\(p_3\)};
\vertex[right=1in of b1](d1);
\vertex[below right=of d1](d){\(p_4\)};
\diagram* {
(a) -- [fermion] (a1) ,
(b) -- [fermion] (b1),
(c1) -- [fermion] (c),
(d1) -- [fermion] (d),
(a1) -- [fermion, half left] (c1)
(c1) -- [fermion, half left] (d1)
(d1) -- [fermion, half left] (b1)
(b1) -- [fermion, half left] (a1)
};
\end{feynman}
\end{tikzpicture}
But it's not coming out quite right. Any help you can provide would be great. Thank you!
Maybe I'm missing something, when I try to compile the snippet provided in documentation regarding using \feynmandiagram
within an equation
environment compilation (with lualatex
) fails with many errors
\documentclass[tikz]{standalone}
\usepackage{tikz-feynman}
\begin{document}
\begin{equation}
\feynmandiagram [inline=(d.base), horizontal=d to b] {
a -- [fermion] b -- [fermion] c,
b -- [boson] d [particle=\(\gamma\)],
};
= i g_{e} \gamma^{\mu}
\end{equation}
\end{document}
Here are some of the errors:
./test.tex:8: Missing $ inserted.
<inserted text>
$
l.8 };
./test.tex:8: Missing \endgroup inserted.
<inserted text>
\endgroup
l.8 };
./test.tex:8: Display math should end with $$.
<to be read again>
\par
l.8 };
[1]
./test.tex:9: Missing $ inserted.
<inserted text>
$
l.9 = i g_
{e} \gamma^{\mu}
./test.tex:10: You can't use `\eqno' in math mode.
\endequation ->\eqno
\hbox {\@eqnnum }$$\@ignoretrue
l.10 \end{equation}
./test.tex:10: LaTeX Error: \begin{document} ended by \end{equation}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.10 \end{equation}
./test.tex:10: Missing $ inserted.
<inserted text>
$
l.10 \end{equation}
./test.tex:10: Extra \endgroup.
<recently read> \endgroup
l.10 \end{equation}
What am I missing?
I have been unable to fix it so far. Luckily, this bug results in only an inconvenience and the package is still completely usable. Suggestions to fix this bug are welcome!
Currently, absolute paths (starting with /
) are required when specifying style for keys. For example, this will work:
\tikzfeynmanset{
my dot/.style={
/tikzfeynman/dot,
/tikz/minimum size=3pt,
}
}
but
\tikzfeynmanset{
my dot/.style={
dot,
minimum size=3pt,
}
}
results in an the following error:
./test.tex:18: Package pgfkeys Error: I do not know the key '/minimum size', to
which you passed '3pt', and I am going to ignore it. Perhaps you misspelled it.
if my dot
gets used.
Currently, Ti_k_Z-Feynman override the way unknown keys in /tikz
are searched for by first looking in /tikzfeynman
. I did this because I have been unable to find any way of changing the search path within the {feynman}
environment such that keys are searched first /tikzfeynman
before searching elsewhere. If this is achievable, please let me know.
From my attempts at debugging, I believe the issue to be due either one (or more) of the following:
/tikz/.unknown
key is redefined at the start of the {feynman}
environment and the .style
handler operates (somehow) outside of that..style
handler uses a completely different method of locating unknown keys.After trying in vain to fix this, I posted the question on the TeX StackExchange, and user Symbol 1 provided a solution.
This has been implemented in the fix-search-paths
branch and it nearly works. I still run into issues with the graph drawing libraries.
Some help would still be appreciated.
On cloning, compiling with lualatex -shell-escape tikz-feynman.tex
fails as it cannot create the folder pgf-img
. Creating the folder fixes the problem, although it would be nice if this was done automatically (or at least documented in the README).
Hi, I really appreciate tikz-feynman package and your work. I would like to ask for an enhancement that, the photon propagator could be more smooth.
As I can see while it is magnified, the photon propagator is actually patched up with straight lines, which would be much more better if it is just the smooth sine function!
If there is anything I could do, please let know and I would really love to be able to help and make tikz-feynman better!
When drawing a propagator with color and momentum options, the propagator line and the momentum text are drawn/written in that color, but the momentum arrow is not.
Example code (v.1.1.0):
\feynmandiagram[horizontal=i1 to o1] { i1 -- [gluon, momentum=$p$, red] o1; };
When I draw a diagram with a 4 line vertex the line are always horizontal or vertical.
\feynmandiagram [] {
i1 -- [boson , edge label=\(W^+\)] a -- [photon, edge label=\(W^-\)] i2,
f1 -- [photon, edge label=\(Z\)] a -- [photon, edge label=\(Z\)] f2,
};
Is there any simple way to have diagonal lines instead?
I've seen sometimes Feynman diagrams with parallel lines drawn between two vertices (see for example https://cnlart.web.cern.ch/cnlart/221/node63.html and http://tex.stackexchange.com/q/121802/31416). Of course, they can be drawn manually using plain Ti_k_Z code, but it'd be great if this package provided a way to draw lines shifted by a specified amount and to a specified side.
For example, the syntax could be something like:
[...]
a -- b,
a -- [shift left=0.1] b,
a -- [shift right=0.1] b,
[...]
This time, I'm sure it's not written how to do this on the manual or on the site ;-)
Reported initially by @cm-cc in #11.
Compiling with LuaLaTeX on Ubuntu 15.10 results in an error. The log is here and the error in particular is:
! LuaTeX error ...carlo/texmf/tex/latex/tikz-feynman/tikzfeynman.patch.lua:966:
unknown phase
stack traceback:
[C]: in function 'assert'
...carlo/texmf/tex/latex/tikz-feynman/tikzfeynman.patch.lua:966: in function 'h
andle'
...carlo/texmf/tex/latex/tikz-feynman/tikzfeynman.patch.lua:979: in function 'g
et_current_options_table'
...carlo/texmf/tex/latex/tikz-feynman/tikzfeynman.patch.lua:139: in function 'b
eginGraphDrawingScope'
[\directlua]:1: in main chunk.
\pgfgdbeginscope ...@gd@parameter@stack@height ) }
\begingroup \pgfgdgraphdra...
l.7 \feynmandiagram [horizontal=a to b] {
TeXLive was installed through apt-get
with TikZ-Feynman installed with tlmgr
.
I created some diagram with uncharged scalars which had a loop. Since I need to label the loop momentum with a direction and the momentum
key does not work with semi-left
at the moment, I just used the charged scalar
option to have an arrow tip along the path. This arrow tip inherits a dashed border from the path itself it seems:
That picture is taken from the documentation that I have downloaded, so it also occurs with your setup. It would be cool if you could prevent this dashed border somehow. This is not urgent in any way, I just wanted to tell you about this as it is visible if you look really close.
From /u/nunudodo on reddit:
An elongated multi-vertex blob would be nice too. For example see
and
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.