1

I'm looking for ways to write this enter image description here, similar to what the steinmetz package, but it must run in a \tikzpicture environment (via node) and in an \align environment, for example.

Note that this form is similar but different from Angle notation for complex numbers in polar form

I tried

\newcommand{\polar}[2]{ \ensuremath{#1^{\,\rule[-1.1mm]{0.2mm}{3mm}\underline{\,#2{\color{white}/}}}}}

but frankly, it looks really ugly

thank you

0
4

Something like this?

\documentclass{article}

\usepackage{steinmetz}
\newcommand\polar[2]{#1 ^{\,\raisebox{3pt}{\scriptsize$\phase{#2^{\circ}}$}}}

\begin{document}

$z = \polar{1.19}{-78.2039}$

\end{document}

enter image description here

Works fine in align:

\documentclass{article}

\usepackage{steinmetz,amsmath}
\newcommand\polar[2]{#1 ^{\,\raisebox{3pt}{\scriptsize$\phase{#2^{\circ}}$}}}

\begin{document}

\begin{align}
z_1 &= \polar{1.19}{-78.2039}\\
z_2 &= \polar{2}{33}\\
\vdots&\\
z_{10} &= \polar{4.1}{\sqrt{3}/6}\\
\end{align}

\end{document}

enter image description here

...and as a tikz node:

\documentclass[a4paper,10pt]{scrartcl}
\usepackage{tikz}
\usepackage{steinmetz}
\newcommand\polar[2]{#1 ^{\,\raisebox{3pt}{\scriptsize$\phase{#2^{\circ}}$}}}

\newcommand*\rectangled[1]{\tikz[baseline=(char.base)]{
    \node[shape=rectangle,draw,inner sep=2pt, rounded corners=4pt, thick] (char) {#1};}}

\begin{document}
  A rectangled number \rectangled{$\polar{1.19}{-78.2039}$}: No problem normally as it is used as normal charakter and TeX can set it in the right position.

\begin{sloppypar}
  A button with a longer name is marked using the same command and \rectangled{$\polar{2}{33}$} if it is set to the end of a line.
\end{sloppypar}
\end{document}

enter image description here

1

A solution using an array environment and siunitx:

\documentclass{article}
\usepackage{siunitx}
\newcommand{\mypolar}[2]{\ensuremath{#1^{\,\setlength{\arraycolsep}{1pt}\renewcommand{\arraystretch}{0.33}\begin{array}{@{}|l@{}}\scriptstyle\ang{#2}\\\hline\end{array}}}}

\begin{document}

\mypolar{5}{38.5}

\end{document} 

enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.