1

I would like to have two different styles of voltage arrows in a single tikzpicture (europeanvoltages and straightvoltages).

You can use the parameters

\ctikzset{voltage/distance from node=0}% in \pgf@circ@Rlen units
\ctikzset{voltage/distance from line=.0}% pos. between 0 and 1
\ctikzset{voltage/bump b/.initial=0.0}% 

but this is cumbursome for many different arrows. Is there any way to do this more easily?

Here is the MWE (I want the arrow for U_out to be straight):

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes,shapes.arrows,calc,circuits.ee.IEC,calc,datavisualization,datavisualization.polar,math,patterns,datavisualization.formats.functions,external,backgrounds,spy}
\usepackage[compatibility,EFvoltages,european,fetbodydiode]{circuitikz}

\begin{document}
\begin{tikzpicture}

    \draw (0,0) to [*L,-o,v^=$U_\mathrm{L}$] ++ (2.2,0) coordinate(endPos);

    \draw (0,-2) coordinate(uocvmin) to [*C,-] (0,0);

    \draw (uocvmin) to [*short,-o] (uocvmin -| endPos);

    \draw (endPos) to [*open,v=$U_\mathrm{out}$] ++(0,-2); %Arrow that should be straight

\end{tikzpicture}
\end{document}

which looks like this:

enter image description here

and with straightvoltages:

enter image description here

2 Answers 2

3

This is not in the manual, because it was experimental (and the interface names are sub-optimal, so they can change in the future) but you can do

   \draw (endPos) to [*open,v=$U_\mathrm{out}$, straight=true] ++(0,-2);

to obtain:

enter image description here

2

You can always use a scope for temporary parameter changes. Interestingly, straight voltages are not set using \ctikzset, although one could always create a /.code key.

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes,shapes.arrows,calc,circuits.ee.IEC,calc,datavisualization,datavisualization.polar,math,patterns,datavisualization.formats.functions,external,backgrounds,spy}
\usepackage[compatibility,EFvoltages,european,fetbodydiode]{circuitikz}

\makeatletter
\newcommand{\straightV}{\pgf@circuit@bipole@voltage@straighttrue}
\newcommand{\curveV}{\pgf@circuit@bipole@voltage@straightfalse}
\makeatother

\begin{document}
\begin{tikzpicture}

    \draw (0,0) to [*L,-o,v^=$U_\mathrm{L}$] ++ (2.2,0) coordinate(endPos);

    \draw (0,-2) coordinate(uocvmin) to [*C,-] (0,0);

    \draw (uocvmin) to [*short,-o] (uocvmin -| endPos);

  \begin{scope}
    \straightV
    \draw (endPos) to [*open,v=$U_\mathrm{out}$] ++(0,-2); %Arrow that should be straight
  \end{scope}
\end{tikzpicture}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .