我正在编写文档,并将设备图片及其技术数据放在同一页面的表格中。我遇到的问题是页面和表格不在同一层,导致图片标题不在同一高度
这是代码:
\begin{minipage}{0.5\textwidth}
\begin{figure}[H]
\centering
\includegraphics[width=7cm, height=4cm]{gaszaehler}
\caption{Q-loud EnrgyCam 2.0}
\end{figure}
\end{minipage}
\begin{minipage}{0.5\textwidth}
\begin{table}[H]
\centering
\scalebox{0.9}{
\begin{tabular}{ | l | c|}
\hline
Stromversorgung & DC 5 V $\geq100$ mA \\ \hline
Betriebstemperatur & -10 ° - 50 °\\ \hline
Schutzklasse & IP64 \\ \hline
Bussystem & M-Bus \\ \hline
Dimensionen & 42 x 42 mm (T x H) \\ \hline
Sensoreinheit & Kamera Modul \\ \hline
% & & & \\ \hline
\end{tabular}
}
\caption{Technische Daten der Q-loud EnrgyCam 2.0 \cite{energycam_mbus} }
\end{table}
\end{minipage}
答案1
好的,评论太长了。
\documentclass{article}
\usepackage{amsmath,siunitx,graphicx,floatrow}
% from https://tex.stackexchange.com/a/6869/121799
\newfloatcommand{capbtabbox}{table}[][\FBwidth]
\begin{document}
\newsavebox{\testbox}%
\newlength{\testheight}%
\savebox{\testbox}{% from https://tex.stackexchange.com/a/66429/121799
\begin{tabular}[b]{ | l | c|}
\hline
Stromversorgung & DC \si{5\volt} $\geq100\si{\milli\ampere}$ \\ \hline
Betriebstemperatur & \si{-10\degree} --- \si{50\degree} \\ \hline
Schutzklasse & IP64 \\ \hline
Bussystem & M-Bus \\ \hline
Dimensionen & 42 x 42 mm (T x H) \\ \hline
Sensoreinheit & Kamera Modul \\ \hline
% & & & \\ \hline
\end{tabular}
}%
\settoheight{\testheight}{\usebox{\testbox}}
\begin{figure}
\begin{floatrow}
\ffigbox{%
\includegraphics[height=\testheight]{example-image-a}%
}{%
\caption{Q-loud EnrgyCam 2.0}%
}
\capbtabbox{%
\usebox{\testbox}
}{%
\caption{Technische Daten der Q-loud EnrgyCam 2.0 \cite{energycam_mbus} }%
}
\end{floatrow}
\end{figure}
\end{document}
我也利用这个机会来siunitx
排版单位。