如何在 minipage/figure/tabular 环境中垂直对齐/在顶部对齐 tikz 图片(circuitikz)?

如何在 minipage/figure/tabular 环境中垂直对齐/在顶部对齐 tikz 图片(circuitikz)?

我正在尝试垂直对齐这 3 个电路。我想将其对齐在顶部,而不是底部(它们会自动使用该代码对齐底部)。

另外,如果可能的话,知道如何将它们对齐到相同的“杆”高度。谢谢。

\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\usepackage{tikz,circuitikz}
\usepackage[singlelinecheck=off]{caption}
\usepackage{float}


\begin{figure}[H]
\begin{minipage}{\textwidth}
 \renewcommand{\arraystretch}{1.0}
    \centering
    \Large
    \begin{tabular}{ccc}
    \scalebox{0.5}{
    \begin{circuitikz}[]
  \draw[]
  (0,3) to [R, l=$\mathbf{R_0}$,o-] (2,3) -- (2,4)
  to [C, l=$\mathbf{Q_{1}}$] (6,4) -- (6,3)
  to [short, -o] (7,3)
  (2,3) -- (2,2) to [R, l=$\mathbf{R_1}$] (6,2) -- (6,3); 
    \end{circuitikz}
    } & 
    \scalebox{0.5}{
     \begin{circuitikz}[]
  \draw[]
  (0,4) to [R, l=$R_0$,o-] (2,4) -- (2,5)
  to [C, l=$Q_{1}$] (8,5) -- (8,4)
  to [short, -o] (9,4)
  (2,4) -- (2,2) to [R, l=$R_1$] (4,2) -- (4,3)
  to [C, l=$Q_{2}$] (8,3)
  (4,2) -- (4,1) to [R, l=$R_2$] (8,1) -- (8,4); 
    \end{circuitikz}
    } & 
    \scalebox{0.5}{
    \begin{circuitikz}[]
  \draw[]
  (0,4) to [R, l=$R_0$,o-] (2,4) -- (2,5)
  to [C, l=$Q_{1}$] (9,5) -- (9,4)
  to [short, -o] (10,4)
  (2,4) -- (2,2) to [R, l=$R_1$] (4,2) -- (4,3)
  to [C, l=$Q_{2}$] (9,3)
  (4,2) -- (4,0) to [R, l=$R_2$] (6,0) -- (6,1)
  to [R, l=$R_3$] (9,1)
  (6,0) -- (6,-1) to [C, l=$Q_{3}$] (9,-1) -- (9,4); 
    \end{circuitikz}
    }\\ 
    \small(a) Randles & \small(b) 2 TC & \small(b) 3 TC
\end{tabular}
\end{minipage}
\vspace{-3pt}    
\captionsetup{labelfont=bf,labelsep=period,font=small}
    \caption{description}
    \label{fig:circuits}
\end{figure}

答案1

另一种可能性是:

  • 为图片定义基线:baseline=(current bounding box.north)
  • 用于tabularray桌子
  • 删除小页面

\documentclass{article}
%\usepackage{geometry} 
\usepackage{circuitikz}
\usepackage[skip=1ex,
            labelfont=bf,labelsep=period,font=small,
            singlelinecheck=off]{caption, subcaption}
\usepackage{tabularray}

\begin{document}
    \begin{figure}[ht]
\tikzset{
    every picture/.append style = {baseline=(current bounding box.north), 
                                   scale=0.53, transform shape}
        }
\ctikzset{
    bipoles/capacitor/height=0.44,
    bipoles/capacitor/width=0.1,
        }
\begin{tblr}{colspec = {*{3}{Q[c]} }, 
             colsep  = 3pt,
             row{2}  = {font=\small, mode=math},
             row{3}  = {font=\small}
             }
    \begin{circuitikz}
\draw   (0,3) to [R, l=$\mathbf{R_0}$,o-] ++ (2,0) coordinate (aux)
              -- ++ (0, 1) 
              to [C, l=$\mathbf{Q_{1}}$]  ++ (2,0) -- ++ (0,-1)
              to [short, -o] ++ (1,0)
        (aux) -- ++ (0,-1) 
              to [R, l=$\mathbf{R_1}$]    ++ (2,0) -- ++ (0,1);
    \end{circuitikz}
    &   \begin{circuitikz}
        \draw   (0,4) to [R, l=$\mathbf{R_0}$,o-] ++ (2,0) coordinate (a)
                      -- ++ (0, 1)
                      to [C, l=$Q_{1}$]     ++ (4,0) -- ++ (0,-1)
                      to [short, -o] ++ (1,0)
                (a)   -- ++ (0,-1)
                      to [R, l=$R_1$]       ++ (2,0) coordinate (b)
                (b)   -- ++ (0, 1)
                      to [C, l=$Q_{2}$]     ++ (2,0)
                (b)   -- ++ (0,-1)
                      to [R, l=$R_2$]       ++ (2,0) -- ++ (0,2);
        \end{circuitikz}
    &   \begin{circuitikz}
        \draw   (0,5) to [R, l=$\mathbf{R_0}$,o-] ++ (2,0) coordinate (a)
                              -- ++ (0, 1)
                              to [C, l=$Q_{1}$]     ++ (6,0) -- ++ (0,-1)
                              to [short, -o] ++ (1,0)
                (a)   -- ++ (0,-1)
                      to [R, l=$R_1$]       ++ (2,0) coordinate (b)
                (b)   -- ++ (0, 1)
                      to [C, l=$Q_{2}$]     ++ (4,0)
                (b)   -- ++ (0,-1)
                      to [R, l=$R_2$]       ++ (2,0) coordinate (c)
                (c)   -- ++ (0, 1)
                      to [R, l=$R_3$]       ++ (2,0)
                (c)   -- ++ (0,-1)
                      to [C, l=$Q_{3}$]     ++ (2,0) -- ++ (0,3);
        \end{circuitikz}   \\
R(QR)       &   R(Q(R(QR))) &   R(Q(R(Q(R(QR)))))   \\
(a) Randles &   (b) 2 TC    &   (c) 3 TC
\end{tblr}
    \caption{Representación de los circuitos equivalentes modelados en este trabajo.}
    \label{fig:circuitos}
\end{figure}

\end{document}

在此处输入图片描述

(红线表示页面布局)

笔记:

  • 您可以考虑使用该geometry包来增加文本块并相应地放大图像比例值(例如,放大\usepackage[margin=25mm]{geometry}scale=0.75),从而使方案更具可读性:

在此处输入图片描述

  • 我擅自使用相对坐标重新绘制了方案。您可能会喜欢这种绘制方式。

答案2

minipage最后我设法使用环境命令解决了它\raisebox

\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\usepackage{tikz,circuitikz}
\usepackage[singlelinecheck=off]{caption}
\usepackage{float}

\begin{document}

\begin{figure}[H]
\begin{minipage}{\textwidth}
 \renewcommand{\arraystretch}{1.0}
    \centering
    \Large
    \begin{tabular}{ccc}
    \raisebox{0.8\height}{\scalebox{0.5}{
    \begin{circuitikz}[]
  \draw[]
  (0,3) to [R, l=$\mathbf{R_0}$,o-] (2,3) -- (2,4)
  to [C, l=$\mathbf{Q_{1}}$] (6,4) -- (6,3)
  to [short, -o] (7,3)
  (2,3) -- (2,2) to [R, l=$\mathbf{R_1}$] (6,2) -- (6,3); 
    \end{circuitikz}
    }} & 
    \raisebox{0.14\height}{\scalebox{0.5}{
     \begin{circuitikz}[]
  \draw[]
  (0,4) to [R, l=$R_0$,o-] (2,4) -- (2,5)
  to [C, l=$Q_{1}$] (8,5) -- (8,4)
  to [short, -o] (9,4)
  (2,4) -- (2,2) to [R, l=$R_1$] (4,2) -- (4,3)
  to [C, l=$Q_{2}$] (8,3)
  (4,2) -- (4,1) to [R, l=$R_2$] (8,1) -- (8,4); 
    \end{circuitikz}
    }} & 
    \raisebox{-0.19\height}{\scalebox{0.5}{
    \begin{circuitikz}[]
  \draw[]
  (0,4) to [R, l=$R_0$,o-] (2,4) -- (2,5)
  to [C, l=$Q_{1}$] (9,5) -- (9,4)
  to [short, -o] (10,4)
  (2,4) -- (2,2) to [R, l=$R_1$] (4,2) -- (4,3)
  to [C, l=$Q_{2}$] (9,3)
  (4,2) -- (4,0) to [R, l=$R_2$] (6,0) -- (6,1)
  to [R, l=$R_3$] (9,1)
  (6,0) -- (6,-1) to [C, l=$Q_{3}$] (9,-1) -- (9,4); 
    \end{circuitikz}
    }}\\ 
    \small$R(QR)$ & \small$R(Q(R(QR)))$ & \small$R(Q(R(Q(R(QR)))))$ \\
    \small(a) Randles & \small(b) 2 TC & \small(c) 3 TC
\end{tabular}
\end{minipage}
\vspace{-3pt}    
\captionsetup{labelfont=bf,labelsep=period,font=small}
    \caption{Representación de los circuitos equivalentes modelados en este trabajo.}
    \label{fig:circuitos}
\end{figure}

\end{document}

无论如何,如果能提供其他选项/解决方案/建议,我将不胜感激。希望我的回答对您有所帮助。

相关内容