New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] voltage shift
is not consistent across components
#747
Labels
Comments
There are clearly two issues here: one is the one spotted on TeX.SX, the other one is that there is something going awry with the open voltage positioning (they are interwined with the additional shift and they shouldn't): \documentclass[border=3mm]{standalone}
\usepackage{graphicx} % Required for inserting images
\usepackage{etoolbox}
\usepackage[european,straightvoltages]{circuitikz}
\makeatletter
\iftrue
\patchcmd{\pgf@circ@drawvoltagegenerator}
{\pgfmathsetmacro{\bumpaplus}{\bumpa + 0.5*\shiftv}}
{\pgfmathsetmacro{\bumpaplus}{\bumpa + 0.3*\shiftv}}
{\relax}{\ERROR}
\fi
\makeatother
% \ctikzset{resistors/scale=0.55}
% \ctikzset{inductors/scale=0.55}
% \ctikzset{capacitors/scale=0.6}
% \ctikzset{sources/scale=.8}
% \ctikzset{bipoles/thickness=1}
% \ctikzset{tripoles/thickness=1}
% \tikzset{every picture/.style = {transform shape, line width=1pt}}
\newcommand{\circuit}{%
\begin{circuitikz}[scale=2]
% Switch
\draw (2,0) node[spdt, rotate=90,anchor=in] (sw) {};
\draw (sw.out 2) node[right] {(2)};
\draw (sw.out 1) node[left] {(1)};
%Komponenen
\draw (0.5,0) to [V_=$U$] (0.5,-1);
\draw (2,0) to [R,v=$U_R$] (2,-1) to [L,v=$U_L$] (2,-2);
\draw (3.5,0) to [C,v=$U_C$] (3.5,-2);
%Verkabelung
\draw (0.5,0) to (0.5,1.5) -| (sw.out 1);
\draw (3.5,0) to (3.5,1.5) -| (sw.out 2);
\draw (2,-2) to (2,-2.5) -| (0.5,-1);
\draw (3.5,-2) |- (2,-2.5) node[circ]{};
%
\draw (4.5,1) [open,v=$U$] to (4.5,-2);
\end{circuitikz}
}
\begin{document}
\circuit
\quad
\ctikzset{voltage shift = 2}
\circuit
\end{document} |
Rmano
added a commit
to Rmano/circuitikz
that referenced
this issue
Oct 29, 2023
As you can see in issue circuitikz#747, the `voltage shift` factor is not always coherent when applied to normal bipoles and sources, especially if the standard size of the component is different. Changing the positioning of the voltage elements maintaining backward compatibility is too difficult for a minor review. Added a tunable to adjust the amount added for sources. Fixes circuitikz#747
Rmano
added a commit
to Rmano/circuitikz
that referenced
this issue
Oct 29, 2023
This version features an important overhaul of the `muxdemux` configurable component/shape, making it much more flexible and powerful by adding configurable labels and negation and clock symbols to the pins. Also, a couple of minor fixes/workarounds. - Added optional and configurable inner, outer and border labels to the `muxdemux` shapes - Added optional clock wedge and negation signs to the pins of `muxdemux` shapes - Added the possibility to add a background drawing to `muxdemux` shapes - Fixed a [bug](circuitikz#748) with `straightvoltages` and `open` - Added an (ugly) workaround for a [voltage shift mismatch](circuitikz#747) for sources
Rmano
added a commit
that referenced
this issue
Oct 29, 2023
CTAN version 1.6.5 (2023-10-29) This version features an important overhaul of the `muxdemux` configurable component/shape, making it much more flexible and powerful by adding configurable labels and negation and clock symbols to the pins. Also, a couple of minor fixes/workarounds. - Added optional and configurable inner, outer and border labels to the `muxdemux` shapes - Added optional clock wedge and negation signs to the pins of `muxdemux` shapes - Added the possibility to add a background drawing to `muxdemux` shapes - Fixed a [bug](#748) with `straightvoltages` and `open` - Added an (ugly) workaround for a [voltage shift mismatch](#747) for sources
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reported on TeX.stackexchange by UserUnkn4wn
When used globally,
voltage shift
works in different ways for different components.Notice how the shift in the voltage source and the open arrow is wrong (too much).
The text was updated successfully, but these errors were encountered: