“罕见”的极地形态

“罕见”的极地形态

我正在寻找方法来写这个在此处输入图片描述,类似于steinmetz包,但它必须在\tikzpicture环境中运行(通过node)并在 \align环境中运行,例如。

请注意,此形式与极坐标形式的复数的角度符号

我试过

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

但说实话,它看起来真的很丑

谢谢

答案1

像这样吗?

\documentclass{article}

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

\begin{document}

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

\end{document}

在此处输入图片描述

适用于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}

在此处输入图片描述

...作为tikz节点:

\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}

在此处输入图片描述

答案2

使用环境的解决方案arraysiunitx

\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} 

在此处输入图片描述

相关内容