Can you suggest an easy way to draw these atoms?

enter image description here

enter image description here


    \fill[shade=ball,ball color=myyellow] (#1,#2) circle (10pt);
    \node at (#1,#2) {\texttt{+}};
    \fill[shade=ball,ball color=myorange] (#1,#2) circle (10pt);
    \fill[shade=ball,ball color=gray!30] (0,0) circle (5pt);
    \node at (0,0) {\texttt{-}};
  mark=at position #2 with {\electron},
  (0,0) ellipse (1.5 and 3.5);
  mark=at position #2 with {\electron},
  (0,0) ellipse (4 and 6);


  • 1
    Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site. Please post a minimal compilable document showing that you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document. – cryingshadow Jan 5 '16 at 15:21
  • If someone has drown a similar athom I can try to change the code. – ryuk Jan 5 '16 at 15:23
  • take a look at this answer tex.stackexchange.com/a/281814/23166 for drawing atoms and lines ;) – Davide Jan 5 '16 at 15:23
  • yes. But when I compile there is an error :( – ryuk Jan 5 '16 at 15:48
  • This is clearly a duplicate of the question linked to in Chris's answer. If your question is about a particular problem you have with the code there, then rework your question to be much more focused on the code itself. – Alan Munn Jan 5 '16 at 15:48

The answers to Draw Bohr atomic model with electron shells in TeX? have some examples that could serve as a starting point. The code of some examples there will not compile out of the box on recent TeX distributions. You have to replace shade=ball with shading=ball on several lines. I guess this is because the TikZ syntax changed over time.

  • there is this error ! Package pgfkeys Error: Choice 'ball' unknown in choice key '/tikz/shade'. I a m going to ignore this key. See the pgfkeys package documentation for explanation. Type H <return> for immediate help. I have updated the packages with ubuntu – ryuk Jan 5 '16 at 15:30
  • 1
    Try adding \usetikzlibrary{shadings} after the first \usetikzlibrary. – Chris Jan 5 '16 at 15:41
  • there is an error :( i post the code. – ryuk Jan 5 '16 at 15:44
  • 1
    Replace shade=ball with shading=ball in the orginal code. \usetikzlibrary{shadings} should not be needed. – Chris Jan 5 '16 at 15:49

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