Summary of my question

I cannot set reasonable margins while using the axodrawj4 package. In particular, the text in my document overlaps with my page numbers.

Full Question

I am using LaTex on Ubuntu + vim.

I am working on a project that involves using Feynman diagrams. To typeset these I am using Jaxodraw, and exporting the diagram to latex code. I then include this code in my main document. (I have already tried using feynman-tikz and feynmf packages but they did not work well on my computer.)

The exported code from Jaxodraw uses the axodraw4j package. This package only compiles correctly to postscript. So, when I compile my document I have to run latex on my document, then dvips and then epstopdf. To do this, I have created a vim shortcut that runs the following command,

:!latex % && dvips -E %:r.dvi && epstopdf --exact %:r.ps

Now, this has been working well, with one issue: The margins are all way too small. What bothers me most is that sometimes the text in my document overlaps with the page numbers.

When I compile with pdflatex, the issue still remains. So I assume this problem has to do with axodraw rather than the dvi -> ps -> pdf conversion.

I realise a very simple solution would be to export Jaxodraw to an image, include this image into my latex document and compile to pdflatex. I would like to avoid this though.

Thank you for reading this long question!

What I have tried

1) Using the Geometry Package

top    = 2.75cm,
bottom = 5.50cm,
left   = 3.00cm,
right  = 2.50cm]{geometry}`

2) Changing \textheight

I have tried to change \setlength{\textheight}{\paperheight} to \setlength{\textheight}{23cm} But this moves the page numbers up. Removing the \setlength{\textheight}{\paperheight} also moves the page numbers up.

3) Running dvips with an a4 option

For completion, I also tried to compile my document with,

!latex % && dvips -t a4 -E %:r.dvi && epstopdf --exact %:r.ps

Sample code







\[ 1 + 1 = 2\]


  \begin{picture}(124,77) (142,-342)

  • 1
    FWIW there is a newer package called axodraw2 which lets you use pdflatex.
    – DG'
    Mar 18, 2021 at 15:34
  • 1
    I'm not sure I understand the question fully. Maybe you can add a screenshot that shows the problem? When I run your example I see that the equation (1+1=2) overlaps with the page number, but that doesn't have anything to do with Axodraw (without the package and the diagram the overlap is still there). Could you clarify?
    – Marijn
    Mar 18, 2021 at 15:36
  • Indeed as @DG' mentioned I used axodraw2 for testing, which results in a horizontally centered Feynman diagram on the second page - which looks fine and no overlap seems to be present. I'm not sure what the behavior with the axodraw4j LaTeX package is because I don't have that installed.
    – Marijn
    Mar 18, 2021 at 15:37
  • I think the problem is \setlength{\footskip}{0pt} which means, that the page number is inside the text area. Set this to a reasonable value, like 15pt and you should be fine.
    – DG'
    Mar 18, 2021 at 15:42
  • @DG' I wasn't aware that there was an axodraw2! Thank you, I will check it out. Changing the footskip to 15pt worked. In retrospect, this was a bit obvious. Thanks.
    – Hyperbolic
    Mar 18, 2021 at 16:09


You must log in to answer this question.

Browse other questions tagged .