Math & ScienceCircuiTikz: Redefining circuit element and other issues

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
hbaromega
Posts: 48
Joined: Mon Mar 07, 2011 8:21 pm

CircuiTikz: Redefining circuit element and other issues

Post by hbaromega »

I am trying to use CircuiTikz to draw resistor network circuits. For example, I am using the following latex code.

Code: Select all

\documentclass{article}
\usepackage[american voltages, american currents,siunitx]{circuitikz}
\begin{document}



\begin{circuitikz}
% Node syntax: (X,Y)

%%% From top :
%% 1st row  ==>
% the voltage source and the resistor   
   \draw  (0,3)  to [R=\SI{}{R_H}, o-o, color=red] (3,3);

% resistors connected; lattce point: x=1, y=Ly 

   \draw [R, o-] (3,3) to (6,3);
   \draw [R, o-] (3,3) to (3,0);
   \draw [R, o-o] (3,0) to (3,-3);

% dashed implying many connections
   \draw [dashed] (6,3) to (9,3);

% resistor continuing after dashed line
   \draw [R, -o] (9,3) to (12,3);

% next resistor 
   \draw [R] (12,3) to (15,3); 
    \draw (15,3) to (15,2.5) node [ground]{};



\end{circuitikz}


\end{document}
One may test the output here:
https://www.sharelatex.com/project/5320 ... d22d001c7a

Now

1) Can I add a text "V" to the top left corner (left of the resistor labelled by R_H) without inserting a new node? In fact, can I add a text at any coordinate without using a node or path?

2) Using coloring and labelling each resistor, can I redifine a circuit element (e.g. the newly defined resistor will always have label R_H and color red)?

3) Is there any alternative way to the labelling

Code: Select all

R=\SI{}{R_H}
?I suspect \SI is redundant.

4) Can I directly construct resistors in a series instead of mentioning coordinates for them each time?

I apologize for the numbers of questions. But I guess, they all are connected and relevant.

Thanks in advance.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

CircuiTikz: Redefining circuit element and other issues

Post by cgnieder »

I don't know circuitikz but I can answer the siunitx question:

I suspect instead of R=\SI{}{R_H} you probably want R=\si{R_H}.

Regards
site moderator & package author
Post Reply