1

I am having trouble with reducing the horizontal lines in following table. I'm using a custom layout that was given to me and it looks like it reduces the standard page width. The horizontal lines I have added to my table are too long as a result. I've seen various answers here using \begin{tabular*}{@{} .... @{}} for example, but none work for me and I feel there should be a simpler way.

I have attached my code and a screenshot and would be very grateful for help.

P.S If someone knows how to reduce the horizontal space between two word clouds in the same row, please also let me know. Thanks

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

enter image description here

  • 3
    The rules are as wide as the cells; but beware that 0.10+0.45+0.45 adds to more than 1, because of intercolumn spaces. – egreg Oct 5 '17 at 10:56
  • Ah, cheers! That may be the error. How can I determine how large intercolumn space is? – mexmex Oct 5 '17 at 10:59
  • \begin{tabular}{m{0.1\textwidth}m{0.4\textwidth}m{0.4\textwidth}} This worked alright. – mexmex Oct 5 '17 at 11:03
  • Use tabular*, as I show in my edited answer – egreg Oct 5 '17 at 11:04
  • you must surely have got error messages from \ \ \multicolumn{ ? multicolumn has to be the first entry in its cell, – David Carlisle Oct 5 '17 at 21:52
6

You shouldn't use the m type just for vertically centering the images.

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

enter image description here

You get a table as wide as the text block with 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}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.