For the MWE below:




    rounded corners, 
    % fill=black!10,
    draw=black, very thick,
    text width=10em, 
    minimum height=3em, 
    text centered, 
    on chain},
  line/.style={draw, thick, <-},
    top color=white,
    bottom color=blue!50!black!60!,
    minimum width=8em,
    draw=blue!40!black!90, very thick,
    text width=10em, 
    minimum height=3.5em, 
    text centered, 
    on chain},
  every join/.style={->, thick,shorten >=1pt},
  tubnode/.style={midway, right=2pt},
  every rectangle node/.style={thick}


  [node distance=.5cm,
  start chain=going below,]
     \node[punktchain, join] (timing) {Timing Solver};
     \node[punktchain, join] (solver)      {Solver};
     \node[punktchain, join] (impl)      {SolverImpl};
     \node[punktchain, join] (stp) {STPSolver};
     \node[punktchain, join, ] (stpimpl) {STPSolverImpl};

    \draw[tuborg, decoration={brace}] let \p1=(solver.north), \p2=(impl.south) in
     ($(2.5, \y1)$) -- ($(2.5, \y2)$) node[tubnode] {*};

    %\draw[red,thick,dashed] ($(solver.north west)+(-0.2,0.2)$)  rectangle ($(impl.south east)+(0.2,-0.2)$);

    \draw[red,thick,dashed] ($(timing.north west)+(-1,0.3)$)  rectangle ($(stpimpl.south east)+(1,-0.2)$); 
    \node[anchor=south] at (current bounding box.north) {The Solver Instance};



How can I add an arrow from STPSolverImpl to STPSolver ? I know it's a chain but is there any way to do it ? EDIT: I actually want two arrows. One up one down. So don't want to just replace that arrow

  • 1
    Don't drink and drive :p – percusse Sep 5 '12 at 0:57

You can provide extra options to the join style. Changing the relevant line as

\node[punktchain, join= by {<-}, ] (stpimpl) {STPSolverImpl};

would reverse the arrow.

  • Ah I see but the problem is that I actually want two arrows. One up one down. :) – Cemre Sep 5 '12 at 0:57
  • 1
    @Cemre Make it <-> and that would do the trick. EDIT: Oops I've misread your edit. – percusse Sep 5 '12 at 1:00
  • It's good this also does the trick thanks! ;) – Cemre Sep 5 '12 at 1:06
  • 1
    @Cemre My pleasure. I think the required coding is longer than putting the arrpws manually anyway. – percusse Sep 5 '12 at 1:20

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.