Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This question already has an answer here:

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}
share|improve this question
add comment

marked as duplicate by tohecz, T. Verron, lockstep, Martin Schröder, zeroth Feb 13 '13 at 11:40

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers

\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.

share|improve this answer
add comment

center both minipages and do not forget the % between the two.

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{amsmath}
\begin{document}
\noindent
\begin{minipage}{0.5\textwidth}
\includegraphics[width=\linewidth,keepaspectratio=true]{./slike-v/taylor_1.pdf}
\end{minipage}%%% to prevent a space
\begin{minipage}{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}

\end{document}
share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.