Graphics, Figures & TablesCircuits

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Diabloi
Posts: 7
Joined: Thu Mar 10, 2022 4:55 pm

Circuits

Post by Diabloi »

Hello Guys,
I would like to ask how it is possible to make this type of option in latex where the switches are gray. I can replicate these circuits with CircuiTik, but I don't know how can I do this option. Any idea?
thanks for your help :D
cp.JPG
cp.JPG (28.82 KiB) Viewed 1356 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
Bartman
Posts: 366
Joined: Fri Jan 03, 2020 2:39 pm

Circuits

Post by Bartman »

Section 7.1 "Shape colors" explains how to color components and their connecting lines.
Diabloi
Posts: 7
Joined: Thu Mar 10, 2022 4:55 pm

Circuits

Post by Diabloi »

Great, thanks! :D
Maybe you know also how to replicate the thickness and the arrows when the switch is closed.
If I increase the thickness the result is not the same as in the picture that I shared.
I share the code of my latex

Code: Select all

\documentclass{article} 
\usepackage[utf8]{inputenc}

\usepackage{tikz}
\usepackage[siunitx, american,european,arrowmos,cuteinductors]{circuitikz}

\ctikzset{tripoles/mos style/arrows} %add arrows on the MOS

\begin{document}

\begin{circuitikz}[american,line width=1pt]  %increase the thickness of the line
%Grid for initial drawing.
%Comment next three lines once typesetting finished
\def\figHt{7};
\def\figWd{10};
\draw[step=0.5,very thin, black!20] (-0.5,-1) grid (\figWd,\figHt);
\foreach \x in {0,...,\figWd} {\node [anchor=north] at (\x,-1) {\x};}
\foreach \y in {-1,...,\figHt} {\node [anchor=east] at (-0.5,\y) {\y};}


%Instantiation of components
% Normally Open Switch
\draw (2,6) to[nos,l_=$S_1$,color=gray,-](4,6);
\draw (4,6) to[ncs,l_=$S_2$,i=$q/2$,-] (6,6);
\draw (2,4) to[ncs,l_=$S_3$,-*] (4,4);
\draw (4,4) to[nos,l_=$S_4$,color=gray] (6,4);
\draw (2,2) to[ncs,l_=$S_7$,i^<=$0$,-] (4,2);
\draw (4,0) to[nos,l_=$S_8$,i^<=$0$,color=gray,-] (6,0);


\draw (4,6) to[C,l^=$C_1$,*-*] (4,4);
\draw (4,2) to[C,l^=$C_2$] (4,0);
\draw (7,4) to[C,l^=$C_L$,*-] (7,2.5) node[sground]{};

%interconnections
\draw (2,4) to[short, *-o] (1,4) node[anchor=east]{$V_{in}$};
\draw (2,4) -- (2,6);
\draw (2,4) -- (2,2);
\draw (6,4) -- (7,4);
\draw (6,6) to[short, -*] (6,4);
\draw (6,0) -- (6,4);
\draw (7,4) to[short, *-o] (8,4) node[anchor=west]{$V_{out}$};
%\draw (C.source) node[ground]{};

\end{circuitikz}
\end{document}
Post Reply