我有一张简短的 LaTeX Tikzpicture。我在三条路径上画了三个箭头。
- 第一个箭头位于围绕文本的圆形节点上。
- 第二个箭头位于以 (b) 为中心的圆节点上。
- 第三个箭头位于两个圆圈节点之间的边上。
我希望三个箭头大小相同。但令我沮丧的是,第一个圆上的箭头比其他箭头小。我该如何解决这个问题?
代码如下:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,positioning}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}
\coordinate (b) at (4,0) ;
\node[circle,draw,postaction={decorate,decoration={markings,
mark=at position 0.5 with {\arrow[scale=5]{>}}}}] at (0,0) (u)
{an arrowed circle};
\node[inner sep=0] at (b) (w) {\tikz \draw
[postaction={decorate,decoration={markings, mark=at position 0.5 with
{\arrow[scale=5]{>}}}}] (b) circle (1.5);};
\draw [postaction={decorate,decoration={markings,
mark=at position 0.7 with {\arrow[scale=5]{>}}}}] (w) -- (u);
\end{tikzpicture}
\end{document}
答案1
节点是难以控制的,它们会重置缩放命令,但你可以使用以下命令添加低级缩放\pgftransformscale{5}
:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,shapes,positioning}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}[]
\coordinate (b) at (-2,-2) ;
\node[circle,draw,postaction={decorate,decoration={markings,
mark=at position 0.5 with {\pgftransformscale{5}\arrow[]{>}}}}] at (0,0) (u)
{an arrowed circle};
\draw [postaction={decorate,decoration={markings,
mark=at position 0.5 with {\arrow[scale=5]{>}}}}] (b) -- (u);
\draw [postaction={decorate,decoration={markings,
mark=at position 0.5 with {\arrow[scale=5]{>}}}}] (b) circle (3);
\end{tikzpicture}
\end{document}
答案2
尽管有种种限制,但事情在平淡中要简单一些元帖子。没有节点的概念,只有点、路径和标签。
prologues := 3;
outputtemplate := "%j%c.eps";
beginfig(1);
% define the paths
path bar, c[];
c0 = fullcircle scaled 90 rotated 180;
c1 = c0 shifted 60 left;
c2 = c0 shifted 60 right;
bar = point 0 of c2 -- point 4 of c1;
% draw the arrows
ahlength := 8;
drawarrow c1;
drawarrow c2;
numeric t; t = 0.66;
drawarrow subpath(0,t) of bar; draw subpath(t,1) of bar;
% add the label
defaultfont := "texnansi-lmr10";
label("an arrowed circle", center c1);
endfig;
end.
如果你想要弯曲的计算机现代箭头,你可以用箭头包裹。