summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/circuit-macros
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-09-05 22:33:48 +0000
committerKarl Berry <karl@freefriends.org>2019-09-05 22:33:48 +0000
commite25c6ee4ea5169bf31ab28ebddcc94c8b4992453 (patch)
tree855a21705c8e75ed71066d3e6215752d04dd43ba /Master/texmf-dist/tex/latex/circuit-macros
parent1047c66359c02d8f8852e0dbdd69f5cf1cd1a76b (diff)
circuit-macros (all except boxdims.sty in doc due to generic file names)
git-svn-id: svn://tug.org/texlive/trunk@52035 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/circuit-macros')
-rw-r--r--Master/texmf-dist/tex/latex/circuit-macros/boxdims.sty33
1 files changed, 33 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/circuit-macros/boxdims.sty b/Master/texmf-dist/tex/latex/circuit-macros/boxdims.sty
new file mode 100644
index 00000000000..22b76d73fd9
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/circuit-macros/boxdims.sty
@@ -0,0 +1,33 @@
+%
+% boxdims.sty, for use with m4 preprocessors. Last modified 30 Apr 2004.
+%
+% \boxdims{arg1}{arg2} expands to arg2, but writes into file \jobname.dim
+% the m4 definitions for macros arg1_h, arg1_w, arg1_d, the height, width
+% and depth of \hbox{arg2}.
+%
+% \defboxdim{arg1}{arg2} writes the definitions but expands to nothing.
+%
+% \boxdimfile{filename} sets the output file to filename, default \jobname.dim
+%
+\ProvidesPackage{boxdims}
+ [2004/04/30 v2.0 Macros: boxdimfile, boxdims, defboxdim (DA)]
+
+\newwrite\@dimensionfile
+\newif\if@dimfile
+\newbox\dimbox
+
+\def\boxdimfile#1{\immediate\openout\@dimensionfile=#1\global\@dimfiletrue%
+ \typeout{ boxdims.sty v2.0: Writing dimension file #1 }}%
+
+\def\boxdims#1#2{\defboxdim{#1}{#2}#2}
+
+\def\defboxdim#1#2{\if@dimfile\else%
+ \immediate\openout\@dimensionfile=\jobname.dim\global\@dimfiletrue%
+ \typeout{ boxdims.sty v2.0: Writing dimension file \jobname.dim }\fi%
+ \setbox\dimbox=\hbox{#2}%
+ \begingroup\@sanitize\edef\@tempa{\write\@dimensionfile{%
+ \@defboxdim{#1}}}\expandafter\endgroup\@tempa}
+\def\@defboxdim#1{%
+define(`#1_w',\the\wd\dimbox__)%
+define(`#1_h',\the\ht\dimbox__)%
+define(`#1_d',\the\dp\dimbox__)dnl}