7

I need to create a double curved arrow that connects two cells in my table. I have found some sample a got this

\documentclass{article}
\usepackage{array,multirow,graphicx}


\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,calc}


\newcommand{\tikzmark}[2][-3pt]{\tikz[remember picture, overlay, baseline=-0.5ex]\node[#1](#2){};}


\newcounter{arrow}
\setcounter{arrow}{0}
\newcommand{\drawcurvedarrow}[3][]{%
\refstepcounter{arrow}
\tikz[remember picture, overlay]\draw[double] (#2.center)edge[#1]node[coordinate,pos=0.5, name=arrow-\thearrow]{}(#3.center);
}

% #1 options, #2 position, #3 text 
\newcommand{\annote}[3][]{%
\tikz[remember picture, overlay]\node[#1] at (#2) {#3};
}

\begin{document}
\begin{table}[H]
\centering
\begin{tabular}{|c|l|r|r|}
\hline
& \multicolumn{1}{c|}{Discrete Time} & \multicolumn{1}{c|}{Continuous Time} \\
\hline
\parbox[t]{2mm}{\multirow{12}{*}{\rotatebox[origin=c]{90}{Stochastic system}}} &  &\\
&$x_{n+1}=f(x_n,u_n)+W_n{,} \hspace{10 mm} \textrm{ initial condition: } x_0$&\\
&&\\
& $W_n = P(\cdot \mid x_n,u_n)$ &\\
& &\\
& Cost function: &\\
& $\min\limits_{u_{0 \to t_f}} E \{ \Phi(t_f)+\sum\limits_{k=0}^{t_f -1} \alpha L(x_k,u_k)  \} \hspace{10mm} \alpha \in [0,1]$ &\\
&&\\
& Bellman equation: &\\
& $V^*(n,x)= \min\limits_{u_n} \{L(x_n,u_n)+ \alpha E[V^*(n+1,x_{n+1})] \}$ &\\
&$V^*(t_f,x_{t_f})=\Phi(t_f)$&\\
&  &\\
& Infinite horizon: \hspace{10 mm}  $\alpha \in [0,1]$&\\
& $\Phi(t_f)=0 \hspace{10mm}$V is NOT function of time.\tikzmark[xshift=2em]{a}&\\
& text &\\
\hline
\parbox[t]{2mm}{\multirow{10}{*}{\rotatebox[origin=c]{90}{Deterministic system}}} &  &\\
&  \tikzmark[xshift=3.5em]{b} $x_{n+1}=f(x_n,u_n){,} \hspace{10 mm} \textrm{ initial condition: } x_0$\tikzmark[xshift=1.5em]{b}&\\
&&\\
& Cost function: &\\
& $\min\limits_{u_{0 \to t_f}} \{ \Phi(t_f)+\sum\limits_{k=0}^{t_f -1} \alpha L(x_k,u_k)  \} \hspace{10mm} \alpha \in [0,1]$ &\\
&  &\\
&  Bellman equation: &\\
& $V^*(n,x)= \min\limits_{u_n} \{L(x_n,u_n)+ \alpha V^*(n+1,x_{n+1}) \}$ &\\
& text &\\
\hline
\end{tabular}
\drawcurvedarrow[bend left=60,-stealth]{a}{b}
\annote[right]{arrow-1}{Duplicate}
\end{table}
\end{document}

I cannot figure out how I can change the arrow style to double arrow (\Rightarrow).

  • 1
    It is quite easy: try to add a double option to the path. For example:\drawcurvedarrow[bend left=60,-stealth,double]{a}{b}. Customization is available with: \drawcurvedarrow[bend left=60,-stealth,double distance=2pt]{a}{b} (select the dimension fits more your needs). – Claudio Fiandrino Nov 1 '13 at 13:51
  • Tanks a lot for helping! – Foont Nov 1 '13 at 14:00
  • @ClaudioFiandrino an answer/ – cmhughes Nov 1 '13 at 15:24
  • @cmhughes: I thought there was already something on this, but questions I found are not adequate to consider this as a duplicate. That's why I didn't answered immediately. – Claudio Fiandrino Nov 1 '13 at 15:35
4

It is quite easy: try to add the option double to the path. For example:

\drawcurvedarrow[bend left=60,-stealth,double]{a}{b}. 

Customization is available with the option double distance=<dim>:

\drawcurvedarrow[bend left=60,-stealth,double distance=2pt]{a}{b} 

(select the dimension fits more your needs).

  • 3
    Why community wiki? – user11232 Nov 2 '13 at 0:35

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.