# labels of nodes with drop shadow

in cases, that all nodes in some tikz pictures have shadow. this can be done for example by:

every node/.style = {draw, fill=white, drop shadow},


problem arise, if i like to some of this nodes add labels. this labels also have shadows, which i not like to have. i try remove them with

no shadows/.style = {general shadow/.style=},


but this doesn't work (as i expected):

\documentclass[tikz, margin=3mm]{standalone}

\begin{document}
\begin{tikzpicture}[
every node/.style = {draw, fill=white, drop shadow},
every label/.append style = {label distance=1em, font=\scriptsize, no shadows}
]
\end{tikzpicture}
\end{document}


edit: to make question and mwe more clear:

• no shadows/.style = {general shadow/.style=}, is taken from Qrrbrbirlbel answer on question here described in code A
• his solution in code B i didn't test since it require (as i understood code) that

\makeatletter \tikzset{no shadows/.code=\let\tikz@preactions\pgfutil@empty} \makeatother

should be in preamble, what for some reasons not like to have

• the solution should be applied to all labels, i.e. it can be used as styles options in every label/.append style = {<other style's definitions>, no shadows} -now i wonder why solution of [Qrrbrbirlbel] works in code example A where no shadows is option of child and not of node. in case, that i move it to node, also this code doesn't work correctly.

so far elegant solution provided by Torbjørn T., which make label shadow invisible, fulfill all my expectations. in time of this writing the solution of marmot is still in progress/evolution.

You could to modify the every shadow style, inside the every label style. E.g. add every shadow/.style={opacity=0} to every label to make the shadow invisible.

\documentclass[tikz, margin=3mm]{standalone}

\begin{document}
\begin{tikzpicture}[
every node/.style = {draw, fill=white, drop shadow},
every label/.append style = {
label distance=1em,
font=\scriptsize,
}
]
\end{tikzpicture}
\end{document}

• good idea to make shadow invisible :-). i will wait for some time if more answers are received. – Zarko Mar 23 '18 at 14:26

OK, I didn't know you don't like the \makeatletter stuff. In this case, I think that Torbjørn T.'s solution is the best. Here is an alternative, which has the advantage that the shadow can be switched off locally (no every shadow), but the big disadvantage that it will put a white box on top of other things that may exist. I have checked that this version can also be appended to every label.

\documentclass[tikz, margin=3mm]{standalone}

\begin{document}
\begin{tikzpicture}[
every node/.style = {draw, fill=white, drop shadow},
every label/.append style = {label distance=1em, font=\scriptsize}
]

\end{tikzpicture}
\end{document}


I'd like to argue that it might be advantageous to switch off shadows locally if needed, as described here.

\documentclass[tikz, margin=3mm]{standalone}
\makeatletter % from https://tex.stackexchange.com/a/129322/121799
\makeatother

\begin{document}
\begin{tikzpicture}[
every node/.style = {draw, fill=white, drop shadow},
every label/.append style = {
label distance=1em,
font=\scriptsize,
}
]
\end{tikzpicture}
\end{document}


And here a special for Zarko, which yields the same output:

\documentclass[tikz, margin=3mm]{standalone}
\makeatletter % from https://tex.stackexchange.com/a/129322/121799
\tikzset{every label/.append code=\let\tikz@preactions\pgfutil@empty}
\makeatother

\begin{document}
\begin{tikzpicture}[
every node/.style = {draw, fill=white, drop shadow},
every label/.append style = {
label distance=1em,
font=\scriptsize,
}
]
\end{tikzpicture}
\end{document}


\documentclass[tikz, margin=3mm]{standalone}
\makeatletter % from https://tex.stackexchange.com/a/129322/121799
\makeatother

\begin{document}
\begin{tikzpicture}[
every node/.style = {draw, fill=white, drop shadow},
every label/.append style = {
label distance=1em,
font=\scriptsize,
fill=blue,

• i looked this solution, but other (used in my test) was declared that also work :-(. do you test, if it work inside every label/.append stale ...? – Zarko Mar 23 '18 at 15:45
• @Zarko I added a solution. Neither every label/.append stale nor every label/.append style works, but append code does. – marmot Mar 23 '18 at 15:55
• i managed to include it in qvery label/.append ..., however, now i remember, why i didn't select this solution on the first lace: for some reason i like to have no shape definition placed between tikzpicture options at other styles definition. is there a way to do this? so far my experiments fails :-( – Zarko Mar 23 '18 at 15:56
• @Zarko What do the ... stand for in qvery label/.append ...? Could you perhaps add the complete experiment that fails? – marmot Mar 23 '18 at 16:00
• ups, mistyping: every label/.append and .... stand for `style = <style definitions>}. sorry disorder. – Zarko Mar 23 '18 at 16:07