6.4.6.1. EDITING POSTSCRIPT FILES

next, previous Section / Table of Contents / Index The following discussion is meant only for those who want to further modify graphics details inside the (encapsulated) PostScript output file produced by BALSAC. The overall structure of this PostScript file together with all elementary macros is described in Sec. 6.4.6 and will be referred to in the following. For further details concerning the PostScript programming language consult the appropriate literature. Modifying PostScript output files can be made easier if PostScript previewing software (for example Ghostscript or Ghostview by the GNU Foundation, or xv by John Bradley (C)) is used in combination with the file editor. This allows you to see changes and errors without having to wait for print output and wasting (expensive color) printer paper. In the following we list a number of problems in graphics output that can be (more or less) easily solved by modifications in the PostScript file. * The plot title can be changed in lines ( Title of plot ... ) show by editing the text inside the brackets. Further modifications, including subscripts, superscripts, and greek/mathematical symbols are possible using the macros Sub, Sup, Ssym. As an example, a title line Pd(111) with C2H2 (3X1 state) adsorbed in di-sigma symmetry with all super- and subscripts would read (Pd\(111\) with C) show (2) Sub (H) show (2) Sub ( \() show (3) Sup (X) show (1) Sub ( state \) adsorbed in di-) show (s) Ssym ( symmetry) show inside the PostScript file. * The sizes and/or fonts of the plot title line (defaulted to Times-Roman, 20pt) can be modified in line /thi 20 def /Fnt1 /Times-Roman findfont thi scalefont def by resetting "20" to a different point size and/or replacing "Times-Roman" by any valid PostScript font. * The sizes and/or fonts of all labels (defaulted to Helvetica, 20pt) can be modified in line /mhi 20 def /Fnt2 /Helvetica findfont mhi scalefont def by resetting "20" to a different point size and/or replacing "Helvetica" by any valid PostScript font. * Multiple copies of the plot can be produced by editing the line /#copies 1 def showpage replacing "1" by a different number of copies. * Removing the "%" character at the beginning of the first of the two lines % 20 20 570 770 Boxd .000 .000 .000 setrgbcolor fill % 20 20 570 770 Boxd 0 setgray stroke fills the background of the plot with black color. If you replace in this line "0.000, 0.000, 0.000" by any other triple of RGB values this color will be used for background. * Removing the "%" character at the beginning of the second of the two lines % 20 20 570 770 Boxd .000 .000 .000 setrgbcolor fill % 20 20 570 770 Boxd 0 setgray stroke frames the plot with a rectangle of black lines. Framing and background painting can be combined by removing the "%" characters of both the above lines. * Removing the "%" character at the beginning of line % 53 45 {dup mul exch dup mul add 1. exch sub } setscreen forces the printer to a 300dpi optimized dithering, which may be needed on some color printers to produce continuous shading. * The plot may be rotated and reduced with respect to its default orientation and magnification (landscape, fitting on a letter or A4 size page) to yield portrait orientation and reduction by 30% thus still fitting on a letter or A4 size page. This is achieved by a) changing the bounding box in the PostScript prologue from %%BoundingBox: 20 20 570 770 to %%BoundingBox: 40 315 565 700 b) removing the "%" character at the beginning of line % 26 714 translate -90 rotate .7 .7 scale This plot rotation / reduction is very useful and can save painful readjustments if BALSAC plots are to be inserted electronically into manuscripts produced with text processing systems such as Word or WordPerfect. * You may place two BALSAC figures (reduced to 70% in size) in one figure (figure 1 at top, figure 2 at bottom) printing on one page. This is achieved by a) copying files file.1 (showing figure 1), file.2 (showing figure 2) one after another into one file file.all. b) editing file.all by b1) removing the first of two lines reading /#copies 1 def showpage b2) replacing the first line ending with "... Boxd clip" by a line 0 800 translate -90 rotate .7 .7 scale b3) replacing the second line ending with "... Boxd clip" by a line 500 0 translate * You may place four BALSAC figures (reduced to 50% in size) in one figure (figure 1 at top left, figure 2 at top right, figure 3 at bottom left, figure 4 at bottom right) printing on one page. This is achieved by a) copying files file.1 (showing figure 1), file.2 (showing figure 2), file.3 (showing figure 3), file.4 (showing figure 4) one after another into one file file.all. b) editing file.all by b1) removing the first three of four lines reading /#copies 1 def showpage b2) replacing the first line ending with "... Boxd clip" by a line .5 .5 scale b3) replacing the second line ending with "... Boxd clip" by a line 0 750 translate b4) replacing the third line ending with "... Boxd clip" by a line 600 -750 translate b5) replacing the fourth line ending with "... Boxd clip" by a line 0 750 translate * PostScript colors and gray scales may be readjusted in the Coldef macro calls. As an examples, the basic color definition describing a set of blue tones of intensities between 0.45 and 0.88 reads .000 .000 1.000 .450 .880 1.000 Coldef Here replacing ".880" by ".980" widens the intensity range towards lighter blues yielding more shining balls. Replacing ".000 .000 1.000" by "1.000 1.000 .000" at the beginning of the line changes the basic color from blue to yellow. * The number of tones used for shading is defined by the parameter nosh in line /nosh 5 def /ncol 3 def ... of the PostScript file. Changing the value of nosh ( = 5 above) increases or decreases the number of tones used in ball shading. Note that the computational effort of the PostScript output scales linearly with nosh. Thus, for interactive testing with a PostScript previewer small nosh values ( < 6) are suggested while for final printing large values ( 10 < nosh < 20) are meaningful. * More basic colors (shading tones) can be added to a plot using shaded balls by including another Coldef macro call .... nR nG nB qbot qtop qgam Coldef after the existing sequence (of N Coldef calls) and increasing the value of the ncol parameter in line /nosh 5 def /ncol 3 def ... ( ncol = 3 ) by one. The added shading set is addressed by its color index number N in calls to CBall. * Two-dimensional lines added to the plot in an interactive BALSAC session show as arrows in the PostScript file (close to the file end). They are always combined with a commented line containing a label command at the beginning of the arrow, e. g. 129.20 604.60 244.40 515.50 0. 0. 0. 1.5 CArrow % 129.20 604.60 ( 1/ 1) Mark Here the arrow can be changed to a line, outlined line, or double headed arrow by replacing "CArrow" above by "CLine", "COLine", or "CArro2". Further, removing the "%" character at the beginning of the second line above shows a label with dummy text "1/1" at the arrow end which can be edited to yield a meaningful label text. * Pairs of 2-dimensional lines or arrows which join at one end can look ugly at the joint due to overwriting, in particular if outlining is used. This can be "cleaned" using the CDLine or CDArrow macros. As an example, the pair of arrows 129.20 604.60 244.40 515.50 0. 0. 0. 1.5 CArrow 129.20 604.60 266.00 300.10 0. 0. 0. 1.5 CArrow describing a 2-dimensional periodicity basis looks more appealing if the above macro calls are replaced by 129.20 604.60 244.40 515.50 266.00 300.10 0. 0. 0. 1.5 CDArrow * Polygons of 2-dimensional joining lines can look ugly at the joint due to overwriting, in particular if outlining is used. This can be cleaned by first drawing all lines with outlining and then repeating the line drawing without outlining. As an example, the red triangle drawn by 100.00 100.00 200.00 200.00 1.0 0.0 0.0 0.5 COLine 200.00 200.00 300.00 100.00 1.0 0.0 0.0 0.5 COLine 300.00 100.00 100.00 100.00 1.0 0.0 0.0 0.5 COLine looks more appealing with 100.00 100.00 200.00 200.00 1.0 0.0 0.0 0.5 COLine 200.00 200.00 300.00 100.00 1.0 0.0 0.0 0.5 COLine 300.00 100.00 100.00 100.00 1.0 0.0 0.0 0.5 COLine 100.00 100.00 200.00 200.00 1.0 0.0 0.0 0.5 CLine 200.00 200.00 300.00 100.00 1.0 0.0 0.0 0.5 CLine 300.00 100.00 100.00 100.00 1.0 0.0 0.0 0.5 CLine repeating the COLine calls by CLine calls. Further, to achieve round joints connecting the lines the macro COLine may have to me modified in line moveto lineto 1 setlinejoin 0 setlinecap gsave lwi 3 add ... replacing "0 setlinecap" by "1 setlinecap". * Labels appearing in BALSAC output use the macro Mark which writes label text in black color on a rectangular background painted white to emphasize its visibility. Suppressing the white background of all labels generated by macro Mark is achieved by removing the two lines newpath xx yy moveto 90 rotate lwi 0 rlineto 0 mhi rlineto lwi neg 0 rlineto -90 rotate closepath 1 setgray fill in the Mark macro definition. Note that this will affect all labels generated by macro Mark. * Using macros Marka, Marke instead of Mark suppresses the white background of selected labels and adds more flexibility to the label text allowing for super/subscripts and greek symbols. As an example, the label call 129.20 604.60 (top site) Mark replaced by 129.20 604.60 Marka (top site) show Marke will suppress the white background. Further, the lines 129.20 604.60 Marka (C) show (2) Sub (H) show (2) Sub ( in di-) show (s) Ssym ( symmetry) show Marke create a label "C2H2 in di-sigma symmetry" with all subscripts and the greek symbol. * Labels generated by macro Mark are positioned to the upper right of their origin definition x, y. Removing the comment '%' in line stringwidth pop def %/xx xx mhi 2 div add def /yy yy lwi 2 div sub def of the Mark macro definition results in labels centered about their origin definition. This may be needed for more obvious atom labelling in complex structures. * Outlining of shaded balls uses a line width 0.25 by default. This can be changed in line /COcir { setrgbcolor 0.25 setlinewidth newpath 0 360 arc ... replacing "0.25" by any other line width value. Note that this change acts on all balls and also on all circles created by the COcir macro. Outline changes of single balls are more difficult requiring PostScript language skills to modify the CBall and COcir macros. * Color filled circles use a default line width 0.25 for outlining. This can be changed in line /CFcir { setrgbcolor 0.25 setlinewidth newpath 0 360 arc ... replacing "0.25" by any other line width value. Note that this change acts on all filled circles. Outline changes of single circles are more difficult requiring PostScript language skills. * The outline color used for shaded balls and color filled circles is defined globally by RGB parameters Rol, Gol, Bol and the outline color for bond sticks is defined by Rbd, Gbd, Bbd. Here the defaults (.000, .000, .000) = black given in lines /Rol .000 def /Gol .000 def /Bol .000 def /Rbd .000 def /Gbd .000 def /Bbd .000 def can be overwritten for special effects. As an example, the line /Rol 1.000 def /Gol .000 def /Bol .000 def results in red outlining of all shaded balls. Different outline colors used for single balls can be set by local redefinition. For example, the calling sequence ... /Rol 1.000 def /Gol 1.000 def /Bol 1.000 def 345.47 483.95 22.24 1 CBall % 8 /Rol .000 def /Gol .000 def /Bol .000 def ... creates a shaded ball with white outlining while all other balls are outlined black. * In BALSAC PostScript output files all atoms shown as points, (color filled) circles, or shaded balls are created by the appropriate macro calls COcir, CFcir, CBall. The number at the end of each calling line (given as a PostScript comment, preceeded by "%") refers to the atom number which is identical to that used inside BALSAC and available in the graphic analysis. As an example, line 274.04 375.51 31.29 2 CBall % 3 creates a shaded ball for atom no. 3. The atom numbers are useful for finding specific atoms (for modification) in the PostScript file: first, you search for the atom with the graphic analysis on the screen, identify its atom number, and then look for the atom number in the PostScript file. * In BALSAC PostScript output files all bonds between atom pairs shown as lines or sticks of finite thickness are created by the appropriate macro calls COLine, CBond. The numbers at the end of each calling line (given as a PostScript comment, preceeded by "%") refer to the numbers of the two atoms involved which are identical to those used inside BALSAC and available in the graphic analysis. As an example, lines 255.06 395.58 258.49 361.83 2.846 2.890 .1820 1.000 1.000 1.000 CBond % 2 - 28 create a bond stick between atoms no. 2 and 28. The atom numbers are useful for finding specific bonds (for modification) in the PostScript file: first, you search for the atoms with the graphic analysis on the screen, identify respective atom numbers, and then look for the bond with these atom numbers in the PostScript file. next, previous Section / Table of Contents / Index