表格與圖(包括圖的標題)並排。

表格與圖(包括圖的標題)並排。

我想創建一個並排放置圖像的表格。我遇到的問題是表格的對齊方式。任何人都可以修復程式碼以使 Lambda_1 和 Lambda_2 相應地成為每個圖的標題嗎?如果我不包含旁邊的 &1.~Real unequal eigenvalues of same sign &
那麼表格的左邊框將不會連接到標題邊框。我知道問題出在\begin{tabularx}{\textwidth}{|XX|}.有人可以幫助我指導更改程式碼以實現更好的對齊嗎?我想將圖的列更改為 1,並並排包含圖表而不是 2 列。
我堅持使用 tabularx 是因為我不希望表格移到文件的邊緣。

\begin{table} [H]
\begin{tabularx}{\textwidth}{|XX|}
\hline
    \multicolumn{2}{|c|}{Collection of Figures of 2D Phase Portraits} \\ \hline 
    1.~Real unequal eigenvalues of same sign & \\ 
        \includegraphics[height=1.8in]{2D/rup.png}        $\lambda_1 > \lambda_2 > 0$ & \includegraphics[height=1.8in]{2D/run.png}$\lambda_1 > \lambda_2 < 0$  \\ 
\hline
\end{tabularx}
\end{table} 

在此輸入影像描述

答案1

實際上沒有必要tabularx只為一列;tabular可以用一個簡單的代替。我使用了subfigure來自的環境subcaption和功能booktabs(沒有表格的垂直規則):

\documentclass[11pt]{article} 
\usepackage[demo]{graphicx} 
\usepackage{subcaption}
\usepackage{booktabs}

\begin{document} 

\begin{table}[H]
\begin{tabular}{l}
\toprule
\multicolumn{1}{c}{Collection of Figures of 2D Phase Portraits} \\ 
\midrule 
1.~Real unequal eigenvalues of same sign  \\ 
\begin{subfigure}{\dimexpr.5\linewidth-2\fboxsep\relax}
  \centering
  \includegraphics[height=1.8in]{2D/rup.png}
  \caption{$\lambda_1 > \lambda_2 > 0$}
\end{subfigure}\hfill%  
\begin{subfigure}{\dimexpr.5\linewidth-2\fboxsep\relax}
  \centering
  \includegraphics[height=1.8in]{2D/run.png}
  \caption{$\lambda_1 > \lambda_2 < 0$}
\end{subfigure} \\
\bottomrule
\end{tabular}
\end{table} 

\end{document}

在此輸入影像描述

如果標題不需要編號以進行交叉引用,則可以簡單地使用小型頁面:

\documentclass[11pt]{article} 
\usepackage[demo]{graphicx} 
\usepackage{booktabs}

\begin{document} 

\begin{table}[H]
\begin{tabular}{l}
\toprule
\multicolumn{1}{c}{Collection of Figures of 2D Phase Portraits} \\ 
\midrule 
1.~Real unequal eigenvalues of same sign  \\ 
\begin{minipage}{\dimexpr.5\linewidth-2\fboxsep\relax}
  \centering
  \includegraphics[height=1.8in]{2D/rup.png}\par
  $\lambda_1 > \lambda_2 > 0$
\end{minipage}%  
\begin{minipage}{\dimexpr.5\linewidth-2\fboxsep\relax}
  \centering
  \includegraphics[height=1.8in]{2D/run.png}\par
  $\lambda_1 > \lambda_2 < 0$
\end{minipage} \\
\bottomrule
\end{tabular}
\end{table} 

\end{document}

在此輸入影像描述

demo選項graphicx簡單地將實際圖形替換為黑色矩形;做不是在您的實際文件中使用該選項。

相關內容