4

For the MWE below:

\documentclass[a4paper,11pt,twoside]{report}
\usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage[T1]{fontenc}

\usepackage{pgfplots,tikz}


\usetikzlibrary{calc,trees,positioning,fit,arrows,chains,shapes.geometric,%
    decorations.pathreplacing,decorations.pathmorphing,shapes,%
    matrix,shapes.symbols,automata}


\tikzset{
>=stealth',
  punktchain/.style={
    rectangle, 
    rounded corners, 
    % fill=black!10,
    draw=black, very thick,
    text width=10em, 
    minimum height=3em, 
    text centered, 
    on chain},
  line/.style={draw, thick, <-},
  element/.style={
    tape,
    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},
  tuborg/.style={decorate},
  tubnode/.style={midway, right=2pt},
  every rectangle node/.style={thick}
}


\begin{document}

\begin{center}
\begin{tikzpicture}
  [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};


 \end{tikzpicture}
\end{center}


\end{document}

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
  • 1
    Don't drink and drive :p
    – percusse
    Commented Sep 5, 2012 at 0:57

1 Answer 1

5

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

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

would reverse the arrow.

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

You must log in to answer this question.

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