I want to create some text, which will be positioned on the left-hand side of an image. My Latex code is:
\begin{minipage}{.6\linewidth}
\lipsum[1]
\end{minipage}
\hspace{0.02\linewidth}
\begin{minipage}{.3\linewidth}
\includegraphics[width=\linewidth]{test.png}
\end{minipage}
This gives me the following output:
However, I want the top of the text to be aligned with the top of the picture. Therefore, I tried using the [t]
argument with the minipage:
\begin{minipage}[t]{.6\linewidth}
\lipsum[1]
\end{minipage}
\hspace{0.02\linewidth}
\begin{minipage}[t]{.3\linewidth}
\includegraphics[width=\linewidth]{test.png}
\end{minipage}
However, this gave the following output:
What do I need to do to get my desired vertical alignment?
Best Answer
The reason is that the
[t]
means align theminipage
with the first (top) baseline. The baseline for the image is under the image, which is perfectly aligned with the first baseline of the text. I see two ways to fix it.Add a row before and remove the vertical space.
Lower the image with all but one row.
Both gives: