Label and anchor info for advanced voltages #567
Comments
|
Maybe something like |
|
@judober you can play with it if you want with: But I'll do a couple of tests and then I hope to merge (and release) soon |
And yes, I did exactly that ;-) |
\newcommand{\iarronly}[1]{% name
\node [currarrow, color=red, anchor=center,
rotate=\ctikzgetdirection{#1-Iarrow}] at (#1-Ipos) {};
}
\newcommand{\varronly}[1]{% name
\draw [color=blue] (#1-Vfrom) .. controls (#1-Vcont1)
and (#1-Vcont2).. (#1-Vto) node [currarrow,
sloped, anchor=tip, allow upside down,pos=1]{};
}
\begin{circuitikz}[]
\ctikzset{!vi/.style={no v symbols, no i symbols}}
\ctikzset{bipole voltage style/.style={color=blue},
bipole current style/.style={color=red}}
\draw (120:6) to[R, *-, name=R, v^=$v_R$, !vi]
(120:3) to[short, i=$i_R$, name=SR, !vi] (0,0);
\draw (180:4) to[L, o-, l=$L$, name=L2, v=$v_L$, !vi]
(180:2) to[V, -*, name=V2, v_=$v_2$, !vi] (0:0);
\iarronly{SR}\varronly{R}\varronly{L2}\varronly{V2}
\end{circuitikz} |
|
I am not sure if adding the |
|
I merged it because I want to release soon. Please @judober feel free to comment (others too ;-)!), I can always change things (before releasing) |
|
Wow, works like a charm. \documentclass[class=report, 11pt,a4paper,tikz, border=4pt]{standalone}
% Version from https://github.com/circuitikz/circuitikz/issues/567
\usepackage[european, straightvoltages, americaninductors, betterproportions, nooldvoltagedirection]{circuitikzgit}[
]
\ctikzset{!vi/.style={no v symbols, no i symbols}}
\ctikzset{bipole voltage style/.style={color=blue},
bipole current style/.style={color=red}}
\newcommand{\iarronly}[1]{% name
\node [currarrow, color=red, anchor=center,
rotate=\ctikzgetdirection{#1-Iarrow}] at (#1-Ipos) {};
}
\newcommand{\varronly}[1]{% name
\draw [color=blue] (#1-Vfrom) .. controls (#1-Vcont1)
and (#1-Vcont2).. (#1-Vto) node [currarrow,
sloped, anchor=tip, allow upside down,pos=1]{};
}
\begin{document}
\begin{tikzpicture}
\draw (120:6) to[R, *-, name=R, v_<=$v_R$, !vi, l=R] (120:3) to[short, i=$i_R$, name=SR, !vi] (0,0);
\draw (180:4) to[L, o-, l=$L$, name=L2, v=$v_L$, !vi] (180:2) to[V, -*, name=V2, v_=$v_2$, !vi] (0:0);
\iarronly{SR}
\varronly{R}
\varronly{L2}
\varronly{V2}
\end{tikzpicture}
\end{document} |
|
Thanks! ;-) |


As noticed by @judober (see issue #448), when using advanced voltages we can say:
v,i,f: no arrows/symbols are added, and no voltage/current/flow label is generated (so we do not have label anchors/data)v=~: the arrows/symbols are generated, and a series of anchors and info (rotation, etc) are generated for the blank label.There is no provision for
I think that it would be nice to have an option to not draw the symbols (but generate the anchors) and placing the labels (that could be a blank one).
I am open to suggestions for a syntax; I do not want to create all the
v_^combinations, so I think that an extra key likesuppress vor!vto add to suppress drawing could be ok.The text was updated successfully, but these errors were encountered: