Open tobiasBora opened 1 year ago
\begin{pgfonlayer} cannot be used inside a matrix. If I try, the node is completely misplaced:
\begin{pgfonlayer}
Soo also https://tex.stackexchange.com/questions/618823/node-on-layer-style-in-tikz-matrix-tikzcd
\documentclass[]{article} \usepackage{tikz} \begin{document} \pgfdeclarelayer{background} \pgfdeclarelayer{foreground} \pgfsetlayers{background,main,foreground} %% some additional layers for demo \begin{tikzpicture} \node [matrix] (my matrix) at (2,1) { \node[fill=pink,name=hello]{Hello}; & \node{A}; \\ \node{B}; & \node[fill=green,name=bye]{Bye}; \\ }; \draw[very thick, red] (hello.center) -- (bye.center); \end{tikzpicture} Adding pgfonlayer only: I would expect the line to be above Hello, but below Bye. Instead, the node is completely misplaced: \begin{tikzpicture} \node [matrix] (my matrix) at (2,1) { \node[fill=pink,name=hello]{Hello}; & \node{A};\\ \node{B}; & \begin{pgfonlayer}{foreground} \node[fill=green,name=bye]{Bye}; \end{pgfonlayer} \\ }; \draw[very thick, red] (hello.center) -- (bye.center); \end{tikzpicture} \end{document}
Brief outline of the bug
\begin{pgfonlayer}
cannot be used inside a matrix. If I try, the node is completely misplaced:Soo also https://tex.stackexchange.com/questions/618823/node-on-layer-style-in-tikz-matrix-tikzcd
Minimal working example (MWE)