1

I'm attempting to make a figure in Tkiz but now it gives me this vauge complie timed out error with no indication on what is the cause here's the figure.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,backgrounds, positioning,arrows,automata,shadows,fit,shapes,intersections,calc,arrows,decorations.pathmorphing,intersections}
\begin{document}
\tracingall
 \begin{tikzpicture}[
        >=stealth,
        donor/.style={shade, ball color=red},
         acceptor/.style={shade, ball color=blue},
        electron/.style={shade, ball color=black},
         vacancy/.style={shade, ball},
        background/.style={ball color=blue!20, opacity=0.4},]
    %Draw the donor atoms
    \foreach \x in {1,1.5,2,3,3.5}
            \draw [donor] (\x,1,-0.5) circle (0.25cm);

    %Draw the acceptor atoms
    \foreach \x in {6,6.5,7,7.5,8,8.5}
           \draw [acceptor] (\x,0.55,-0.2) circle (0.25cm);


    %Draw the electrons molecules
    \draw [electron] (1.5,3.8) circle (0.15cm);


    %Draw excitation arrows showing the electrons going to the excited state
     \draw (2.5,1) -- (2.5,4.4) [->,thick];
     \draw (7,3.4) -- (7,1) [->,thick];
     \draw (3.5,4.5) -- (6.3,3.5) [->,thick, color=red];

     %draw vacancy
   \shadedraw [vacancy] (2.5,1) circle (0.25cm) 
   node [above=3pt,right=2pt] {\small{2-}};

    %Draw orbital levels
    \draw (1.5,4.5) -- (3.5,4.5) [--,very thick];
    \draw (1.5,1.5) -- (3.5,1.5) [--,very thick];

    \draw (6.3,3.5) -- (8.3,3.5) [--,very thick];
    \draw (6.3,1) -- (8.3,1) [--,very thick];

    %Draw the background
    %\begin{scope}
     %       \clip (1,1) rectangle (8.5,5);
      %      \draw[background] (4.5,1,-0.5) circle (3.5cm);
    %\end{scope}
    \end{tikzpicture}
\end{document}
| improve this question | | | | |
1

I changed the vacancy style: ball -> ball color=white and replaced the -- in the orbital levels to - to make it compile. None of the libraries you are loading are needed.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,backgrounds, positioning,arrows,automata,shadows,fit,shapes,intersections,calc,arrows,decorations.pathmorphing,intersections}
\begin{document}
%\tracingall
 \begin{tikzpicture}[
        >=stealth,
        donor/.style={shade, ball color=red},
         acceptor/.style={shade, ball color=blue},
        electron/.style={shade, ball color=black},
         vacancy/.style={shade, ball color=white},
        background/.style={ball color=blue!20, opacity=0.4},]
    %Draw the donor atoms
    \foreach \x in {1,1.5,2,3,3.5}
            \draw [donor] (\x,1,-0.5) circle (0.25cm);

    %Draw the acceptor atoms
    \foreach \x in {6,6.5,7,7.5,8,8.5}
           \draw [acceptor] (\x,0.55,-0.2) circle (0.25cm);


    %Draw the electrons molecules
    \draw [electron] (1.5,3.8) circle (0.15cm);


    %Draw excitation arrows showing the electrons going to the excited state
     \draw (2.5,1) -- (2.5,4.4) [->,thick];
     \draw (7,3.4) -- (7,1) [->,thick];
     \draw (3.5,4.5) -- (6.3,3.5) [->,thick, color=red];

     %draw vacancy
   \shadedraw [vacancy] (2.5,1) circle (0.25cm) 
   node [above=3pt,right=2pt] {\small{2-}};

    %Draw orbital levels
    \draw (1.5,4.5) -- (3.5,4.5) [-,very thick];
    \draw (1.5,1.5) -- (3.5,1.5) [-,very thick];

    \draw (6.3,3.5) -- (8.3,3.5) [-,very thick];
    \draw (6.3,1) -- (8.3,1) [-,very thick];

    %Draw the background
    %\begin{scope}
     %       \clip (1,1) rectangle (8.5,5);
      %      \draw[background] (4.5,1,-0.5) circle (3.5cm);
    %\end{scope}
    \end{tikzpicture}
\end{document}

enter image description here

I also do not understand why you are switching back and forth between 3d and 2d coordinates. This is an attempt to somewhat unify the coordinates.

\documentclass{article}
\usepackage{tikz}
%\usetikzlibrary{shapes,backgrounds, positioning,arrows,automata,shadows,fit,shapes,intersections,calc,arrows,decorations.pathmorphing,intersections}
\begin{document}
%\tracingall
 \begin{tikzpicture}[
        >=stealth,
        donor/.style={shade, ball color=red},
         acceptor/.style={shade, ball color=blue},
        electron/.style={shade, ball color=black},
         vacancy/.style={shade, ball color=white, opacity=0.4},
        background/.style={ball color=blue!20, opacity=0.4},]
    %Draw the donor atoms
    \foreach \x in {1,1.5,2,3,3.5}
            \draw [donor] (\x,1,-0.5) circle (0.25cm);

    %Draw the acceptor atoms
    \foreach \x in {6,6.5,7,7.5,8,8.5}
           \draw [acceptor] (\x,0.55,-0.2) circle (0.25cm);


    %Draw the electrons molecules
    \draw [electron] (2.5,4.55,-0.5) circle (0.15cm);


    %Draw excitation arrows showing the electrons going to the excited state
     \draw (2.5,1,-0.5) -- (2.5,4.4,-0.5) [->,thick];
     \draw (7,3.4) -- (7,1) [->,thick];
     \draw (3.5,4.5) -- (6.3,3.5) [->,thick, color=red];

     %draw vacancy
   \shade[vacancy] (2.5,1,-0.5) circle (0.25cm) 
   node [above=3pt,right=2pt,font=\small] {2-};

    %Draw orbital levels
    \draw (1.5,4.5) -- (3.5,4.5) [-,very thick];
    \draw (1.5,1.5) -- (3.5,1.5) [-,very thick];

    \draw (6.3,3.5) -- (8.3,3.5) [-,very thick];
    \draw (6.3,1) -- (8.3,1) [-,very thick];

    %Draw the background
    %\begin{scope}
     %       \clip (1,1) rectangle (8.5,5);
      %      \draw[background] (4.5,1,-0.5) circle (3.5cm);
    %\end{scope}
    \end{tikzpicture}
\end{document}

enter image description here

| improve this answer | | | | |
  • Thank you well, i'm still pretty new to latex and was attempting to adapt someone else's template to fit what I Needed – Elder Moose Apr 18 '19 at 12:35
  • @ElderMoose You're welcome! BTW, if this answer solved your problem, could you perhaps consider accepting it by clicking on the check mark left of it? – user121799 Apr 18 '19 at 13:34

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.