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
\usepackage[
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
\documentclass[a4paper]{article}
\usepackage{lipsum}
\usepackage{axodraw4j}
\usepackage{pstricks}
\usepackage{color}
\setlength{\oddsidemargin}{0pt}
\setlength{\evensidemargin}{0pt}
\setlength{\topmargin}{0pt}
\setlength{\headheight}{0pt}
\setlength{\headsep}{0pt}
\setlength{\topskip}{0pt}
\setlength{\footskip}{0pt}
\setlength{\textwidth}{\paperwidth}
\addtolength{\textwidth}{-2in}
\setlength{\textheight}{\paperheight}
\addtolength{\textheight}{-2in}
\pagenumbering{arabic}
\begin{document}
\lipsum[1-7]
\lipsum[4-4]
\lipsum[4-4]
\[ 1 + 1 = 2\]
%%JaxoComment:
%%JaxoScale{1.0}
\begin{center}
\fcolorbox{white}{white}{
\begin{picture}(124,77) (142,-342)
\SetWidth{1.0}
\SetColor{Black}
\Line[arrow,arrowpos=0.5,arrowlength=5,arrowwidth=2,arrowinset=0.2](143,-341)(176,-307)
\Line[arrow,arrowpos=0.5,arrowlength=5,arrowwidth=2,arrowinset=0.2](176,-307)(143,-275)
\Photon(176,-307)(220,-308){4.5}{4}
\Line[arrow,arrowpos=0.5,arrowlength=5,arrowwidth=2,arrowinset=0.2](220,-308)(253,-275)
\Line[arrow,arrowpos=0.5,arrowlength=5,arrowwidth=2,arrowinset=0.2](253,-341)(220,-308)
\end{picture}
}
\end{center}
\end{document}
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 theaxodraw4j
LaTeX package is because I don't have that installed.\setlength{\footskip}{0pt}
which means, that the page number is inside the text area. Set this to a reasonable value, like15pt
and you should be fine.