# node placement relativ positioning

i'm trying to draw a schematic with a gain that has \times 2 inside of it. The description places the text far above the element. I tried to place a node exactly where the amp is, but it seems to be placed somewhere else, is this due to the relative positioning? I'm trying to get "test" to show inside of the amp.

\documentclass[border=10pt]{standalone}

\usepackage[pdftex]{graphicx}           %% Grafikeinbindung
\usepackage{circuitikz}

\begin{document}
\begin{circuitikz} [scale=2]
% switches
%S1
\path(0,0) -- (2,0) node[midway, nigfete, bodydiode, rotate=90, xscale=-1](s1){} ;
\draw (s1.G) node[anchor=east] {$S_1$};
\draw (0,0) to (s1.D) (s1.S) to (2,0);

%S3
\path(2,-2) -- (4,-2) node[midway, nigfete, bodydiode,rotate=90, xscale=-1](s3){};
\draw (s3.G) node[anchor=east] {$S_3$};
\draw[color=red] (s3.G |- 0,-0.5) to (s3.G |- 0, 0) -- ++ (s1.G -| 0,0) to [amp, l_=$\times 2$] ++(-1,0) node[midway]{test}  to [nos](s1.G) ;

\end{circuitikz}
\end{document}


One way is to name the node and place the label later.

\documentclass[border=10pt]{standalone}
\usepackage{circuitikz}
\begin{document}
\begin{circuitikz} [scale=2]
\draw[color=red] (0,0) to [amp,name=opamp] ++(2,0);
\node[red,anchor=west] at (opamp.west) {$\times 2$};
\end{circuitikz}
\end{document}

• the name option is a good idea, thanks! – Julian Aug 21 at 12:28
• Yes, this is often the best option if you want fine control on the text position. +1. – Rmano Aug 21 at 13:28

In your ode, the label "x2" is so far away because you are probably using a version of circuitikz before the fix for labels in scaled environments was introduced (that is, previous to 0.9.0).

To put the "test" label into the amp, you can use the t= key, but you have to un-flip the text (the amp is drawn from left to right, so it's rotated 180 degrees):

\documentclass[border=10pt]{standalone}
\usepackage[RPvoltages]{circuitikz}
\begin{document}
\begin{circuitikz} [scale=2]
% switches
%S1
\path(0,0) -- (2,0) node[midway, nigfete, bodydiode, rotate=90, xscale=-1](s1){} ;
\draw (s1.G) node[anchor=east] {$S_1$};
\draw (0,0) to (s1.D) (s1.S) to (2,0);

%S3
\path(2,-2) -- (4,-2) node[midway, nigfete, bodydiode,rotate=90, xscale=-1](s3){};
\draw (s3.G) node[anchor=east] {$S_3$};
\draw[color=red] (s3.G |- 0,-0.5) to (s3.G |- 0, 0) -- ++ (s1.G -| 0,0)
to [amp, l_=$\times 2$, t={\scalebox{-1}{test}}, ] ++(-1,0)
to [nos](s1.G);
\end{circuitikz}
\end{document}


With the current version (0.9.3) it gives: