Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

revtex4, twocolumn, and axodraw

128 views
Skip to first unread message

Nicolas Bock

unread,
Oct 26, 2004, 7:07:55 PM10/26/04
to
In a paper I am working on, I would like to include a Feynman diagram
using axodraw. The paper is written using revtex4. I run latex, dvips,
and then display the postscript file using gv.

When I use the onecolumn option of revtex4, the diagram comes out
beautifully.

However, when I use the twocolumn option, gv can not display the
diagram anymore. I tracked this problem down to the following: For
some reason the raw postscript code that defines how to draw the
diagrams is not included in the twocolumn case, but is in the
onecolumn case. I can hand-edit the postscript file and reinsert the
raw postscript definitions and the twocolumn version can be rendered
again.

After some more experimentation I found that the trigger is a
combination of twocolumn and \maketitle. The example file I included
works fine without the \maketitle command, but fails with it.

Has anyone else seen this? Does anyone know a solution possibly?

Thanks already, nick

\documentclass[twocolumn]{revtex4}

\usepackage{axodraw}

\begin{document}

\title{
Test
}

\date{\today}

%\maketitle

This is the beginning....

\begin{picture}(320,80)(-10,25)
\ArrowLine(0,25)(100,25)
\end{picture}

\end{document}

Ralf Stubner

unread,
Oct 29, 2004, 9:13:48 AM10/29/04
to
nicol...@gmail.com (Nicolas Bock) writes:

> However, when I use the twocolumn option, gv can not display the
> diagram anymore. I tracked this problem down to the following: For
> some reason the raw postscript code that defines how to draw the
> diagrams is not included in the twocolumn case, but is in the
> onecolumn case. I can hand-edit the postscript file and reinsert the
> raw postscript definitions and the twocolumn version can be rendered
> again.
>
> After some more experimentation I found that the trigger is a
> combination of twocolumn and \maketitle. The example file I included
> works fine without the \maketitle command, but fails with it.
>
> Has anyone else seen this? Does anyone know a solution possibly?

I haven't seen this before (I use feynmf for Feynman graphs and include
them as external figures for publications) and can't explain what's
happening. However, loading axodraw after \maketitle seems to work. Of
course, one can't use \usepackage after \begin{document}. So one has to
resort to \input{axodraw.sty}. Horrible workaround, but seems to give
correct results.

cheerio
ralf

Alberto L

unread,
Oct 29, 2004, 11:36:37 AM10/29/04
to

>>>>> "Nicolas" == Nicolas Bock <nicol...@gmail.com> wrote:

Nicolas> In a paper I am working on, I would like to include a Feynman
Nicolas> diagram using axodraw. The paper is written using revtex4. I
Nicolas> run latex, dvips, and then display the postscript file using
Nicolas> gv.

Nicolas> When I use the onecolumn option of revtex4, the diagram comes
Nicolas> out beautifully.

Nicolas> However, when I use the twocolumn option, gv can not display
Nicolas> the diagram anymore. I tracked this problem down to the
Nicolas> following: For some reason the raw postscript code that
Nicolas> defines how to draw the diagrams is not included in the
Nicolas> twocolumn case, but is in the onecolumn case. I can hand-edit
Nicolas> the postscript file and reinsert the raw postscript
Nicolas> definitions and the twocolumn version can be rendered again.

Nicolas> After some more experimentation I found that the trigger is a
Nicolas> combination of twocolumn and \maketitle. The example file I
Nicolas> included works fine without the \maketitle command, but fails
Nicolas> with it.

Nicolas> Has anyone else seen this? Does anyone know a solution
Nicolas> possibly?

I have looked a bit into this. axodraw.sty seems to contain somewhat
obsolete code, in particular I notice that the inclusion of epsf.sty
is deprecated.

I have done some modifications and now it works for me (with tetex 2.0
on Linux). I have replaced the inclusion of epsf.sty and colordvi.sty
with:

\RequirePackage[dvips]{graphics}
\RequirePackage[usenames,dvipsnames]{color}

I have dropped the code that handles the case when colordvi is not
found by reverting to black and white and replaced it with just:

\def\axocolor{\current@color\space}

Finally I have put a: \AtBeginDvi{...} around all the \special{} macros
that insert Postscript code in the prologue. Probably just this last
modification would do the trick for you.

With these modifications your example works also with \maketitle
uncommented. Additionally, axodraw now works with the standard color
commands like \color and textcolor.

I have the impression that using the above mentioned \special macros
to insert Postscript code in the header is actually bad practice, and
one should collect the PS code in an axodraw.pro file, to be included
with a \special(header=axodraw.pro} command. However so far I have
not yet proceeded in doing this additional modification.

