我正在尝试使用该包将文本环绕在 TikZ 图像周围wrapfigure
,但似乎不起作用——文档编译成功,但图像被新文本推下。我在日志中收到的错误是正在wrapfigure
冲突的环境中使用。我不太清楚如何解决这个问题,如果能得到任何帮助我将不胜感激。
这是我的代码:
\documentclass[a4paper,12pt]{article}
\usepackage{outlines}
\usepackage{tensor}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{wasysym}
\usepackage[top=2cm, bottom=1.3cm, left=3cm, right=2.0cm]{geometry}
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{wrapfig}
\pagestyle{empty}
\begin{document}
\section*{Chapter 3 Problems}
\begin{outline}[enumerate]
\1 A car is driven 215 km west and then 85 km southwest. What is the displacement of the car from the point of origin (magnitude and direction)? Draw a diagram.
\begin{wrapfigure}{l}{0.5cm}
\begin{tikzpicture}
\draw[<->,thick] (-3,0) -- (1,0);
\draw[<->,thick] (0,-2) -- (0,1);
\draw[step=0.25cm,gray,very thin] (-3,-2) grid (1,1);
\draw[red,very thick,<-] (-2,0) -- (0,0);
\draw (-1,0.15) node [font=\tiny] {215 km};
\draw[blue,very thick,->] (-2,0) -- (-2.5591,-1);
\draw (-2.1,-0.5) node [rotate=57,font=\tiny] {85 km};
\draw (-2.22,0) arc (180:225:0.3);
\draw[black,thick,->] (0,0) -- (-2.5591,-1);
\draw (-1,0) arc (180:225:0.5);
\draw[orange,very thick,dashed] (-2.5591,0) -- (-2.5591,-1);
\draw[green,very thick,dashed] (-2,0) -- (-2.5591,0);
\end{tikzpicture}
\end{wrapfigure}
\2 [] Displacement in the \textit{y}:
\3 [] \textit{D}$_y$
\end{outline}
\end{document}
提前致谢!
答案1
您可以使用 picins
而wrapfig
不是但类似于outlines
picins
texLive 中不存在。
我用
\parpic[r]{%
\begin{tikzpicture}
...
用你的例子。