我想知道是否可以将任何对象(如文本或图像)放置在文档中现有文本的顶部或后面而不影响它?
也就是说,让对象像图像编辑器中的新图层一样浮动。
答案1
一个小tikz
例子:
使用这段代码:
\documentclass[a4paper]{article}
\usepackage{lipsum}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}[remember picture, overlay]
\draw[blue, fill=blue!20, fill opacity=0.7]
(current page.center) circle (3cm)
node {Blue circle behind text};
\end{tikzpicture}
\lipsum[3]
\lipsum[9]
\begin{tikzpicture}[remember picture, overlay]
\draw[red, fill=red!20, fill opacity=0.7]
($(current page.north)+(0,-4)$) circle (3cm)
node {Red circle in front of text};
\end{tikzpicture}
\end{document}