latex

LaTeX Item gets pushed down by image in table


I've made a rather complex layout in LaTeX. A Table is positioned next to an image, which is accomplished with a tabular widget:

\documentclass{article}

\usepackage{graphicx} % Required for inserting images
\usepackage[a4paper,top=2cm,bottom=0cm,right=2cm,left=2cm]{geometry}
\usepackage{fourier, heuristica}
\usepackage[x11names,table]{xcolor}

\begin{document}


% timeline (line behind bullet points) command creation
\newcommand{\timeline}{\color{blue}\makebox[0pt]{\Large\textbullet}\hskip-0.5pt\vrule width 1pt\hspace{\labelsep}}

% table  
\begin{table}[ht]
\renewcommand\arraystretch{1.7} % set vertical padding for timeline
    \begin{tabular*}{\textwidth}{l | r |} % tabular to posision timeline and image next to each other
        \hline
        \vspace{0pt}
        \begin{tabular}{@{\,} >{\fontfamily{phv}\selectfont} r  <{\hskip 2pt} !{\timeline} >{\raggedright\arraybackslash\fontfamily{phv}\selectfont} p{0.4\linewidth}} % tabular for timeline with timeline command
            % \addlinespace[1.5ex]
            \hline
            2015 & 1. Platz IMAV Indoor-Competition Aachen, Deutschland \\
            2016 & 1. Platz IMAV Outdoor-Competition, Peking, China. \\
            2017 & 2. Platz IMAV Outdoor-Competition, Toulouse, Frankreich.\\
            2018 & 2. Platz beim Innovationspreis Senkrechtstarter, Friedrichshafen, Deutschland \\
            2022 & IMAV Sonderauszeichnung für das Kartieren des Wettbewerbsgeländes, Delft, Niederlande.\\
            2023 & 2. Platz IMAV Outdoor-Competition, Aachen, Deutschland. \\
            2024 & 2. Platz IMAV Outdoor-Competition, Bristol, England \\
        \end{tabular}
    
        &
        \vspace{0pt}
        \includegraphics[width=0.5\linewidth]{group_photo.JPG} % image
    \end{tabular*}
    
\end{table}

\end{document}

The problem is, that the vertical alignment of the table is influenced by the alignment of the Image. The bigger the image, the more the table gets pushed down. How do i place both items directly next to each other, so that both are on the top edge?

table gets pushed down wh


Solution

  • I would ditch the outer table and use the adjustbox package to change the vertical alignment of the image:

    \documentclass{article}
    
    \usepackage{graphicx} % Required for inserting images
    \usepackage[a4paper,top=2cm,bottom=0cm,right=2cm,left=2cm]{geometry}
    \usepackage{fourier, heuristica}
    \usepackage[x11names,table]{xcolor}
    
    \usepackage[export]{adjustbox}
    
    \begin{document}
    
    
    % timeline (line behind bullet points) command creation
    \newcommand{\timeline}{\color{blue}\makebox[0pt]{\Large\textbullet}\hskip-0.5pt\vrule width 1pt\hspace{\labelsep}}
    
    % table  
    \begin{table}[ht]
            \begin{tabular}[t]{@{\,} >{\fontfamily{phv}\selectfont} r  <{\hskip 2pt} !{\timeline} >{\raggedright\arraybackslash\fontfamily{phv}\selectfont} p{0.4\linewidth}} % tabular for timeline with timeline command
                % \addlinespace[1.5ex]
                \hline
                2015 & 1. Platz IMAV Indoor-Competition Aachen, Deutschland \\
                2016 & 1. Platz IMAV Outdoor-Competition, Peking, China. \\
                2017 & 2. Platz IMAV Outdoor-Competition, Toulouse, Frankreich.\\
                2018 & 2. Platz beim Innovationspreis Senkrechtstarter, Friedrichshafen, Deutschland \\
                2022 & IMAV Sonderauszeichnung für das Kartieren des Wettbewerbsgeländes, Delft, Niederlande.\\
                2023 & 2. Platz IMAV Outdoor-Competition, Aachen, Deutschland. \\
                2024 & 2. Platz IMAV Outdoor-Competition, Bristol, England \\
            \end{tabular}
            \includegraphics[width=0.5\linewidth,valign=T]{example-image-duck}% image
        
    \end{table}
    
    \end{document}
    

    enter image description here