我在减少下表中的水平线时遇到了麻烦。我使用的是别人给我的自定义布局,它似乎减少了标准页面宽度。结果,我添加到表格中的水平线太长了。我在这里看到了各种使用 \begin{tabular*}{@{} .... @{}}
例如的答案,但没有一个对我有用,我觉得应该有一种更简单的方法。
我已附上我的代码和截图,并非常感谢您的帮助。
PS 如果有人知道如何减少同一行中两个词云之间的水平间距,也请告诉我。谢谢
\begin{figure}
\begin{tabular}{m{0.10\textwidth}m{0.45\textwidth}m{0.45\textwidth}}
\centering
\textbf{Aspect} & \ \ \multicolumn{1}{c}{\textbf{Negative Reviews}} & \ \ \multicolumn{1}{c}{\textbf{Positive Reviews}} \\
\toprule
Look & {\includegraphics[scale=0.2]{figures/wordle/look_bad_crop}} & {\includegraphics[scale=0.21]{figures/wordle/look_good_crop}} \\
\midrule
Smell & {\includegraphics[scale=0.2]{figures/wordle/smell_bad_crop}} & {\includegraphics[scale=0.2]{figures/wordle/smell_good_crop}} \\
\midrule
Feel & {\includegraphics[scale=0.2]{figures/wordle/feel_bad_crop}} & {\includegraphics[scale=0.2]{figures/wordle/feel_good_crop}} \\
\end{tabular}
\caption{Word-cloud visualisation for each of the three aspect. MAP subsets were extracted for each review from the training, validation and test set. Word size reflects frequency in these MAP sets.}
\label{fig:wordle}
\end{figure}
答案1
您不应该m
仅使用该类型来使图像垂直居中。
\documentclass{article}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage{booktabs}
\begin{document}
\begin{table}
\centering
\begin{tabular}{@{} l c c @{}}
\textbf{Aspect} & \textbf{Negative Reviews} & \textbf{Positive Reviews} \\
\midrule
Look
& \includegraphics[width=0.3\textwidth,valign=c]{example-image-a}
& \includegraphics[width=0.3\textwidth,valign=c]{example-image-b}
\\
\midrule
Smell
& \includegraphics[width=0.3\textwidth,valign=c]{example-image-a}
& \includegraphics[width=0.3\textwidth,valign=c]{example-image-b}
\\
Feel
& \includegraphics[width=0.3\textwidth,valign=c]{example-image-a}
& \includegraphics[width=0.3\textwidth,valign=c]{example-image-b}
\\
\bottomrule
\end{tabular}
\end{table}
\end{document}
使用以下命令可获得与文本块一样宽的表格tabular*
:
\documentclass{article}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage{booktabs}
\begin{document}
\begin{table}
\centering
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} l c c @{}}
\textbf{Aspect} & \textbf{Negative Reviews} & \textbf{Positive Reviews} \\
\midrule
Look
& \includegraphics[width=0.3\textwidth,valign=c]{example-image-a}
& \includegraphics[width=0.3\textwidth,valign=c]{example-image-b}
\\
\midrule
Smell
& \includegraphics[width=0.3\textwidth,valign=c]{example-image-a}
& \includegraphics[width=0.3\textwidth,valign=c]{example-image-b}
\\
Feel
& \includegraphics[width=0.3\textwidth,valign=c]{example-image-a}
& \includegraphics[width=0.3\textwidth,valign=c]{example-image-b}
\\
\bottomrule
\end{tabular*}
\end{table}
\end{document}