1

To see my issue, you will need an image at this path: ../images/a_random_image, presumably in a jpg or png format.

My issue is visible on page two of the resulting file generated by running pdflatex mwe.tex and can be described as:

(1) the wrapfig package is failing to play well with the multicol package, leading to my copy overwriting the image; and of more concern,

(2) the first several words of the copy intended to follow the image are wrapping to the right of the image, but are over-writing other copy placed in that space by the multicol package.

I'd really like to see the image at least this large, but am willing to sacrifice that and shrink it to the width of a single column IF I can resolve that second issue. But I'd love to sort out both issues, actually.

This is my mwe.tex file:

\documentclass[12pt]{report}

\usepackage[width=4.375in, height=7.0in, top=1.0in, papersize={5.5in,8.5in}]{geometry} \usepackage[toc]{} \usepackage{titlesec} \usepackage{multicol} \usepackage{wrapfig} \usepackage{graphicx} \usepackage{lipsum}

\begin{document}

\begin{multicols}{2} \lipsum[5-8] \end{multicols}

\begin{wrapfigure}{L}{0.70\textwidth} \includegraphics[width=.65\textwidth]{example-image} \caption{This is a roughly seven word caption.} \end{wrapfigure}

\begin{multicols}{2} \columnbreak \lipsum[1-4] \end{multicols}

\end{document}

enter image description here

Any guidance on how to resolve at least the second issue, but hopefully both of them would be appreciated!

Thanks, -- Hugh Esco

David Carlisle
  • 757,742
Hugh Esco
  • 43
  • 4
  • you could make a usable test file by using \includegraphics[width=.65\textwidth, height=whatever height you need to show the issue]{example-image} – David Carlisle Dec 07 '21 at 22:17
  • It is hard to guess your intent having multicols after a wrapfigure, the wrapfigure would need to be inside the multicols to do anything useful – David Carlisle Dec 07 '21 at 22:18
  • I edited your example as suggested above. if that is not the effect that you wanted to show then please adjust further and change the screenshot. – David Carlisle Dec 07 '21 at 22:24
  • 1
    Your image is 70% of the page width is your intention that it takes up all of the left column, and cuts in to half the right column with the text taking up the remaining half of the right column? That's possible but tricky and why not simply make the image full width and not use wrapfig at all? – David Carlisle Dec 07 '21 at 22:25
  • 1
    Originally I had intended to have the image span both columns, and to then resume the two-column layout. But that intention is getting balanced against a desire to not have this content run over to the next page.

    I have tried moving the wrapfig inside the multicol scope, it did not change the outcome.

    – Hugh Esco Dec 07 '21 at 22:33
  • but it is really hard to guess what output you want (the wrapfig in the example can not possibly have text wrapped round it as that is in a full width multicol) it clearly needs to be inside the multicol if you want the text that is inside multicol to wrap around the image. – David Carlisle Dec 07 '21 at 22:43
  • You could do it with flowfram, but you would have to manually break the paragraphs where the column width changes. You also need to decide what order the text will fill the frames. – John Kormylo Dec 08 '21 at 18:58
  • See also https://tex.stackexchange.com/questions/512455/two-column-with-a-text-box-in-the-center-wrapping-on-both-sides – John Kormylo Dec 08 '21 at 19:05

1 Answers1

3

I would not use wrapfig at all here

enter image description here

\documentclass[12pt]{report}

\usepackage[width=4.375in, height=7.0in, top=1.0in, papersize={5.5in,8.5in}]{geometry} \usepackage[toc]{} \usepackage{titlesec} \usepackage{multicol} \usepackage{wrapfig} \usepackage{graphicx} \usepackage{lipsum}

\begin{document}

\begin{multicols}{2} \lipsum[5-8] \end{multicols}

\begin{figure}[htp] \centering \includegraphics[width=.65\textwidth]{example-image} \caption{This is a roughly seven word caption.} \end{figure}

\begin{multicols}{2} \columnbreak \lipsum[1-4] \end{multicols}

\end{document}


If you really want wrapfig, you can force the layout:

enter image description here

\documentclass[12pt]{report}

\usepackage[width=4.375in, height=7.0in, top=1.0in, papersize={5.5in,8.5in}]{geometry} \usepackage[toc]{} \usepackage{titlesec} \usepackage{multicol} \usepackage{wrapfig} \usepackage{graphicx} \usepackage{lipsum}

\begin{document}

\begin{multicols}{2} \lipsum[5-8] \end{multicols}

\begin{multicols}{2} \vspace*{14\baselineskip} enough text enough text enough text enough text enough text enough text enough text enough text enough text enough text enough text enough text enough text enough text enough text enough text enough text enough text

\columnbreak \begin{wrapfigure}{l}[.5\textwidth]{.7\textwidth} \centering \includegraphics[width=.65\textwidth]{example-image} \caption{This is a roughly seven word caption.} \end{wrapfigure}

\lipsum[2-4] \end{multicols}

\end{document}

David Carlisle
  • 757,742
  • David Carisle: I copied your wrapfig code as a local .tex file and ran pdflatex against it, but these are the results I got:

    https://drive.google.com/file/d/1FUADb2DqtSYZLEL053aw41rWEvHobZLV/view?usp=sharing

    Not nearly so nice as yours. Any thoughts on what may be different from my own environment and yours?

    – Hugh Esco Dec 07 '21 at 23:18
  • your g drive link is not public @HughEsco – David Carlisle Dec 07 '21 at 23:27
  • Sorry about that. Please try again with this link: https://drive.google.com/file/d/1FUADb2DqtSYZLEL053aw41rWEvHobZLV/view?usp=sharing – Hugh Esco Dec 08 '21 at 01:18
  • @HughEsco that is not the document that I posted here, you have used an image of a different size so naturally you need to adjust the space and text before the column break. As I commented originally under your question any answer would be highly dependent on the image size, you could have provided an example-image test document forcing the right size for your case with height and width keys however presumably your real text isn't lipsum either and so the exact adjustment requred to make the gap in the left column fall in the right place will always need adjustment – David Carlisle Dec 08 '21 at 08:03