I am a beginner in LaTeX, trying to use it for an industrial document. I am trying to make a small circuit in order to illustrate a point.
However, I would like to:
- add a sort of legend, such as "Rc: constriction resistance" . Due to the length of text, I feel it should be placed on the side, and not directly in the diagram. I could not find a way to do this properly.
- Also , I would like to add on both west and east sides of the diagram, a text, perhaps vertical, stating "Pin side" and "socket side" respectively.
- I have tried to highlight the "half coil" resistances" by a blue color, but only the text is blue and not the resistance itself…. Can this be improved ?
- Is there a way to make the code more elegant and more flexible/reusable (avoiding to put all dimensions manually by using
foreach
or another approach)? - Any other tip or suggested improvement/clarification is welcome of course…
Here's a MWE
\documentclass[a4paper, oneside,11pt, english]{scrreprt}
\usepackage{tikz}
\usepackage[siunitx]{circuitikz} %------------
\ctikzset{bipoles/length=3em}
\begin{document}
\begin{figure}[H]
\centering
\begin{circuitikz}[scale =1]
\draw [ultra thick] (0,-5)-- (0,2);
\draw (0,1) to[R=Rc] (2,1);
\draw [blue] (2,1) to [R=R half coil] (3,0);
\draw (3,0) to [R=Rc] (6,0);
\draw [blue] (2,-1) to[R=R half coil] (3,0);
\draw (0,-1) to[R=Rc] (2,-1);
\draw [blue](2,-1) to [R=R half coil] (3,-2);
\draw (3,-2) to[R=Rc] (6,-2);
\draw [blue] (2,-3) to[R=R half coil] (3,-2);
\draw (0,-3) to[R=Rc] (2,-3);
\draw [blue] (2,-3) to[R=R half coil] (3,-4);
\draw (3,-4) to[R=Rc] (6,-4);
\draw [ultra thick] (6,-5) -- (6,2);
\end{circuitikz}
\caption{electrical model of a canted coil power contact element}
\end{figure}
\end{document}
Best Answer
You can use a (rectangular) node to place the legend.
Again, using nodes you can add the text.
You can pass the
color=blue
option to the resistor:You could use
\foreach
, but I don't really think it contributes a lot in this particular case.To avoid using
color=blue
five (or more times), I used ascope
with the option.In the circuit I used
R h.c.
instead ofR half coil
to increase readability and explained the meaning in the legend.Here's a modified version of your code: