tikz-feynman: edge labels
I would like to understand how can I label edges of diagrams as at this picture:
I assume that it possible to label vertices and than move each label, but I do not know how. Can anyone gives some suggestions?
What I tried: label each vertex
begin{feynman}
vertex (v1) {(cl)};
vertex[right=0.5cm of v1] (v2) {(cl)};
vertex[right=1cm of v2] (v3) {(cl)};
vertex[right=0.5cm of v3] (v4) {(cl)};;
diagram*{(v1)--(v2), (v2)--[half left](v3)--[half left](v2),(v3)--(v4)};
end{feynman}
It is awful. Then, I have tried to label edges:
begin{feynman}
vertex (v1);
vertex[right=0.5cm of v1] (v2);
vertex[right=1cm of v2] (v3);
vertex[right=0.5cm of v3] (v4);
diagram*{(v1)--[edge label={(cl quad)}](v2), (v2)--[half left,edge label={(cl quad cl)}](v3)--[half left,edge label={(cl quad cl)}](v2),(v3)--[edge label={(quad cl)}](v4)};
end{feynman}
It looks not so awful, but not perfect: labels are so far from edges.
tikz-feynman
add a comment |
I would like to understand how can I label edges of diagrams as at this picture:
I assume that it possible to label vertices and than move each label, but I do not know how. Can anyone gives some suggestions?
What I tried: label each vertex
begin{feynman}
vertex (v1) {(cl)};
vertex[right=0.5cm of v1] (v2) {(cl)};
vertex[right=1cm of v2] (v3) {(cl)};
vertex[right=0.5cm of v3] (v4) {(cl)};;
diagram*{(v1)--(v2), (v2)--[half left](v3)--[half left](v2),(v3)--(v4)};
end{feynman}
It is awful. Then, I have tried to label edges:
begin{feynman}
vertex (v1);
vertex[right=0.5cm of v1] (v2);
vertex[right=1cm of v2] (v3);
vertex[right=0.5cm of v3] (v4);
diagram*{(v1)--[edge label={(cl quad)}](v2), (v2)--[half left,edge label={(cl quad cl)}](v3)--[half left,edge label={(cl quad cl)}](v2),(v3)--[edge label={(quad cl)}](v4)};
end{feynman}
It looks not so awful, but not perfect: labels are so far from edges.
tikz-feynman
Could you please remove the green tick and give it to the user valerie? His answer is impeccable. Thank you.
– Sebastiano
1 hour ago
add a comment |
I would like to understand how can I label edges of diagrams as at this picture:
I assume that it possible to label vertices and than move each label, but I do not know how. Can anyone gives some suggestions?
What I tried: label each vertex
begin{feynman}
vertex (v1) {(cl)};
vertex[right=0.5cm of v1] (v2) {(cl)};
vertex[right=1cm of v2] (v3) {(cl)};
vertex[right=0.5cm of v3] (v4) {(cl)};;
diagram*{(v1)--(v2), (v2)--[half left](v3)--[half left](v2),(v3)--(v4)};
end{feynman}
It is awful. Then, I have tried to label edges:
begin{feynman}
vertex (v1);
vertex[right=0.5cm of v1] (v2);
vertex[right=1cm of v2] (v3);
vertex[right=0.5cm of v3] (v4);
diagram*{(v1)--[edge label={(cl quad)}](v2), (v2)--[half left,edge label={(cl quad cl)}](v3)--[half left,edge label={(cl quad cl)}](v2),(v3)--[edge label={(quad cl)}](v4)};
end{feynman}
It looks not so awful, but not perfect: labels are so far from edges.
tikz-feynman
I would like to understand how can I label edges of diagrams as at this picture:
I assume that it possible to label vertices and than move each label, but I do not know how. Can anyone gives some suggestions?
What I tried: label each vertex
begin{feynman}
vertex (v1) {(cl)};
vertex[right=0.5cm of v1] (v2) {(cl)};
vertex[right=1cm of v2] (v3) {(cl)};
vertex[right=0.5cm of v3] (v4) {(cl)};;
diagram*{(v1)--(v2), (v2)--[half left](v3)--[half left](v2),(v3)--(v4)};
end{feynman}
It is awful. Then, I have tried to label edges:
begin{feynman}
vertex (v1);
vertex[right=0.5cm of v1] (v2);
vertex[right=1cm of v2] (v3);
vertex[right=0.5cm of v3] (v4);
diagram*{(v1)--[edge label={(cl quad)}](v2), (v2)--[half left,edge label={(cl quad cl)}](v3)--[half left,edge label={(cl quad cl)}](v2),(v3)--[edge label={(quad cl)}](v4)};
end{feynman}
It looks not so awful, but not perfect: labels are so far from edges.
tikz-feynman
tikz-feynman
edited 6 hours ago
Artem Alexandrov
asked 7 hours ago
Artem AlexandrovArtem Alexandrov
134
134
Could you please remove the green tick and give it to the user valerie? His answer is impeccable. Thank you.
– Sebastiano
1 hour ago
add a comment |
Could you please remove the green tick and give it to the user valerie? His answer is impeccable. Thank you.
– Sebastiano
1 hour ago
Could you please remove the green tick and give it to the user valerie? His answer is impeccable. Thank you.
– Sebastiano
1 hour ago
Could you please remove the green tick and give it to the user valerie? His answer is impeccable. Thank you.
– Sebastiano
1 hour ago
add a comment |
2 Answers
2
active
oldest
votes
I have kept the same structure as you by eliminating your labels and I have inserted them manually using nodes.... (a) (b) ....
with cartesian coordinates that have all small labels and are closer to the ellipse.
documentclass[tikz]{article}
usepackage{tikz-feynman}
tikzfeynmanset{compat=1.0.0}
begin{document}
begin{tikzpicture}
begin{feynman}
vertex (v1);
vertex[right=0.5cm of v1] (v2);
vertex[right=1cm of v2] (v3);
vertex[right=0.5cm of v3] (v4);
diagram*{(v1)--[edge label={{}}](v2),
(v2)--[half left,edge label={}](v3)--[half left,edge label={}](v2),
(v3)--[edge label={}](v4)};
end{feynman}
node(a) at (.6,-.5) {small cl};
node(b) at (1.35,-.5) {small cl};
node(c) at (.6,.5) {small cl};
node(d) at (1.35,.5) {small cl};
node(e) at (-.11,.15) {small cl};
node(f) at (2.1,.15) {small cl};
end{tikzpicture}
end{document}
add a comment |
Using hardcoded coordinates like node(a) at (.6,-.5) {small cl};
in tikz is a deadly sin, this will break as soon as you change the tiniest thing.
to move the labels on the horizontal lines to the start and end of the lines, use
near start
andnear end
to move the labels around the circle closer to the line, reduce the
inner sep
don't use inline math to make multi-letter things italic
% !TeX TS-program = lualatex
documentclass{article}
usepackage{tikz-feynman}
begin{document}
begin{tikzpicture}
begin{feynman}
vertex (v1);
vertex[right=0.5cm of v1] (v2);
vertex[right=1cm of v2] (v3);
vertex[right=0.5cm of v3] (v4);
diagram*{
(v1)--[edge label={textit{cl}},near start](v2),
(v2)--[half left,edge label={textit{clquad cl}},inner sep=1pt](v3)--[half left,edge label={textit{clquad cl}},inner sep=1pt](v2),
(v3)--[edge label={textit{cl}},near end](v4)
};
end{feynman}
end{tikzpicture}
end{document}
Alternatively without any manual intervention, one can let tikz-feynman
do it's job:
% !TeX TS-program = lualatex
documentclass{article}
usepackage{tikz-feynman}
begin{document}
begin{tikzpicture}[inner sep=2pt]
itshape
begin{feynman}
diagram[horizontal=a to f,small]{
a--[edge label={cl},near start]b,
b -- [quarter right,edge label'={cl}]
c -- [quarter right,edge label'={cl}]
d -- [quarter right,edge label'={cl}]
e -- [quarter right,edge label'={cl}]
b,
d--[edge label={cl},near end]f
};
end{feynman}
end{tikzpicture}
end{document}
New contributor
Very good (+1). I have given my little contribute. I hope I haven't made a deadly sin. After see the comment to the OP.
– Sebastiano
1 hour ago
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f487519%2ftikz-feynman-edge-labels%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I have kept the same structure as you by eliminating your labels and I have inserted them manually using nodes.... (a) (b) ....
with cartesian coordinates that have all small labels and are closer to the ellipse.
documentclass[tikz]{article}
usepackage{tikz-feynman}
tikzfeynmanset{compat=1.0.0}
begin{document}
begin{tikzpicture}
begin{feynman}
vertex (v1);
vertex[right=0.5cm of v1] (v2);
vertex[right=1cm of v2] (v3);
vertex[right=0.5cm of v3] (v4);
diagram*{(v1)--[edge label={{}}](v2),
(v2)--[half left,edge label={}](v3)--[half left,edge label={}](v2),
(v3)--[edge label={}](v4)};
end{feynman}
node(a) at (.6,-.5) {small cl};
node(b) at (1.35,-.5) {small cl};
node(c) at (.6,.5) {small cl};
node(d) at (1.35,.5) {small cl};
node(e) at (-.11,.15) {small cl};
node(f) at (2.1,.15) {small cl};
end{tikzpicture}
end{document}
add a comment |
I have kept the same structure as you by eliminating your labels and I have inserted them manually using nodes.... (a) (b) ....
with cartesian coordinates that have all small labels and are closer to the ellipse.
documentclass[tikz]{article}
usepackage{tikz-feynman}
tikzfeynmanset{compat=1.0.0}
begin{document}
begin{tikzpicture}
begin{feynman}
vertex (v1);
vertex[right=0.5cm of v1] (v2);
vertex[right=1cm of v2] (v3);
vertex[right=0.5cm of v3] (v4);
diagram*{(v1)--[edge label={{}}](v2),
(v2)--[half left,edge label={}](v3)--[half left,edge label={}](v2),
(v3)--[edge label={}](v4)};
end{feynman}
node(a) at (.6,-.5) {small cl};
node(b) at (1.35,-.5) {small cl};
node(c) at (.6,.5) {small cl};
node(d) at (1.35,.5) {small cl};
node(e) at (-.11,.15) {small cl};
node(f) at (2.1,.15) {small cl};
end{tikzpicture}
end{document}
add a comment |
I have kept the same structure as you by eliminating your labels and I have inserted them manually using nodes.... (a) (b) ....
with cartesian coordinates that have all small labels and are closer to the ellipse.
documentclass[tikz]{article}
usepackage{tikz-feynman}
tikzfeynmanset{compat=1.0.0}
begin{document}
begin{tikzpicture}
begin{feynman}
vertex (v1);
vertex[right=0.5cm of v1] (v2);
vertex[right=1cm of v2] (v3);
vertex[right=0.5cm of v3] (v4);
diagram*{(v1)--[edge label={{}}](v2),
(v2)--[half left,edge label={}](v3)--[half left,edge label={}](v2),
(v3)--[edge label={}](v4)};
end{feynman}
node(a) at (.6,-.5) {small cl};
node(b) at (1.35,-.5) {small cl};
node(c) at (.6,.5) {small cl};
node(d) at (1.35,.5) {small cl};
node(e) at (-.11,.15) {small cl};
node(f) at (2.1,.15) {small cl};
end{tikzpicture}
end{document}
I have kept the same structure as you by eliminating your labels and I have inserted them manually using nodes.... (a) (b) ....
with cartesian coordinates that have all small labels and are closer to the ellipse.
documentclass[tikz]{article}
usepackage{tikz-feynman}
tikzfeynmanset{compat=1.0.0}
begin{document}
begin{tikzpicture}
begin{feynman}
vertex (v1);
vertex[right=0.5cm of v1] (v2);
vertex[right=1cm of v2] (v3);
vertex[right=0.5cm of v3] (v4);
diagram*{(v1)--[edge label={{}}](v2),
(v2)--[half left,edge label={}](v3)--[half left,edge label={}](v2),
(v3)--[edge label={}](v4)};
end{feynman}
node(a) at (.6,-.5) {small cl};
node(b) at (1.35,-.5) {small cl};
node(c) at (.6,.5) {small cl};
node(d) at (1.35,.5) {small cl};
node(e) at (-.11,.15) {small cl};
node(f) at (2.1,.15) {small cl};
end{tikzpicture}
end{document}
edited 5 hours ago
answered 5 hours ago
SebastianoSebastiano
11.5k42366
11.5k42366
add a comment |
add a comment |
Using hardcoded coordinates like node(a) at (.6,-.5) {small cl};
in tikz is a deadly sin, this will break as soon as you change the tiniest thing.
to move the labels on the horizontal lines to the start and end of the lines, use
near start
andnear end
to move the labels around the circle closer to the line, reduce the
inner sep
don't use inline math to make multi-letter things italic
% !TeX TS-program = lualatex
documentclass{article}
usepackage{tikz-feynman}
begin{document}
begin{tikzpicture}
begin{feynman}
vertex (v1);
vertex[right=0.5cm of v1] (v2);
vertex[right=1cm of v2] (v3);
vertex[right=0.5cm of v3] (v4);
diagram*{
(v1)--[edge label={textit{cl}},near start](v2),
(v2)--[half left,edge label={textit{clquad cl}},inner sep=1pt](v3)--[half left,edge label={textit{clquad cl}},inner sep=1pt](v2),
(v3)--[edge label={textit{cl}},near end](v4)
};
end{feynman}
end{tikzpicture}
end{document}
Alternatively without any manual intervention, one can let tikz-feynman
do it's job:
% !TeX TS-program = lualatex
documentclass{article}
usepackage{tikz-feynman}
begin{document}
begin{tikzpicture}[inner sep=2pt]
itshape
begin{feynman}
diagram[horizontal=a to f,small]{
a--[edge label={cl},near start]b,
b -- [quarter right,edge label'={cl}]
c -- [quarter right,edge label'={cl}]
d -- [quarter right,edge label'={cl}]
e -- [quarter right,edge label'={cl}]
b,
d--[edge label={cl},near end]f
};
end{feynman}
end{tikzpicture}
end{document}
New contributor
Very good (+1). I have given my little contribute. I hope I haven't made a deadly sin. After see the comment to the OP.
– Sebastiano
1 hour ago
add a comment |
Using hardcoded coordinates like node(a) at (.6,-.5) {small cl};
in tikz is a deadly sin, this will break as soon as you change the tiniest thing.
to move the labels on the horizontal lines to the start and end of the lines, use
near start
andnear end
to move the labels around the circle closer to the line, reduce the
inner sep
don't use inline math to make multi-letter things italic
% !TeX TS-program = lualatex
documentclass{article}
usepackage{tikz-feynman}
begin{document}
begin{tikzpicture}
begin{feynman}
vertex (v1);
vertex[right=0.5cm of v1] (v2);
vertex[right=1cm of v2] (v3);
vertex[right=0.5cm of v3] (v4);
diagram*{
(v1)--[edge label={textit{cl}},near start](v2),
(v2)--[half left,edge label={textit{clquad cl}},inner sep=1pt](v3)--[half left,edge label={textit{clquad cl}},inner sep=1pt](v2),
(v3)--[edge label={textit{cl}},near end](v4)
};
end{feynman}
end{tikzpicture}
end{document}
Alternatively without any manual intervention, one can let tikz-feynman
do it's job:
% !TeX TS-program = lualatex
documentclass{article}
usepackage{tikz-feynman}
begin{document}
begin{tikzpicture}[inner sep=2pt]
itshape
begin{feynman}
diagram[horizontal=a to f,small]{
a--[edge label={cl},near start]b,
b -- [quarter right,edge label'={cl}]
c -- [quarter right,edge label'={cl}]
d -- [quarter right,edge label'={cl}]
e -- [quarter right,edge label'={cl}]
b,
d--[edge label={cl},near end]f
};
end{feynman}
end{tikzpicture}
end{document}
New contributor
Very good (+1). I have given my little contribute. I hope I haven't made a deadly sin. After see the comment to the OP.
– Sebastiano
1 hour ago
add a comment |
Using hardcoded coordinates like node(a) at (.6,-.5) {small cl};
in tikz is a deadly sin, this will break as soon as you change the tiniest thing.
to move the labels on the horizontal lines to the start and end of the lines, use
near start
andnear end
to move the labels around the circle closer to the line, reduce the
inner sep
don't use inline math to make multi-letter things italic
% !TeX TS-program = lualatex
documentclass{article}
usepackage{tikz-feynman}
begin{document}
begin{tikzpicture}
begin{feynman}
vertex (v1);
vertex[right=0.5cm of v1] (v2);
vertex[right=1cm of v2] (v3);
vertex[right=0.5cm of v3] (v4);
diagram*{
(v1)--[edge label={textit{cl}},near start](v2),
(v2)--[half left,edge label={textit{clquad cl}},inner sep=1pt](v3)--[half left,edge label={textit{clquad cl}},inner sep=1pt](v2),
(v3)--[edge label={textit{cl}},near end](v4)
};
end{feynman}
end{tikzpicture}
end{document}
Alternatively without any manual intervention, one can let tikz-feynman
do it's job:
% !TeX TS-program = lualatex
documentclass{article}
usepackage{tikz-feynman}
begin{document}
begin{tikzpicture}[inner sep=2pt]
itshape
begin{feynman}
diagram[horizontal=a to f,small]{
a--[edge label={cl},near start]b,
b -- [quarter right,edge label'={cl}]
c -- [quarter right,edge label'={cl}]
d -- [quarter right,edge label'={cl}]
e -- [quarter right,edge label'={cl}]
b,
d--[edge label={cl},near end]f
};
end{feynman}
end{tikzpicture}
end{document}
New contributor
Using hardcoded coordinates like node(a) at (.6,-.5) {small cl};
in tikz is a deadly sin, this will break as soon as you change the tiniest thing.
to move the labels on the horizontal lines to the start and end of the lines, use
near start
andnear end
to move the labels around the circle closer to the line, reduce the
inner sep
don't use inline math to make multi-letter things italic
% !TeX TS-program = lualatex
documentclass{article}
usepackage{tikz-feynman}
begin{document}
begin{tikzpicture}
begin{feynman}
vertex (v1);
vertex[right=0.5cm of v1] (v2);
vertex[right=1cm of v2] (v3);
vertex[right=0.5cm of v3] (v4);
diagram*{
(v1)--[edge label={textit{cl}},near start](v2),
(v2)--[half left,edge label={textit{clquad cl}},inner sep=1pt](v3)--[half left,edge label={textit{clquad cl}},inner sep=1pt](v2),
(v3)--[edge label={textit{cl}},near end](v4)
};
end{feynman}
end{tikzpicture}
end{document}
Alternatively without any manual intervention, one can let tikz-feynman
do it's job:
% !TeX TS-program = lualatex
documentclass{article}
usepackage{tikz-feynman}
begin{document}
begin{tikzpicture}[inner sep=2pt]
itshape
begin{feynman}
diagram[horizontal=a to f,small]{
a--[edge label={cl},near start]b,
b -- [quarter right,edge label'={cl}]
c -- [quarter right,edge label'={cl}]
d -- [quarter right,edge label'={cl}]
e -- [quarter right,edge label'={cl}]
b,
d--[edge label={cl},near end]f
};
end{feynman}
end{tikzpicture}
end{document}
New contributor
edited 2 hours ago
New contributor
answered 4 hours ago
valerievalerie
764
764
New contributor
New contributor
Very good (+1). I have given my little contribute. I hope I haven't made a deadly sin. After see the comment to the OP.
– Sebastiano
1 hour ago
add a comment |
Very good (+1). I have given my little contribute. I hope I haven't made a deadly sin. After see the comment to the OP.
– Sebastiano
1 hour ago
Very good (+1). I have given my little contribute. I hope I haven't made a deadly sin. After see the comment to the OP.
– Sebastiano
1 hour ago
Very good (+1). I have given my little contribute. I hope I haven't made a deadly sin. After see the comment to the OP.
– Sebastiano
1 hour ago
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f487519%2ftikz-feynman-edge-labels%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Could you please remove the green tick and give it to the user valerie? His answer is impeccable. Thank you.
– Sebastiano
1 hour ago