我需要它\alpha_1
稍微靠近角落,它应该被“很好地”放置。
我尝试了以下代码(标签距离/角度中有各种数字):
\documentclass{article}
\usepackage{tikz}
\begin{document}
\pagenumbering{gobble} % Remove the page numbering
\begin{tikzpicture}
\coordinate (orig) at (0,0);
%node[label={[label distance=0.05cm]90:$i_a$}]
\draw[->] (orig) -- (90:1) node[above] (ia) {$i_a$};
\draw[->] (orig) -- (10:1) node[right] (ib) {$i_b$};
\draw[->] (orig) -- (-45:1) node[right] (ic) {$i_c$};
\draw[blue] (10:0.2) arc (10:90:0.2) node[label={[label distance=-0.01cm]3:$\alpha_1$}] (asd) {};
\end{tikzpicture}
\end{document}
由于某种原因,代码似乎以躲避那个角落的方式运行......我尝试过的许多数字都避开了那个角落附近的任何地方。
答案1
angles
和库quotes
的结合使得这变得容易得多。
\documentclass[border=10pt,multi,tikz]{standalone}
\usetikzlibrary{angles,quotes}
\begin{document}
\begin{tikzpicture}
\coordinate (orig) at (0,0);
\draw[->] (orig) -- (90:1) node[above] (ia) {$i_a$};
\draw[->] (orig) -- (10:1) node[right] (ib) {$i_b$};
\draw[->] (orig) -- (-45:1) node[right] (ic) {$i_c$};
\pic [draw, blue, angle radius=2mm, "$\alpha_1$", angle eccentricity=2] {angle=ib--orig--ia};
\end{tikzpicture}
\end{document}
答案2
将文本放入节点内并使用postioning
库移动节点本身更容易:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\pagenumbering{gobble} % Remove the page numbering
\begin{tikzpicture}
\coordinate (orig) at (0,0);
%node[label={[label distance=0.05cm]90:$i_a$}]
\draw[->] (orig) -- (90:1) node[above] (ia) {$i_a$};
\draw[->] (orig) -- (10:1) node[right] (ib) {$i_b$};
\draw[->] (orig) -- (-45:1) node[right] (ic) {$i_c$};
\draw[blue] (10:0.2) node[above right=0.1ex and -1ex]
(asd) {\color{blue}$\alpha_1$} arc (10:90:0.2) ;
\end{tikzpicture}
\end{document}