![如何将表格放在图形旁边?](https://linux22.com/image/394788/%E5%A6%82%E4%BD%95%E5%B0%86%E8%A1%A8%E6%A0%BC%E6%94%BE%E5%9C%A8%E5%9B%BE%E5%BD%A2%E6%97%81%E8%BE%B9%EF%BC%9F.png)
我想在图形旁边放一张表格。我该怎么做?我最接近的方法是这样的:
\begin{table}[H]
\footnotesize
\begin{minipage}{0.48\textwidth}
\centering
\caption{Systematic uncertainty in equipment}
\begin{tabular}{|l|l|}
\hline
Torque & $\pm 0.05\%$\\
\hline
Wind velocity & $\pm 0.1\%$ \\
\hline
Air density & $\pm 0.3 \%$ \\
\hline
RPM & $\pm 3$ \\
\hline
Current & $\pm 0.05\%$ \\
\hline
Voltage & $\pm 0.05 \%$ \\
\hline
\end{tabular}
\label{tab:Windtunneluncertanty}
\end{minipage}
\hspace*{\fill}
\begin{minipage}{.5\textwidth}
\centering
\includegraphics[scale=0.3]{bilder/testrig.jpg}
\caption{Testrig for the wind turbine} % kanskje endres
\label{fig:testrig}
\end{minipage}
\end{table}
答案1
看看以下解决方案是否能帮助您:
\documentclass{article}
\usepackage[demo, % in real document remove this option
]{graphicx}
\usepackage{capt-of} % added for figure/table caption
\usepackage{tabularx} %
\begin{document}
\begin{table}[htb]
\begin{tabularx}{\linewidth}{*{2}{>{\centering\arraybackslash}X}}
\begin{tabular}[b]{|l|l|}
\hline
Torque & $\pm 0.05\%$\\
\hline
Wind velocity & $\pm 0.1\%$ \\
\hline
Air density & $\pm 0.3 \%$ \\
\hline
RPM & $\pm 3$ \\
\hline
Current & $\pm 0.05\%$ \\
\hline
Voltage & $\pm 0.05 \%$ \\
\hline
\end{tabular}
&
\includegraphics[scale=0.3]{bilder/testrig.jpg} \\
\caption{Systematic uncertainty in equipment}
\label{tab:Windtunneluncertanty}
&
\captionof{figure}{Testrig for the wind turbine} % kanskje endres
\label{fig:testrig}
\end{tabularx}
\end{table}
\end{document}
答案2
另一种选择是使用两个,并使用包中的说明符\minipage
将浮点数放置在里面。[H]
float
\documentclass{article}
\usepackage{graphicx}
\usepackage{float}
\begin{document}
\begin{minipage}{0.45\textwidth}
\begin{table}[H]
\centering
\begin{tabular}{|l|l|}
\hline
Torque & $\pm 0.05\%$\\
\hline
Wind velocity & $\pm 0.1\%$ \\
\hline
Air density & $\pm 0.3 \%$ \\
\hline
RPM & $\pm 3$ \\
\hline
Current & $\pm 0.05\%$ \\
\hline
Voltage & $\pm 0.05 \%$ \\
\hline
\end{tabular}
\label{tab:Windtunneluncertanty}
\caption{Systematic uncertainty in equipment}
\end{table}
\end{minipage}
\hfill
\begin{minipage}{0.45\textwidth}
\begin{figure}[H]
\centering
\includegraphics[scale=0.3]{example-image-a}
\caption{Testrig for the wind turbine} % kanskje endres
\label{fig:testrig}
\end{figure}
\end{minipage}
\end{document}