1

In my document i have a picture in a multicols env.

The problem is that Latex put the multicols in the bottom of the page and the picture is going under the footer. Latex should create a new page. Can you help me ?

thank you

Here is a demo code

Edit MWE

\documentclass[a4paper]{article}
\usepackage{geometry}
\usepackage{multicol}
\usepackage{graphicx}
\usepackage{lipsum}

\geometry{a4paper, portrait, left=2cm, top=1cm, right=2cm, bottom=2cm}

\begin{document}
\section{Etape : 1}
\lipsum[1-5]

\section{Etape : 2}
\begin{multicols}{2}
     \includegraphics[width=10cm]{example-image}

\vfill
\columnbreak
text text text 
\end{multicols}

\section{Etape : 3}
\begin{multicols}{2}
     \includegraphics[width=10cm]{example-image}

\vfill
\columnbreak
text text text 
\end{multicols}
\end{document}

Original MWE

\documentclass[a4paper]{article}
\usepackage[document]{ragged2e}
\usepackage{geometry}
\usepackage{multicol}
\usepackage{graphicx}
\usepackage{lipsum}

\geometry{a4paper, portrait, left=2cm, top=1cm, right=2cm, bottom=2cm}

\begin{document}
\section{Etape : 1}
{\lipsum[1-5]}

\section{Etape : 2}

\begin{multicols}{2}
    \includegraphics[width=4cm]{example-image}

\vfill
\columnbreak
text text text 
\end{multicols}

\section{Etape : 3}
\begin{multicols}{2}
     \includegraphics[width=4cm]{example-image}

\vfill
\columnbreak
text text text 
\end{multicols}
\end{document}

enter image description here

3
  • when i compile your code it is fine (no problem) may be because i don't have the images you use. If all what you need is to start new page before multicol you can use \newpage.
    – touhami
    Commented Feb 26, 2016 at 17:37
  • I edit your post (sorry if this not what you mean)
    – touhami
    Commented Feb 26, 2016 at 17:45
  • Hello, thanks for your help, i have added a screenshot with my contents. The problem is that the picture on the 1st column doesn't care about the footer. Thanks
    – PeterRoger
    Commented Feb 26, 2016 at 21:28

1 Answer 1

1

Here is a solution. the multicols environment has two optional arguments

\begin{multicols}{columns}[text in full width][vertical space at least]

\documentclass[a4paper]{article}
\usepackage{geometry}
\usepackage{multicol}
\usepackage{graphicx}
\usepackage{lipsum}

\geometry{a4paper, portrait, left=2cm, top=1cm, right=2cm, bottom=2cm}

\newsavebox\mt

\begin{document}
\section{Etape : 1}
\lipsum[1-5]


\sbox\mt{\parbox{\textwidth}{\section{Etape : 2}\includegraphics[width=10cm]{example-image}}}
\begin{multicols}{2}[\section{Etape : 2}][\ht\mt]
\includegraphics[width=10cm]{example-image}
\vfill
\columnbreak
text text text 
\end{multicols}


\sbox\mt{\parbox{\textwidth}{\section{Etape : 3}\includegraphics[width=10cm]{example-image}}}
\begin{multicols}{2}[\section{Etape : 3}][\ht\mt]
\includegraphics[width=10cm]{example-image}
\vfill
\columnbreak
text text text 
\end{multicols}
\end{document}
6
  • Hello, thank you, it's almost working, just seems that it doesn't take in account the height of the section title. So i still can have some problems. Maybe it is possible to add the height of the section title in the \ht\mt ? but how ? thank you
    – PeterRoger
    Commented Feb 27, 2016 at 7:50
  • @PeterRoger i will update my answer.
    – touhami
    Commented Feb 27, 2016 at 7:54
  • @PeterRoger done
    – touhami
    Commented Feb 27, 2016 at 8:01
  • Thanks, but it adds two times the Section name and the Section in the mt sbox move the picture on the right. I tried to remove the Section name declared on the multicols arguments, but the one on the mt box still move the picture
    – PeterRoger
    Commented Feb 27, 2016 at 8:20
  • I can't see what you mean. Did you compile my code as it is? here the save box is used only for measuring, section and image to be used explicitly inside multicols.
    – touhami
    Commented Feb 27, 2016 at 8:25

You must log in to answer this question.

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