# A Question Regarding TikZ Background Layer

In the Tik Z & PGF Manual for Version 2.10-CVS, page 120/880 there is an example to create a yellow rounded rectangular background as below:

And here is the code I used:

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[execute at end picture=%
{
\begin{pgfonlayer}{background}
\path[fill=yellow,rounded corners]
(current bounding box.south west) rectangle
(current bounding box.north east);
\end{pgfonlayer}
}]
\node at (0,0) {X};
\node at (2,1) {Y};
\end{tikzpicture}
\end{document}


However I got an error as below: ! Package pgf Error: Sorry, the requested layer 'background' could not be found . Maybe you misspelled it?.

Do you know how to fix this? Thanks for your support in advance.

In the manual you must to use \usetikzlibrary{backgrounds}. It is written in gray color:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{backgrounds}
\begin{document}
\begin{tikzpicture}[execute at end picture=%
{
\begin{pgfonlayer}{background}
\path[fill=yellow,rounded corners]
(current bounding box.south west) rectangle
(current bounding box.north east);
\end{pgfonlayer}
}]
\node at (0,0) {X};
\node at (2,1) {Y};
\end{tikzpicture}
\end{document}


Here there is the output:

• I appreciate your excellent answer! Thanks! – Aria Jul 12 '20 at 22:30
• @Aria happy to help you :-) "excellent" it is not exact ahahahah. – Sebastiano Jul 12 '20 at 22:31