[Tex/LaTex] Positioning equation and figure side by side fails

minipagepositioning

I have been trying to position an equation and a figure side by side for quite some time and an equation allways mooves down for some reason. Here is the code that i use. What am i doing wrong?

\par\smallskip\nointerlineskip
\noindent
\begin{minipage}[t]{0.5\textwidth}
\includegraphics[width=\linewidth,keepaspectratio=true]{./slike-v/taylor_1.pdf}
\end{minipage}
\begin{minipage}[t]{0.5\textwidth}
\scriptsize
\begin{equation}\label{eA1}
\begin{split}
P_0 &= a_0\\
P_1 &= a_0+ a_1x\\
P_2 &= a_0+ a_1x+ a_2x^2 \\
P_3 &= a_0+ a_1x+ a_2x^2+ a_3x^3+\\
&\dots
\end{split}
\end{equation}
\null
\par\xdef\tpd{\the\prevdepth}
\end{minipage}

Best Answer

\begin{minipage}[t]{0.5\textwidth}
\includegraphics[width=\linewidth,keepaspectratio=true]{./slike-v/taylor_1.pdf}
\end{minipage}
\begin{minipage}[t]{0.5\textwidth}

You have two half width minipages with a word space in between. Since a word space can not shrink to zero this can not fit on one line. You need a % here

\begin{minipage}[t]{0.5\textwidth}
\includegraphics[width=\linewidth,keepaspectratio=true]{./slike-v/taylor_1.pdf}
\end{minipage}%%%%%%%%%%%%%%%%
\begin{minipage}[t]{0.5\textwidth}

Compare the setting of

A
B

and

A%
B

minipage has no special layout rules, it is just treated as a big letter by the paragraph breaker.

You may also want to use [c] rather than [t] as otherwise the baseline of the equation will align with the bottom of the image, which may make the image seem too high.

Related Question