Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a table. Each row in that table represents data at a certain point of time. Lower rows represent data for later times.

To illustrate this, I'd like to draw an arrow at the side (which doesn't really matter) of the table, pointing downwards, labelled with something like "time".

How would I do this?

share|improve this question
add comment

2 Answers

up vote 11 down vote accepted

You can use \Downarrow to put a double arrow, or \downarrow for a single arrow. Applying a \left ... \right will allow it to be scaled to the height of the table.

The text can be added via \rotatebox[origin=c]{90}{time} from the graphicx package.

enter image description here

Notes:

  • Assuming you only want the arrow on the left, then you will need to ensure that you replace the \right\downarrow with \right. at the end of the table. Similarly, replace the \left\Downarrow with \left. if you only want the arrow on the right..

Code:

\documentclass{article}
\usepackage{graphicx}

\begin{document}
$\rotatebox[origin=c]{90}{time}%
\left\Downarrow% Use `\left.` if don't want arrow on this side.
\begin{tabular}{r r}
 1:00 & 2 \\
 3:00 & 4 \\
 5:00 & 6 \\
 7:00 & 8 \\
 8:00 & 10 \\
\end{tabular}
\right\downarrow%  Use `\right.` if don't want arrow on this side.
\rotatebox[origin=c]{90}{time}$
\end{document}
share|improve this answer
    
Very elegant! Upvoted this. :) –  mSSM Jun 20 '12 at 22:51
add comment

The following code contains two options; the first one doesn't use any special symbol, simply adds /time(incr.) to the column header to indicate an increasing time sequence order. The second one is a TikZ based solution:

\documentclass{article}
\usepackage{booktabs}
\usepackage{tikz}
\usetikzlibrary{calc}

\newcommand\tikzmark[1]{%
  \tikz[overlay,remember picture] \coordinate (#1);}

\begin{document}

\noindent\begin{tabular}{lc}
\toprule
head1 & data/time(incr.) \\
\midrule
text & 3 \\
text & 2 \\
text & 1 \\
\bottomrule
\end{tabular}

\vspace{1cm}

\noindent\begin{tabular}{lc}
\toprule
head1 & data \\
\midrule
text & 3\tikzmark{start}\\
text & 2 \\
text & 1\tikzmark{end} \\
\bottomrule
\end{tabular}

\begin{tikzpicture}[overlay,remember picture]
    \draw[->] let \p1=(start), \p2=(end) in ($(\x1,\y1)+(0.8,0.2)$) -- node[label=right:time] {} ($(\x1,\y2)+(0.8,0)$);
  \end{tikzpicture}

\end{document}

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.