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}
3
  • 2
    can you add a simple full working code? Dec 9, 2014 at 9: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. Dec 9, 2014 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. Dec 10, 2014 at 10:45

1 Answer 1

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

12
  • How about using medbreak?
    – Johannes_B
    Dec 9, 2014 at 9:49
  • @Johannes_B Thank you, never heard about that.
    – LaRiFaRi
    Dec 9, 2014 at 9:58
  • Does not give needed results. tried with medbreak, bigbreak, with and without par before, tried nofloat package but same problem. Dec 9, 2014 at 10:48
  • full pdf here link. source so messy that I am embarrassed to show it ... Dec 9, 2014 at 11:20
  • We do not need external (unsafe) links to pdfs but an MWE. Please adapt your question. I am guessing around, if I do not know what you are doing.
    – LaRiFaRi
    Dec 9, 2014 at 11:23

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.