# Why do these two tikzpictures result in different output?

The following document has two tikzpictures in it, and they result in slightly different output. Why is this? I don't understand how the use of draw works in one but not the other. In the first one, the outline shows up and the rectangle is filled; in the second one just the labels "A" and "B" appear.

\documentclass[a4paper]{amsart}

\usepackage{fullpage,tikz}
\xdefinecolor{lightgrey}{RGB}{220,220,220}

\begin{document}

\begin{center}\begin{tikzpicture}
[ box/.style = {draw, rectangle, inner sep = 3mm, fill = lightgrey}
]
\node (A) at (0,0) [box] {$A$};
\node (B) at (2cm,0) [box] {$B$};
\draw [->] (A.east) -- (B.west);
\end{tikzpicture}\end{center}

\begin{center}\begin{tikzpicture}
\begin{scope}[draw, rectangle, inner sep = 3mm, fill = lightgrey]
\node (A) at (0,0) {$A$};
\node (B) at (2cm,0) {$B$};
\end{scope}
\draw [->] (A.east) -- (B.west);
\end{tikzpicture}\end{center}

\end{document}
-

What's happening is that the default style of a node is going unchanged; the parameters you set on the scope don't apply to anything. To make it apply, you need to specify that it's the style for a node, using every node/.style:

\begin{center}\begin{tikzpicture}
\begin{scope}[every node/.style={ draw
, rectangle
, inner sep = 3mm
, fill      = lightgrey }]
\node (A) at (0,0)   {$A$} ;
\node (B) at (2cm,0) {$B$} ;
\end{scope}
\draw [->] (A.east) -- (B.west);
\end{tikzpicture}\end{center}

You could also remove the scope block and put the options directly after the tikzpicture environment, as you did in the first block with box/.style, unless you want to have nodes with other styles.

-