4

I made these two circuit diagrams: enter image description here

But I don't want them to be one above the other, instead I want them to be ''in the same line'' if that makes sense, one next to the other. I tried the multicolumn thing and it didn't work as it should.

Circuit code:

\begin{tikzpicture}
    
    \tkzDefPoints{0/0/A, 3/0/B, 7/0/C, 11/0/D, 14/0/E, 14/4/F, 11/4/G, 7/4/H, 3/4/I, 0/4/J}
    
    \draw (A) to[short] (B);
    
    \draw (J) to[R, l=$R$] (I);
    
    \draw (A) to[european resistor, l_=$\Bar{Z_{a}}$, v^<=$v_a$] (J);
    
    \draw (B) to[sV] (I);
    
\end{tikzpicture}

\begin{tikzpicture}
    
    \tkzDefPoints{0/0/A, 3/0/B, 7/0/C, 11/0/D, 14/0/E, 14/4/F, 11/4/G, 7/4/H, 3/4/I, 0/4/J}
    
    \draw (A) to[short, -*] (B) to[short] (C);
    
    \draw (J) to[short, -*] (I) to[R, l=$R$] (H);
    
    \draw (A) to[R, l_=$R_a$, v^<=$v_a$] (J);
    
    \draw (C) to[sV] (H);
    
    \draw (B) to[cute inductor, l_=$L$] (I);

2 Answers 2

8

I don't know why you define those nodes that you won't use them. Those will create empty space in your figure. I have deleted them.

And notice: If next time you ask a question, please provide a minimum work example. (as the code in my answer that someone can compile it without guessing which packages and document class you are using)

Here is the solution in standalone class. It should work in other document class:

\documentclass[border=0.618cm]{standalone}
\usepackage{amsmath}
\usepackage{circuitikz}
\usepackage{tkz-euclide}

\begin{document}
\begin{tikzpicture}
\tkzDefPoints{0/0/A, 3/0/B, 3/4/I, 0/4/J}
    
\draw (A) to[short] (B);
    
\draw (J) to[R, l=$R$] (I);
    
\draw (A) to[european resistor, l_=$\Bar{Z_{a}}$, v^<=$v_a$] (J);
    
\draw (B) to[sV] (I);

\begin{scope}[xshift=5cm]
\tkzDefPoints{0/0/A, 3/0/B, 7/0/C, 7/4/H, 3/4/I, 0/4/J}
    
\draw (A) to[short, -*] (B) to[short] (C);
    
\draw (J) to[short, -*] (I) to[R, l=$R$] (H);
    
\draw (A) to[R, l_=$R_a$, v^<=$v_a$] (J);
    
\draw (C) to[sV] (H);
    
\draw (B) to[cute inductor, l_=$L$] (I);
\end{scope}    
\end{tikzpicture}
\end{document}

enter image description here

9

As Tom said before, please always provide a minimal working example (MWE).

Your problem is pretty simple. You have a blank line here:

\end{tikzpicture}

\begin{tikzpicture}

That creates a new paragraph. Once you delete that blank line, it looks like this:

circuit

6
  • You are right. This is a neat solution. But I still think if two diagrams next to each other should be drawn in the same tikz picture. I guess it doesn't matter in this case.
    – Tom
    May 15 at 5:57
  • 2
    @Tom I just added this solution for making him understand the root cause. Your solution is more tikz of course. May 15 at 6:14
  • thank you both! it was, indeed, real helpful. and yeah, it doesn't matter in this case, so glad it worked :)
    – ronny
    May 15 at 7:25
  • 2
    @MaestroGlanz I am not sure --- often having small circuits to compose in figures is the best solution. Clearly, it depends on semantics; if you have a single circuit with two parts, use a single environment; otherwise, if circuits are different, use different environments.
    – Rmano
    May 15 at 9:31
  • 2
    @MaestroGlanz additionally, notice that you can choose easily where to align vertically the circuits, by saying \begin{tikzpicture}[baseline=(A)] ... and \begin{tikzpicture}[align=(H)]... (or whatever you need).
    – Rmano
    May 15 at 9:33

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.