[ I hope that messages re: TeXPower are still tolerated ... ]

Yeterday, I played with TeXPower for the first time and was was very
pleased to find a package that can mimic seminar's \overlay and build
pages incrementally in any order (not just sequentially).

I soon realized that it is even more flexible than seminar: it can build
MetaPost graphics incrementally.  Either Feynman diagrams with
`feynmp' or general graphics with `emp'.  For example

\newcommand{\singlestep}[2]{\step[\value{step}=#1][\value{step}=#1]{#2}}
\stepwise{%
  \begin{fmfchar*}(40,25)
    \fmfleft{em,ep} \fmflabel{$e^+$}{ep} \fmflabel{$e^-$}{em}
    \fmf{fermion}{em,Zee,ep}
    \singlestep{1}{\fmf{phantom}{Zee,Zff}}%
    \singlestep{2}{\fmf{gluon,label=$g$}{Zee,Zff}}
    \singlestep{3}{\fmf{photon,label=$\gamma$}{Zee,Zff}}
    \singlestep{4}{\fmf{phantom}{Zee,Zff}}%
    \singlestep{5}{\fmf{double,label=$Z$}{Zee,Zff}}%
    \singlestep{6}{\fmf{phantom}{Zee,Zff}}%
    \singlestep{7}{\fmf{photon,label=$\gamma,,Z$}{Zee,Zff}}
    \fmf{fermion}{fb,Zff,f}
    \fmfright{fb,f} \fmflabel{$\bar f'$}{fb} \fmflabel{$f$}{f}
    \fmfdot{Zee,Zff}
  \end{fmfchar*}}

will produce a series of pages differing only by the shape of the line
(`propagator') connecting Zee and Zff.

However, I have two problems

  (easy)    feynmp needs \write (`robustduplicates' takes care of this).

  (harder)  feynmp uses a counter to identify the current picture and
            since counters are turned off, only the first version is
            drawn.  I worked around this for a proof of concept by
            `\def\thefmfgraph{\thestep}', but this is obviously not even
            close to a solution.

Question: will there be a way to keep counters going inside of
\stepwise{} or should I prepare to modify feynmp and emp to use
private counter macros that will be protected?

I have appended a complete example, to be processed with

   pdflatex foo    %%% replace foo everywhere with whatever filename you chose
   mpost fmftempl
   mpost foo
   pdflatex foo

NB: the emp.sty currently on CTAN will not work (the empx environment
    is missing), either comment it out or get a newer version of emp from
    ftp://heplix.ikp.physik.tu-darmstadt.de/pub/emp

Cheers,
-Thorsten

\PassOptionsToPackage{slifonts,robustduplicates}{texpower}
\documentclass[a4paper,landscape,KOMA,smallheadings,calcdimensions,display]{powersem}

\renewcommand{\slidetopmargin}{5mm}
\renewcommand{\slidebottommargin}{5mm}
\renewcommand{\slideleftmargin}{5mm}
\renewcommand{\sliderightmargin}{5mm}
\usepackage{url}
\usepackage[latin1]{inputenc}
\let\name=\textsc
\usepackage{fixseminar}
\usepackage{texpower}
\usepackage[pdftex]{graphicx,feynmp,emp}
\DeclareGraphicsRule{*}{mps}{*}{}
% \usepackage[colorlinks,urlcolor=red,pdfview=Fit,pdfstartview=Fit]{hyperref}
\slidesmag{5}
\slideframe{none}
\pagestyle{empty}

\begin{document}
\begin{slide}
\unitlength=1mm
\begin{fmffile}{fmftempl}
\begin{empfile}
\begin{empcmds}
  vardef draw_face expr fg =
    pair lefteye, righteye, nose[];
    lefteye = c + (-0.25w,0.15h);  righteye = c + (0.25w,0.15h);
    nose1 = c - (0,0.05h);  nose2 = c + (0,0.15h);
    pickup pencircle scaled 0.7;
    draw fullcircle xscaled w yscaled h shifted c withcolor fg;
    draw fullcircle scaled 2 shifted lefteye withcolor fg;
    draw fullcircle scaled 2 shifted righteye withcolor fg;
    draw nose1--nose2 withcolor fg;
    draw mouth1..mouth2..mouth3 withcolor fg;
    setbounds currentpicture to unitsquare xscaled w yscaled .5h;
  enddef;
\end{empcmds}

\newcommand{\singlestep}[2]{\step[\value{step}=#1][\value{step}=#1]{#2}}

\begin{center}
\setcounter{firststep}{1}
\stepwise{%
  %%% this is NOT a solution, of course: 
  \def\thefmfgraph{\thestep}
  \begin{fmfchar*}(40,25)
    \fmfleft{em,ep} \fmflabel{$e^+$}{ep} \fmflabel{$e^-$}{em}
    \fmf{fermion}{em,Zee,ep}
    \singlestep{1}{\fmf{phantom}{Zee,Zff}}%
    \singlestep{2}{\fmf{gluon,label=$g$}{Zee,Zff}}
    \singlestep{3}{\fmf{photon,label=$\gamma$}{Zee,Zff}}
    \singlestep{4}{\fmf{phantom}{Zee,Zff}}%
    \singlestep{5}{\fmf{double,label=$Z$}{Zee,Zff}}%
    \singlestep{6}{\fmf{phantom}{Zee,Zff}}%
    \singlestep{7}{\fmf{photon,label=$\gamma,,Z$}{Zee,Zff}}
    \fmf{fermion}{fb,Zff,f}
    \fmfright{fb,f} \fmflabel{$\bar f'$}{fb} \fmflabel{$f$}{f}
    \fmfdot{Zee,Zff}
  \end{fmfchar*}\\
  %%% this is NOT a solution, of course: 
  \def\theempfig{\thestep}
  \begin{empx}(20,20)
    \singlestep{1}{%
      \empcmd{pair mouth[], c;  c = (0.5w,0);}
      \empcmd{mouth1 = c + (-0.2w,-0.25h);}
      \empcmd{mouth2 = c + (0,-0.2h);}
      \empcmd{mouth3 = c + (0.2w,-0.25h);}
      \empcmd{draw_face red;}}
    \singlestep{2}{%
      \empcmd{pair mouth[], c;  c = (0.5w,0);}
      \empcmd{mouth1 = c + (-0.2w,-0.2h);}
      \empcmd{mouth2 = c + (0,-0.25h);}
      \empcmd{mouth3 = c + (0.2w,-0.2h);}
      \empcmd{draw_face red;}}
    \step[\value{step}=3]{%
      \empcmd{pair mouth[], c;  c = (0.5w,0);}
      \empcmd{mouth1 = c + (-0.2w,-0.2h);}
      \empcmd{mouth2 = c + (0,-0.25h);}
      \empcmd{mouth3 = c + (0.2w,-0.2h);}
      \empcmd{draw_face green;}}
  \end{empx}}
\end{center}
\end{empfile}
\end{fmffile}
\end{slide}
\end{document}

-- 
Thorsten Ohl, Physics Department, TU Darmstadt -- [EMAIL PROTECTED]
http://heplix.ikp.physik.tu-darmstadt.de/~ohl/ [<=== PGP public key here]

Reply via email to