1

I have a problem regarding the vertical space between \item and an image. I use the following code and the image doesn't move vertical as it should. Why is that? And how can I fix it?

\documentclass[12pt]{article}

\usepackage{graphicx}

\begin{document}

\begin{enumerate}
\item

\begin{enumerate}
\item

\vspace{0.3cm}

\includegraphics[scale=0.7]{2.2.a.png}

\end{enumerate}

\end{enumerate}

\end{document}

Edit I: Also I had deleted by mistake the \usepackage{graphicx} and it still compiled without error! How is that possible and why?

4
  • ! Undefined control sequence. l.13 \includegraphics Commented Apr 2, 2014 at 19:03
  • Sorry I deleted it by mistake while copying it.
    – Adam
    Commented Apr 2, 2014 at 19:25
  • You can edit the question to fix it, add draft at same time as no one has an image of that name, Commented Apr 2, 2014 at 19:27
  • I edited it. You can change it with a random image in order to compile it.
    – Adam
    Commented Apr 2, 2014 at 19:30

1 Answer 1

3

enter image description here

\documentclass[12pt]{article}

\usepackage{adjustbox}
\begin{document}

\begin{enumerate}
\item

\begin{enumerate}
\item


\adjustbox{valign=t}{\rule{1cm}{2cm}}

\end{enumerate}

\end{enumerate}

\end{document}
5
  • Why doesn't work without any fixes? What's the problem?
    – Adam
    Commented Apr 2, 2014 at 19:51
  • @Adam It does work, it just doesn't give what you want (a) images align on their baselines and you want a top alignment and (b) vspace does nothing there as latex is busy removing space to make nested enumeration labels line up. Commented Apr 2, 2014 at 20:06
  • What do you mean in b?
    – Adam
    Commented Apr 2, 2014 at 20:09
  • @Adam when you nest enumerations latex goes to some lengths to make the 1 the (a) and the text of the actual item to all come on the same line. Commented Apr 2, 2014 at 20:11
  • I am sorry but what does that mean especially when you say that "goes to some lengths". What does it do?? Why \vspace doesn't do anything?
    – Adam
    Commented Apr 2, 2014 at 21:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .