I'm trying to fill some pictures with a background image using path picture
as recomended here or here. It works great if I put the style in the cell directly like |[path card]| my content
, but it does not compile if I put it inside cells={nodes={path card}}
. Any idea what's wrong?
MWE:
\documentclass[]{article}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{cd,calc,positioning,shadows}
\begin{document}
\tikzset{
path card/.style={
path picture={
\node[] at (path picture bounding box.center) {
\includegraphics[height=3cm]{example-image}};}},
}
{
\begin{tikzcd}[
nodes in empty cells,
column sep=1mm,
row sep=1mm,
cells={
nodes={
inner sep=0pt,
minimum width=3.9mm,
minimum height=6mm,
drop shadow,
draw,
fill=white,
rounded corners=2pt,
anchor=center,
shape=rectangle,
font={\fontsize{4}{12}\selectfont},
%path card, %% <- uncomment this line, everything breaks.
}
},
]
|[path card]| & & [1mm] & \\
& & & \\[1mm]
& & & \\
& & &
\end{tikzcd}
}%
\end{document}