[texhax] RE: embedding Feynman graphs in preprints

Giuseppe.Angilella at ct.infn.it Giuseppe.Angilella at ct.infn.it
Wed Aug 18 16:39:40 CEST 2004


Many thanks to Thorsten Ohl, who promptly replied to my question, with the 
following e-mail.

Best regards,

Giuseppe.

---------- Forwarded message ----------
Date: Wed, 18 Aug 2004 16:02:22 +0200
From: Thorsten Ohl <ohl at physik.uni-wuerzburg.de>
To: Giuseppe.Angilella at ct.infn.it
Cc: texhax-request at tug.org, ohl at physik.uni-wuerzburg.de
Subject: embedding Feynman graphs in preprints

Giuseppe.Angilella at ct.infn.it writes:

> There, it is suggested that Metapost is used, and that feynmp.sty be
> included in the submission of the preprint, along with all the single
> postscript files for each diagram.
> 
> This is what I did, then, but due to some "dull" uploading form, which 
> nowadays automatize the submission of papers to several scientific 
> journals, I still had some problems.

Here's what I do when the upload form requires EPS files to have the
ending .eps:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% BEGIN APS HACK
%%%
%%% The following is only required to work around a problem with
%%% Phys. Rev.'s WWW submission form: they don't recognize feynmf.sty's
%%% *.1, %%% *.2, etc PostScript files.  When the following kludge is
%%% enabled, these files (and the *.t1, etc.) must be renamed like
%%%
%%%     paperpics.1  -> paperpics1.eps
%%%     paperpics.2  -> paperpics2.eps
%%%     ...
%%%     paperpics.t1 -> paperpics1.tex
%%%     paperpics.t2 -> paperpics2.tex
%%%     ...
%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Standard
\newcommand{\thefmfmpsfile}{\thefmffile.\thefmfgraph}
\newcommand{\thefmftexfile}{\thefmffile.t\thefmfgraph}
%%% Use hooks
\makeatletter
\def\fmfgraph(#1,#2){%
  \fmf at graph{#1}{#2}%
  \def\fmfkeep##1{\fmf at keep{#1}{#2}{##1}}%
  \leavevmode
  \IfFileExists{\thefmfmpsfile}%
    {\includegraphics{\thefmfmpsfile}}%
    {\typeout{%
      feynmp: File \thefmfmpsfile\space not found:}}%
  \ignorespaces}
\@namedef{fmfgraph*}(#1,#2){%
  \begin{picture}(#1,#2)
    \fmf at graph{#1}{#2}%
    \def\fmfkeep##1{\fmf at keepstar{#1}{#2}{##1}}%
  \IfFileExists{\thefmfmpsfile}%
    {\put(0,0){\includegraphics{\thefmfmpsfile}}}%
    {\typeout{%
      feynmp: File \thefmfmpsfile\space not found:}}%
      \ignorespaces}
\@namedef{endfmfgraph*}{%
    \endfmfgraph
    \if at fmfio
      {\catcode`\%=14\relax
       \fmf at noexpandoff
        \InputIfFileExists{\thefmftexfile}{}{%
          \typeout{%
       feynmf: Label file \thefmftexfile\space not found:}}}%
    \fi
  \end{picture}}
\makeatother
%%% APS
\renewcommand{\thefmfmpsfile}{\thefmffile\thefmfgraph.eps}
\renewcommand{\thefmftexfile}{\thefmffile\thefmfgraph.tex}
%%% END APS HACK
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

I have a target in my Makefile tha uncomments the lines above and does
the renaming:

	for i in $(PROJECT)pics.[0-9]*; do \
	  cp $$i `echo $$i | sed -e 's/pics\./pics/' -e 's/$$/.eps/'`; \
	done
	for i in $(PROJECT)pics.t[0-9]*; do \
	  cp $$i `echo $$i | sed -e 's/pics\.t/pics/' -e 's/$$/.tex/'`; \
	done

I could make this the default behaviour, but FeynMP would depend on
operating system dependend external tools.

Cheers,
-Thorsten
-- 
Thorsten Ohl, Physics Dept., Wuerzburg Univ. -- ohl at physik.uni-wuerzburg.de
http://theorie.physik.uni-wuerzburg.de/~ohl/     [<=== PGP public key here]



More information about the texhax mailing list