Quick start.
Detailed
description.
The first driver
can be used to print all of diagrams in the postscript file,
arranging diagrams along several columns and rows on each page:
The second driver
prints all diagrams into one postscript file,
one diagram per page.
The diagrams are printed together with the topology and momenta flow.
Such a form is convinient not for printing, but for investigating
the digram visually by means of some PostScript interpreter, e.g.,
by the GhostView:
The third driver
can be used to create an encapsulated postscript file
containing the current diagram:
The fourth driver
can be used to create an encapsulated postscript file
containing the current diagram with additional information about
momenta flow:
The styles "specmode.tml" and "folders.tml" contain
all the necessary function calls. Thus the users of these styles
only need to initialize the proper postscript driver in the environment
\Begin(initialization) ... \End(initialization), or
invoke the function \outEPS(...) or
\outInfoEPS(...) to create
an encapsulated PostScript file containing the current diagram.
Diana is able to produce the pictorial representation of diagrams only if the shapes of topologies are defined, i.e., if all coordinates for the topology are defined. The user can use the Diana topology editor to define the coordinates.
Optionally, the user may add to the model the description of a type of the drawing line, and description of a particle identifier to be printed. By default, the propagator will be drawn as a solid arrowed line of width 2, and the identifier coincides with the beginning of the propagator.
To print all diagrams in one file, arranging diagrams along several rows and columns
on each page, the user has to
initialize the PostScript driver by means of the function
\initPostscript(. . . )
in the environment initialization. Example:
\Begin(program,routines.rtn)
\section(common,browser,regular)
\Begin(initialization)
. . .
\initPostscript( pictures.ps,
A4,
Portrait,
20,
20,
40,
2,
10,
Helvetica,
15
)
. . .
\End(initialization)
. . .
\End(program)
There is another form of graphical representation of diagram:
all diagrams are printed into one postscript file, one diagram per page.
The diagrams are printed together with the topology and momenta flow.
Such a form is convinient not for printing, but for investigating
the digram visually by means of some postscript interpreter, e.g.,
by the ghostview. To initialize this driver, the user has to
define only the output file name by means of the function
\initInfoPS(filename)
in the environment initialization. Example:
\Begin(program,routines.rtn) \section(common,browser,regular) \Begin(initialization) . . . \initInfoPS(info.ps) . . . \End(initialization) . . . \End(program)To print current diagram into the encapsulated postscript file, the user has to invoke the function
\outEPS(filename,Height,font,fontsize)
or, if the user wants to print momenta flow as well,
\outInfoEPS(filename,Height,font,fontsize)
in the environment
\Begin(output)...\End(output).Example:
. . . \Begin(output,\askfilename()) \outEPS( d\currentdiagramnumber().eps,100,Helvetica,15) \outInfoEPS( ie\currentdiagramnumber().eps,100,Helvetica,15) . . . \End(output) . . .Some parameters of "info" eps pictures can be adjusted by the user.
\getPSarclabel(l)
\getPSvertexlabel(v)
\getPSvertex(v)
return X,Y coordinates of arcs, vertices or labels, if they are
defined. If not, all these operators retur an empty string.
Returned values are of the form x y so they can be used
to load the PostScript parameters.
\getPSarc(l)
\getPSInfoArc(l)
return the PostScript coordinates of the line number l in the
form: ox oy r as ae l
Here (ox,oy) -- the center coordinates,
|r| -- radius, as,ae --
initial and target angles. If r<0.0, the angle is clockwise,
if r>0.0, the angle is anti-clockwise.
If r = 0.0, the line is stright, from
(ox,oy)
to (as,ae).
l is the length of the arc.
\getPSarc(l) assumes the line directions along
directed
propagators
while \getPSInfoArc(l) assumes the line directions
according the tolology possibly
modified by operators \lsubstitution() or
\vsubstitution().
\getXfromY(fontsize,height)
returns the width of the diagram scaled to fit the EPS bounding box
0 0 width height.
\adjust(fontsize, x,y) outputs complete PS code
to adjust the size of diagram so that it fits to
0 0 x y bounding box, together with up line of
fontsize height.x,y coordinates adjusted so
that the text in font of fontsize
height will be printed in proper place).
\parseParticleImage(particle,string) converts
Diana-specific string into a set of
Postscript routines.
\_PImage(l,id),
\_PDocFonts(id),
\_PDiaImages(formatstring),
\_PAllImages(formatstring) are for internal use only! They
are developed to speed up TM Postscript drivers from "specmode.tml".
\initps(header,target) -- returns "" (empty srting) if ok, or
none, if there are NO
topologies with distributed coordinates.
This operator reads information from the file header,
filters out all comments and extra lines and appends
the result to the
file target. It reduces all separators to single
spaces,
so the result
is the human unreadable text!
\thiscoordinatesok() returns true or
false depending on the completeness
of all coordinates in the current topology.
\coordinatesok() -- returns true,
if at least one of topology has
coordinates.
[Wm,Wp ;W; VV(num,ind:1 ,ind:2 ,vec, 2)*i_ ;mmW]Extension added in 2.17:
[Wm,Wp ;W; VV(num,ind:1 ,ind:2 ,vec, 2)*i_ ;mmW;arrowWavy,4,2]Extension added in 2.28:
[Wm,Wp ;W; VV(num,ind:1 ,ind:2 ,vec, 2)*i_ ;mmW;arrowWavy,4,2;W{y(5)-}]
The first extension permits the user to desribe (optionally) how to draw
this line. The syntax is:
;linetype,parameter,linewidth
In the above example:
linetype=arrowWavy parameter=4 linewidth = 2
The linetype is an abstract type of the line.
It can be one of the
following:
The second model extension added in the revision 2.28 permits the user to desribe (optionally) how to print a particle identifier. To do that, the user must add, after a line type, the character ';' and a particle image.
The particle image is the text with possible modifications, e.g.:
W{y(10){f(Symbol)(8)a}} ->
Example:
[Wm,Wp ;W; VP(num,ind:2 ,ind:1 ,vec, 2)*i_ ;mmW]- the line will be (default) - solid arrowed line, the particle image will be
Wm.
[Wm,Wp ;W; VP(num,ind:2 ,ind:1 ,vec, 2)*i_ ;mmW; arrowWavy,3,2;W{y(5){s(20)-}}]
- the line
will be of a photon-like arrowed curve of a width 2 and amplitude 3, and the
particle image will be
All modifications are local agains block. Block is started by '{'
followed one
of a keyword with possible parameters in parenthesis:
{x(#) ... } - paints the content shifted along
x. After the
block, the current point
is set to (old x, new y);
{y(#) ... } - paints the content shifted along y. After the
block, the current point
is set to (new x, old y);
{xy(#)(#) ... } - paints the content with shift along
both x
and
y. After the block,
the current point is set to (old x, old y);
{f(fontname)(#) ... } - sets font
fontname scaled by
# (in
1/10 fractions
of the current font size);
{s(#) ... } - scales current font by # (in 1/10 fractions of
the current font
size);
{c(#)(#)(#) ... } - sets RGB color. Each parameters
must be a positive decimal number in the region [0...1].
All sizes are in 1/10 fractions of the base font size, i.e. "10" means the size of the current font, "20" is twice bigger, "5" is a half size.
As a fontname, one can recommends to use only the standard
13 PostScript level 1 fonts:
Courier, Courier-Oblique, Courier-Bold, Courier-BoldOblique, Helvetica, Helvetica-Oblique, Helvetica-Bold, Helvetica-BoldOblique, Times-Roman, Times-Italic, Times-Bold, Times-BoldItalic, Symbol:
The 35 standard fonts according to the PostScript level 2 are:
Bookman-Demi, Bookman-DemiItalic, Bookman-Light, Bookman-LightItalic, Courier, Courier-Oblique, Courier-Bold, Courier-BoldOblique, AvantGarde-Book, AvantGarde-BookOblique, AvantGarde-Demi, AvantGarde-DemiOblique, Helvetica, Helvetica-Oblique, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Narrow, Helvetica-Narrow-Oblique, Helvetica-Narrow-Bold, Helvetica-Narrow-BoldOblique, Palatino-Roman, Palatino-Italic, Palatino-Bold, Palatino-BoldItalic, NewCenturySchlbk-Roman, NewCenturySchlbk-Italic, NewCenturySchlbk-Bold, NewCenturySchlbk-BoldItalic, Times-Roman, Times-Italic, Times-Bold, Times-BoldItalic, Symbol, ZapfChancery-MediumItalic, ZapfDingbats:
Example: the image
was produced by the following description:
{f(Symbol)(15)
{c(0)(0)(1)
W
}
}
{c(1)(0.5)(0)
{xy(1.2)(5)
{s(27)
+
}
}
{y(5)
{f(Courier)(30)
o
}
}
}
Base font is "Helvetica", base fotn size is 18.
\initPostscript( filename,
papersize,
orientation,
xmargin,
ymargin,
xleftmargin,
ncols,
nrows,
font,
fontsize
)
This function creates the PS header, so it must be invoked only
once. filename -- the output file name;
papersize -- one of the possible
paper size;
orientation -- portrait or landscape
xmargin -- both left and right margins
ymargin -- both up and down margins
xleftmargin -- additional left margin
ncols -- number of columns per page
nrows -- number of rows per page
font -- the PostScript font name
fontsize -- the PostScript font size
\initPostscript(alldiargams.ps,
A4,
Portrait,
20,
20,
40,
2,
10,
Helvetica,
15
)
\outpostscript()
\closePS()
\initInfoPS(filename)
\outInfoPS()
\closePS()
\closePS(),
is used to close .ps files
opened by both initPostscript and initInfoPS.
If the user opens
both these files, he must call the function
\closePS()
only once
to close both these files.
The styles "specmode.tml" and "folders.tml" contain all the necessary functions calls. Thus users of these styles only need to initialize the proper postscript driver in the environment
\Begin(initialization) ... \End(initialization)
\outEPS(filename,Height,font,fontsize)
after the output expression is created.
If fontsize == 0,
then the particles labels will not be printed.
The width of the diagram will be defined automatically.
The diagram will be scaled to fit the EPS bounding box
0 0 Width Height
No initialization, no \closePS()!
Example see above.
the user has to invoke the function
\outInfoEPS(filename,Height,font,fontsize)
after the output expression is created.
If fontsize == 0,
then the particles labels will not be printed.
The width of the diagram will be defined automatically.
The diagram will be scaled to fit the EPS bounding box
0 0 Width Height
No initialization, no \closePS()!
Some parameters may be adjusted by the user. There are two TM functions,
\setIEPSshift() and \setIEPSpars(), which may be
invoked in the "initialization" section to reset default parameters of this driver.
\setIEPSshift(particle, shift)
- sets a deviation of small arrow pointing a momentum flux, from the main propagator
line:
May be set individually for each particle. If the first argument,
particle, is empty, then the function sets the parameter shift
for all propagators. Negative value is acceptable. Default is 10.
The function \setIEPSpars(length, width,fsize,r,g,b) sets other parameters.
The first argument, length, is the length of the arrow:
Default is 20.
The width of the arrow, width:
Default is 2.
The third parameter, fsize, is the size of a font for momentua flows,
in 1/10 fractions of the base font size, i.e. "10" means the size of the
current font, "20" is twice bigger, "5" is a half size. Default is 7.
fsize=7:
, and
fsize=11:
.
Last three parameters define the RGB color for momenta flows. Each of them
must be between 0 and 1. Default is (1, 0.5, 0.3).
The example was produced using the following propagators:
[g,g;;VV(num,ind:1,ind:2,vec,3);0;spiral,5,2]
[A,A;;VV(num,ind:1,ind:2,vec,0);0;wavy,3,3;{f(Symbol)(10)g}{xy(-5)(5)~}]
[u,U;;FF(num,fnum,vec,0);mmU;arrowLine,0,2;e{y(4)-}]
The corresponding TM code is:
\Begin(initialization) \setIEPSshift(,10) \setIEPSshift(u,8) \setIEPSpars(20,2,7,1,0,0) \End(initialization) . . . \Begin(output,\askfilename()) \outInfoEPS( ie\currentdiagramnumber().eps,100,Helvetica,15) . . . \End(output)
The first one is to use the above mentioned model extension. Another one is using the the function
\setpropagatorline(particle, linetype, parameter, linewidth)Here parameters are the same as described for the model extension. The user can use this function to re-set line type come from the model. Here are several examples of the line types:
By default, all of the above PS drivers use the same particle images. By default the particle will be printed as the beginning of a propagator. The user can set non-trivial image by means of the above described model extension, or using the function
\setparticleimage(A,image)Here
image is the same as described
particle image, e.g.:
\setparticleimage(A,{f(Symbol)(10)g})
The user can use this function to re-set particle image come from the
model.