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.

As demonstrated by the following MWE, I've placed a simple image in the margin of a document. What appears to happen is the caption text is vertically aligned with the line that I type the \marginpar command on, and the image sits above it. Is there any way I can make the top of the image be in line with the line of text in the body where I include the \marginpar command? I need to be able to do this to accurately have an idea where images are going to appear when I typeset a textbook I'm making.

Thanks

Please don't mind the incredibly not straight line I tried to draw to emphasize my point.

enter image description here

\documentclass{report}
\usepackage{caption}
\usepackage{graphicx}

\begin{document}
  \chapter{test}
  This is a test.\marginpar{
    \includegraphics[width=\marginparwidth]{resources/Georg_Cantor2.jpg}
    \captionof{figure}{Georg Cantor (1845-1918) was a German mathematician, best known as the inventor of set theory, which has become a fundamental theory in mathematics.}}
\end{document}
share|improve this question
    
+1 for the "incredibly not straight line" ;-) –  Benedikt Bauer Feb 22 '13 at 21:07
    
Just check : Putting text at the side of a tikzpicture. Just add :\vskip0pt like this... \marginpar{ \vskip0pt ... –  La Raison Feb 22 '13 at 21:32

1 Answer 1

\marginpar{\vskip0pt\includegraphics...}

This worked very well. Probably not the optimal solution, but it does the job for the time being. Thanks very much La Raison.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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