4

Mini page parts are not properly arranged

In above link i found best useful answer. I am asking new question in which i have some issue that in second part figure is dragged down i cant understand that how it is happening?

Codes:

\documentclass[12pt, a4paper]{article}
\usepackage[
top=0.6in,bottom=0.5in,left=0.7in,right=0.5in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[misc]{ifsym}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{forest}
\usepackage{subcaption}
\usepackage[parfill]{parskip}
%line spacing
\renewcommand{\baselinestretch}{0.9}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usetikzlibrary{intersections}
\headsep=10pt

\usepackage{wrapfig}
\begin{document}
    \begin{wrapfigure}{r}{6cm}
        \centering
        \begin{tikzpicture}
        %\draw[step=1cm,red,very thin] (-4,-4) grid (11,7);
        \tkzDefPoint(2,3.5){P}
        \tkzDefPoint(0,0){Q}
        \tkzDefPoint(4,0){R}
        \tkzDefPoint(0.8,1.4){E}
        \tkzDefPoint(2.6,2.4){F}
        \tkzDrawSegments(P,Q Q,R P,R E,F)
        \tkzLabelPoints[above,yshift=0pt](P)
        \tkzLabelPoints[left,yshift=4pt](Q)
        \tkzLabelPoints[right,yshift=4pt](R)
        \tkzLabelPoints[left,xshift=0pt](E)
        \tkzLabelPoints[right,xshift=00pt](F)
        \end{tikzpicture}
    \end{wrapfigure}

    For (i)
    \begin{align*}
    \dfrac{PE}{EQ}&=\dfrac{3.9}{3}=1.3\\
    \dfrac{PF}{FR}&=\dfrac{3.6}{2.4}=1.5\\
    \dfrac{PE}{EQ}&\neq \dfrac{PF}{FR}
    \end{align*}
    Therefore, $EF$ is not parallel to $QR$.

    \begin{wrapfigure}{r}{6cm}
        \centering
        \begin{tikzpicture}
        \tkzDefPoint(2,3.5){P}
        \tkzDefPoint(0,0){Q}
        \tkzDefPoint(4,0){R}
        \tkzDefPoint(0.8,1.4){E}
        \tkzDefPoint(3.2,1.4){F}
        \tkzDrawSegments(P,Q Q,R P,R E,F)
        \tkzLabelPoints[above,yshift=0pt](P)
        \tkzLabelPoints[left,yshift=4pt](Q)
        \tkzLabelPoints[right,yshift=4pt](R)
        \tkzLabelPoints[left,xshift=0pt](E)
        \tkzLabelPoints[right,xshift=00pt](F)
        \end{tikzpicture}
    \end{wrapfigure}
    For (ii)
    \begin{align*}
    \dfrac{PE}{QE}&=\dfrac{4}{4.5}=\dfrac{8}{9}\\
    \dfrac{PF}{RF}&=\dfrac{8}{9}\\
    \dfrac{PE}{QE}&=\dfrac{PF}{RF}
    \end{align*}
    Therefore, $EF$ is not parallel to $QR$.
\end{document}
  • 1
    For cases like yours I'd recommend using minipages instead of wrapfig. – leandriis Apr 26 at 8:32
4

If you add some lipsum text, you will see that wrapfigure produces a great space below the first figure (sigh). However, you can get rid of this space by adding an option [5] which means the figure will only be as height as 5 lines of text (note that these lines may be very wide, as in the fractions)

\documentclass[12pt, a4paper]{article}
\usepackage[
top=0.6in,bottom=0.5in,left=0.7in,right=0.5in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[misc]{ifsym}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{forest}
\usepackage{subcaption}
\usepackage[parfill]{parskip}
%line spacing
\renewcommand{\baselinestretch}{0.9}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usetikzlibrary{intersections}
\headsep=10pt

\usepackage{wrapfig}
\usepackage{lipsum}
\begin{document}
    \begin{wrapfigure}[5]{r}{6cm} % <=================================
        \centering
        \begin{tikzpicture}
        %\draw[step=1cm,red,very thin] (-4,-4) grid (11,7);
        \tkzDefPoint(2,3.5){P}
        \tkzDefPoint(0,0){Q}
        \tkzDefPoint(4,0){R}
        \tkzDefPoint(0.8,1.4){E}
        \tkzDefPoint(2.6,2.4){F}
        \tkzDrawSegments(P,Q Q,R P,R E,F)
        \tkzLabelPoints[above,yshift=0pt](P)
        \tkzLabelPoints[left,yshift=4pt](Q)
        \tkzLabelPoints[right,yshift=4pt](R)
        \tkzLabelPoints[left,xshift=0pt](E)
        \tkzLabelPoints[right,xshift=00pt](F)
        \end{tikzpicture}
    \end{wrapfigure}

    For (i)
    \begin{align*}
    \dfrac{PE}{EQ}&=\dfrac{3.9}{3}=1.3\\
    \dfrac{PF}{FR}&=\dfrac{3.6}{2.4}=1.5\\
    \dfrac{PE}{EQ}&\neq \dfrac{PF}{FR}
    \end{align*}
    Therefore, $EF$ is not parallel to $QR$.

    \begin{wrapfigure}{r}{6cm}
        \centering
        \begin{tikzpicture}
        \tkzDefPoint(2,3.5){P}
        \tkzDefPoint(0,0){Q}
        \tkzDefPoint(4,0){R}
        \tkzDefPoint(0.8,1.4){E}
        \tkzDefPoint(3.2,1.4){F}
        \tkzDrawSegments(P,Q Q,R P,R E,F)
        \tkzLabelPoints[above,yshift=0pt](P)
        \tkzLabelPoints[left,yshift=4pt](Q)
        \tkzLabelPoints[right,yshift=4pt](R)
        \tkzLabelPoints[left,xshift=0pt](E)
        \tkzLabelPoints[right,xshift=00pt](F)
        \end{tikzpicture}
    \end{wrapfigure}

    For (ii)
    \begin{align*}
    \dfrac{PE}{QE}&=\dfrac{4}{4.5}=\dfrac{8}{9}\\
    \dfrac{PF}{RF}&=\dfrac{8}{9}\\
    \dfrac{PE}{QE}&=\dfrac{PF}{RF}
    \end{align*}
    Therefore, $EF$ is not parallel to $QR$.
\end{document}

enter image description here

  • Suppose i add third part below these two, will it work? – Maths4Sandy Apr 26 at 8:41
  • @Sandy It will always work if you add vertical-height option to every wrapfigure. But with such a high number of pictures in only one page, I think gathering all these figures into one figure by subfigure is the best practice. – JouleV Apr 26 at 8:43
2

With minipages:

\documentclass[12pt, a4paper]{article}
\usepackage[
top=0.6in,bottom=0.5in,left=0.7in,right=0.5in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[misc]{ifsym}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{forest}
\usepackage{subcaption}
\usepackage[parfill]{parskip}
%line spacing
\renewcommand{\baselinestretch}{0.9}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usetikzlibrary{intersections}
\headsep=10pt

\usepackage{wrapfig}
\begin{document}

\begin{minipage}{\textwidth-6cm}
    For (i)
    \begin{align*}
    \dfrac{PE}{EQ}&=\dfrac{3.9}{3}=1.3\\
    \dfrac{PF}{FR}&=\dfrac{3.6}{2.4}=1.5\\
    \dfrac{PE}{EQ}&\neq \dfrac{PF}{FR}
    \end{align*}
    Therefore, $EF$ is not parallel to $QR$.
\end{minipage}%
\begin{minipage}{6cm}
        \centering
        \begin{tikzpicture}
        %\draw[step=1cm,red,very thin] (-4,-4) grid (11,7);
        \tkzDefPoint(2,3.5){P}
        \tkzDefPoint(0,0){Q}
        \tkzDefPoint(4,0){R}
        \tkzDefPoint(0.8,1.4){E}
        \tkzDefPoint(2.6,2.4){F}
        \tkzDrawSegments(P,Q Q,R P,R E,F)
        \tkzLabelPoints[above,yshift=0pt](P)
        \tkzLabelPoints[left,yshift=4pt](Q)
        \tkzLabelPoints[right,yshift=4pt](R)
        \tkzLabelPoints[left,xshift=0pt](E)
        \tkzLabelPoints[right,xshift=00pt](F)
        \end{tikzpicture}
\end{minipage}



    \bigskip
\begin{minipage}{\textwidth-6cm}
    For (ii)
    \begin{align*}
    \dfrac{PE}{QE}&=\dfrac{4}{4.5}=\dfrac{8}{9}\\
    \dfrac{PF}{RF}&=\dfrac{8}{9}\\
    \dfrac{PE}{QE}&=\dfrac{PF}{RF}
    \end{align*}
    Therefore, $EF$ is not parallel to $QR$.
\end{minipage}%
\begin{minipage}{6cm}
        \centering
        \begin{tikzpicture}
        \tkzDefPoint(2,3.5){P}
        \tkzDefPoint(0,0){Q}
        \tkzDefPoint(4,0){R}
        \tkzDefPoint(0.8,1.4){E}
        \tkzDefPoint(3.2,1.4){F}
        \tkzDrawSegments(P,Q Q,R P,R E,F)
        \tkzLabelPoints[above,yshift=0pt](P)
        \tkzLabelPoints[left,yshift=4pt](Q)
        \tkzLabelPoints[right,yshift=4pt](R)
        \tkzLabelPoints[left,xshift=0pt](E)
        \tkzLabelPoints[right,xshift=00pt](F)
        \end{tikzpicture}
\end{minipage}

\end{document}

You could also use the paracol package as shown here:

\documentclass[12pt, a4paper]{article}
\usepackage[
top=0.6in,bottom=0.5in,left=0.7in,right=0.5in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[misc]{ifsym}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{forest}
\usepackage{subcaption}
\usepackage[parfill]{parskip}
%line spacing
\renewcommand{\baselinestretch}{0.9}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usetikzlibrary{intersections}
\headsep=10pt

\usepackage{paracol}

\begin{document}
\begin{paracol}{2}
    For (i)
    \begin{align*}
    \dfrac{PE}{EQ}&=\dfrac{3.9}{3}=1.3\\
    \dfrac{PF}{FR}&=\dfrac{3.6}{2.4}=1.5\\
    \dfrac{PE}{EQ}&\neq \dfrac{PF}{FR}
    \end{align*}
    Therefore, $EF$ is not parallel to $QR$.
\switchcolumn
        {\centering
        \begin{tikzpicture}
        %\draw[step=1cm,red,very thin] (-4,-4) grid (11,7);
        \tkzDefPoint(2,3.5){P}
        \tkzDefPoint(0,0){Q}
        \tkzDefPoint(4,0){R}
        \tkzDefPoint(0.8,1.4){E}
        \tkzDefPoint(2.6,2.4){F}
        \tkzDrawSegments(P,Q Q,R P,R E,F)
        \tkzLabelPoints[above,yshift=0pt](P)
        \tkzLabelPoints[left,yshift=4pt](Q)
        \tkzLabelPoints[right,yshift=4pt](R)
        \tkzLabelPoints[left,xshift=0pt](E)
        \tkzLabelPoints[right,xshift=00pt](F)
        \end{tikzpicture}}
\switchcolumn
    For (ii)
    \begin{align*}
    \dfrac{PE}{QE}&=\dfrac{4}{4.5}=\dfrac{8}{9}\\
    \dfrac{PF}{RF}&=\dfrac{8}{9}\\
    \dfrac{PE}{QE}&=\dfrac{PF}{RF}
    \end{align*}
    Therefore, $EF$ is not parallel to $QR$.
\switchcolumn
       { \centering
        \begin{tikzpicture}
        \tkzDefPoint(2,3.5){P}
        \tkzDefPoint(0,0){Q}
        \tkzDefPoint(4,0){R}
        \tkzDefPoint(0.8,1.4){E}
        \tkzDefPoint(3.2,1.4){F}
        \tkzDrawSegments(P,Q Q,R P,R E,F)
        \tkzLabelPoints[above,yshift=0pt](P)
        \tkzLabelPoints[left,yshift=4pt](Q)
        \tkzLabelPoints[right,yshift=4pt](R)
        \tkzLabelPoints[left,xshift=0pt](E)
        \tkzLabelPoints[right,xshift=00pt](F)
        \end{tikzpicture}}
\end{paracol}

\end{document}

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.