From a5ae129f3aa3a3a0aeaa21c55b75a1d543fe4111 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Fri, 4 Jun 2021 03:02:48 +0000 Subject: CTAN sync 202106040302 --- graphics/circuit_macros/svg.m4 | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) (limited to 'graphics/circuit_macros/svg.m4') diff --git a/graphics/circuit_macros/svg.m4 b/graphics/circuit_macros/svg.m4 index 113174d0be..e686074a6b 100644 --- a/graphics/circuit_macros/svg.m4 +++ b/graphics/circuit_macros/svg.m4 @@ -1,7 +1,7 @@ divert(-1) svg.m4 Initialization for SVG output. -* Circuit_macros Version 9.5, copyright (c) 2021 J. D. Aplevich under * +* Circuit_macros Version 9.6, copyright (c) 2021 J. D. Aplevich under * * the LaTeX Project Public Licence in file Licence.txt. The files of * * this distribution may be redistributed or modified provided that this * * copyright notice is included and provided that modifications are clearly * @@ -26,6 +26,7 @@ dnl Put define(`Inkscape') in the source for Inkscape input ifelse(ifdef(`Inkscape',T)`'ifdef(`nosvgformat',T),T, `define(`svg_it',`$1') define(`svg_tt',`$1') +define(`svg_sf',`$1') define(`svg_norm',`$1') define(`svg_bf',`$1') define(`svg_small',`$1') @@ -99,15 +100,22 @@ dptextratio)') define(`svg_symbol',`changecom(,)`$1'changecom(`#',)') define(`svg_it',``$1'') define(`svg_tt',``$1'') +define(`svg_sf',``$1'') define(`svg_norm',``$1'') define(`svg_bf',``$1'') -dnl To get %% in a sprintf string, set the size explicitly, +dnl T0 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'') +dnl svg_ul(text) Underline text +define(`svg_ul',``$1'') +dnl svg_ol(text) Overline text +define(`svg_ol',``$1'') + +dnl svg_sup dnl This is black magic but seems necessary to work with Firefox dnl Arg 2: size of subscript font in percent dnl Arg 3: vertical shift, e.g. svg_sub(1,,0.5ex) @@ -126,6 +134,29 @@ define(`svg_sub',` ')dnl note the space + + + `svg_frac(numerator[:wid],denominator[:wid]) + Basic fraction for simple arguments + wid is in drawing units' +define(`svg_frac',`define(`m4ex',`(textht*0.675)')dnl sans-serif: 0.8525 +define(`m4num',`patsubst(`$1',:.*)')dnl +define(`m4den',`patsubst(`$2',:.*)')dnl +define(`m4numx',`ifinstr(`$1',:,((patsubst(`$1',.*:))/m4ex),len(`$1'))')dnl +define(`m4denx',`ifinstr(`$2',:,((patsubst(`$2',.*:))/m4ex),len(`$2'))')dnl +define(`m4mx',`max(m4numx,m4denx)')dnl + " m4numm4den " + line right m4mx*m4ex from Here+((m4mx/2-0.8)*m4ex,-0.2*m4ex) + move to Here+(0,0.2*m4ex) + {box invis wid last line.len ht 2.8*textht with .w at last line.start} +') + +define(`svg_hat',`svg_circ`$1'') + define(`svg_alpha',`svg_symbol(&`#'945;)') define(`svg_beta',`svg_symbol(&`#'946;)') define(`svg_chi',`svg_symbol(&`#'967;)') @@ -174,14 +205,15 @@ define(`svg_backsl',`svg_symbol(&`#'92;)') define(`svg_pound',`svg_symbol(&`#'35;)') define(`svg_circ',`svg_symbol(&`#'710;)') define(`svg_deg',`svg_symbol(&`#'176;)') +define(`svg_equiv',`svg_symbol(&`#'8801;)') ') define(`svgcolor',`sprintf("rgb(%g,%g,%g)",\ -round_(`$1'),round_(`$2'),round_(`$3'))') +int(`$1'+0.5),int(`$2'+0.5),int(`$3'+0.5))') # Obsolete but kept for compatibility. Use `rgbstring(r,g,b)' define(`svgcolor255', - `svgcolor(round_((`$1')*255),round_((`$2')*255),round_((`$3')*255))') + `svgcolor(int((`$1')*255+0.5),int((`$2')*255+0.5),int((`$3')*255+0.5))') define(`svgLink',`command " -- cgit v1.2.3