这个问题一直是我的其他。由于我的名声,我不能对答案发表评论。所以我借此机会感谢约翰·科米洛感谢他回答了我最初的问题。也为我的错误英语道歉。
对于这个问题:
对于电路我使用circuitikz
语法,例如
\begin{circuitikz}
\draw
(0,0) to [V = $U$] (0,3)
to [short, i = $I$, -*] (3,3) -- (6,3)
to [R = $R_2$, v = $U_2$, i = $I_2$] (6,0) -- (0,0)
(3,3) to [R = $R_1$, v = $U_1$, i = $I_1$, -*] (3,0);
\end{circuitikz}
这非常简单直观。但是当我想在电路中添加网格箭头时,我会使用(除了上面的代码;以网格为例):
\draw
%
% mesh one (detailed explanation of the implementation)
%
[<-,% direction of the arrow
> = triangle 45,% kind of the arrow end
path picture =% allows ''to paint a picture'' inside of an other ''picture''
{\node[anchor = center]% position of the inner ''picture''
at (path picture bounding box.center)% bordering rectangle,
% centered inside the arrow (arrow is the outer ''picture'')
{$M_1$};}]% text of the inner ''picture''
(1.75,1)% coordinates of the arrow end
arc% arc-shaped arrow
(-60:% angle of the arrow start
170:% angle of the arrow end
.5);% radius of the arc
要了解这两个代码片段的结果,请参见上面的链接(我最初的问题)。
对于我来说,“仅仅”一个箭头的代码量似乎有点太多、太复杂而且不直观。
我想要的是:
1.将电路的各个部分(作为具有名称的节点)彼此相对放置,如PGF
手册第 51 页(第 3.8 节)中的“Petri-Net”示例:
结合circuitikz
语法(参见第一个代码示例)。
2.使用电路零件的名称来放置网格箭头,通过controls
宏直观(第 748 页,PGF
手册),就像 John Kormylo 在回答我最初的问题时所做的那样:
\node (M 3) [below] at (0,0) {\phantom{$M_3$}};% reserving space for M 3 under the circuit
\draw
[->, > = triangle 45] (current bounding box.east) .. controls
(current bounding box.south east) ..
(M 3.south) node[above, pos = .95] {$M_3$};% see below
% above: location of the inscription ''M_3'' relative to the arrow end
% pos=: location of the inscription ''M_3'' on the ''x''-axis (arrow beginning is zero,
% arrow end is one)
这可能吗?如果可以,我该怎么做?希望你能理解我的意图。
提前感谢您的回答和帮助!
答案1
我没有将节点放在圆弧的中心,而是将圆弧放在节点周围。结果相同,按键次数更少。还有许多方法可以避免一遍又一遍地重复相同的选项。我使用了示波器,因为更改只会持续示波器的持续时间。
大部分的简化是由于删除了注释。
\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenx}
\usepackage{amsmath}
\usepackage[european]{circuitikz}
\usepackage{showframe}
\begin{document}
\noindent
\begin{minipage}[t]{.5\linewidth}
\begin{circuitikz}[baseline=(current bounding box.north)]
%
% circuit
%
\draw
(0,0) to [V = $U$] (0,3)
to [short, i = $I$, -*] (3,3) -- (6,3)
to [R = $R_2$, v = $U_2$, i = $I_2$] (6,0) -- (0,0)
(3,3) to [R = $R_1$, v = $U_1$, i = $I_1$, -*] (3,0);
%
% mesh arrows
%
\begin{scope}[>=triangle 45]
\draw[<-] (1.5,1.5) node{$M_1$} +(.25,-.433) arc(-60:170:.5);
\draw[<-] (4.5,1.5) node{$M_2$} +(.25,-.433) arc(-60:170:.5);
\node (mesh3) [below] at (0,0) {\phantom{$M_3$}};% reserve space below circuit for M_3
\draw[->, thick] (current bounding box.east)% not the only way, just easy
.. controls (current bounding box.south east) ..
(mesh3.south) node[above,pos=.9] {$M_3$};
\end{scope}
\end{circuitikz}
\end{minipage}
\hfill
\begin{minipage}[t]{.45\linewidth}
%
% equations for mesh and knot
%
\begin{align*}
&K : \quad I = I_1 + I_2\\
&M_1: \quad -U = -U_1\Leftrightarrow U = U_1 = R_1I_1\\
&M_2: \quad U_1 = -U_2\\
&M_3: \quad -U = -U_2\Leftrightarrow U = U_2 = R_2I_2
\end{align*}
\end{minipage}
\end{document}