3

Need some help floating a graphic. I want the following graphic to float directly to the right of the enumeration below it. The enumeration should flow normally within the text (as if there was no picture there) and the picture's top should be roughly aligned with the top of the enumeration (the alignment is not that important). How do I do that?

EDIT 1 Here's a working MWE

\documentclass[10pt,fleqn,reqno]{article}
\usepackage{graphicx}
\usepackage[inline]{enumitem}
\setlist{topsep=0pt,itemsep=0pt,parsep=1\parsep,label={\textbf{\alph*})}}
\begin{document}

Region $\mathcal{R}$ is pictured below.

\includegraphics[scale=0.2]{sinhandcosh.PNG}

\begin{enumerate}
    \item $x=0$
    \item $x=2$
    \item $x=4$
    \item $x=-2$
\end{enumerate}

\end{document}

Here's a link to the picture (but I don't know how to load an attachment on here).

enter image description here

EDIT 2 Trying minipages (per suggestion in comments). It compiles, but puts the minipages vertically. Here's the minipages MWE:

\documentclass[10pt,fleqn,reqno]{article}
\usepackage{graphicx}
\usepackage[inline]{enumitem}
\setlist{topsep=0pt,itemsep=0pt,parsep=1\parsep,label={\textbf{\alph*})}}
\begin{document}

Region $\mathcal{R}$ is pictured below.

\begin{minipage}[t]{0.4\linewidth}
    \begin{enumerate}
            \item $x=0$
            \item $x=2$
            \item $x=4$
            \item $x=-2$
    \end{enumerate}
\end{minipage}
\begin{minipage}[t]{0.5\linewidth}
    \includegraphics[scale=0.2]{sinhandcosh.PNG}
\end{minipage}
\end{document}
  • 3
    It would be helpful if you composed a fully compilable minimal working example (MWE) including \documentclass and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem. – samcarter is at topanswers.xyz Feb 3 '19 at 20:48
  • 3
    Just a guess because I cannot test without a MWE, but I would probably place the enumeration and the image in two minipages besides each other. – samcarter is at topanswers.xyz Feb 3 '19 at 20:49
  • 2
    There are tons of Q & A that show you how you can achieve such things. However, as pointed out by @samcarter, it is next-to-impossible to help you concretely as we do not know what document class you are using, nor do many users know what \adjincludegraphics, and we do not have your graphics file. – user121799 Feb 3 '19 at 20:51
  • 1
    @Jeff We don't need your complete document, just a compilable document that reproduces your problem. – samcarter is at topanswers.xyz Feb 3 '19 at 21:12
  • 1
    So you want something like this? tex.stackexchange.com/questions/332843/figure-next-to-a-list – Torbjørn T. Feb 3 '19 at 21:19
3

with two minipages beside each other:

\documentclass[10pt,fleqn,reqno]{article}
\usepackage{graphicx}
\usepackage[inline]{enumitem}
\setlist{topsep=0pt,itemsep=0pt,
  parsep=1\parsep,
    label={\textbf{\alph*})}}
\begin{document}

Region $\mathcal{R}$ is pictured below.

\bigskip

\noindent%
\begin{minipage}[t]{.5\textwidth}%
\begin{enumerate}
    \item $x=0$
    \item $x=2$
    \item $x=4$
    \item $x=-2$
\end{enumerate}
\end{minipage}%
\begin{minipage}[t]{.5\textwidth}
\raisebox{\dimexpr-\height+\baselineskip}{\includegraphics[scale=0.2]{DdkiH}}
\end{minipage}%

\end{document}

enter image description here

  • 2
    Small tip: \height refers to the height of the box in \raisebox, so one could do something like \raisebox{\dimexpr-\height+10pt}{...}. – Torbjørn T. Feb 3 '19 at 21:42
  • 2
    @TorbjørnT. Thanks for the suggestion! I'm missing beamers columns environment where I could simply use T to top align the image :) – samcarter is at topanswers.xyz Feb 3 '19 at 21:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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