2

I've tried using the wrapfig package, though this always results in my images going to the bottom-left corner. I have a document like this:

\begin{document}
\usepackage{tikz}
\begin{center}
\begin{tikzpicture}
\draw (0,0) --(0,5) -- (5,5) -- (5,0) -- (0,0); 

\end{tikzpicture}
\end{center}
lorem ipsum....
\begin{center}
\begin{tikzpicture} \draw (0,0) -- (3.8,0) -- (3.8,0.5) -- (0,0); 
\node [below] at (1.9,0) {\(\sqrt{1450}\)}; \node [right] at (3.8,0.25) {\(5\)}; 
\node [below left] at (0,0) {\(A\)}; \node [above right] at (3.8,0.5) {\(B\)}; 
\end{tikzpicture}\end{center}
\end{document}

It currently looks like mwe but I want it to look something like enter image description here

Bernard
  • 271,350
  • 1
    please provide complete but small document beginning by \documentclass{...} and ending with \end{document}. from your code fragment is not seen that you try to use wrapfigure. welcome to tex.se! – Zarko Mar 30 '18 at 12:55
  • Please also have a look here. –  Mar 30 '18 at 14:45

1 Answers1

3

This works with no problem

\documentclass{article}
\usepackage{tikz, wrapfig,kantlipsum}
\begin{document}
\begin{wrapfigure}{l}{0.5\textwidth}
    \centering\tikz\draw (0,0) --(0,12) -- (5,5) -- (5,0) -- cycle; 
\end{wrapfigure}
\noindent\kant[1]\begin{tikzpicture} \draw (0,0) -- (3.8,0) -- (3.8,0.5) -- (0,0); 
\node [below] at (1.9,0) {\(\sqrt{1450}\)}; \node [right] at (3.8,0.25) {\(5\)}; 
\node [below left] at (0,0) {\(A\)}; \node [above right] at (3.8,0.5) {\(B\)}; 
\end{tikzpicture}

\kant[2]
\end{document}

enter image description here

percusse
  • 157,807
  • Note that wrapfig treats the second tikzpicture as a singles line of text (\baselineskip). See the \wrapspacer macro from https://tex.stackexchange.com/questions/390520/have-titlerule-not-overlap-wrapfigure/390544?s=1|13.9420#390544. – John Kormylo Mar 30 '18 at 13:51
  • @JohnKormylo Or just properly use cutwin package :) – percusse Mar 30 '18 at 13:57