3

I am creating an activity-on-node project diagram for my Critical Path method lecture. I could able to create the customized node for the same as indicated in the attached image. However, I would like to customize/modify the existing node (code), to produce the modified node as indicated below the expected outcome in the attached image. Kindly help me.

enter image description here

The Minimal Working Example is as follows:

 \documentclass[border=12pt]{standalone}
 \usepackage{amsmath}
 \usepackage{tikz}
 \usetikzlibrary{shapes,arrows}
 \usetikzlibrary{chains}
 \usetikzlibrary{positioning}

 \tikzset{sectors/.style n args={5}{%
  circle,
  draw,
  minimum width=#4,
  append after command={%
  \pgfextra{ %
  \draw (\tikzlastnode.center) -- (\tikzlastnode.south);
  \draw (\tikzlastnode.west)   -- (\tikzlastnode.east);
  \path (\tikzlastnode.center) -- node[#5] {#1} (\tikzlastnode.north west);  
  \path (\tikzlastnode.center) -- node[#5] {#2} (\tikzlastnode.north east);  
  \path (\tikzlastnode.center) -- node[#5] {#3} (\tikzlastnode.south west); 
  \path (\tikzlastnode.center) -- node[#5] {#4} (\tikzlastnode.south east);}}}}

  \newcommand*\circled[1]{\tikz[baseline=(char.base)]{
        \node[shape=circle,draw,inner sep=1pt] (char) {#1};}}

   \begin{document}
   \begin{tikzpicture}[node distance=7cm,ultra thick]
   \node [circle split,
     draw,
     minimum width=2cm,
     append after command={%
     \pgfextra{\draw (\tikzlastnode.north) -- (\tikzlastnode.south) ;
              } 
              }]  (a)  {};
  \node[yshift=0em] at (a.center) {\LARGE \textbf{A}};  
  \node[xshift=-1.2em,yshift=1.2em] at (a.center) {\LARGE $a$}; 
  \node[xshift= 1.2em,yshift=1.2em] at (a.center) {\LARGE $b$};  
  \node[xshift=-1.2em,yshift=-1.2em] at (a.center) {\LARGE $c$}; 
  \node[xshift= 1.2em,yshift=-1.2em] at (a.center) {\LARGE $d$};  
  \end{tikzpicture}
  \end{document}

1 Answer 1

4

With some modifications on your code, the following code gives desired output.

    \documentclass[border=12pt]{standalone}
     \usepackage{amsmath}
     \usepackage{tikz}
     \usetikzlibrary{shapes,arrows}
     \usetikzlibrary{chains}
     \usetikzlibrary{positioning}

       \begin{document}
       \begin{tikzpicture}[node distance=7cm,ultra thick]
       \node [circle,
         draw,fill=white,
         minimum width=2cm,
        % append after command={%
        % \pgfextra{\draw (\tikzlastnode.north) -- (\tikzlastnode.south) ;
                % } 
                % }
                 ]  (a)  {};
\draw (a.north) -- (a.south) ; 
\draw (a.west) -- (a.east) ;            
                  \node [circle ,
         draw,fill=white,
         minimum width=0.7cm,
        % append after command={%
        % \pgfextra{\draw (\tikzlastnode.north) -- (\tikzlastnode.south) ;
                 % } 
                 % }
                  ]  (b)  {};
      \node[yshift=0em] at (a.center) {\LARGE \textbf{A}};  
      \node[xshift=-1.2em,yshift=1.2em] at (a.center) {\LARGE $a$}; 
      \node[xshift= 1.2em,yshift=1.2em] at (a.center) {\LARGE $b$};  
      \node[xshift=-1.2em,yshift=-1.2em] at (a.center) {\LARGE $c$}; 
      \node[xshift= 1.2em,yshift=-1.2em] at (a.center) {\LARGE $d$};  
      \end{tikzpicture}
      \end{document}

enter image description here

6
  • ferahfeza it works perfectly good. Thank you very much.
    – rakatex
    May 16, 2020 at 12:17
  • 1
    @RameshKannan, Your welcome.
    – user31034
    May 16, 2020 at 12:20
  • ferahfeza could you provide solution for my another similar question, if you like?tex.stackexchange.com/questions/544554/…
    – rakatex
    May 16, 2020 at 12:22
  • 1
    First of all, you don't need to use circle split option. Only use circle as a node. Then use it's anchors such as north, south, east, west to drawing lines in circle. I have removed the tikzset and \newcommand\circled, because you don't need it for your output.
    – user31034
    May 16, 2020 at 12:30
  • 2
    It is really good that you removed all the \pgfextra{\draw ...} which should not be used.
    – user194703
    May 16, 2020 at 16:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .