1

I've noticed that recent changes of Circuitikz modified the behaviour of european voltage arrows. When an open path is used instead of a componente path the voltage arrow tip is placed in different positions. The open path compatibility is important to allow the placement of a voltage arrow after drawing the component path. Is there a simple fix for this?

\documentclass[10pt]{article}
\usepackage[usenames]{color} %used for font color
\usepackage{amssymb} %maths
\usepackage{amsmath} %maths
\usepackage[utf8]{inputenc} %useful to type directly diacritic characters
\usepackage[siunitx,american, RPvoltages]{circuitikz}  

% Definitions to help locate nodes. Comment out the second definition when done!
\def\coord(#1){coordinate(#1)}
%\def\coord(#1){node[circle, inner sep=1pt,pin={[teal, overlay, inner sep=0.5pt, font=\tiny, pin distance=0.3cm, pin edge={teal, line width=0.5pt, shorten <=-2pt, {Kite[length=1.5mm]}-{Circle[open,line width=0.5pt,length=0.75mm]}}]45:#1}](#1){}} 

\newcommand{\flagv}[5] %{x,y}{dx,dy}{name}{label}{color}  e.g. \flagv{0,0}{-0.2,0.5}{A}{$A_L$}{red}
{\draw[#5!50!gray,Kite-] (#1) -- ($(#1)+(#2)$) node[circle, very thin, inner sep=0pt, minimum size=8pt, draw=#5!25!white, fill=#5!10,font=\scriptsize](#3){#4};
}

\begin{document}
\begin{circuitikz}
    \draw[european voltages](-1,0) to[short,-*]  (0,0) \coord(1) to[R, v=$V_{12}$] ++(3,0)\coord(2) to[short,*-] ++(1,0);

    \draw[european, blue, color=blue!50!gray] (1) to[open, v^=$V_{12}$] (2);
    \draw[european voltages, color=red!50!gray] (1) to[open, v^=$V_{12}$, voltage shift=2.0 ] (2);

    \flagv{1}{0,-0.75}{A}{$A$}{red}
    \flagv{2}{0,-0.75}{B}{$B$}{red}

  \draw[european, blue, color=blue!50!gray] (A) to[open, v=$V_{AB}$] (B);

\end{circuitikz}
\end{document}
3
  • Hi! I am not sure what you want to achieve --- yes, the position has changed because before the arrows in some components were too near to them. You can revert using one of the roll-off (see manual at section 1.9), but I think this is a XY-problem. Have you seen the new access to anchors, see tex.stackexchange.com/a/560331/38080?
    – Rmano
    Aug 29 '20 at 16:34
  • Hi Rmano, I do appreciate the new flexibility with the anchors. I only noticed that the arrows were touching the wires when using to[open,v=$v_{12}$}. But your tip solved the problem. By the way, all Circuitikz updates has been great and well thought, but I admit, the changes sometimes requires a lot of reworking. Being able to have a simple keyword to locally solve big changes is always helpful. Aug 30 '20 at 23:40
  • Thanks for thr nice words. You're right, and I try to create local key to go back to legacy mode every time something changes, but there are changes (like the big voltage and path-to rewrite) where that's impossible... That is the reason I created the roll-back points, although I understand is suboptimal.
    – Rmano
    Aug 31 '20 at 7:08
1

I am not sure what are you trying to achieve here, but the "open voltage" behaviour can be changed with the (misnamed, I will adjust it*) american open voltage key (see section 4.5.5).

\documentclass[10pt]{article}
\usepackage[T1]{fontenc}   % default since TeXLive 2018
\usepackage[utf8]{inputenc} % default since TeXLive 2018
\usepackage[siunitx,american, RPvoltages]{circuitikz}
\begin{document}
\begin{circuitikz}
    \draw[blue, color=red!50!gray] (0,0)
        node[draw, circle, inner sep=1pt]{}
        to[european voltages, open, v=$V_{AB}$]
        (3,0)
        node[draw, circle, inner sep=1pt]{}
        ;
    \ctikzset{american open voltage=legacy}
    \draw[blue, color=blue!50!gray] (0,0)
        node[draw, circle, inner sep=1pt]{}
        to[european voltages, open, v=$V_{AB}$]
        (3,0)
        node[draw, circle, inner sep=1pt]{}
        ;
\end{circuitikz}
\end{document}

output of the previous snippet

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.