Sho's catennel

Physics —TeX for Phys—

Dangerous Bend Sign Warning! I put here the dangerous bend mark because what you can found here are arcana in the TeX/LaTeX system. This document is written for TeX-wizards.

(LaTeX + dvipdfmx) || PDFLaTeX

Sometimes we want a TeX file to be compiled both with (latex + dvipdfmx) procedure and pdflatex procedure. For such cases, I always put the following lines in my tex file.

\ifpdf                                     % For pdfLaTeX
  \usepackage{hyperref,graphicx}           %   usepackage without driver option
  \DeclareGraphicsRule{*}{mps}{*}{}        %   [For feynMP] Accept metapost graphics
\else                                      % For (p)LaTeX + dvipdfmx
  \usepackage[dvipdfmx]{hyperref,graphicx} %   usepackage with driver option
  \usepackage{mediabb}                     %   [For PDF graphics] Automatic PDF-bounding box
\fi

I will explain these commands in the following.

feynMP

As you know, we want to draw Feynman diagrams automatically in a TeX file! The package feynMP (or the old feynMF) is the only choice for us, and thus all of us uses feynMP. In latex + dvipdfmx procedure, it can be easily used by \usepackage[dvipdfmx]{graphicx}\usepackage{feynmp}. However, for pdflatex procedure, we have to use a magic spell, \DeclareGraphicsRule{*}{mps}{*}{}. As a summary:

%%% For latex+dvipdfmx
\usepackage[dvipdfmx]{graphicx}
\usepackage{feynmp}

%%% For pdflatex
\usepackage{graphicx}   % auto-detectable
\usepackage{feynmp}
\DeclareGraphicsRule{*}{mps}{*}{}

For arXiv submission

What should we do to submit a preprint with feynMP package to the arXiv? A good guideline is: arXiv will execute only pdfLaTeX + BibTeX. Note that it is always pdfLaTeX (as long as in Oct., 2011). Whatever we specify in \pdfoutput=X command, arXiv executes pdfLaTeX. Therefore the files to be uploaded must be compiled with the above two commands.

So, in practice, what we have to do is only to execute mpost commands beforehand. *.mp files are not necessary. As an example,

latex hoge.tex
mpost hoge_diagram.mp
rm hoge.dvi
rm hoge.log
rm hoge_diagram.mp
tar czvf hoge_for_arxiv.tar.gz *

For JHEP/JCAP submission

JHEP/JCAP processing system acts like the arXiv server. So what we have to do is the same as the arXiv case.