summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/circuit-macros/svg.m4
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-07-28 20:05:13 +0000
committerKarl Berry <karl@freefriends.org>2022-07-28 20:05:13 +0000
commitd48b14adae709901fb4e3f9f044e7436ee7d3ffd (patch)
tree1f2ffb6f33503123fbeb471c11139f107fcef414 /Master/texmf-dist/doc/latex/circuit-macros/svg.m4
parent7be9f06d64cecf58d5b50b70e09ad53e96372cfe (diff)
circuit-macros (28jul22)
git-svn-id: svn://tug.org/texlive/trunk@63991 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/circuit-macros/svg.m4')
-rw-r--r--Master/texmf-dist/doc/latex/circuit-macros/svg.m432
1 files changed, 27 insertions, 5 deletions
diff --git a/Master/texmf-dist/doc/latex/circuit-macros/svg.m4 b/Master/texmf-dist/doc/latex/circuit-macros/svg.m4
index dfa968891fe..73f144594fd 100644
--- a/Master/texmf-dist/doc/latex/circuit-macros/svg.m4
+++ b/Master/texmf-dist/doc/latex/circuit-macros/svg.m4
@@ -1,7 +1,7 @@
divert(-1)
svg.m4 Initialization for SVG output.
-* Circuit_macros Version 9.8, copyright (c) 2022 J. D. Aplevich under *
+* Circuit_macros Version 9.9, copyright (c) 2022 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 *
@@ -207,6 +207,7 @@ 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(`svg_tilde',`svg_symbol(&`#'126;)')
')
define(`svgcolor',`sprintf("rgb(%g,%g,%g)",\
@@ -242,7 +243,7 @@ define(`svg_rot_init',`
| sed -e \"s/x=\\"\([0-9.]*\)\\" y=\\"\([0-9.]*\)\\".*/\1 \2/\" dnl
> _file_.cor" )
if retcode != 0 then { print "
- Awk failure
+ Awk failure.
Awk and sed are required by svg_rot to rotate svg text.
" }
svgrot_k = 0
@@ -254,7 +255,7 @@ define(`svg_rot_init',`
svgrot_i = 0
ifdef(`svg_rot_',,`
-# `svg_rot(degrees,"text" [at position])
+# `svg_rot(degrees,"text",[at position])
# Rotate text degrees ccw
# Requires svg_rot_init(filename)
# which uses both awk and sed.
@@ -263,15 +264,36 @@ define(`svg_rot_init',`
if "$`'1" != "" then { svg_rang = -($`'1) } else { svg_rang = -90 }
if svgrot_k != 0 then { svgrot_i +=1
command sprintf("<g transform=\"rotate(%g %g %g)\">",svg_rang,\
- svg_rx[svgrot_i],svg_ry[svgrot_i]) }\
+ svg_rx[svgrot_i]+textht/2*sind(svg_rang),\
+ svg_ry[svgrot_i]+textht/2*(1-cosd(svg_rang))) }\
else { command sprintf("<g transform=\"rotate(%g)\">",svg_rang) }
-$`'2
+ if "$`'3"=="" then { $`'2 } \
+ else { $`'2 $`'3 - (sind(svg_rang),(cosd(svg_rang)-1))*textht/2 }
command "</g>" } }
define(`svg_rot_')
')
`# svg_rot'_init end
')
+ifelse(0,1,`
+# ifdef(`svg_rot_',,`
+## `svg_rot(degrees,"text" [at position])
+## Rotate text degrees ccw
+## Requires svg_rot_init(filename)
+## which uses both awk and sed.
+## The source must be processed twice by m4 and dpic.'
+# define svg_rot { if retcode != 0 then {$`'2} else {
+# if "$`'1" != "" then { svg_rang = -($`'1) } else { svg_rang = -90 }
+# if svgrot_k != 0 then { svgrot_i +=1
+# command sprintf("<g transform=\"rotate(%g %g %g)\">",svg_rang,\
+# svg_rx[svgrot_i],svg_ry[svgrot_i]) }\
+# else { command sprintf("<g transform=\"rotate(%g)\">",svg_rang) }
+#$`'2
+# command "</g>" } }
+# define(`svg_rot_')
+# ')
+')
+
# ---------------------------------------------------------------------------#
define(`thinlines_',`linethick = 0.4