0
\documentclass{beamer}
\usepackage{graphicx,tikz}
\begin{document}
\begin{frame}
  \begin{tikzpicture}[node distance=1cm and 1.5cm]
    \node[]at (0,0) (e1){$G_0$};
    \node[]at(1.75,-1.75) (aux1){};
    \shade[ball color=red] at (1.0,1.0) circle(0.2) {scat1};
    \draw[path] (e1) -- (aux1);
  \end{tikzpicture}
\end{frame}
\end{document}

is giving error:

! Use of \@next doesn't match its definition.
\beamer@doifinframe ... \shade [ball color=red] at
                                                   (1.0,1.0) circle(0.2) {sc...
l.11 \end{frame}

everything is fine, if i remove at () from shade, only its in wrong position

  • Can you also share the "everything is fine" version? – user36296 Sep 29 '17 at 13:55
  • Offtopic: you don't need "\usepackage{graphicx}" with beamer – user36296 Sep 29 '17 at 13:55
  • @samcarter: just remove at () part, and sphere is coming at e1. – BaRud Sep 29 '17 at 13:57
  • As the answer shows, you're not supposed to use the at keyword in this context. at only applies to nodes, while \shade is similar to \fill. – Torbjørn T. Sep 29 '17 at 16:51
2

The code worked without the at, but with the (1.0,1.0) also needed to replace the \draw[path] by \path[draw] and remove the {scat1}.

Working code:

\begin{tikzpicture}[node distance=1cm and 1.5cm]
    \node at(0,0) (e1){$G_0$};
    \node at(1.75,-1.75) (aux1){};
    \shade[ball color=red] (1.0,1.0) circle(0.2);
    \path[draw] (e1) -- (aux1);
\end{tikzpicture}

off-topic: graphicx is loaded with tikz too

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.