Miktex/XeLaTeX - wrong aligned images to the top of text using wrapfigure












2















I'm trying to display image wrapped by text, but I'm not able to align them exactly. Image is always rendered one line below the begin of text block. Additionally, it's displayed line below even when I want to align it with the subsection.



I've tried to shift the image by vspace{-33pt}, but it works only when wrapfigure has specified width. This setting is completely ignored in my case when I need to detect wrapfigure width using 0pt width settings.
(Please don't be confused by specified image (=rule) width in my example - real document contains hundreds of images of variable width, so width can't be specified as a parameter and wrapfigure width must be really detected.)



How shall be correctly aligned top of the image to



1) subsection header



2) first line of text



with additional requirement for wrapfigure width detection?



Full non-working code and screenshots describing observed and expected behaviour are below.



documentclass[a4paper]{book}

usepackage{fontspec}

usepackage{polyglossia}
setmainlanguage{czech}

usepackage{ulem}
usepackage{spverbatim}
usepackage[unicode]{hyperref}
usepackage{graphicx}
usepackage{grffile}
usepackage{color}

usepackage{wrapfig}
usepackage{hologo}

usepackage{pdfpages}

usepackage{needspace}

begin{document}

chapter{Chapter 1}
section{Section 1}
needspace{6cm}
begin{wrapfigure}{R}{0pt}
%vspace{-33pt} % Doesn't work for width detection (0pt above)
centering
rule{3cm}{4cm}
%includegraphics[height=4cm,width=3cm]{img.jpg}
end{wrapfigure}
subsection{Subsection 1} % <----- Image shall be here, but is one line below Some text
Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below.

chapter{Chapter 2}
section{Section 2}
subsection{Subsection 2}
needspace{6cm}
begin{wrapfigure}{R}{0pt}
centering
rule{3cm}{4cm}
%includegraphics[height=4cm,width=3cm]{img.jpg}
end{wrapfigure}
Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below.

end{document}


Screenshot 1Screenshot 2










share|improve this question




















  • 2





    off-topic: your problem is not related to miktex , the very same problem you will meet at any latex distribution... wrapfigure work correctly (only) at standard paragraph.

    – Zarko
    Dec 22 '18 at 22:46
















2















I'm trying to display image wrapped by text, but I'm not able to align them exactly. Image is always rendered one line below the begin of text block. Additionally, it's displayed line below even when I want to align it with the subsection.



I've tried to shift the image by vspace{-33pt}, but it works only when wrapfigure has specified width. This setting is completely ignored in my case when I need to detect wrapfigure width using 0pt width settings.
(Please don't be confused by specified image (=rule) width in my example - real document contains hundreds of images of variable width, so width can't be specified as a parameter and wrapfigure width must be really detected.)



How shall be correctly aligned top of the image to



1) subsection header



2) first line of text



with additional requirement for wrapfigure width detection?



Full non-working code and screenshots describing observed and expected behaviour are below.



documentclass[a4paper]{book}

usepackage{fontspec}

usepackage{polyglossia}
setmainlanguage{czech}

usepackage{ulem}
usepackage{spverbatim}
usepackage[unicode]{hyperref}
usepackage{graphicx}
usepackage{grffile}
usepackage{color}

usepackage{wrapfig}
usepackage{hologo}

usepackage{pdfpages}

usepackage{needspace}

begin{document}

chapter{Chapter 1}
section{Section 1}
needspace{6cm}
begin{wrapfigure}{R}{0pt}
%vspace{-33pt} % Doesn't work for width detection (0pt above)
centering
rule{3cm}{4cm}
%includegraphics[height=4cm,width=3cm]{img.jpg}
end{wrapfigure}
subsection{Subsection 1} % <----- Image shall be here, but is one line below Some text
Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below.

chapter{Chapter 2}
section{Section 2}
subsection{Subsection 2}
needspace{6cm}
begin{wrapfigure}{R}{0pt}
centering
rule{3cm}{4cm}
%includegraphics[height=4cm,width=3cm]{img.jpg}
end{wrapfigure}
Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below.

end{document}


Screenshot 1Screenshot 2










share|improve this question




















  • 2





    off-topic: your problem is not related to miktex , the very same problem you will meet at any latex distribution... wrapfigure work correctly (only) at standard paragraph.

    – Zarko
    Dec 22 '18 at 22:46














2












2








2








I'm trying to display image wrapped by text, but I'm not able to align them exactly. Image is always rendered one line below the begin of text block. Additionally, it's displayed line below even when I want to align it with the subsection.



