Hello friends, could you helpme? I need to draw this circuits but I dont know, thanks for your help.
-
2Well what have you tried? Maybe provide some MWE? – SolidMark Jul 03 '21 at 03:13
-
My personal suggestion is to go through (in the sense: read and try) the first tutorial in the TikZ manual and then the tutorials in circuitikz manual. You need to dedicate a few hours to it, but it's absolutely usefuls if you are serious about using circuitikz. – Rmano Jul 03 '21 at 08:31
-
Except possibly the ocirc node, you don't need circuitiks for this. – John Kormylo Jul 03 '21 at 14:32
-
Any news? You got three answers ... It is time to decide which one of them the best fulfil your expectation and accept it then (by clicking check mark at top left side of selected answer). As I see, so far you have not accepted any of the answers to your questions. By this you tell us, that no one your question is not solved. Is this true? – Zarko Jul 06 '21 at 19:20
-
For all, thanks!! – Juliperezor Jul 08 '21 at 17:15
2 Answers
As starting point:
\documentclass{article}
\usepackage{circuitikz}
\begin{document}
\begin{tikzpicture}
\draw (0,0) to [short,o-] ++ (1,0) node[right] (p) {$p$}
(p.east) -- ++ (1,0) node[right] (q) {$q$}
(q.east) to [short,-o] ++ (1,0);
\end{tikzpicture}
\begin{tikzpicture}
\draw (0,0) to [short,o-] ++ (1,0) coordinate (a)
(a) |- ++ (1, 0.5) node[right] (p) {$p$}
(p.east) -| ++ (1,-0.5) coordinate (b)
(b) to [short,-o] ++ (1,0)
(a) |- ++ (1,-0.5) node[right] (q) {$q$}
(q) -| (b);
\end{tikzpicture}
\end{document}
Edit: Considered is @rmano comment.
- 296,517
-
NIce, +1, --- and I think you found a bug in
circuitikz, because your code (which is ok) gives a warning in newer TikZ – Rmano Jul 03 '21 at 10:50 -
@Rmano, you are right. Since warning is somewhere on the middle of ˙
.logfile, I didn't notice it.. It complain about node coordinates when constructto [short,-o]is used. bu not at--:Package pgf Warning: Returning node center instead of a point on node border. D id you specify a point identical to the center of node ``q''? on input line 9.Thank you very much! – Zarko Jul 03 '21 at 11:20 -
Yes, that's the bug ;-) see https://github.com/circuitikz/circuitikz/pull/562. – Rmano Jul 03 '21 at 12:03
-
Anyway, if you want that the branch of the second diagram become symmetrical, you should use
(p.east) -| ++ (1,-0.5) coordinate (b)(relative coordinates are computed from the center of the node even if then the border anchor is used). – Rmano Jul 03 '21 at 12:04 -
@Rmano, you are right. This should be used at relative coordinates. Using it, also warning disappear. So there is no bug? – Zarko Jul 03 '21 at 12:14
-
No, it's still a bug.You should be able to use a node name before the
toand have the border anchor automatically used. Like in\node[draw](a) at(0,0) {A}; \node[draw](b) at(1,2) {B}; \draw (a) to[R] (b);– Rmano Jul 03 '21 at 13:13 -
You might want to render node labels to italicized math sans serif similar to https://tex.stackexchange.com/questions/434391/how-do-i-get-italic-sans-serif-in-math-mode – SolidMark Jul 06 '21 at 18:43
-
@MarkA.Bromuela, ah, you see such fonts on image of OP question :-). Well, it not give any information about document where will be this image. For example, in beamer, such fonts are defaul.t Anyway, I can add sans serif math font, but after some respond of OP. – Zarko Jul 06 '21 at 18:50
An alternate way of doing the same. It's mostly tikz. The node shape node[ocirc]{} from circuitikz is used.
\documentclass[border=3mm]{standalone}
\usepackage{circuitikz}
\begin{document}
\begin{circuitikz}
\draw
(0,0)node[ocirc]{}
-- node[fill=white]{$p$} ++(2,0)
-- node[fill=white]{$q$} ++(2,0)node[ocirc]{}
(0,-2)node[ocirc]{}
-| ++(1,0.5)
-- node[fill=white]{$p$} ++(2,0)
|- ++(1,-0.5)node[ocirc]{}
-| ++(-1,-0.5)
-- node[fill=white]{$q$} ++(-2,0)
-- ++(0,0.5)
;
\end{circuitikz}
\end{document}
- 7,932



