3

Long time listener, first time caller. I've got a table

\begin{center}
\begin{tabular}{cc}

And two columns of pictures displaying results with a particular parameter increasing. I am trying to place a nice long and thick arrow with a big arrowhead alongside the table, to show the direction in which the parameter increases, as such:

   ------   ------
   |    |   |     |
   |    |   |     |
_  ------   ------
|  
|  ------   ------
|  |    |   |     |
|  |    |   |     |
|  ------   ------
|  
|  ------   ------
V  |    |   |     |
   |    |   |     |
   ------   ------

I'm trying with a tikz arrow, where the entire tikz picture is a third column multirow, but it sticks to the top of the columns, and isn't vertically aligned like I drew. I'm also not managing to write along the curve "Increasing \lambda".

Any help would be appreciated. Maybe there's a better way to achieve this.

EDIT

I can't really add a truly working example, since it has pictures that are on my hard drive, but it looks simply like this:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}

\begin{document}

\begin{center}
\begin{tabular}{cc}

\textbf{Original} & \textbf{Noisy}\\
\includegraphics[scale=.25]{example-image-a} &
\includegraphics[scale=.25]{example-image-b}\\
~\\
$\boldsymbol{ \ell_1 }$\textbf{ regularisation} & \textbf{TV regularisation} \\
\includegraphics[scale=.25]{example-image-c} &
\includegraphics[scale=.25]{example-image}\vspace{5pt}\\
\includegraphics[scale=.25]{example-image} &
\includegraphics[scale=.25]{example-image}\vspace{5pt}\\
\includegraphics[scale=.25]{example-image} &
\includegraphics[scale=.25]{example-image}
\end{tabular}
\end{center}

\end{document}
  • 1
    Does tex.stackexchange.com/questions/60623/… help? Also, it's always nice if you add a minimal working example (MWE), saves us the trouble of having to create a document from scratch, as we can just copy-paste the code, and add the necessary bits. – Torbjørn T. Aug 18 '13 at 18:07
  • @TorbjørnT. thanks, didn't find that reference earlier. I'll reply in just a moment to see if that solves it. – bjorne Aug 18 '13 at 18:20
  • It kind of works. I was looking for something a little more easily flexible (which is why I went in the tikz direction), i.e. line thickness, arrowhead size, and only taking up part of the table height, not the whole thing. – bjorne Aug 18 '13 at 18:24
  • You can always use mwe package and then use example-image or example-image-a etc. for dummy images. However, we need to see your preamble too. – percusse Aug 18 '13 at 18:29
  • The preamble is uber standard. Images are 512x512 pixels. – bjorne Aug 18 '13 at 18:33
2

Here's the start of something that uses tikz

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{tikz}
\begin{document}

\begin{center}
\begin{tabular}{cc}
\textbf{Original}                                                     & \textbf{Noisy}              \\
\llap{\tikz[remember picture]\node (top node){};\hspace*{1em}}%%
\raisebox{-0.25\height}{\includegraphics[scale=.25]{example-image-a}} &                             
\raisebox{-0.25\height}{\includegraphics[scale=.25]{example-image-b}}                               \\
~                                                                                                   \\
$\boldsymbol{ \ell_1 }$\textbf{ regularisation}                       & \textbf{TV regularisation}  \\
\includegraphics[scale=.25]{example-image-c}                          &                             
\includegraphics[scale=.25]{example-image}\vspace{5pt}                                              \\
\includegraphics[scale=.25]{example-image}                            &                             
\includegraphics[scale=.25]{example-image}\vspace{5pt}                                              \\
\llap{\tikz[remember picture]\node (bottom node){};\hspace*{1em}}%%
\raisebox{-0.5\height}{\includegraphics[scale=.25]{example-image}}    & 
\raisebox{-0.5\height}{\includegraphics[scale=.25]{example-image}}


\end{tabular}
\end{center}

\begin{tikzpicture}[remember picture, overlay]
  \draw[->,very thick] (top node) -- (bottom node);
\end{tikzpicture}

\end{document}

By changing the value of \raisebox{<multiplier>\height} you can control where the baseline of the images are, and thus control where the arrow begins and end.

You can change the arrow style and the thickness of the arrow as:

\draw[-stealth,line width=10pt,] (top node) -- (bottom node);

which will give an uber thick arrow.

enter image description here

You can also do this without having to muck around with overlays by using the tikz matrix library:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}

\begin{tikzpicture}
\matrix[matrix of nodes,row sep={2pt},column sep={2pt}]
{
                         & [0.5cm]  \textbf{Original}                                            & \textbf{Noisy}                                                         \\
  \node (top node){};    & \raisebox{-0.55\height}{\includegraphics[scale=.25]{example-image-a}} & \raisebox{-0.55\height}{\includegraphics[scale=.25]{example-image-b}}  \\[14pt]
                         & $\boldsymbol{ \ell_1 }$\textbf{ regularisation}                       & \textbf{TV regularisation}                                             \\
                         & \includegraphics[scale=.25]{example-image-c}                          & \includegraphics[scale=.25]{example-image}\vspace{5pt}                 \\
                         & \includegraphics[scale=.25]{example-image}                            & \includegraphics[scale=.25]{example-image}\vspace{5pt}                 \\
  \node (bottom node){}; & \raisebox{-0.45\height}{\includegraphics[scale=.25]{example-image}}   & \raisebox{-0.45\height}{\includegraphics[scale=.25]{example-image}}    \\
};
\draw[-stealth,line width=10pt,] (top node) -- (bottom node);
\end{tikzpicture}

\end{document}
| improve this answer | |
  • Thank you very much. I'm using the second one, even though for some intuitive reason I prefer the first, however it only worked standalone, but when I used it in the document the arrow jumped to another page. – bjorne Aug 18 '13 at 20:35
  • @bjorne Regarding the arrow jumping around, with overlays, you need to compile the document twice; also, you should be using pdflatex for the overlay. If the arrow still jumps around after compiling twice, let me know; there's probably something else going on. – A.Ellett Aug 18 '13 at 22:03

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.