summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/steinmetz/steinmetz.sty
blob: 3ad767293063dbc4e115728c4b48e418a779e489 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
%%
%% This is file `steinmetz.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% steinmetz.dtx  (with options: `package')
%% 
%% This is a generated file.
%% 
%% Copyright (C) 2009 by Enrico Gregorio <Enrico dot Gregorio (at) univr dot it>
%% 
%% This file may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.3 of this license
%% or (at your option) any later version.  The latest version of this
%% license is in:
%% 
%%    http://www.latex-project.org/lppl.txt
%% 
%% and version 1.3 or later is part of all distributions of LaTeX version
%% 2005/12/01 or later.
%% 
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{steinmetz}
    [2009/06/14 v1.0 Steinmetz symbol for electrotechnics]
\RequirePackage{pict2e}[2004/07/06]
\newsavebox{\stm@phasebox}
\newlength{\stm@phasedp}
\newlength{\stm@phaseht}
\newlength{\stm@phasetot}
\newlength{\stm@phasewd}
\newcommand\phase[2][1]{%
  \sbox\stm@phasebox{%
    $\ifcase#1\relax
      \displaystyle\or\textstyle\or\scriptstyle\or\scriptscriptstyle
     \fi#2$}
  \stm@phaseht=\ht\stm@phasebox
  \stm@phasedp=\dp\stm@phasebox
  \stm@phasetot=\stm@phasedp \advance\stm@phasetot .35ex
    \advance\stm@phasetot\stm@phaseht
  \stm@phasewd=\wd\stm@phasebox
    \advance\stm@phasewd .5\stm@phasetot
  \setbox\stm@phasebox=\vbox to\stm@phaseht{
    \hbox{\setlength{\unitlength}{1pt}\linethickness{.6pt}%
    \edef\ph@x{\strip@pt\stm@phasewd}\edef\ph@y{\strip@pt\stm@phasetot}%
    \dimen@ .5\stm@phasetot \edef\ph@dx{\strip@pt\dimen@}%
  \begin{picture}(\ph@x,\ph@y)
    \put(0,0){\circle*{.4}}
    \put(0,0){\line(1,0){\ph@x}}\put(0,0){\line(1,2){\ph@dx}}
    \put(\ph@dx,1.5){\raise\stm@phasedp\vbox{\box\stm@phasebox}}
  \end{picture}%
  }\vss}%
  \advance\stm@phasedp .35ex \advance\stm@phasedp .6pt
  \dp\z@=\stm@phasedp \box\stm@phasebox}
\endinput
%%
%% End of file `steinmetz.sty'.