Align start of paragraph and images











up vote
0
down vote

favorite












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:



(...)
begin{wrapfigure}[9]{l}{1in}
centering
includegraphics[width=1in]{my_image_1}
caption*{a caption}
end{wrapfigure}

This is some text.par

begin{wrapfigure}[9]{l}{1in}
centering
includegraphics[width=1in]{my_image_2}
caption*{another caption}
end{wrapfigure}

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 |
Picture|
=======|


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...










share|improve this question









New contributor




user3175717 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
























    up vote
    0
    down vote

    favorite












    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:



    (...)
    begin{wrapfigure}[9]{l}{1in}
    centering
    includegraphics[width=1in]{my_image_1}
    caption*{a caption}
    end{wrapfigure}

    This is some text.par

    begin{wrapfigure}[9]{l}{1in}
    centering
    includegraphics[width=1in]{my_image_2}
    caption*{another caption}
    end{wrapfigure}

    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 |
    Picture|
    =======|


    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...










    share|improve this question









    New contributor




    user3175717 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      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:



      (...)
      begin{wrapfigure}[9]{l}{1in}
      centering
      includegraphics[width=1in]{my_image_1}
      caption*{a caption}
      end{wrapfigure}

      This is some text.par

      begin{wrapfigure}[9]{l}{1in}
      centering
      includegraphics[width=1in]{my_image_2}
      caption*{another caption}
      end{wrapfigure}

      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 |
      Picture|
      =======|


      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...










      share|improve this question









      New contributor




      user3175717 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      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:



      (...)
      begin{wrapfigure}[9]{l}{1in}
      centering
      includegraphics[width=1in]{my_image_1}
      caption*{a caption}
      end{wrapfigure}

      This is some text.par

      begin{wrapfigure}[9]{l}{1in}
      centering
      includegraphics[width=1in]{my_image_2}
      caption*{another caption}
      end{wrapfigure}

      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 |
      Picture|
      =======|


      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...







      paragraphs wrapfigure alignment






      share|improve this question









      New contributor




      user3175717 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      user3175717 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 16 hours ago





















      New contributor




      user3175717 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 16 hours ago









      user3175717

      11




      11




      New contributor




      user3175717 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      user3175717 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      user3175717 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.



























          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "85"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          user3175717 is a new contributor. Be nice, and check out our Code of Conduct.










           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f459619%2falign-start-of-paragraph-and-images%23new-answer', 'question_page');
          }
          );

          Post as a guest





































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          user3175717 is a new contributor. Be nice, and check out our Code of Conduct.










           

          draft saved


          draft discarded


















          user3175717 is a new contributor. Be nice, and check out our Code of Conduct.













          user3175717 is a new contributor. Be nice, and check out our Code of Conduct.












          user3175717 is a new contributor. Be nice, and check out our Code of Conduct.















           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f459619%2falign-start-of-paragraph-and-images%23new-answer', 'question_page');
          }
          );

          Post as a guest




















































































          Popular posts from this blog

          How to change which sound is reproduced for terminal bell?

          Can I use Tabulator js library in my java Spring + Thymeleaf project?

          Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents