From e25c6ee4ea5169bf31ab28ebddcc94c8b4992453 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 5 Sep 2019 22:33:48 +0000 Subject: 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 --- .../tex/latex/circuit-macros/boxdims.sty | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/circuit-macros/boxdims.sty (limited to 'Master/texmf-dist/tex/latex/circuit-macros') 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} -- cgit v1.2.3