TransWikia.com

Wrap figure interfering with text

TeX - LaTeX Asked by Michaela on August 2, 2021

I wanted to wrap my figure and just write text around it but this happens:
enter image description here

Here’s my code:

subsection{Príklad č.2}
textbf{Zadanie:} Na obrázku ref{koleno} je znázornené koleno.

begin{wrapfigure}{r}{0.40textwidth}
includegraphics[width=0.9linewidth]{uloha2.png} 
caption{Koleno (zdroj: Zadania bonusových príkladov )}
label{koleno}

end{wrapfigure}

begin{tabular}{l l}
 $D_1 = 20 quad mm$   & $p= 49 900 quad Pa $
 $D_2 = 10 quad mm$   & $V_k =1.8 cdot 10^{-5} quad m^3$ 
 $H = 0.1 quad m$ & $rho = 998 quad kgcdot m^{-3}$ 
 $h = 25 quad mm$ &  $g = 9.81 quad m cdot s^{-1}$
end{tabular}

 Vypočítať: 
begin{itemize}
   item Silu $Vec{F_K}$ pôsobiacu na koleno (vzťah odvodiť z vety o zmene hybnosti)
   item Odvodiť vzťah závislosti priemeru paprsku na súradnici z. Predpokladá sa, že paprsok je celú dobu kompaktný a nerozkladá sa.
   item Silu pôsobiacu na dosku.
end{itemize}
subsubsection{BR 2 (výstup z kolena) - 3 (vrchol paprsku)}
begin{equation}
frac{p}{rho} + frac{{v_2}^2}{2} + gh_2 = frac{p_3}{rho} + frac{{v_3}^2}{2} + gh_3
end{equation}
Tlak okolia je konštantný, takže mi vypadne z rovnice tlaková potencionálna energia na vrchole paprsku. Taktiež mi vypadne kinetická merná energia na vrchole paprsku, pretože tam je už všetka spotrebovaná. 
begin{equation*}
   frac{p}{rho} + frac{{v_2}^2}{2} + gh_2 = gh_3
end{equation*}
begin{equation*}
frac{{v_2}^2}{2} = g (h_3 - h_2 ) - frac{p}{rho}
end{equation*}
begin{equation*}
v_2 = sqrt{2 cdot (g cdot H - frac{p}{rho}) }
end{equation*}

Do you know what’s the problem ? thanks

2 Answers

When things that are not plain text are present, the automatic calculations of the figure space is often wrong. You can do two things:

  1. In this case, you have a lot of white space above. Try adding a vspace*{-1.5cm} (or whatever) before the includegraphics.

  2. say explicitly to wrapfig how many lines you want to skip. You have to use the optional argument:

    begin{wrapfigure}[16]{r}
    

    adjusting the 16 more or less by try and error (LaTeX is not really though for wrapfigures, I fear).

If you had posted a complete minimal working example (MWE), I could have tried it...

Correct answer by Rmano on August 2, 2021

Probably this alternative, that uses two minipages instead of wrapfig also suits your needs:

enter image description here

documentclass{article}
usepackage{graphicx}
usepackage{amsmath}
usepackage{siunitx}
usepackage{caption}
usepackage[export]{adjustbox}
begin{document}

subsection{Príklad č.2}

begin{minipage}[t]{0.55linewidth}
textbf{Zadanie:} Na obrázku ref{koleno} je znázornené koleno.
[
begin{aligned}
 D_1 &= SI{20}{mm}   & p    &= SI{49 900}{Pa}          
 D_2 &= SI{10}{mm}   & V_k  &= SI{1.8e-5}{cubicm}      
 H   &= SI{0.1}{m}   & rho &= SI{998}{kgpercubicm} 
 h   &= SI{25}{mm}   & g    &= SI{9.81}{mpers}       
end{aligned}
]
 Vypočítať: 
begin{itemize}
   item Silu $Vec{F_K}$ pôsobiacu na koleno (vzťah odvodiť z vety o zmene hybnosti)
   item Odvodiť vzťah závislosti priemeru paprsku na súradnici z. Predpokladá sa, že paprsok je celú dobu kompaktný a nerozkladá sa.
   item Silu pôsobiacu na dosku.
end{itemize}
end{minipage}hfill
begin{minipage}[t]{0.4linewidth}
includegraphics[width=linewidth,valign=t]{example-image-10x16} 
captionof{figure}{Koleno (zdroj: Zadania bonusových príkladov )}
label{koleno}
end{minipage}

subsubsection{BR 2 (výstup z kolena) - 3 (vrchol paprsku)}
begin{equation}
frac{p}{rho} + frac{{v_2}^2}{2} + gh_2 = frac{p_3}{rho} + frac{{v_3}^2}{2} + gh_3
end{equation}
Tlak okolia je konštantný, takže mi vypadne z rovnice tlaková potencionálna energia na vrchole paprsku. Taktiež mi vypadne kinetická merná energia na vrchole paprsku, pretože tam je už všetka spotrebovaná. 
begin{align*}
frac{p}{rho} + frac{{v_2}^2}{2} + gh_2 &= gh_3    
frac{{v_2}^2}{2} &= g (h_3 - h_2 ) - frac{p}{rho} 
v_2 &= sqrt{2 cdot (g cdot H - frac{p}{rho}) }
end{align*}
end{document}

Answered by leandriis on August 2, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP