1

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}
6
  • 1
    FWIW there is a newer package called axodraw2 which lets you use pdflatex.
    – DG'
    Commented 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
    Commented 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
    Commented 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'
    Commented 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
    Commented Mar 18, 2021 at 16:09

0

You must log in to answer this question.

Browse other questions tagged .