2

I have a pretty bigcircuit for a band pass filter that uses two opamps in cascade.Now this looks pretty small when aligned horizontal A4 layout.I want to to rotate this figure vertical(or 90) so that we can enlarge it.How is it possible?

enter image description here

\documentclass{article}
\usepackage[american,siunitx]{circuitikz}
\usetikzlibrary{positioning, fit, calc}

\tikzset{opamp label/.style={xshift=-9mm, font=\normalsize,right}}
\tikzset{iovardelay/.style={label={[above]90:\textsf{#1}},
                            label={[right=2ex]180:\textsf{I}},
                            label={[left=3ex]0:\textsf{O}},
                            draw,fill=blue!10,
                            minimum width=1cm,
                            minimum height=2cm
                            }
        }
\ctikzset{bipoles/diode/height=0.3, bipoles/diode/width=0.3,}
\ctikzset{tripoles/op amp/height=2.0, tripoles/op amp/width=2.5,}

\usepackage[font={color=blue,large},figurename=Fig.,labelfont={it}]{caption}
 \tikzset{PH/.append style={font=\scriptsize,inner ysep=2pt,inner xsep=5pt},
                   PV/.append style={PH,inner ysep=2pt,inner xsep=2pt}}
\begin{document}
\begin{figure}[!h]
\begin{center}
\begin{circuitikz}[scale =0.6,transform shape]

\draw (0,0) node[op amp] (opamp){}
 (opamp)     node[opamp label] {LM741}
 (opamp.-) |-($(opamp.-)+(0.6,2)$) to[short] ++(1.8,0)   -| ($(opamp.out)+ 
 (0.5,0)$)
 (opamp.out) to[short] ($(opamp.out)+(3.0,0)$)  node [ocirc] {}
 ($(opamp.+)-(0,0.0)$)  to[C,l=$C_4(5.6nF)$]++(0,-3)node [ground] {}
 ($(opamp.+)-(3,0.0)$) to [short]++(0,5) to[short]++(3,0)to 
 [C,l=$C_3(12nF)$]++(2,0)  -| ($(opamp.out)+(2,0)$)
 ($(opamp.+)-(0,0.0)$) to[,R,l_=$(R_2(1k)$,*-*]++(-3,0) to[ R,l_=$R_1(1k)$]++(-3,0)node [left] {$V_{in}$}
 (opamp.down) ++ (0,-.5) node[below] {$-15V$}-- (opamp.down)
 (opamp.up) ++ (0,.5) node[above]{$+15V$}-- (opamp.up)
 (opamp.-)node [PH,above right] {2} 
 (opamp.+) node [PH,above right] {3}
 (opamp.out)node [PH,above left] {6}
 (opamp.down)node[PV,below right] {4} 
 (opamp.up)node[PV,above right] {7}
 ($(opamp.-)+(-0.3,-0.3)$) node[]{$v_{-}$}
 ($(opamp.+)+(-0.3,-0.3)$) node[]{$v_{+}$}
 ;
 \draw (12.5,.69) node[op amp] (opamp2){}
 (opamp2)     node[opamp label] {LM741}
 (opamp2.-) |-($(opamp2.-)+(0.6,2)$) to[short] ++(1.8,0)   -| 
 ($(opamp2.out)+(0.5,0)$)
 (opamp2.out) to[short] ($(opamp2.out)+(3.0,0)$) node [right] {$V_{out}$} 
 node [ocirc] {}
 ($(opamp2.+)-(0,0.0)$)  to[R,l=$R_4(12k)$]++(0,-3)node [ground] {}
 ($(opamp2.+)-(3,0.0)$) to [short]++(0,5) to[short]++(3,0)to 
 [R,l=$R_3(5.6k\Omega)$]++(2,0)  -| ($(opamp2.out)+(2,0)$)
 ($(opamp2.+)-(0,0.0)$) to[C,l_=$C_2(10nF)$,*-*]++(-3,0) to[C,l_=$C_1(10nF)$]++(-3,0)
 ($(opamp2.-)+(-0.3,-0.3)$) node[]{$v_{-}$}
 ($(opamp2.+)+(-0.3,-0.3)$) node[]{$v_{+}$}
 (opamp2.down) ++ (0,-.5) node[below] {$-15V$} -- (opamp2.down)
 (opamp2.up) ++ (0,.5) node[above]{$+15V$} -- (opamp2.up)
 (opamp2.-)node [PH,above right] {2} 
 (opamp2.+) node [PH,above right] {3}
 (opamp2.out)node [PH,above left] {6}
 (opamp2.down)node[PV,below right] {4} 
 (opamp2.up)node[PV,above right] {7}
 ;
\end{circuitikz}
\end{center}
\end{figure}

\end{document}
  • rotate=90, i.e. \begin{circuitikz}[scale =0.6,transform shape,rotate=90]. – user121799 Jun 22 '18 at 3:48
  • Why not to draw the picture in a diferent document in a standalone document class, compile, obtain the pdf output, and then import it using graphicx pakage, like I explain in this post Scaling different components of tikzpicture together.. You can draw freely what you want only using the specific packages and configurations for tikz and even in a WYSIWYG mode using TikzEdt. – J Leon V. Jun 22 '18 at 4:06
  • any news? you receive four solutions. is no one acceptable to you? – Zarko Jul 11 '18 at 9:42
3

I take that you want the text not get rotated. Normally you could achieve this by omitting transform shape but in your example the resistor and so do need to be rotated. So I propose to rotate the texts back.

\documentclass{article}
\usepackage[american,siunitx]{circuitikz}
\usetikzlibrary{positioning, fit, calc}

\tikzset{opamp label/.style={xshift=-9mm, font=\normalsize,right}}
\tikzset{iovardelay/.style={label={[above]90:\textsf{#1}},
                            label={[right=2ex]180:\textsf{I}},
                            label={[left=3ex]0:\textsf{O}},
                            draw,fill=blue!10,
                            minimum width=1cm,
                            minimum height=2cm
                            }
        }
\ctikzset{bipoles/diode/height=0.3, bipoles/diode/width=0.3,}
\ctikzset{tripoles/op amp/height=2.0, tripoles/op amp/width=2.5,}

\usepackage[font={color=blue,large},figurename=Fig.,labelfont={it}]{caption}
 \tikzset{PH/.append style={font=\scriptsize,inner ysep=2pt,inner xsep=5pt},
                   PV/.append style={PH,inner ysep=2pt,inner xsep=2pt}}
\begin{document}
\begin{figure}[!h]
\begin{center}
\begin{circuitikz}[scale =0.6,transform shape,rotate=90]

\draw (0,0) node[op amp] (opamp){}
 (opamp)     node[opamp label,rotate=-90,xshift=-5mm,yshift=3mm] {LM741}
 (opamp.-) |-($(opamp.-)+(0.6,2)$) to[short] ++(1.8,0)   -| ($(opamp.out)+ 
 (0.5,0)$)
 (opamp.out) to[short] ($(opamp.out)+(3.0,0)$)  node [ocirc] {}
 ($(opamp.+)-(0,0.0)$)  to[C,l={\rotatebox{-90}{\makebox[0pt][c]{$C_4(5.6nF)$}}}]++(0,-3)node [ground] {}
 ($(opamp.+)-(3,0.0)$) to [short]++(0,5) to[short]++(3,0)to 
 [C,l={\rotatebox{-90}{\makebox[0pt][r]{$C_3(12nF)$}}}]++(2,0)  -| ($(opamp.out)+(2,0)$)
 ($(opamp.+)-(0,0.0)$) to[,R,l_={\rotatebox{-90}{\makebox[0pt][r]{$(R_2(1k)$}}},*-*]++(-3,0) to[
 R,l_={\rotatebox{-90}{\makebox[0pt][r]{$R_1(1k)$}}}]++(-3,0)node [below,rotate=-90] {$V_{in}$}
 (opamp.down) ++ (0,-.5) node[right,rotate=-90] {$-15V$}-- (opamp.down)
 (opamp.up) ++ (0,.5) node[left,rotate=-90]{$+15V$}-- (opamp.up)
 (opamp.-)node [PH,above left,rotate=-90] {2} 
 (opamp.+) node [PH,above left,rotate=-90] {3}
 (opamp.out)node [PH,below left,rotate=-90] {6}
 (opamp.down)node[PV,above right,rotate=-90] {4} 
 (opamp.up)node[PV,above right] {7}
 ($(opamp.-)+(-0.3,-0.3)$) node[rotate=-90]{$v_{-}$}
 ($(opamp.+)+(-0.3,-0.3)$) node[rotate=-90]{$v_{+}$}
 ;
 \draw (12.5,.69) node[op amp] (opamp2){}
 (opamp2)     node[opamp label,rotate=-90,xshift=-5mm,yshift=3mm] {LM741}
 (opamp2.-) |-($(opamp2.-)+(0.6,2)$) to[short] ++(1.8,0)   -| 
 ($(opamp2.out)+(0.5,0)$)
 (opamp2.out) to[short] ($(opamp2.out)+(3.0,0)$) node [above,rotate=-90] {$V_{out}$} 
 node [ocirc] {}
 ($(opamp2.+)-(0,0.0)$)  to[R,l=\rotatebox{-90}{\makebox[0pt][c]{$R_4(12k)$}}]++(0,-3)node [ground] {}
 ($(opamp2.+)-(3,0.0)$) to [short]++(0,5) to[short]++(3,0)to 
 [R,l={\rotatebox{-90}{\makebox[0pt][r]{$R_3(5.6k\Omega)$}}}]++(2,0)  -| ($(opamp2.out)+(2,0)$)
 ($(opamp2.+)-(0,0.0)$) to[C,l_={\rotatebox{-90}{\makebox[0pt][r]{$C_2(10nF)$}}},*-*]++(-3,0) 
 to[C,l_={\rotatebox{-90}{\makebox[0pt][r]{$C_1(10nF)$}}}]++(-3,0)
 ($(opamp2.-)+(-0.3,-0.3)$) node[rotate=-90]{$v_{-}$}
 ($(opamp2.+)+(-0.3,-0.3)$) node[rotate=-90]{$v_{+}$}
 (opamp2.down) ++ (0,-.5) node[right,rotate=-90] {$-15V$} -- (opamp2.down)
 (opamp2.up) ++ (0,.5) node[left,rotate=-90]{$+15V$} -- (opamp2.up)
 (opamp2.-)node [PH,above left,rotate=-90] {2} 
 (opamp2.+) node [PH,above left,rotate=-90] {3}
 (opamp2.out)node [PH,below left,rotate=-90] {6}
 (opamp2.down)node[PV,above right,rotate=-90] {4} 
 (opamp2.up)node[PV,above left,rotate=-90] {7}
 ;
\end{circuitikz}
\end{center}
\end{figure}

\end{document}

enter image description here

The cleaner solution would of course be to draw the thing in such a way that it becomes rotated, i.e. to change the coordinates of the respective objects according to x\to y and y\to-x.

1

Just for fun an option drawing in separate archive and then import using graphicx package.

The code is using default circutikz options, it could be rotared each one like marmot's answer; file saved as Circuitikz005.tex, when is compiled an output pdf file name Circuitikz005.pdf is created:

CODE:

\documentclass[border=20pt]{standalone}
\usepackage{circuitikz}
\usepackage{siunitx}

\begin{document}

    \begin{tikzpicture}[
        %Environment Config
        font=\large
    ]
    %Put the opamps in position
        \draw(0,0)node[plain amp,scale=2]
            (OP-01){}
            (OP-01)++(-5pt,0)node{LM471}
            (OP-01.out)node[label=135:\small$6$]{}
            (OP-01.+)node[label=-135:$v_+$,label=45:\small$3$]{} ++(1,0) node{$+$}
            (OP-01.-)node[label=-135:$v_-$,label=45:\small$2$]{} ++(1,0) node{$-$}
            (OP-01.up)node[label=45:\small$7$]{} -- ++(0,1) node[label=90:$+15V$]{}
            (OP-01.down)node[label=-45:\small$4$]{} -- ++(0,-1) node[label=-90:$-15V$]{};
        %Close Loop
        \draw(OP-01.-) -- ++(0,2.5) -| (OP-01.out);
        \draw(12,1)node[plain amp,scale=2]
            (OP-02){}
            (OP-02)++(-5pt,0)node{LM471}
            (OP-02.out)node[label=135:\small$6$]{}
            (OP-02.+)node[label=-135:$v_+$,label=45:\small$3$]{} ++(1,0) node{$+$}
            (OP-02.-)node[label=-135:$v_-$,label=45:\small$2$]{} ++(1,0) node{$-$}
            (OP-02.up)node[label=45:\small$7$]{} -- ++(0,1) node[label=90:$+15V$]{}
            (OP-02.down)node[label=-45:\small$4$]{} -- ++(0,-1) node[label=-90:$-15V$]{};
        %Close Loop
        \draw(OP-02.-) -- ++(0,2.5) -| (OP-02.out);

    %Draw the rest circuits:
        %From imput to opamp 1 positive ref
        \draw(OP-01.+)++(-6,0)
            node[label=180:$V_{in}$]{}
            to [R,l=$R_1$,a=$1K\si\ohm$,o-]++(2.5,0) coordinate (NOD1)
            to [R,l=$R_2$,a=$1K\si\ohm$,*-](OP-01.+)
            to [C,l^=$5.6\si{\nano}F$,a=$C_4$,*-] node [ground]{}++(0,-4) coordinate (GND);
        %From opamp 1 output to opamp 2 positive ref.
        \draw(OP-01.out)
            to [short,*-] ++(1,0) coordinate (NOD2)
            to [C,a=$10\si{\nano}F$,l=$C_1$,*-]++(2.5,0) coordinate (NOD3)
            to [C,a=$10\si{\nano}F$,l=$C_2$,*-](OP-02.+)
            to [R,a=$R_2$,l=$12K\si\ohm$,*-] node [ground]{} (GND -| OP-02.+);
        %Capacitive opamp 1 loop
        \draw(NOD1) -- ++(0,6) coordinate (NOD4)
            to [C,a=$12\si{\nano}F$,l=$C_3$] (NOD4 -| NOD2)
            to [short] (NOD2);
        %From Output point to opamp 2 output
        \draw(OP-02.out)++(2,0)
            node [label=0:$V_{out}$]{}
            to [short,o-*]++(-1,0) coordinate (NOD5)
            to [short,-*](OP-02.out);
        %Resistive opamp 2 loop.    
        \draw(NOD3) -- ++(0,6) coordinate (NOD6)
            to [R,l=$R_2$,a=$12K\si\ohm$] (NOD6 -| NOD5)
            to [short] (NOD5);
    \end{tikzpicture}
\end{document}

RESULT: enter image description here

PSD:For this image,I forget to change the sign to the negative ref pin label, in the current code is corrected.


In the main document you can import using graphicx and control freely as an image without loosing vector properties.

RESULT: enter image description here MWE:

% arara: pdflatex: {synctex: yes, action: nonstopmode}

\documentclass[a4paper]{article}
\usepackage[top=2cm,bottom=2cm,left=3cm,right=2cm]{geometry}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{tikz}
\usetikzlibrary{backgrounds}

\begin{document}
\lipsum[1-2]

    \begin{figure}[!h]
        \centering
        \includegraphics[width=\textwidth]{Circuitikz005} 
        \caption{Imported pdf using graphicx}
    \end{figure}

\lipsum[3-5]    

    \begin{figure}[!h]
        \centering
        \begin{tikzpicture}[
            background rectangle/.style={% Background style
                rectangle, 
                rounded corners,
                shade,
                opacity=0.8,
                top color=green!3,
                bottom color=blue!30,
                draw=black!40!black!60,
            },
            show background rectangle,
            %Global config
            >=latex,
            line width=1pt
            ]

        \node[inner sep=0pt] (FIG1) at (0,0) {\includegraphics[scale=0.8,angle=90]{Circuitikz005.pdf}};
        \node[inner sep=0pt] (FIG1) at (6,0) {\includegraphics[scale=0.3,angle=45]{Circuitikz005.pdf}};
        \end{tikzpicture}
        \caption{Imported pdf within Tikz environment}
    \end{figure}

\end{document}
  • +1 for redrawing circuit. so far i was not aware for option a for the second positions of bipoles labels. – Zarko Jun 22 '18 at 8:43
0
  • even if you rotate your circuit scheme, it is longer than text height
  • (edit) with redrawing your schema with shortening distances for bipoles, used option a (stolen from nice J Leon V. answer), use siunitx syntax for bipoles labels and with simplified/regrouping code, it can be fit by rotation for 90 degree to text area without scaling the image
  • if i understood your question correctly, you looking for something like this

enter image description here

  • for rotating scheme on showed way i use sidewaysfigure environment from the package `rotating:

    \documentclass{article}
    \usepackage[american,siunitx]{circuitikz}
    \usetikzlibrary{positioning, fit, calc}
    \ctikzset{tripoles/op amp/height=2.0, tripoles/op amp/width=2.5,}
    \tikzset{PH/.append style={font=\scriptsize,inner ysep=2pt,inner xsep=7pt},
             PV/.append style={PH,inner ysep=2pt,inner xsep=2pt}
             }
    
    \usepackage[font={color=blue,large},figurename=Fig.,labelfont={it}]{caption}
    \usepackage{rotating}
    
    \begin{document}
    \begin{sidewaysfigure}
        \centering
    \begin{circuitikz}
    %%%% first stage
    \draw   (0,0)       node[op amp, label=center:LM741] (opamp){}
            (opamp.-)   node [PH,above right,label=left:] {2}
                        node [left]{$v_{-}$}
                        |- ($(opamp.out)+(0,2.5)$)
                        to [short, -*] (opamp.out)
    %
            (opamp.+)   node [PH,above right] {3}
                        node [above left]{$v_{+}$}
                        to [R,l=$R_2$,a=1<\kilo\ohm>,*-*] ++ (-2.5,0) coordinate (aux1)
                        to [R,a=$R_1$,l=1<\kilo\ohm>, -o] ++ (-2.5,0) node [left] {$V_{in}$}
            (opamp.+)   to [C,a=$C_4$,l=5.6<\nano\farad>] ++ (0,-3)   node [ground] {}
            ($(opamp.out)+(0.5,0)$)
                        to [short,*-] ++ (0,4)  coordinate (aux2)
                        to [C,a=$C_3$,l=12<\nano\farad>]  (aux1 |- aux2) -- (aux1)
            (opamp.out) node [PH,above left] {6}
                        to [short, -o] ++ (1,0) coordinate (aux3)
    % supply 1
            (opamp.up)   node[PV,above right] {7} -- ++ (0, .5) node[above] {$+15V$}
            (opamp.down) node[PV,below right] {4} -- ++ (0,-.5) node[below] {$-15V$}
    %%%% second stage
            (aux3)      to [C,l=$C_1$,a=10<\nano\farad>]       ++ (2,0) coordinate (aux4)
                        to [C,l=$C_2$,a=10<\nano\farad>,*-*]   ++ (2,0) coordinate (aux5)
                        to [R,a=$R_4$,l=10<\kilo\ohm>]        ++ (0,-3) node [ground] {}
    %
            (aux5)      node [op amp, label=center:LM741,
                              right, anchor=+] (opamp2) {}
            (opamp2.-)  node [PH,above right] {2}
                        node [left]{$v_{-}$}
                        |- ($(opamp2.out)+(0,2.5)$)
                        to [short, -*] (opamp2.out)
            (opamp2.+) node [PH,above right] {3}
                       node[above left]{$v_{+}$}
            ($(opamp2.out)+(0.5,0)$)
                        to [short,*-] ++ (0,4)  coordinate (aux7)
                        to [R,a=$R_3$,l=5.6<\kilo\ohm>]  (aux4 |- aux7) -- (aux4)
            (opamp2.out) node [PH,above left] {6}
                        to [short, -o] ++ (1,0) node [right] {$V_{out}$}
    
    % supply 2
            (opamp2.up)   node[PV,above right] {7} -- ++ (0, .5) node[above] {$+15V$}
            (opamp2.down) node[PV,below right] {4} -- ++ (0,-.5) node[below] {$-15V$}
     ;
    \end{circuitikz}
    \caption{My scheme}
    \label{fig: my big scheme}
    \end{sidewaysfigure}
    
        \end{document}
    
0

I would really advise against rotate and scaling. If the circuit is so complex you can't use (more or less) the same text size of the text, you should split it logically. Treat the circuit as an equation.

Besides, one of the great advantages of using tikz, or pgfplots, against doing the graph in specialized external programs and import them, is that it will merge beautifully with your main text, with text fonts, and sizes, coherent.

So I would try to use the same text as you main font (or use \small or something like that, if you want) and make the circuit smaller by avoiding the vast space you add to it, which personally I find distracting.

I am proposing a solution using the last version of circuitkz, to have access to the a (annotation) key, and I have converted just one cell, as an example.

enter image description here

\documentclass{article}
\usepackage[american,siunitx]{circuitikzgit}
\usetikzlibrary{positioning, fit, calc}

\tikzset{opamp label/.style={xshift=-9mm, font=\normalsize,right}}
\tikzset{iovardelay/.style={label={[above]90:\textsf{#1}},
                            label={[right=2ex]180:\textsf{I}},
                            label={[left=3ex]0:\textsf{O}},
                            draw,fill=blue!10,
                            minimum width=1cm,
                            minimum height=2cm
                            }
        }
%\ctikzset{bipoles/diode/height=0.3, bipoles/diode/width=0.3,}
%\ctikzset{tripoles/op amp/height=2.0, tripoles/op amp/width=2.5,}

\usepackage[font={color=blue,large},figurename=Fig.,labelfont={it}]{caption}
 \tikzset{PH/.append style={font=\scriptsize,inner ysep=2pt,inner xsep=5pt},
                   PV/.append style={PH,inner ysep=2pt,inner xsep=2pt}}
\begin{document}
Normal text here

\begin{circuitikz}[]

\draw (0,0) node[op amp] (opamp){}
 (opamp)     node[opamp label] {LM741}
 (opamp.-) |-($(opamp.-)+(0.3,1.1)$) to[short] ++(0.9,0)   -| ($(opamp.out)+ 
 (0.25,0)$)
 (opamp.out) to[short] ($(opamp.out)+(1.1,0)$)  node [ocirc] {}
 (opamp.+)  to[short] ++(0,-0.5) to[C,l=$C_4$,a=5.6<nF>]++(0,-1.5)node [ground] {}
 ($(opamp.+)-(2.4,0.0)$) coordinate (dotin) to [short]++(0,2.5) to[short]++(0.5,0)  
 to[C,l=$C_3$, a=12<nF>] ++(1,0)  -| ($(opamp.out)+(0.5,0)$)
 (opamp.+) to[R,l=$R_2$, a=1<k\ohm>,*-*] (dotin) to[R,l=$R_1$, a=1<k\ohm>] ++(-2.4,0)node [left] {$V_{in}$}
 (opamp.down) ++ (0,-.5) node[right, font=\small] {$-15V$}-- (opamp.down)
 (opamp.up) ++ (0,.5) node[right, font=\small]{$+15V$}-- (opamp.up)
 (opamp.-)node [PH,above right] {2} 
 (opamp.+) node [PH,above right] {3}
 (opamp.out)node [PH,above left] {6}
 (opamp.down)node[PV,below right] {4} 
 (opamp.up)node[PV,above right] {7}
 ($(opamp.-)+(-0.3,-0.3)$) node[]{$v_{-}$}
 ($(opamp.+)+(-0.3,-0.3)$) node[]{$v_{+}$}
 ;
\end{circuitikz}

\end{document}

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.