3

I've been trying everything, but I'm lost right now, is there any way to really align image to the top of the column after a column break.

Here's an example code :

\documentclass{article}
\usepackage[demo]{graphics}
\usepackage{multicol}
\usepackage{lipsum}

\begin{document}

\begin{multicols}{2}
\noindent 
\lipsum[2]

\columnbreak

\noindent
\includegraphics{test}
\lipsum[2]

\end{multicols}
\end{document}

And here's the result I get :

result

Is there anyway to get a better layout (image aligned with top of first column?)

  • Welcome to TeX SE! What do you count as the top of the first column exactly? – cfr May 12 '15 at 2:14
  • You got it right... :-) – Arklost May 12 '15 at 7:49
  • Actually, Harish Kumar got it right... ;). – cfr May 12 '15 at 12:47
2

If you add

\fbox{This is the top line of text and I want it to go on a bit.}

at the start of the first column, you can see that the image is perfectly aligned:

aligned columns

So some adjustments are needed to make things 'look right':

\documentclass{article}
\usepackage[export]{adjustbox}
\usepackage{multicol}
\usepackage{lipsum}

\begin{document}
\hrule

\vspace{-1.2\baselineskip}
\begin{multicols}{2}
\noindent
\lipsum[2]
\columnbreak

\noindent
\includegraphics[width=\linewidth,valign=t,raise=-0.5\dp\strutbox]{example-image}
\lipsum[2]

\end{multicols}
\end{document}

enter image description here

  • May I add something to your answer? You can delete it if you object, of course. – cfr May 12 '15 at 2:30
  • @cfr Please feel free. You are welcome and thanks. :-) – user11232 May 12 '15 at 2:35
  • I shouldn't really have asked and then done it before waiting for a response, should I? Thanks for your understanding ;). [I don't mean: the mistake was in the asking.] – cfr May 12 '15 at 2:37
  • @cfr Not at all. You don't even have to ask anything but edit straight away. It is OK with me. – user11232 May 12 '15 at 2:39
  • By the way, is there in any way to make this work in a figure environnement ? so that the image is referenced – Arklost May 12 '15 at 7:47

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.