我尝试使用 wrapfig 包,但这总是导致我的图像移到左下角。我有一份这样的文档:
\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}
答案1
这没有问题
\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}