LaTeX formatting Feynman Diagrams incorrectly

In summary, the conversation discusses the issue of a weird vertical Feynman Diagram appearing instead of a horizontally aligned one when using TikZ-Feynman in LaTeX code. Possible solutions mentioned include changing the compiler to LuaLaTex and using a different tool called jaxodraw. The problem is identified as a compiler bug, which can be resolved by commenting out a certain package.
  • #1
85
11
I've been trying to get Feynman Diagrams to work in my LaTeX code, however, the output is not what it is supposed to be. I'm using TeXMaker and TikZ-Feynman to draw the diagrams. My code looks like this:

\feynmandiagram [horizontal=a to b] {
i1 -- [fermion] a -- [fermion] i2,
a -- [photon] b,
f1 -- [fermion] b -- [fermion] f2,
};

which I have copied from the internet for testing purposes. However, instead of displaying a horizontally aligned Feynman Diagram, this gives me a weird vertical one, as seen in the attached picture.
Can anybody explain why this is happening? I am clueless and I haven't really found any solutions on the internet yet.

Thank you in advance and have a great day everybody.
 

Attachments

  • Screenshot (11).png
    Screenshot (11).png
    702 bytes · Views: 95
Physics news on Phys.org
  • #3
It is a compiler bug. If you change the compiler to LuaLaTex (IDE options) then you might not be able to see the pdf previewer, but the pdf document results in (see attachment)


The disadvantage is, that you have to comment out
%\usepackage[latin1]{inputenc}

Corr.: my previewer works meanwhile:

1665072342453.png
 

Attachments

  • testfile.pdf
    3.4 KB · Views: 92
Last edited:
  • Informative
  • Like
Likes topsquark, Wrichik Basu, PhysicsRock and 1 other person
  • #4
fresh_42 said:
It is a compiler bug. If you change the compiler to LuaLaTex (IDE options) then you might not be able to see the pdf previewer, but the pdf document results in (see attachment)


The disadvantage is, that you have to comment out
%\usepackage[latin1]{inputenc}

Corr.: my previewer works meanwhile:

View attachment 315126
That helped. Thank you so much!
 

What is LaTeX?

LaTeX is a document preparation system commonly used for typesetting scientific and mathematical documents. It allows for precise and professional-looking formatting of equations, diagrams, and other complex structures.

Why are my Feynman diagrams not formatting correctly in LaTeX?

There could be several reasons for this. It could be due to incorrect syntax or missing packages in the document. It is also possible that there is a conflict between different packages or settings. Double-checking the code and consulting online resources or forums can help troubleshoot the issue.

How can I fix incorrect formatting of Feynman diagrams in LaTeX?

If the issue is due to incorrect syntax, double-checking the code and making necessary corrections should fix the problem. If it is due to missing packages, make sure to include the necessary packages in the preamble of the document. In case of conflicts between packages or settings, it may require some trial and error to find the correct combination.

Are there any tips for formatting Feynman diagrams in LaTeX?

Yes, there are some tips that can help with formatting Feynman diagrams in LaTeX. It is recommended to use the feynmf package for creating diagrams and to use a separate .tex file for each diagram. It is also important to use consistent notation and to include all necessary packages and settings in the preamble.

Can I use LaTeX to create Feynman diagrams in different styles?

Yes, LaTeX offers several packages for creating Feynman diagrams in different styles. Some popular packages include feynmp, tikz-feynman, and axodraw. Each package has its own syntax and capabilities, so it is recommended to explore and choose the one that best suits your needs.

Suggested for: LaTeX formatting Feynman Diagrams incorrectly

Replies
7
Views
1K
Replies
1
Views
1K
Replies
1
Views
471
Replies
3
Views
5K
Replies
11
Views
2K
Replies
7
Views
1K
Replies
8
Views
5K
Replies
2
Views
585
Replies
8
Views
1K
Back
Top