0

I am trying to align two minipages next to each other. The first minipage are informations in a tabular form. The second minipage is a photo. As you can see the photo is not starting on the same height as the first line of the table. How can I fix the position of the second minipage to have the picture align with first line of the table? Hope you can help me

\section{Persönliche Informationen}

\savestack\mytable{
\begingroup
\renewcommand{\arraystretch}{1.0}
\begin{tabular}{rl}
    \textsc{Vor- und Nachname:} & Max Mustermann\\\
    \textsc{Geburtsdatum und -ort:} & 01.01.1995 in Musterstadt\\
    \textsc{Staatsangehörigkeit:} & deutsch\\
    \textsc{Familienstand:} & ledig\\
    \textsc{Adresse:}   & Musterstraße 1\\                  
    \textsc{}   &12345 Musterstadt \\           
    \textsc{Mobil:}     & +49~(123)~4567~8910\\
    \textsc{email:}     & \href{mailto:max\[email protected]}\\
\end{tabular}
\endgroup
}

\begin{minipage}[t][4,8cm]{0.492\textwidth}
  \mytable 
\end{minipage}
\begin{minipage}[c]{0.5\textwidth}
  \begin{flushright}
    \includegraphics[scale = 0.1475]{ba} 
  \end{flushright}
\end{minipage}

enter image description here

1
  • Provide MWE as in executable format, i.e., from \documentclass to \end{document}
    – MadyYuvi
    Commented Nov 18, 2020 at 13:21

1 Answer 1

0

With the help of adjustbox:

enter image description here

\documentclass{article}
\usepackage[margin=2cm]{geometry}
\usepackage[demo]{graphicx} % do not use demo in real document
\usepackage[export]{adjustbox} % provides the valign option
\usepackage{hyperref}

\begin{document}

\section{Persönliche Informationen}

\begin{minipage}[t]{0.7\textwidth} % adjusted width since the table seems to be a lot sider than the image
  \renewcommand{\arraystretch}{1.0}
  \begin{tabular}[t]{rl} % added [t] 
    \textsc{Vor- und Nachname:} & Max Mustermann\\\
    \textsc{Geburtsdatum und -ort:} & 01.01.1995 in Musterstadt\\
    \textsc{Staatsangehörigkeit:} & deutsch\\
    \textsc{Familienstand:} & ledig\\
    \textsc{Adresse:}   & Musterstraße 1\\                  
    \textsc{}   &12345 Musterstadt \\           
    \textsc{Mobil:}     & +49~(123)~4567~8910\\
    \textsc{email:}     & \href{mailto:[email protected]}{max\[email protected]}\\ % corrected the use of \href, second argument was missing
  \end{tabular} 
\end{minipage}% % added a % here to make sure both minipages fit 
\begin{minipage}[t]{0.3\textwidth} % used [t] instead of [c],  adjusted width since the table seems to be a lot sider than the image
  \begin{flushright}
    \includegraphics[scale = 0.1475, valign=t]{ba} % added valign=t  
  \end{flushright}
\end{minipage}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .