se metti
`\graffito{{\includegraphics[width=\marginparwidth]{img}}}`
cioè chiudi l’immagine in un gruppo, a me funziona. Il perché non so spiegartelo.
Oppure puoi mettere le parentesi graffe attorno all’argomento #1, cioè
`\makeatletter
% Graffiti as in GKP's book “Concrete Mathematics”
\def\graffito@setup{%
\slshape\footnotesize%\small%
\parindent=0pt \lineskip=0pt \lineskiplimit=0pt %\baselineskip=10pt
\tolerance=2000 \hyphenpenalty=300 \exhyphenpenalty=300 %
\doublehyphendemerits=100000 \finalhyphendemerits=\doublehyphendemerits}
\DeclareRobustCommand{\graffito}[1]{\marginpar
[\graffito@setup\raggedleft\hspace{0pt}{#1}]
{\graffito@setup\raggedright\hspace{0pt}{#1}}}
\makeatother`
e poi normale
`\graffito{\includegraphics[width=\marginparwidth]{fotobn}}`
Comunque per una cosa più precisa aspetta il prof.
Ciao
Andrea