I've tried to shift the image by vspace{-33pt}, but it works only when wrapfigure has specified width. This setting is completely ignored in my case when I need to detect wrapfigure width using 0pt width settings.
(Please don't be confused by specified image (=rule) width in my example - real document contains hundreds of images of variable width, so width can't be specified as a parameter and wrapfigure width must be really detected.)



How shall be correctly aligned top of the image to



1) subsection header



2) first line of text



with additional requirement for wrapfigure width detection?



Full non-working code and screenshots describing observed and expected behaviour are below.



documentclass[a4paper]{book}

usepackage{fontspec}

usepackage{polyglossia}
setmainlanguage{czech}

usepackage{ulem}
usepackage{spverbatim}
usepackage[unicode]{hyperref}
usepackage{graphicx}
usepackage{grffile}
usepackage{color}

usepackage{wrapfig}
usepackage{hologo}

usepackage{pdfpages}

usepackage{needspace}

begin{document}

chapter{Chapter 1}
section{Section 1}
needspace{6cm}
begin{wrapfigure}{R}{0pt}
%vspace{-33pt} % Doesn't work for width detection (0pt above)
centering
rule{3cm}{4cm}
%includegraphics[height=4cm,width=3cm]{img.jpg}
end{wrapfigure}
subsection{Subsection 1} % <----- Image shall be here, but is one line below Some text
Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below.

chapter{Chapter 2}
section{Section 2}
subsection{Subsection 2}
needspace{6cm}
begin{wrapfigure}{R}{0pt}
centering
rule{3cm}{4cm}
%includegraphics[height=4cm,width=3cm]{img.jpg}
end{wrapfigure}
Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below.

end{document}


Screenshot 1Screenshot 2










share|improve this question
















I'm trying to display image wrapped by text, but I'm not able to align them exactly. Image is always rendered one line below the begin of text block. Additionally, it's displayed line below even when I want to align it with the subsection.



I've tried to shift the image by vspace{-33pt}, but it works only when wrapfigure has specified width. This setting is completely ignored in my case when I need to detect wrapfigure width using 0pt width settings.
(Please don't be confused by specified image (=rule) width in my example - real document contains hundreds of images of variable width, so width can't be specified as a parameter and wrapfigure width must be really detected.)



How shall be correctly aligned top of the image to



1) subsection header



2) first line of text



with additional requirement for wrapfigure width detection?



Full non-working code and screenshots describing observed and expected behaviour are below.



documentclass[a4paper]{book}

usepackage{fontspec}

usepackage{polyglossia}
setmainlanguage{czech}

usepackage{ulem}
usepackage{spverbatim}
usepackage[unicode]{hyperref}
usepackage{graphicx}
usepackage{grffile}
usepackage{color}

usepackage{wrapfig}
usepackage{hologo}

usepackage{pdfpages}

usepackage{needspace}

begin{document}

chapter{Chapter 1}
section{Section 1}
needspace{6cm}
begin{wrapfigure}{R}{0pt}
%vspace{-33pt} % Doesn't work for width detection (0pt above)
centering
rule{3cm}{4cm}
%includegraphics[height=4cm,width=3cm]{img.jpg}
end{wrapfigure}
subsection{Subsection 1} % <----- Image shall be here, but is one line below Some text
Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below.

chapter{Chapter 2}
section{Section 2}
subsection{Subsection 2}
needspace{6cm}
begin{wrapfigure}{R}{0pt}
centering
rule{3cm}{4cm}
%includegraphics[height=4cm,width=3cm]{img.jpg}
end{wrapfigure}
Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below.

end{document}


Screenshot 1Screenshot 2







xetex wrapfigure alignment






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 22 '18 at 22:57









David Carlisle

488k4111291877




488k4111291877










asked Dec 22 '18 at 22:33









Joseph Joseph

596




596








  • 2





    off-topic: your problem is not related to miktex , the very same problem you will meet at any latex distribution... wrapfigure work correctly (only) at standard paragraph.

    – Zarko
    Dec 22 '18 at 22:46














  • 2





    off-topic: your problem is not related to miktex , the very same problem you will meet at any latex distribution... wrapfigure work correctly (only) at standard paragraph.

    – Zarko
    Dec 22 '18 at 22:46








2




2





off-topic: your problem is not related to miktex , the very same problem you will meet at any latex distribution... wrapfigure work correctly (only) at standard paragraph.

