To give some context, I am working with a fairly big document, that contains some concatenated outputs from chained curl requests to a forum-like webpage, formatted afterwards with a bunch of regular expressions (it is as bad as it sounds). Thing is, the amount of text is so big that going through all paragraphs and modifying them one by one seems like a never-ending task.

With that in mind, the appearance of my output would be something like:

    \caption*{a caption}

This is some text.\par

    \caption*{another caption}

This is another text.\par
And this time there are two paragraphs!\par

That, times infinity.

So, the idea is that the first paragraph for each "block" appears aligned to the picture, that is, both start at the same line. This happens whenever the text is big enough to go over the figure height, but not when it is the other way around (text starts when the previous one ended, but picture needs to go down to avoid clashing with the previous one, so you got something like:

=======|  This is some text.
First  |
Picture|  This is another text.                   <==== This should not go here
          And this time there are two paragraphs!
=======|                                          <==== It should appear here
Second |

Is there a way to achieve this without adding line breaks manually for each of the blocks?

Thanks in advance!

PS: I guess there is a case to be made for tables here. Not really that familiar with Latex yet, but having a two cell table for each "block", with left cell containing the picture and right cell containing the text, and invisible borders, would probably achieve what I want. Problem there would be that large texts would not wrap the image, which is a desired effect...


\usepackage{picinpar} and figwindow fixed the problem... More or less. Wrapfigure was not the best idea

\begin{figwindow}[0,l,\includegraphics[width=1in]{my_image_1},*{A Caption}]
Some text.\par
\begin{figwindow}[0,l,\includegraphics[width=1in]{my_image_2},*{Another Caption}]
Other text.\par
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review
    – Bobyandbob
    Nov 13 '18 at 15:19
  • Can you add a short example to your answer how to use \usepackage{picinpar} and figwindow? This would make the answer more helpful for future users with the same problem. Nov 13 '18 at 15:56
  • @samcarter Edited to add the example
    – Kyra_W
    Nov 14 '18 at 18:35
  • @Bobyandbob It is not exactly an answer to the question, but is a solution to the problem I had to begin with. I just wanted to share it with the community, but I am ok with it being deleted.
    – Kyra_W
    Nov 14 '18 at 18:37
  • @Kyra_W Great! Thank you for sharing your solution with us! Nov 14 '18 at 20:58

I would recommend the use of geometry or memoir AND marginpar. Here is an example to allow for 1in figures.










This does not WRAP content around the figures. I have a sense however that you do not need the text to wrap as compared to fixing the alignment of picture and text.

  • Thanks for the answer! I do need the text to wrap, though. It is a tricky one :)
    – Kyra_W
    Nov 16 '18 at 9:21

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.