0

I've tried for hours to find a solution for this fairly simple layout. The closest I've got is:

\begin{minipage}{.25\textwidth}
    \includegraphics[width=\textwidth]{res/server.jpg}
\end{minipage}
\begin{minipage}{.75\textwidth}
    \begin{flushright}
        asdasd\\
        asdasdasdasdasddsa
    \end{flushright}
\end{minipage}

.. which produces something like: example

How to move the text up to the top line?

I've seen many solutions with tables and boxes. Is there a simple way to do it with minipage?

With [t] alignment of the minipage

\begin{minipage}[t]{.25\textwidth}
    \includegraphics[width=\textwidth]{res/server.jpg}
\end{minipage}
\begin{minipage}[t]{.75\textwidth}
    \begin{flushright}
        some text\\
        some more text
    \end{flushright}
\end{minipage}

more

With \vspace{0pt}

\begin{minipage}[t]{.25\textwidth}
    \vspace{0pt}
    \includegraphics[width=\textwidth]{res/server.jpg}
\end{minipage}
\begin{minipage}[t]{.75\textwidth}
    \vspace{0pt}
    \begin{flushright}
        some text\\
        some more text
    \end{flushright}
\end{minipage}

another

9
  • More specifically the comment below the first answer: tex.stackexchange.com/questions/81955/… – Marijn Feb 12 '20 at 11:48
  • I also don't get the desired result with [t] or fbox. I've seen this question when I did my research. I can add a negative vspace to get it working, but it's an ugly solution :( – Robin Feb 12 '20 at 11:53
  • 1
    Did you include \vspace{0pt}? For me \begin{minipage}[t]{.25\textwidth} \vspace{0pt} \includegraphics[width=\textwidth]{res/server.jpg} \end{minipage} \begin{minipage}[t]{.75\textwidth} \vspace{0pt} \begin{flushright} asdasd\\ asdasdasdasdasddsa \end{flushright} \end{minipage} works correctly. – Marijn Feb 12 '20 at 12:01
  • Admittedly this is still a bit hacky, but you don't have to find the correct amount of negative vspace with trial and error, you just have to trick the minipages by providing equally high contents to align to. – Marijn Feb 12 '20 at 12:06
  • @Marijn Thank you for answering. Unfortunately also with \vspace{0pt} something odd happens. – Robin Feb 12 '20 at 12:11