– Zarko
Dec 22 '18 at 22:46





off-topic: your problem is not related to miktex , the very same problem you will meet at any latex distribution... wrapfigure work correctly (only) at standard paragraph.

– Zarko
Dec 22 '18 at 22:46










2 Answers
2






active

oldest

votes


















3














You can set intextsep to 0 to align with the first line of the paragraph. To move it more up in e.g. a heading use raisebox and hide the real height with the option argument. Be aware that a long heading will be overwritten by such an image.



documentclass[a4paper]{book}
usepackage{wrapfig}
usepackage{needspace}
intextsep=0pt
begin{document}

chapter{Chapter 1}
section{Section 1}
needspace{6cm}
begin{wrapfigure}{R}{0pt}
centering
raisebox{baselineskip}[dimexprheight-baselineskip][0pt]{rule{3cm}{4cm}}
end{wrapfigure}
subsection{Subsection 1} % <----- Image shall be here, but is one line below Some text
Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below.

chapter{Chapter 2}
section{Section 2}
subsection{Subsection 2}
needspace{6cm}
begin{wrapfigure}{R}{0pt}
centering
rule{3cm}{4cm}
end{wrapfigure}
Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below.

end{document}





share|improve this answer































    3














    You can play with raisebox, fooling LaTeX with the real height of the image via the 1st optional argument of the command:



    documentclass[a4paper]{book}

    usepackage{fontspec}

    usepackage{polyglossia}
    setmainlanguage{czech}

    usepackage{ulem}
    usepackage{spverbatim}
    usepackage[unicode]{hyperref}
    usepackage[demo]{graphicx}
    usepackage{grffile}
    usepackage{color}

    usepackage{wrapfig}
    usepackage{hologo}

    usepackage{pdfpages}

    usepackage{needspace}
    usepackage{lipsum}

    begin{document}

    chapter{Chapter 1}
    section{Section 1}
    needspace{6cm}
    begin{wrapfigure}{R}{0pt}
    %vspace{-33pt} % Doesn't work for width detection (0pt above)
    centering
    rule{3cm}{4cm}
    %includegraphics[height=4cm,width=3cm]{img.jpg}
    end{wrapfigure}
    subsection{Subsection 1} % <----- Image shall be here, but is one line below Some text
    Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below.

    chapter{Chapter 2}
    section{Section 2}
    subsection{Subsection 2}
    needspace{6cm}
    begin{wrapfigure}[8]{R}{0pt}
    centering
    raisebox{4ex}[0.8height]{ includegraphics[height=4cm,width=3cm]{img.jpg}}
    end{wrapfigure}
    leavevmode lipsum[1]

    end{document}


    enter image description here






    share|improve this answer























      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',
      autoActivateHeartbeat: false,
      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
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f467036%2fmiktex-xelatex-wrong-aligned-images-to-the-top-of-text-using-wrapfigure%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      3














      You can set intextsep to 0 to align with the first line of the paragraph. To move it more up in e.g. a heading use raisebox and hide the real height with the option argument. Be aware that a long heading will be overwritten by such an image.



      documentclass[a4paper]{book}
      usepackage{wrapfig}
      usepackage{needspace}
      intextsep=0pt
      begin{document}

      chapter{Chapter 1}
      section{Section 1}
      needspace{6cm}
      begin{wrapfigure}{R}{0pt}
      centering
      raisebox{baselineskip}[dimexprheight-baselineskip][0pt]{rule{3cm}{4cm}}
      end{wrapfigure}
      subsection{Subsection 1} % <----- Image shall be here, but is one line below Some text
      Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below.

      chapter{Chapter 2}
      section{Section 2}
      subsection{Subsection 2}
      needspace{6cm}
      begin{wrapfigure}{R}{0pt}
      centering
      rule{3cm}{4cm}
      end{wrapfigure}
      Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below.

      end{document}





      share|improve this answer




























        3














        You can set intextsep to 0 to align with the first line of the paragraph. To move it more up in e.g. a heading use raisebox and hide the real height with the option argument. Be aware that a long heading will be overwritten by such an image.



        documentclass[a4paper]{book}
        usepackage{wrapfig}
        usepackage{needspace}
        intextsep=0pt
        begin{document}

        chapter{Chapter 1}
        section{Section 1}
        needspace{6cm}
        begin{wrapfigure}{R}{0pt}
        centering
        raisebox{baselineskip}[dimexprheight-baselineskip][0pt]{rule{3cm}{4cm}}
        end{wrapfigure}
        subsection{Subsection 1} % <----- Image shall be here, but is one line below Some text
        Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below.

        chapter{Chapter 2}
        section{Section 2}
        subsection{Subsection 2}
        needspace{6cm}
        begin{wrapfigure}{R}{0pt}
        centering
        rule{3cm}{4cm}
        end{wrapfigure}
        Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below.

        end{document}





        share|improve this answer


























          3












          3








          3







          You can set intextsep to 0 to align with the first line of the paragraph. To move it more up in e.g. a heading use raisebox and hide the real height with the option argument. Be aware that a long heading will be overwritten by such an image.



          documentclass[a4paper]{book}
          usepackage{wrapfig}
          usepackage{needspace}
          intextsep=0pt
          begin{document}

          chapter{Chapter 1}
          section{Section 1}
          needspace{6cm}
          begin{wrapfigure}{R}{0pt}
          centering
          raisebox{baselineskip}[dimexprheight-baselineskip][0pt]{rule{3cm}{4cm}}
          end{wrapfigure}
          subsection{Subsection 1} % <----- Image shall be here, but is one line below Some text
          Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below.

          chapter{Chapter 2}
          section{Section 2}
          subsection{Subsection 2}
          needspace{6cm}
          begin{wrapfigure}{R}{0pt}
          centering
          rule{3cm}{4cm}
          end{wrapfigure}
          Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below.

          end{document}





          share|improve this answer













          You can set intextsep to 0 to align with the first line of the paragraph. To move it more up in e.g. a heading use raisebox and hide the real height with the option argument. Be aware that a long heading will be overwritten by such an image.



          documentclass[a4paper]{book}
          usepackage{wrapfig}
          usepackage{needspace}
          intextsep=0pt
          begin{document}

          chapter{Chapter 1}
          section{Section 1}
          needspace{6cm}
          begin{wrapfigure}{R}{0pt}
          centering
          raisebox{baselineskip}[dimexprheight-baselineskip][0pt]{rule{3cm}{4cm}}
          end{wrapfigure}
          subsection{Subsection 1} % <----- Image shall be here, but is one line below Some text
          Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below.

          chapter{Chapter 2}
          section{Section 2}
          subsection{Subsection 2}
          needspace{6cm}
          begin{wrapfigure}{R}{0pt}
          centering
          rule{3cm}{4cm}
          end{wrapfigure}
          Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below.

          end{document}






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 22 '18 at 22:48









          Ulrike FischerUlrike Fischer

          191k8298679




          191k8298679























              3














              You can play with raisebox, fooling LaTeX with the real height of the image via the 1st optional argument of the command:



              documentclass[a4paper]{book}

              usepackage{fontspec}

              usepackage{polyglossia}
              setmainlanguage{czech}

              usepackage{ulem}
              usepackage{spverbatim}
              usepackage[unicode]{hyperref}
              usepackage[demo]{graphicx}
              usepackage{grffile}
              usepackage{color}

              usepackage{wrapfig}
              usepackage{hologo}

              usepackage{pdfpages}

              usepackage{needspace}
              usepackage{lipsum}

              begin{document}

              chapter{Chapter 1}
              section{Section 1}
              needspace{6cm}
              begin{wrapfigure}{R}{0pt}
              %vspace{-33pt} % Doesn't work for width detection (0pt above)
              centering
              rule{3cm}{4cm}
              %includegraphics[height=4cm,width=3cm]{img.jpg}
              end{wrapfigure}
              subsection{Subsection 1} % <----- Image shall be here, but is one line below Some text
              Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below.

              chapter{Chapter 2}
              section{Section 2}
              subsection{Subsection 2}
              needspace{6cm}
              begin{wrapfigure}[8]{R}{0pt}
              centering
              raisebox{4ex}[0.8height]{ includegraphics[height=4cm,width=3cm]{img.jpg}}
              end{wrapfigure}
              leavevmode lipsum[1]

              end{document}


              enter image description here






              share|improve this answer




























                3














                You can play with raisebox, fooling LaTeX with the real height of the image via the 1st optional argument of the command:



                documentclass[a4paper]{book}

                usepackage{fontspec}

                usepackage{polyglossia}
                setmainlanguage{czech}

                usepackage{ulem}
                usepackage{spverbatim}
                usepackage[unicode]{hyperref}
                usepackage[demo]{graphicx}
                usepackage{grffile}
                usepackage{color}

                usepackage{wrapfig}
                usepackage{hologo}

                usepackage{pdfpages}

                usepackage{needspace}
                usepackage{lipsum}

                begin{document}

                chapter{Chapter 1}
                section{Section 1}
                needspace{6cm}
                begin{wrapfigure}{R}{0pt}
                %vspace{-33pt} % Doesn't work for width detection (0pt above)
                centering
                rule{3cm}{4cm}
                %includegraphics[height=4cm,width=3cm]{img.jpg}
                end{wrapfigure}
                subsection{Subsection 1} % <----- Image shall be here, but is one line below Some text
                Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below.

                chapter{Chapter 2}
                section{Section 2}
                subsection{Subsection 2}
                needspace{6cm}
                begin{wrapfigure}[8]{R}{0pt}
                centering
                raisebox{4ex}[0.8height]{ includegraphics[height=4cm,width=3cm]{img.jpg}}
                end{wrapfigure}
                leavevmode lipsum[1]

                end{document}


                enter image description here






                share|improve this answer


























                  3












                  3








                  3







                  You can play with raisebox, fooling LaTeX with the real height of the image via the 1st optional argument of the command:



                  documentclass[a4paper]{book}

                  usepackage{fontspec}

                  usepackage{polyglossia}
                  setmainlanguage{czech}

                  usepackage{ulem}
                  usepackage{spverbatim}
                  usepackage[unicode]{hyperref}
                  usepackage[demo]{graphicx}
                  usepackage{grffile}
                  usepackage{color}

                  usepackage{wrapfig}
                  usepackage{hologo}

                  usepackage{pdfpages}

                  usepackage{needspace}
                  usepackage{lipsum}

                  begin{document}

                  chapter{Chapter 1}
                  section{Section 1}
                  needspace{6cm}
                  begin{wrapfigure}{R}{0pt}
                  %vspace{-33pt} % Doesn't work for width detection (0pt above)
                  centering
                  rule{3cm}{4cm}
                  %includegraphics[height=4cm,width=3cm]{img.jpg}
                  end{wrapfigure}
                  subsection{Subsection 1} % <----- Image shall be here, but is one line below Some text
                  Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below.

                  chapter{Chapter 2}
                  section{Section 2}
                  subsection{Subsection 2}
                  needspace{6cm}
                  begin{wrapfigure}[8]{R}{0pt}
                  centering
                  raisebox{4ex}[0.8height]{ includegraphics[height=4cm,width=3cm]{img.jpg}}
                  end{wrapfigure}
                  leavevmode lipsum[1]

                  end{document}


                  enter image description here






                  share|improve this answer













                  You can play with raisebox, fooling LaTeX with the real height of the image via the 1st optional argument of the command:



                  documentclass[a4paper]{book}

                  usepackage{fontspec}

                  usepackage{polyglossia}
                  setmainlanguage{czech}

                  usepackage{ulem}
                  usepackage{spverbatim}
                  usepackage[unicode]{hyperref}
                  usepackage[demo]{graphicx}
                  usepackage{grffile}
                  usepackage{color}

                  usepackage{wrapfig}
                  usepackage{hologo}

                  usepackage{pdfpages}

                  usepackage{needspace}
                  usepackage{lipsum}

                  begin{document}

                  chapter{Chapter 1}
                  section{Section 1}
                  needspace{6cm}
                  begin{wrapfigure}{R}{0pt}
                  %vspace{-33pt} % Doesn't work for width detection (0pt above)
                  centering
                  rule{3cm}{4cm}
                  %includegraphics[height=4cm,width=3cm]{img.jpg}
                  end{wrapfigure}
                  subsection{Subsection 1} % <----- Image shall be here, but is one line below Some text
                  Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below. Some text below.

                  chapter{Chapter 2}
                  section{Section 2}
                  subsection{Subsection 2}
                  needspace{6cm}
                  begin{wrapfigure}[8]{R}{0pt}
                  centering
                  raisebox{4ex}[0.8height]{ includegraphics[height=4cm,width=3cm]{img.jpg}}
                  end{wrapfigure}
                  leavevmode lipsum[1]

                  end{document}


                  enter image description here







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Dec 22 '18 at 23:08









                  BernardBernard

                  169k772197




                  169k772197






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f467036%2fmiktex-xelatex-wrong-aligned-images-to-the-top-of-text-using-wrapfigure%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Bressuire

                      Cabo Verde

                      Gyllenstierna