英文:
How can I align vertically/on top tikz pictures (circuitikz) in minipage/figure/tabular environment?
问题
我想将这三个电路顶部对齐。另外,如果可能的话,我想知道如何将它们在相同的 '极' 高度对齐。谢谢。
英文:
I am trying to align vertically this 3 circuits. I would like to align the on top, instead of bottom part (they automatically align bottom with that code)
\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}
I would like the three circuits to be aligned on the top part. Also, if possible, to know how to align the at the same 'pole' height. Thank you.
答案1
得分: 0
你可以使用tikz
中的baseline
选项来更改对齐方式。例如,要使图像顶部对齐:
\documentclass{article}
\usepackage{graphicx} % 插入图像所需
\usepackage{tikz,circuitikz}
\usepackage[singlelinecheck=off]{caption}
\usepackage{float}
\usepackage{tabularray}
\begin{document}
\begin{figure}[H]
\begin{minipage}{\textwidth}
\renewcommand{\arraystretch}{1.0}
\centering
\Large
\begin{tblr}{Q[c,t]Q[c,t]Q[c,t]}
\scalebox{0.5}{
\begin{circuitikz}[baseline=(current bounding box.north)]
\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}[baseline=(current bounding box.north)]
\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}[baseline=(current bounding box.north)]
\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(c) 3 TC
\end{tblr}
\end{minipage}
\vspace{-3pt}
\captionsetup{labelfont=bf,labelsep=period,font=small}
\caption{描述}
\label{fig:circuits}
\end{figure}
\end{document}
英文:
You can use the baseline
option from tikz
to change the alignment. For example to get the images top aligned:
\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\usepackage{tikz,circuitikz}
\usepackage[singlelinecheck=off]{caption}
\usepackage{float}
\usepackage{tabularray}
\begin{document}
\begin{figure}[H]
\begin{minipage}{\textwidth}
\renewcommand{\arraystretch}{1.0}
\centering
\Large
\begin{tblr}{Q[c,t]Q[c,t]Q[c,t]}
\scalebox{0.5}{
\begin{circuitikz}[baseline=(current bounding box.north)]
\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}[baseline=(current bounding box.north)]
\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}[baseline=(current bounding box.north)]
\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{tblr}
\end{minipage}
\vspace{-3pt}
\captionsetup{labelfont=bf,labelsep=period,font=small}
\caption{description}
\label{fig:circuits}
\end{figure}
\end{document}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论