如何将表格放在图形旁边?

如何将表格放在图形旁边?

我想在图形旁边放一张表格。我该怎么做?我最接近的方法是这样的:

\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}

在此处输入图片描述

相关内容