-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtab2.tex
61 lines (56 loc) · 2.53 KB
/
tab2.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
\documentclass[preview]{standalone}
\usepackage{tabularx}
\usepackage{leftidx}
\usepackage[flushleft]{threeparttable}
\usepackage{tikz}
\usepackage[left=2.5cm,right=2.5cm,top=3cm,bottom=3cm]{geometry}
\usetikzlibrary{matrix,positioning,calc}
\newcommand\tikzmark[1]{%
\tikz[remember picture] \coordinate (#1){};%
}
%% For table drawing, refer to https://tex.stackexchange.com/questions/160423/tikz-table-with-mathmode-and-drawing
% style inspired by table 4 in https://onlinelibrary.wiley.com/doi/10.1046/j.1095-8312.2002.00008.x
\begin{document}
\begin{minipage}[h]{.7\linewidth}
\begin{table}
\caption{Population variation in hatch success(mean percent) of unfertilized eggs for females from populations sampled in 1997.}
\begin{tabular*}{\linewidth}{p{0.4\linewidth}cccl}
\hline \\[-10pt]
Population & mean (\%) &\begin{tabular}[c]{@{}l@{}}Standard\\ deviation\end{tabular} & Range & N \tikzmark{columnTitle} \\ \hline
Population name1$^T$ & 10 & 1 & 0-50 & 10 \\
Population name2$^T$ & 10 & 1 & 0-50 & 10 \\
Population name3$^T$ & 10 & 1 & 0-50 & 10 \\
Population name4$^P$ & 10 & 1 & 0-50 & 10 \\
Population name5$^P$ & 10 & 1 & 0-50 & 10 \tikzmark{tableBody} \\
Population name6$^P$ & 10 & 1 & 0-50 & 10 \\
Population name7$^L$ & 10 & 1 & 0-50 & 10 \\
Population name8$^L$ & 10 & 1 & 0-50 & 10 \\
Population name9$^L$ & 10 & 1 & 0-50 & 10 \tikzmark{endNode}\\
\hline
\end{tabular*}
\begin{tablenotes}
\item $\leftidx{^T}{}$ = \footnotesize{temporary stream},
$\leftidx{^P}{}$ = \footnotesize{permanent streams},
$\leftidx{^L}{}$ = \footnotesize{lakes}.\tikzmark{footnoteNode}
\item
\item
\end{tablenotes}
\end{table}
\end{minipage}
% draw an arrow annotation
\tikzset{arrow/.style ={draw, line width=1.5pt,dashed}}
\newcommand{\drawArrowTxt}[2]{
\node[draw=none,red,anchor=west,text width=3cm] at ($(#1.east)+(0.8cm,0)$) {#2};
\draw [red,arrow] ($(#1.east)+(0.8cm,0)$) -- +(-0.5cm,0);
}
\tikz\coordinate (captionNode) at ($(columnTitle)+(0,0.85)$);
\tikz\coordinate (endNode1) at ($(endNode)+(15pt,-5pt)$);
\begin{tikzpicture}[remember picture,overlay,->]
%\tikz \node[inner sep=0,outer sep=0] (#1){};%
\drawArrowTxt{captionNode}{Table legend}
\drawArrowTxt{columnTitle}{Column titles}
\drawArrowTxt{tableBody}{Table body(data)}
\drawArrowTxt{endNode1}{\footnotesize{Lines demarcating the different parts of the table}}
\drawArrowTxt{footnoteNode}{footnodes}
\end{tikzpicture}
\end{document}