Problem using variables with feynmp fmffor Announcing the arrival of Valued Associate #679:...

Direct Experience of Meditation

Is above average number of years spent on PhD considered a red flag in future academia or industry positions?

Estimate capacitor parameters

Replacing HDD with SSD; what about non-APFS/APFS?

What are the performance impacts of 'functional' Rust?

How can I make names more distinctive without making them longer?

Do working physicists consider Newtonian mechanics to be "falsified"?

Is there folklore associating late breastfeeding with low intelligence and/or gullibility?

Writing Thesis: Copying from published papers

What is the electric potential inside a point charge?

Statistical model of ligand substitution

Can a 1st-level character have an ability score above 18?

How to rotate it perfectly?

Complexity of many constant time steps with occasional logarithmic steps

Why does this iterative way of solving of equation work?

How to pour concrete for curved walkway to prevent cracking?

Make it rain characters

What LEGO pieces have "real-world" functionality?

How does modal jazz use chord progressions?

Keep going mode for require-package

Is it possible to ask for a hotel room without minibar/extra services?

Was credit for the black hole image misattributed?

How to retrograde a note sequence in Finale?

Why is "Captain Marvel" translated as male in Portugal?



Problem using variables with feynmp fmffor



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Problem using variables with feynmpAutomatic spacing with feynmf/feynmp?Feynmp together with beamerFeynmp: Circle with five verticesDrawing tadpole diagram using feynmpHow can a label be positioned in feynmp?Balance length of lines in Feynman diagram (feynmp)How to use feynmf (feynmp)?Self-energy diagram using feynmphow do I put a dot in a fmf line using feynmp?Problem using variables with feynmp












0















This is a follow-up to this question. The solution provided by egreg worked, but the same solution doesn't work when trying to update a variable within an fmffor loop. A complete example is shown below. The expected behavior is to produce two photons each bending in the opposite direction (right=+0.5, and right=-0.5), but instead temp is always set to +0.5 in the simple.mp file.



documentclass[border=2cm]{standalone}
usepackage{feynmp}
usepackage[pdftex]{graphicx}
usepackage{pgf}

DeclareGraphicsRule{*}{mps}{*}{}

begin{document}
begin{fmffile}{fgraphs}

