2

Good Evening!

I want to draw some X-dependent resistor (like temperature-dependent, as shown in the picture [there are some parts in red at this moment]).

I have a solution, but I do not think, this is the right way.

Is there a possibility, to edit the adjustable style in a simple setting, to get the form as wished? For example, I can kill its arrowhead with the setting:

\tikzset{NoArrowhead/.style={annotation arrow/.style = {> = none}}}

Can I add the tiny red line and a textsymbol in a similar way?

BTW: The letter 'vartheta' has not to be a fix symbol, because there could be some other dependences, like voltage-dependence for example, so we need the symbol 'V'

Thank you for reading and for your interest!

enter image description here

OK, here is my Code - say, what you mean.

\documentclass[margin=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{circuits.ee.IEC}
\usepackage{amsmath, amssymb}

%% temp adjustable %%%%%%%%%%%%%%%%
\tikzset{
temp adjustable/.style={
append after command={%
%NEW:
(-2.5\tikzcircuitssizeunit,-1.5\tikzcircuitssizeunit) edge[line to, red]
(-1.5\tikzcircuitssizeunit,-1.5\tikzcircuitssizeunit) 
%OLD:
(-1.5\tikzcircuitssizeunit,-1.5\tikzcircuitssizeunit) edge[line to] (1.5\tikzcircuitssizeunit,1.5\tikzcircuitssizeunit)
%NEW
node[red] () at (-0.5\tikzcircuitssizeunit,-1.5\tikzcircuitssizeunit) {$\vartheta$}
}}}
%%%%%%%%%%%%%%%%
%===========
\begin{document}
%===========
\begin{tikzpicture}[circuit ee IEC, font=\sffamily\footnotesize]

\draw (3,0) to  [resistor= {temp adjustable}] (5,0);

\end{tikzpicture}
%===========
\end{document}
%===========
  • The is no one right way! There are other ways, but this is fairly simple and effective. – John Kormylo Apr 18 '14 at 13:51
  • Mmhh, but so test my "solution", she is not very consistent, due to 'infotexts' and so on. – cis Apr 18 '14 at 16:57
3

Ok, due to the comment from John Kormylo, I apreciate; so let me present you my solution:

enter image description here

\documentclass[margin=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{circuits.ee.IEC}
\usepackage{amsmath, amssymb}

%%%%%%%%%%%%%%%%%%%%%%%%%%
% LowUpDep %%%%%%%%%%%%%%%%%%%%
\tikzset{dependent/.style={annotation arrow/.style = {>=}}}
%
%
%LowDep %%%%%
\tikzset{LowDep/.style args={#1}{
append after command={%
\bgroup
[current point is local=true]
[every LowDep/.try]
[annotation arrow,-]
(-2.5\tikzcircuitssizeunit,-1.5\tikzcircuitssizeunit) edge[line to]
(-1.5\tikzcircuitssizeunit,-1.5\tikzcircuitssizeunit) node[xshift=3.0\tikzcircuitssizeunit]{#1}
\egroup%
}},
%
LowDep'/.style args={#1}{
append after command={%
\bgroup
[current point is local=true, yscale=-1]
[every LowDep/.try]
[annotation arrow,-]
(-2.5\tikzcircuitssizeunit,-1.5\tikzcircuitssizeunit) edge[line to]
(-1.5\tikzcircuitssizeunit,-1.5\tikzcircuitssizeunit) node[xshift=3.0\tikzcircuitssizeunit]{#1}
\egroup%
}}
}
%
%
%
%UpDep %%%%%
\tikzset{UpDep/.style args={#1}{
append after command={%
\bgroup
[current point is local=true]
[every UpDep/.try]
[annotation arrow,-]
%
(2.5\tikzcircuitssizeunit,1.5\tikzcircuitssizeunit)  edge[line to]
(1.5\tikzcircuitssizeunit,1.5\tikzcircuitssizeunit) node[xshift=-3.0\tikzcircuitssizeunit]{#1}
\egroup%
}},
%
UpDep'/.style args={#1}{
append after command={%
\bgroup
[current point is local=true, yscale=-1]
[every UpDep/.try]
[annotation arrow,-]
%
(2.5\tikzcircuitssizeunit,1.5\tikzcircuitssizeunit)  edge[line to]
(1.5\tikzcircuitssizeunit,1.5\tikzcircuitssizeunit) node[xshift=-3.0\tikzcircuitssizeunit]{#1}
\egroup%
}}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%


%===========
\begin{document}
%===========

\begin{tikzpicture}[circuit ee IEC, font=\sffamily\footnotesize]

%
\draw (0,0) to  [resistor={LowDep={foo}, UpDep={bar}, adjustable={
info={Testtext}, info'={Testtext}
}}, dependent] (2,0);

\draw (0,-2) to  [resistor={LowDep={foo}, adjustable}, dependent] (2,-2);

\draw (0,-4) to  [resistor={UpDep={bar}, adjustable}, dependent] (2,-4);


%
\draw (3,0) to  [resistor={LowDep'={foo}, UpDep'={bar}, adjustable'={
info={Testtext}, info'={Testtext }
}}, dependent] (5,0);

\draw (3,-2) to  [resistor={LowDep'={foo}, adjustable'}, dependent] (5,-2);

\draw (3,-4) to  [resistor={UpDep'={bar}, adjustable'}, dependent] (5,-4);

%%
\draw (0,-6) to  [capacitor={LowDep={foo}, UpDep={bar}, adjustable}, dependent] (2,-6);

\draw (3,-6) to  [diode={LowDep={foo}, UpDep={bar}, adjustable}, dependent] (5,-6);

\end{tikzpicture}
%===========
\end{document}
%===========
  • So do you need any help now? – John Kormylo Apr 18 '14 at 20:14
  • No, I think it is ok. What do you mean? – cis Apr 18 '14 at 21:31
3

If you want to make the \vartheta adjustable, you can use the following:

\documentclass[margin=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{circuits.ee.IEC}
\usepackage{amsmath, amssymb}

%create new parameter
\tikzset{adj var/.initial={\vartheta}}

%% temp adjustable %%%%%%%%%%%%%%%%
\tikzset{
temp adjustable/.style={
append after command={%
%NEW:
(-2.5\tikzcircuitssizeunit,-1.5\tikzcircuitssizeunit) edge[line to, red]
(-1.5\tikzcircuitssizeunit,-1.5\tikzcircuitssizeunit) 
%OLD:
(-1.5\tikzcircuitssizeunit,-1.5\tikzcircuitssizeunit) edge[line to] (1.5\tikzcircuitssizeunit,1.5\tikzcircuitssizeunit)
%NEW
node[red] () at (-0.5\tikzcircuitssizeunit,-1.5\tikzcircuitssizeunit) {$\pgfkeysvalueof{/tikz/adj var}$}
}}}
%%%%%%%%%%%%%%%%
%===========
\begin{document}
%===========
\begin{tikzpicture}[circuit ee IEC, font=\sffamily\footnotesize]

\draw (0,0) to  [resistor= {temp adjustable}, adj var=V] (2,0);

\end{tikzpicture}
%===========
\end{document}
%===========

adj var

  • Hey, ah ok! Have a look on my answer. So how I wrote it, you could take text, what ever you want on to lower and upper dependence ;) – cis Apr 18 '14 at 20:10

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.