我使用环境添加了一个矩形tikzpicture
。但是,在环境之后和环境之外添加的任何文本都位于图像顶部。我一直在寻找解决方案,但还没有找到。对于我的任何错误,我深表歉意。显然,简单的方法\vspace
也不起作用。我正在使用scrartcl
文档类。请帮忙。代码如下:
\begin{tikzpicture}[remember picture,overlay,shift={(5,0)}]
\draw (0,-4) node[below]{($x_i, y_i$)} -- (4,-4) node[below]{($x_i + dx_i, y_i$)} -- (4,0) node[above]{($x_i+dx_i,y_i+dy_i$)} --
(0,0) node[above]{($x_i,y_i+dy_i$)} -- cycle;
\end{tikzpicture}
答案1
您正在使用overlay
,如果删除它,它将随不在其上方的文本一起流动。
\documentclass[12pt,a4paper]{scrartcl}
\usepackage{tikz}
\begin{document}
Some text above ... Some text above ... Some text above ... Some text above ... Some text above ... Some text above ... Some text above ...
\begin{center}
\begin{tikzpicture}[remember picture,shift={(5,0)}]
\draw (0,-4) node[below]{($x_i, y_i$)} -- (4,-4) node[below]{($x_i + dx_i, y_i$)} -- (4,0) node[above]{($x_i+dx_i,y_i+dy_i$)} -- (0,0) node[above] {($x_i,y_i+dy_i$)} -- cycle;
\end{tikzpicture}
\end{center}
And some text below ... And some text below ... And some text below ... And some text below ... And some text below ... And some text below ... And some text below ... And some text below ...
\end{document}