我正在寻找方法来写这个,类似于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}