0

I try to place pictures within the columns of a mulicol environment. The look should be register-true (even if there is no support for that in latex), i.e. all lines should be at same height across the columns. When I place pictures with includegraphics, sometimes it messes up the position of the lines after the picture. The pictures have unfortunately different sizes and I do adjust them to fit the column width.

Before and after the picture there should be some space. I try with vfill, vspace, etc. but I can't figure out what causes latex to change or not change the positions of the line. All I want is that the position of the lines after the includegraphics is same as all other columns.

MWE:

\documentclass[9pt,twoside]{extreport}
\usepackage{etex}
\usepackage[papersize={32cm,47cm }]{geometry}
% \usepackage{graphicx}
\usepackage{lipsum}
\usepackage[demo]{graphicx}

%\usepackage{color}
\usepackage{microtype}
\usepackage{multicol}

\usepackage{multicol}
\newlength{\mybottom}
\setlength{\mybottom}{60pt}
\newlength{\myleft}
\setlength{\myleft}{50pt}

\parskip=0pt 
\parindent=12pt

\geometry{
top=80pt,
bottom=\mybottom,
left=\myleft,
right=30pt
}

\newcommand{\floatpic}[1]{
\noindent\rule{\linewidth}{#1}
}

\begin{document}
\begin{multicols}{5}

\lipsum
\lipsum

\floatpic{2.1cm}

\lipsum
\floatpic{4.3cm}
\lipsum
\floatpic{4.3cm}

\lipsum
\lipsum

\end{multicols}
\newpage


\end{document}
  • 2
    can you add a simple full working code? – Pattisahusiwa Dec 09 '14 at 09:25
  • Please make your example a minimal example that demonstrates the problem. First replace the image (which we don't have) by \rule{3cm}{2cm} or whatever size is needed to show the problem, then remove every package that you can remove while still showing the problem the above loads graphicx three times, it loads but doesn't use tikz and has several dozen other unused packages. – David Carlisle Dec 09 '14 at 14:27
  • Sorry for the mess. The substitution for includegraphics makes it a lot easier. Here a MWE. nb: the first columns are fine (register-true), then the problem starts. – Thierry Blanc Dec 10 '14 at 10:45

1 Answers1

1

A combination of \par and \medskip (or the combining command \medskip) will give you, what you want. You can define an environment for that as shown in this nice answer.

% arara: pdflatex

\documentclass{article}
\usepackage{blindtext} % for dummy text
\usepackage{multicol}
\usepackage{microtype} % for nice typesetting in narrow columns
\usepackage[demo]{graphicx}
\usepackage{caption} % for \captionof

\begin{document}
    \begin{multicols}{3}
        \blindtext
        %
        \medbreak\noindent\minipage{\columnwidth}
            %\centering % if smaller than \columnwidth
            \includegraphics[width=\columnwidth]{abc}
            %\captionof{figure}{some caption} % optional
        \endminipage\medbreak % might require \bigbreak if caption is too short
        %
        \blindtext
    \end{multicols}
\end{document}

enter image description here

LaRiFaRi
  • 43,807