newcommand{efmf}[1]{
begingroupedefx{endgroupnoexpandfmf{#1}}x
}

begin{fmffile}{simple}
begin{fmfgraph*}(450,320)
fmftopn{t}{3} fmfn{plain}{t}{3}
fmfbottomn{b}{3} fmfn{plain}{b}{3}
pgfmathsetmacro{temp}{-0.5}
begin{fmffor}{n}{1}{1}{2}
pgfmathsetmacro{temp}{temp+1}
efmf{photon, foreground=blue, tension=0.1, right=temp}{t2,b2}
end{fmffor}
end{fmfgraph*}
end{fmffile}


end{fmffile}
end{document}









share|improve this question







New contributor




user1247 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • If temp is -0.5, then temp+1 is 0.5. What's the problem? You're simply doing the vconnect operation twice with the same data.

    – egreg
    8 mins ago













  • Note that fmffor doesn't execute the body multiple times, but only writes code for a Metapost loop.

    – egreg
    2 mins ago


















0















This is a follow-up to this question. The solution provided by egreg worked, but the same solution doesn't work when trying to update a variable within an fmffor loop. A complete example is shown below. The expected behavior is to produce two photons each bending in the opposite direction (right=+0.5, and right=-0.5), but instead temp is always set to +0.5 in the simple.mp file.



documentclass[border=2cm]{standalone}
usepackage{feynmp}
usepackage[pdftex]{graphicx}
usepackage{pgf}

DeclareGraphicsRule{*}{mps}{*}{}

begin{document}
begin{fmffile}{fgraphs}

newcommand{efmf}[1]{
begingroupedefx{endgroupnoexpandfmf{#1}}x
}

begin{fmffile}{simple}
begin{fmfgraph*}(450,320)
fmftopn{t}{3} fmfn{plain}{t}{3}
fmfbottomn{b}{3} fmfn{plain}{b}{3}
pgfmathsetmacro{temp}{-0.5}
begin{fmffor}{n}{1}{1}{2}
pgfmathsetmacro{temp}{temp+1}
efmf{photon, foreground=blue, tension=0.1, right=temp}{t2,b2}
end{fmffor}
end{fmfgraph*}
end{fmffile}


end{fmffile}
end{document}









share|improve this question







New contributor




user1247 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • If temp is -0.5, then temp+1 is 0.5. What's the problem? You're simply doing the vconnect operation twice with the same data.

    – egreg
    8 mins ago













  • Note that fmffor doesn't execute the body multiple times, but only writes code for a Metapost loop.

    – egreg
    2 mins ago
















0












0








0








This is a follow-up to this question. The solution provided by egreg worked, but the same solution doesn't work when trying to update a variable within an fmffor loop. A complete example is shown below. The expected behavior is to produce two photons each bending in the opposite direction (right=+0.5, and right=-0.5), but instead temp is always set to +0.5 in the simple.mp file.



documentclass[border=2cm]{standalone}
usepackage{feynmp}
usepackage[pdftex]{graphicx}
usepackage{pgf}

DeclareGraphicsRule{*}{mps}{*}{}

begin{document}
begin{fmffile}{fgraphs}

newcommand{efmf}[1]{
begingroupedefx{endgroupnoexpandfmf{#1}}x
}

begin{fmffile}{simple}
begin{fmfgraph*}(450,320)
fmftopn{t}{3} fmfn{plain}{t}{3}
fmfbottomn{b}{3} fmfn{plain}{b}{3}
pgfmathsetmacro{temp}{-0.5}
begin{fmffor}{n}{1}{1}{2}
pgfmathsetmacro{temp}{temp+1}
efmf{photon, foreground=blue, tension=0.1, right=temp}{t2,b2}
end{fmffor}
end{fmfgraph*}
end{fmffile}


end{fmffile}
end{document}









share|improve this question







New contributor




user1247 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












This is a follow-up to this question. The solution provided by egreg worked, but the same solution doesn't work when trying to update a variable within an fmffor loop. A complete example is shown below. The expected behavior is to produce two photons each bending in the opposite direction (right=+0.5, and right=-0.5), but instead temp is always set to +0.5 in the simple.mp file.



documentclass[border=2cm]{standalone}
usepackage{feynmp}
usepackage[pdftex]{graphicx}
usepackage{pgf}

DeclareGraphicsRule{*}{mps}{*}{}

begin{document}
begin{fmffile}{fgraphs}

newcommand{efmf}[1]{
begingroupedefx{endgroupnoexpandfmf{#1}}x
}

begin{fmffile}{simple}
begin{fmfgraph*}(450,320)
fmftopn{t}{3} fmfn{plain}{t}{3}
fmfbottomn{b}{3} fmfn{plain}{b}{3}
pgfmathsetmacro{temp}{-0.5}
begin{fmffor}{n}{1}{1}{2}
pgfmathsetmacro{temp}{temp+1}
efmf{photon, foreground=blue, tension=0.1, right=temp}{t2,b2}
end{fmffor}
end{fmfgraph*}
end{fmffile}


end{fmffile}
end{document}






feynman feynmf feynmp






share|improve this question







New contributor




user1247 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




user1247 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




user1247 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 15 mins ago









user1247user1247

1133




1133




New contributor




user1247 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





user1247 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






user1247 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • If temp is -0.5, then temp+1 is 0.5. What's the problem? You're simply doing the vconnect operation twice with the same data.

    – egreg
    8 mins ago













  • Note that fmffor doesn't execute the body multiple times, but only writes code for a Metapost loop.

    – egreg
    2 mins ago





















  • If temp is -0.5, then temp+1 is 0.5. What's the problem? You're simply doing the vconnect operation twice with the same data.

    – egreg
    8 mins ago













  • Note that fmffor doesn't execute the body multiple times, but only writes code for a Metapost loop.

    – egreg
    2 mins ago



















If temp is -0.5, then temp+1 is 0.5. What's the problem? You're simply doing the vconnect operation twice with the same data.

– egreg
8 mins ago







If temp is -0.5, then temp+1 is 0.5. What's the problem? You're simply doing the vconnect operation twice with the same data.

– egreg
8 mins ago















Note that fmffor doesn't execute the body multiple times, but only writes code for a Metapost loop.

– egreg
2 mins ago







Note that fmffor doesn't execute the body multiple times, but only writes code for a Metapost loop.

– egreg
2 mins ago












0






active

oldest

votes












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
});


}
});






user1247 is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f484863%2fproblem-using-variables-with-feynmp-fmffor%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes








user1247 is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















user1247 is a new contributor. Be nice, and check out our Code of Conduct.













user1247 is a new contributor. Be nice, and check out our Code of Conduct.












user1247 is a new contributor. Be nice, and check out our Code of Conduct.
















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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f484863%2fproblem-using-variables-with-feynmp-fmffor%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

IEEEtran - How to include ORCID in TeX/PDF with PdfLatexIs there a standard way to include ORCID in TeX /...

Cicindela nigrior Przypisy | Menu nawigacyjneCicindela varians unicolorManual for the Identification of the...

Glossaries-extra: Adding glossaries package to “Clas­sicTh­e­sis” template by Dr. André Miede v. 4.6 ...