I'm a Mathematica stylesheet enthusiast. I love using beautiful stylesheet instead of the default one, such as Dracular. I'm also a physics researcher on scattering amplitudes, which forces me to use FeynCalc and FeynArts etc. However, while all the other texts changes with my stylesheet, the diagrams Paint paints don't.

enter image description here

As you see, the paintings stay Black, which in such a dark background it's very hard to see.

I don't wanna give up my beautiful, coding-friendly stylesheet. How do I change the settings of FeynArts, or maybe Paint function, to let them suit my background?


1 Answer 1


I ask and answer myself, because after seaching I found nobody asked this and I have to solve it myself. And very fortunately, I found the answer and it's quite easy!

First, I try to look at the options for Paint by Options[Paint]. No Background or PlotStyle -like stuffs are its options.

Then I try to dive into the whole blackbox——the FeynArts package's source files. In the very beginning, I copy the diagrams output and query about its Head, and I found it's Graphics (Actually all the Plots and other graphs are with head "Graphics"). So I guess there should be Graphics[...,options] in the FeynArts source code. It is by changing Graphics' options that I can achieve my goal.

So I found the 《Graphics.m》 file in the FeynArts folder, which in my case is C:\Users\19927\AppData\Roaming\Mathematica\Applications\FeynCalc\FeynArts\FeynArts. After testing, there are 2 and only 2 Graphics[...] in it and they indeed control the style of the outcome of Paint. They are as follows.

The first one isenter image description here. I add the 415th line of code, to set the painting color to be red. The effect is enter image description here, only changing the "PlotLabel".

To see this, you need to quit and reload FeynArts.

The second one is at around line 460.enter image description here I add the line 460 of code expecting to change sth to blue. The effect isenter image description here.

So as you see, we find the keys. You can change to any style you want, or suitable for your stylesheet. Btw, I think Background -> White is much better since we always need to copy the Feynman diagrams to somewhere else.

  • 2
    $\begingroup$ Please, provide the code in a text form, not as a screenshot. Nobody wants to retype all of this :) $\endgroup$
    – Domen
    Oct 2, 2023 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.