如何将表格移动到垂直中心?,并将图形和表格对齐在一起

如何将表格移动到垂直中心?,并将图形和表格对齐在一起
 \begin{figure}[htbp]
    \centering
    \makebox[0.5\textwidth]{\includegraphics[width=0.7\textwidth]{figure/ch3/result_s2/book.jpg}}
    \qquad \qquad
        \scalebox{0.7}{
    \begin{tabular}[c]{cc}
    \hline
      \textbf{Method} & \textbf{$\sigma$} \\ \hline
      method 1 & 0.0 \\
      method 2 & 0.1 \\
      method 3 & 0.2 \\ \hline
    \end{tabular}}
  \end{figure}

请帮忙!谢谢

答案1

我建议您将图形放在minipage宽度为的范围内0.5\textwidth

在此处输入图片描述

\documentclass{article}
\usepackage[demo]{graphicx} % omit 'demo' option in real document
\begin{document}
\begin{figure}
\centering
 \begin{minipage}{0.5\textwidth}
     \includegraphics[width=\linewidth]{figure/ch3/result_s2/book.jpg}
 \end{minipage}%
 \hspace{4em}% easier to read than "\qquad\qquad", right?
 \begin{tabular}{cc}
      \hline
      \textbf{Method} & \textbf{$\sigma$} \\ 
      \hline
      method 1 & 0.0 \\
      method 2 & 0.1 \\
      method 3 & 0.2 \\ 
      \hline
 \end{tabular}
\end{figure}
\end{document}

相关内容