divert(-1) svg.m4 Initialization for SVG output. * Circuit_macros Version 8.0, copyright (c) 2014 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',svg) Default is to produce svg for web documents ifdef(`m4textprocessor',,`define(`m4textprocessor',xml)') ifdef(`libgen_',,`include(libgen.m4)divert(-1)')dnl # These definitions are tentative and subject to change. # ---------------------------------------------------------------------------# # If either nosvgformat or Inkscape is defined then the svg formatting # macros are turned off. Text formatting can then be done in Inkscape. dnl Put define(`Inkscape') in the source for Inkscape input ifelse(ifdef(`Inkscape',T)`'ifdef(`nosvgformat',T),T, `define(`svg_it',`$1') define(`svg_norm',`$1') define(`svg_bf',`$1') define(`svg_small',`$1') define(`svg_fsize',`$1') define(`svg_sub',`$1') define(`svg_sup',`$1') ', `define(`svg_it',``$1'') define(`svg_norm',``$1'') define(`svg_bf',``$1'') dnl To get %% in a sprintf string, set the size explicitly, dnl eg sprintf("x`'svg_sub(%g,50%)",i) define(`svg_small',`svg_fsize(`$1',ifelse(`$2',,66,`$2'))') define(`svg_fsize',``$1'') define(`svg_sub',`svg_small(`$1', ifelse(`$2',,66,`$2'))') define(`svg_sup',`svg_small(`$1', ifelse(`$2',,66,`$2'))') ') define(`svgcolor',`sprintf("rgb(%g,%g,%g)",\ int(`$1'+0.5),int(`$2'+0.5),int(`$3'+0.5))') define(`svgcolor255', `svgcolor(round_((`$1')*255),round_((`$2')*255),round_((`$3')*255))') define(`svgLink',`command " " `$2' command ""') define(`svgLinkString',`"dnl `$2' dnl "') # ---------------------------------------------------------------------------# define(`thinlines_',`linethick = 0.4 arrowwid = 0.04*scale; arrowht = 0.2/3*scale') define(`thicklines_',`linethick = 0.8 arrowwid = 0.05*scale; arrowht = 0.1*scale') `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