I include the beginning of the modified file. Don't forget to also
insert the closing bracket of \AtBeginDvi{ after the last \special
macro.

%
% Style file for the drawing of Feynman diagrams with LaTeX.
% It assumes that the dvips that is used is by Radical Eye Software
% (by Rokicki), because the graphics primitives are given in
% postscript. If you do not work with a dvi to postscript converter
% you are out of luck.
%
% Made by J.A.M. Vermaseren 14-feb-1994
%
% Use:
% Enter the picture environment with for instance
% \begin{picture}(width,height)(0,0)
% statements
% \end{picture}
% All statements should be entered inside the picture environment.
% All coordinates should be in terms of pt (but the pt must be
omitted).
% One may also use the figure environment.
%
%%
%% Comment old style code, A.L. Oct 2004
%%
%% \input{epsf.sty}
%% \openin5=colordvi.sty
%% \ifeof5
%% \closein5
%% \def\axocolor{ }
%% \def\SetColor#1{ }
%% \def\Color#1#2{#2}
%% \def\IfColor#1#2{#2 }
%% \else
%% \closein5
%% \input{colordvi.sty}
%% \background{White}
%% \textBlack
%% \def\axocolor{Black }
%% \def\SetColor#1{\def\axocolor{#1 }}
%% \def\IfColor#1#2{#1}
%% \fi
%%
%% New style code to include graphics/color standard commands
%% force dvips, as it is needed, A.L. Oct 2004
%%
\RequirePackage[dvips]{graphics}
\RequirePackage[usenames,dvipsnames]{color}
\def\axocolor{\current@color\space}
%%
%% include PS header code inside \AtBeginDvi{}
%% a better solution would probably be to create a separate file
%% with the PS code, A.L. Oct 2004
%%
\AtBeginDvi{
% #[ inventory :
%
% The variables in are:
% mtrx,num,ampi,x1,y1,x2,y2,dx,dy,dr,speed
% step,phi,arcend,arcstart,radius
% theindex,thechar,darc,const,amp1 amp2 amp3
% gcolor,xx,name,name1,name2,xx1,xx2
%
% NOTE: blank lines are not allowed inside the postscript code!!!!!
% (LaTeX sneaks \par commands in and the postscript goes boink)
%
\special{! /ed{exch def}def /gs{gsave dup scale}def
/gsw{gs /width ed width setlinewidth}def /p1{/y1 ed /x1 ed}def
/p2{/y2 ed /x2 ed}def /abox{newpath x1 y1 moveto x1 y2 lineto
x2 y2 lineto x2 y1 lineto closepath}def }

Regards,
Alberto

Dan Luecking

unread,
Oct 29, 2004, 12:16:27 PM10/29/04
to
On 29 Oct 2004 15:13:48 +0200, Ralf Stubner
<ralf.s...@physik.uni-erlangen.de> wrote:

I couldn't identify the problem, but I did find one or two things that
are dangerous in axodraw. There a lot of EOL spaces that would be better
commented out. The file starts with \openin5=colordvi.sty without
ensuring that \read stream 5 is not already open. The file ends with
several definitions beginning like:
\def\B2Text(#1,#2)#3#4{
which we all know defines (or perhaps redefines) a macro \B and not
\B2Text. This also happens with \C and \G. Simple macro names like
\B, \C and \G are generally unwise in a package, as users commonly
use them for math symbols.


Dan

--
Dan Luecking Department of Mathematical Sciences
University of Arkansas Fayetteville, Arkansas 72701
To reply by email, change Look-In-Sig to luecking

Dan Luecking

unread,
Oct 29, 2004, 2:35:38 PM10/29/04
to
On Fri, 29 Oct 2004 08:36:37 -0700, Alberto L <albe...@nospam.net>
wrote:

>
>>>>>> "Nicolas" == Nicolas Bock <nicol...@gmail.com> wrote:
>
>Nicolas> In a paper I am working on, I would like to include a Feynman
>Nicolas> diagram using axodraw. The paper is written using revtex4. I
>Nicolas> run latex, dvips, and then display the postscript file using
>Nicolas> gv.
>

>Nicolas> However, when I use the twocolumn option, gv can not display
>Nicolas> the diagram anymore.
>

>I have looked a bit into this. axodraw.sty seems to contain somewhat
>obsolete code, in particular I notice that the inclusion of epsf.sty
>is deprecated.
>
>I have done some modifications and now it works for me (with tetex 2.0
>on Linux). I have replaced the inclusion of epsf.sty and colordvi.sty
>with:
>
>\RequirePackage[dvips]{graphics}
>\RequirePackage[usenames,dvipsnames]{color}

A good idea. Still, epsf is unlikely to be the culprit.

>
>I have dropped the code that handles the case when colordvi is not
>found by reverting to black and white and replaced it with just:
>
>\def\axocolor{\current@color\space}

Also good.

>
>Finally I have put a: \AtBeginDvi{...} around all the \special{} macros
>that insert Postscript code in the prologue. Probably just this last
>modification would do the trick for you.

Does anyone know the timing of \special commands? I assumed they were
placed as whatsits on the vertical list and output with the first
\shipout. What could \maketitle possibly be doing that they are
discarded? I found that a \leavevmode right before \maketitle caused
them to to reappear.

Robin Fairbairns

unread,
Oct 29, 2004, 3:26:16 PM10/29/04
to
Dan Luecking <Look-...@uark.edu> writes:
>On Fri, 29 Oct 2004 08:36:37 -0700, Alberto L <albe...@nospam.net>
>wrote:
>>I have looked a bit into this. axodraw.sty seems to contain somewhat
>>obsolete code, in particular I notice that the inclusion of epsf.sty
>>is deprecated.
>>
>>I have done some modifications and now it works for me (with tetex 2.0
>>on Linux). I have replaced the inclusion of epsf.sty and colordvi.sty
>>with:
>>
>>\RequirePackage[dvips]{graphics}
>>\RequirePackage[usenames,dvipsnames]{color}
>
>A good idea. Still, epsf is unlikely to be the culprit.

indeed.

>>I have dropped the code that handles the case when colordvi is not
>>found by reverting to black and white and replaced it with just:
>>
>>\def\axocolor{\current@color\space}
>
>Also good.
>
>>Finally I have put a: \AtBeginDvi{...} around all the \special{} macros
>>that insert Postscript code in the prologue. Probably just this last
>>modification would do the trick for you.
>
>Does anyone know the timing of \special commands? I assumed they were
>placed as whatsits on the vertical list and output with the first
>\shipout. What could \maketitle possibly be doing that they are
>discarded? I found that a \leavevmode right before \maketitle caused
>them to to reappear.

remember that revtex4 has its own double-column handling. ime (i've
not covered myself in glory in this area) it's painfully easy to lose
things off the vertical list when juggling the columns. i wouldn't be
surprised if even \maketitle was doing that...

i can see why \AtBeginDvi would solve the problem, in a vague sort of
way...
--
Robin (http://www.tex.ac.uk/faq) Fairbairns, Cambridge

Donald Arseneau

unread,
Oct 29, 2004, 5:40:33 PM10/29/04
to
Dan Luecking <Look-...@uark.edu> writes:

> Does anyone know the timing of \special commands? I assumed they were
> placed as whatsits on the vertical list and output with the first
> \shipout. What could \maketitle possibly be doing that they are
> discarded?

It could be performing \newpage. LaTeX discards blank pages,
and whatsits (\special) are not enough to make a page look
"occupied". (You wouldn't want a blank page there in any case.)

--
Donald Arseneau as...@triumf.ca

Alberto L

unread,
Oct 30, 2004, 6:59:00 AM10/30/04
to

>>>>> "Alberto" == Alberto L <Alberto> wrote:

[regarding axodraw]
Alberto> I have done some modifications and now it works for me (with
Alberto> tetex 2.0 on Linux). I have replaced the inclusion of
Alberto> epsf.sty and colordvi.sty with:

Alberto> \RequirePackage[dvips]{graphics}
Alberto> \RequirePackage[usenames,dvipsnames]{color}

Alberto> I have dropped the code that handles the case when colordvi
Alberto> is not found by reverting to black and white and replaced it
Alberto> with just:

Alberto> \def\axocolor{\current@color\space}

Just updating myself ... probably a slightly better solution is to
disentangle axodraw from color.sty completely, commenting the
"\RequirePackage[usenames,dvipsnames]{color} " and replacing the
"\def\axocolor" with:

%% \RequirePackage[usenames,dvipsnames]{color}
\AtBeginDocument{%
\@ifpackageloaded{color}{%
\def\axocolor{\current@color\space}%
}{%
\def\axocolor{\space}%
}%
}

A note on the above: I first tried to check whether \current@color was
defined, and I found it defined to "Black" even if color.sty was not
loaded. And with that definition it was producing invalid PS code
with axodraw.

Greetings,
--
Alberto

0 new messages