我怎样才能使我的电路居中?

我怎样才能使我的电路居中?
\documentclass[11pt,letterpaper]{article} 

\usepackage[latin1]{inputenc}
\usepackage{graphicx}
\usepackage{geometry}[top=2cm,bottom=2cm,hmargin=2.5cm]
\usepackage[american]{circuitikz}

\begin{document}


\begin{figure}\centering

\begin {circuitikz} [scale = 0.7] [american][H]
\draw

(0,0) node[op amp] (opamp1) {}

(6,-0.7) node[op amp] (opamp2) {}

(opamp1.-) to [short,-] ++ (-2,0)

to [R, l_=$1K$] ++(-5,0) node[left]{$V_1$}

to [V, l_=$3\;V$] ++(0,-3)

to node[ground]{} ++(0,0)



(-6.5,-4) to node[ground]{} ++(0,0)

to [V, v=$6\;V$, invert] ++(0,3)

to [R, l_=$1K$] ++(3,0)

to [short,-*] ++(0,1.7)

to [short,-] ++(0,3)

to [R, l_=$1K$] ++ (3,0)

to[short,-] ++(0,0) coordinate (leftC)

to (leftC -| opamp1.out)

to[short,-*] (opamp1.out)

  

(opamp1.+) to [short,-] ++ (-1,0)

to node[ground]{} ++(0,-1)



(opamp1.out) [short,-] ++(0,0)

to [R, l_=$1K$] ++ (2,0) 

coordinate (leftC)

to (leftC -| opamp2.-)

to[short,-] (opamp2.-)



(opamp2.-) to [short, *-] ++(0,3) 

 to [short, -] ++(2,0) 

to [R, l_=$2K \Omega$] ++(3,0)

to [short, -] ++(0,-3.7) 

coordinate (leftC) 

to (leftC -| opamp2.out)

to[short,-] (opamp2.out)  



(opamp2.up) to [short, -]  ++(0,5)

to [short, -] ++(8,0)

to [V,l_=$15v$] ++(0,-4) 

to [V,l_=$15v$] ++(0,-4) 

 to[short,-] ++(0,0) coordinate (leftC)

  to (leftC -| opamp2.down)

  to[short,-] (opamp2.down)



(opamp1.up) to [short, -]  ++(0,4.3)

to [short, -] ++(6,0)

 

(opamp1.down) to [short, -]  ++(0,-2.15)

to [short, -] ++(6,0)



(opamp2.+) -| ++(0,-0.4) node[ground]{}



(opamp2.out) to [short, -o] ++(3,0) node[right]{$V_o$}



(13.9,0)[short,*-] ++(0,1) to node[ground]{} ++(2,0)

;

\end{circuitikz}

\end{figure}

\end{document}

在此处输入图片描述

答案1

我将重新绘制您的电路方案如下:

\documentclass[11pt]{article}
\usepackage[letterpaper, 
            vmargin=2cm, hmargin=2.5cm]{geometry}
\usepackage[american,siunitx]{circuitikz}

%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\begin{document}
    \begin{figure}
    \centering
    \ctikzset{bipoles/length=1cm, nodes width=0.08}
\begin{circuitikz}
\node[op amp] (oa1) {};
\draw   (oa1.out)   to [R=1<\kilo\ohm>,*-*] ++ (2,0)
                    node[op amp,anchor=-] (oa2) {}
        (oa1.-)     -- ++ (-1,0)                coordinate (aux1)   
                    --  ++ (0,1)                coordinate (aux2)
                    to [R=1<\kilo\ohm>] ++ (2,0) 
                    --  (aux2 -| oa1.out) -- (oa1.out)
        (oa1.+)     -- ++ (0,-0.5) node[ground] {}
%
        (aux1)      to [R=1<\kilo\ohm>,*-] ++(-3.5,0) node[left] {$V_1$}
                    to [V_=3<\volt>] ++ (0,-1.5)
                    node[ground] {}
        (aux1)      -- ++ (0,-1)
                    to [R=1<\kilo\ohm>] ++(-2,0) node[left] {$V_1$}
                    to [V_=6<\volt>] ++ (0,-1.5)
                    node[ground] {}
%%
        (oa2.out)   to [short,  -*] ++ (1,0)    coordinate (aux3)
        (oa2.-)     |-  ++ (1,1)                coordinate (aux4)
                    to [R=2<\kilo\ohm>]  (aux4 -| aux3) -- (aux3)
                    to [short, -o] ++ (1,0) node[right] {$V_o$}
        (oa2.+)     -- ++ (0,-0.5) node[ground] {}
%%% suply
        (oa1.up)    |- ($(oa2.up)+(0,2)$)       
                    -- ++ (4,0)                 coordinate (aux5)
        (oa2.up)    -- (oa2.up |- aux5)
        (aux5)      to [V_=15<\volt>,-*]    (aux5 |- oa2.out)
        (oa1.down)  |- ($(oa2.down)-(0,2)$)
                    -- ++ (4,0)                 coordinate (aux6)
        (aux5 |- oa2.out)   to [V_=-15<\volt>]    (aux6)
        (aux5 |- oa2.out)   -| ++ (1,-0.5) node[ground] {}
    ;
\end{circuitikz}
    \end{figure}
\end{document}

编译后结果为:

在此处输入图片描述

(红线标记文字宽度)

上面的 MWE 与您的相比有所改变:

  • 双极子的尺寸减小
  • 使用的是siunitx单位符号
  • 所有电路元件都相对于相邻元件定位,并且略微减小
  • 省略图像缩放
  • 还省略了未知circuitikz选项 H

编辑: 已更正方案。现在正如楼主所言,有问题。

答案2

删除居中并添加以下行\hspace - 其余不变 - 您的图形将始终延伸到较大的边距

在此处输入图片描述

\begin{figure}
\hspace{-2cm}
........
\end{figure}

相关内容