Re: Simbolo matematico della fase

#6860
Up
0
Down
::


Nuova versione, un po’ più definitiva 😀
`\newsavebox{\phasebox}
\newlength{\phasedp}
\newlength{\phaseht}
\newlength{\phasetot}
\newlength{\phasewd}

\makeatletter
\newcommand\phase[2][0]{%
\sbox\phasebox{%
$\ifcase#1\relax
\displaystyle\or\textstyle\or\scriptstyle\or\scriptscriptstyle
\fi#2$}
\phaseht=\ht\phasebox
\phasedp=\dp\phasebox
\phasetot=\phasedp \advance\phasetot .35ex %0.23ex
\advance\phasetot\phaseht
\phasewd=\wd\phasebox
\advance\phasewd .5\phasetot
\setbox0=\vbox to\phaseht{\hbox{\setlength{\unitlength}{1pt}\linethickness{.6pt}%
\edef\ph@x{\strip@pt\phasewd}\edef\ph@y{\strip@pt\phasetot}%
\dimen@ .5\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\phasedp\vbox{\box\phasebox}}
\end{picture}%
}\vss}\advance\phasedp .35ex \advance\phasedp .6pt \dp0=\phasedp \box0 }
\makeatother`
A differenza della precedente il risultato ha altezza e profondità corrette. Inoltre è possibile specificare un argomento opzionale per forzare un particolare stile di formula:
`\phase[0]{X}
\phase[1]{X}
\phase[2]{X}
\phase[3]{X}`
compongono X all’interno dell’angolo rispettivamente in \displaystyle, \textstyle, \scriptstyle e \scriptscriptstyle.

Ciao
Enrico

Go to top