0

I am trying to build the table of two columns. The first one contains an image and the second one pretty long description. Moreover, the size of the table exceeds one page, therefore my idea was to use longtable package. Here is my code:

\begin{longtable}{|c|c|} \hline
\raisebox{-.5\height}{\includegraphics[width=6cm]{Thesis/figures/ALICE.jpg}} & \parbox[t]{10cm}{\centering \textbf{ALICE} is designed to study heavy-ions collisions. It is mostly focusing on study of the quark-gluon plasma. \strut}  \\\hline   \raisebox{-.5\height}{\includegraphics[width=6cm]{Thesis/figures/Alpha.jpg}} & \parbox[t]{10cm}{ \textbf{ALPHA} is working on trapped antihidrogen atoms. The precise measurement of hydrogen and antihydrogen may allows to understand the fundamental symmetries between matter and antimatter. \strut}  \\\hline
\raisebox{-.5\height}{\includegraphics[width=6cm]{Thesis/figures/AMS.jpeg}} & \parbox[t]{10cm}{ \textbf{AMS} is a particle detector that looks for dark matter, antimatter and missing matter. It is attached to the International Space Station. \strut}  \\\hline

\end{longtable}

And here is the result: enter image description here

How can I improve the layout of my table?

  • Whatever you are using to achieve the double spacing effect, can you turn it off, at least for captions? If your thesis is required to be double spaced, ask them why? – John Kormylo Aug 8 '18 at 1:08
1

do you like to have white space around image?

enter image description here

with help of the package adjustwidth you can move baseline of image on its center and also add vertical space above and below of image. for shorter code is used keys Gin which use Skillmon's hack given in this answer:

\documentclass{article}
\usepackage{geometry}
\usepackage{ragged2e}
\usepackage{array, longtable}

\usepackage[export]{adjustbox}
\usepackage{etoolbox}

\begin{document}
\begingroup
    \expandafter\patchcmd\csname Gin@ii\endcsname   % needed etoolbox
      {\setkeys {Gin}{#1}}
      {\setkeys {Gin}
          {width=\linewidth,                     % standard graphicx settings
           valign=c, margin=-3pt 6pt 0pt 6pt,#1}     % settings from adjustbox
      }
      {}{}
\begin{longtable}{|p{\dimexpr0.4\linewidth-2\tabcolsep-1.33\arrayrulewidth}|
                   m{\dimexpr0.6\linewidth-2\tabcolsep-1.33\arrayrulewidth}|
                }
    \hline
\includegraphics{example-image-duck}
    & \textbf{ALICE} is designed to study heavy-ions collisions. It is mostly focusing on study of the quark-gluon plasma.            \\
    \hline
\includegraphics{example-image-duck}
    & \textbf{ALPHA} is working on trapped antihidrogen atoms. The precise measurement of hydrogen and antihydrogen may allows to understand the fundamental symmetries between matter and antimatter.                      \\
    \hline
\includegraphics{example-image-duck}
    & \textbf{AMS} is a particle detector that looks for dark matter, antimatter and missing matter. It is attached to the International Space Station   \\
    \hline
\end{longtable}
\endgroup
\end{document}
0

This solution is implemented as a paragraph of \fboxes. \lineskip is used to overlap the edges of the boxes.

\documentclass[]{report}
\usepackage{graphicx}

\begin{document}
\noindent{\fboxsep=0pt 
\lineskip=-\fboxrule
\fbox{\raisebox{-.5\height}{\includegraphics[width=6cm]{example-image-a}}\vrule
  \hspace{\tabcolsep}\parbox{6cm}{\textbf{ALICE} is designed to study heavy-ions collisions. 
    It is mostly focusing on study of the quark-gluon plasma.}\hspace{\tabcolsep}}
\fbox{\raisebox{-.5\height}{\includegraphics[width=6cm]{example-image-b}}\vrule
  \hspace{\tabcolsep}\parbox{6cm}{\textbf{ALPHA} is working on trapped antihidrogen atoms. 
    The precise measurement of hydrogen and antihydrogen may allows to understand the fundamental 
    symmetries between matter and antimatter.}\hspace{\tabcolsep}}
\fbox{\raisebox{-.5\height}{\includegraphics[width=6cm]{example-image-c}}\vrule
  \hspace{\tabcolsep}\parbox{6cm}{\textbf{AMS} is a particle detector that looks for dark matter, 
    antimatter and missing matter. It is attached to the International Space Station.}\hspace{\tabcolsep}}
\par}% needed to use current lineskip
\end{document}

demo

  • Thank you. Any idea how can I split this table into two columns? – user1877600 Aug 8 '18 at 10:37
  • I'm not sure what you mean. It was originally a two column tabular. If you wanted a gap in between, you can add that with @{\hspace{\columnsep}}. At 12cm+ it is already too wide for one column. – John Kormylo Aug 8 '18 at 14:04

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.