divert(-1) postscript.m4 Initialization for Postscript output. * Circuit_macros Version 7.1, copyright (c) 2011 J. D. Aplevich, under * * the LaTeX Project Public License. The files of this distribution may * * be redistributed or modified, provided that this copyright notice is * * included and provided that modifications are clearly marked to * * distinguish them from this distribution. There is no warranty * * whatsoever for these files. * define(`m4picprocessor',dpic) define(`m4postprocessor',postscript) ifdef(`up_',,`include(libgen.m4)divert(-1)')dnl Color utilities define(`setrgb',`pushdef(`r_',`$1')pushdef(`g_',`$2')pushdef(`b_',`$3')dnl pushdef(`m4cl_',ifelse(`$4',,lcspec,`$4'))dnl command sprintf(" /m4cl_ {%7.5f %7.5f %7.5f} def",r_,g_,b_) command " m4cl_ setrgbcolor"') define(`resetrgb',`popdef(`m4cl_')popdef(`r_')popdef(`g_')popdef(`b_')dnl ifdef(`r_', `command sprintf(" %7.5f %7.5f %7.5f setrgbcolor",r_,g_,b_)', `command " 0 0 0 setrgbcolor"') ') `rgbdraw(color triple, drawing commands)' define(`rgbdraw',`setrgb(`$1',`$2',`$3') shift(shift(shift($@))) resetrgb') `rgbfill(color triple, closed path)' `This ought to be fixed to work for nonconvex areas' define(`rgbfill', `command " npath /npath {} def /endstroke {} def" shift(shift(shift($@))) command sprintf("gsave %7.5f %7.5f %7.5f setrgbcolor", `$1',`$2',`$3') command " fill grestore ostroke" command " /endstroke {ostroke} def /npath {newpath} def"') Define some primary colors define(`defineRGBprimaries',` command "/white {1 1 1} def /lightgrey {0.75 0.75 0.75} def /grey {0.5 0.5 0.5} def /darkgrey {0.25 0.25 0.25} def /black {0 0 0} def /red {1 0 0} def /green {0 1 0} def /blue {0 0 1} def /cyan {0 1 1} def /magenta {1 0 1} def /yellow {1 1 0} def "') define(`thinlines_',`linethick = 0.4 arrowwid = 0.04*scale; arrowht = 0.2/3*scale command " 0.4 setlinewidth";') define(`thicklines_',`linethick = 0.8 arrowwid = 0.05*scale; arrowht = 0.1*scale command " 0.8 setlinewidth";') `linethick_(x) set line width to x pt' define(`linethick_',`linethick = ifelse(`$1',,`0.8',`$1'); dnl arrowwid = ifelse(`$1',,`0.05',linethick/16)*scale; dnl arrowht = ifelse(`$1',,`0.1',linethick/8)*scale;') divert(0)dnl