TeX - LaTeX Asked on January 1, 2021
Starting from a recent answer
with this MWE:
documentclass[a4paper,12pt]{article}
usepackage{amssymb,amsmath}
usepackage{tikz-feynman}
tikzfeynmanset{compat=1.1.0}
newcommand{virgola}{smash{raisebox{0.1ex}{,}}}
begin{document}
feynmandiagram [layered layout, horizontal=b to c] {
a -- [boson,edge label'=(pvirgola a),charged boson] b
-- [fermion, half left, looseness=1.5,edge label'=(scriptstyle q+frac{p}{2})] c
-- [fermion, half left, looseness=1.5, edge label'=(scriptstyle q-frac{p}{2})] b,
c -- [boson,edge label'=(pvirgola a),charged boson] d,
};
end{document}
I have encountered these difficulties:
- I am not able to put the label of every fermion to outside of the graph. I read the manual and there is only the option of placing under boson, photon, etc.. I think that is exist only this option:
edge label'
;- Into the label can I put only symbols? For example I have created a comma "virgola" in math-mode. If I do not adopt this solution I get errors.
What are the solutions?
In edge label'
, the '
means "move label to the other side of the line", so use edge label
instead of edge label'
.
Regarding the comma, the problem is that the option list is a comma separated list, so if you have a comma in one of the entries you need to protect it with braces. In other words, use foo={bar, baz}
instead of foo=bar,baz
, otherwise the parser is confused by the comma. In your case, edge label'={(p, a)}
.
documentclass[a4paper,12pt]{article}
usepackage{amssymb,amsmath}
usepackage{tikz-feynman}
tikzfeynmanset{compat=1.1.0}
begin{document}
feynmandiagram [layered layout, horizontal=b to c] {
a -- [boson,edge label'={(p, a)},charged boson] b
-- [fermion, half left, looseness=1.5,edge label=(scriptstyle q+frac{p}{2})] c
-- [fermion, half left, looseness=1.5, edge label=(scriptstyle q-frac{p}{2})] b,
c -- [boson,edge label'={(p,a)},charged boson] d,
};
end{document}
Correct answer by Torbjørn T. on January 1, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP