I saved the following LaTeX code in the file ~\Test.tex.
\documentclass{beamer}
\usepackage{tikz}
\usetheme{Warsaw}
\begin{document}
\begin{frame}{Frame Title}
\begin{tikzpicture}
\draw[fill,red](0,0)rectangle(\textwidth,\textheight);
\draw[fill,orange](0,0)circle(2pt);
\draw[fill,orange](\textwidth,\textheight)circle(2pt);
\end{tikzpicture}
\end{frame}
\end{document}
The code creates a beamer presentation whose theme is Warsaw. (The Warsaw theme adds headers and footers to every frame.) The presentation consists of a single, regular frame. The frame's content consists of a single object: a TikZ picture. The picture is composed of three elements: a filled red rectangle whose width is \textwidth and whose height is \textheight, and two filled orange circles at the bottom left and top right corners of the red rectangle.
I then executed the following commands in the Terminal.
> cd ~
> lualatex Test
> lualatex Test
At the end of the compilation ~/Test.log did not contain any instructions to rerun the compilation. The compilation resulted in the creation of the file ~/Test.pdf. When opened in a PDF viewer, the file displayed as follows.
As can be seen, the orange circle at the top right corner of the red rectangle is visible, but the one at the bottom left corner is invisible. This indicates that part of the red rectangle is hidden behind the black and blue footer.
Questions
- How can the red rectangle be drawn in front of the footer?
- More generally, how can a TikZ picture be drawn in front of any other TikZ picture that overlaps it, even without knowing which TikZ pictures, if any, actually overlap it, or even if there are any other TikZ pictures in the document?
- Even more generally, how can a PGF picture be drawn in front of any other PGF picture? (Apparently the footer of a
beamerpresentation of theWarsawtheme is not a TikZ picture, but a PGF picture. Moreover, every TikZ picture is a PGF picture, but not vice versa.)







remember picture, overlay. The second option puts the picture out of the text-segment and on top of it. Now, if you create the picture in the beamer context, it will not cover the footer, I think. – Daniel N Dec 17 '22 at 07:12tikzpictureapgfpicture? – Evan Aad Dec 18 '22 at 10:13overlayoption to a drawing command is that the command's drawing takes place in a layer that "sits" on top of all other layers. This layer is unique throughout a LaTeX document: if two commands in two differenttikzpictureenvironments are given theoverlayoption, they both draw on the same top-level layer. However, differenttikzpictureenvironments set up different systems of coordinates on this top layer. Those systems of coordinates are local to eachtikzpictureenvironments. – Evan Aad Dec 18 '22 at 10:28\draw[overlay](0,0)circle(1cm);in two differenttikzpictureenvironments, both circles will be drawn on the top layer, but possibly at different locations on the top layer: the first circle will be drawn about the point (0,0) w.r.t. the coordinate system set up locally by the firsttikzpictureenvironment, whereas the second circle will be drawn about the point (0,0) w.r.t. the coordinate system set up locally by the secondtikzpictureenvironment. – Evan Aad Dec 18 '22 at 10:29overlayoption is added to thetikzpictureenvironment in the code listed in my question, the red rectangle changes position: theoverlayoption changes the environment's local coordinate system, or more accurately, it changes the mapping of the environment's local coordinate system to absolute positions on the physical page. – Evan Aad Dec 18 '22 at 10:47overlayoption cause this change of mapping? I don't have an answer to this question. – Evan Aad Dec 18 '22 at 10:55