我想在表格内绘制一个 \downarrow(或任何箭头)。表格如下图所示:
我希望能够更像这样:
这是我的代码:
$\rotatebox[origin=c]{90}{}%
\left\Downarrow
\begin{tabular}{lrr}
\toprule
{} & Aantal Zetels & Aantal Zetels \\
Strategie & Vrouwen & Mannen \\
\midrule
a & 10 & 0\\
b & 4 & 6 \\
a & 8 & 2\\
b & 5 & 5 \\
a & 7 & 3 \\
b & 6 & 4 \\
\bottomrule
\end{tabular}
\right.
\rotatebox[origin=c]{90}{}$
谁能帮我吗?
答案1
由于您的问题已加标签tikz-pgf,我想\tikzmark
解决方案就很好了。您必须运行 LaTeX 两次才能使箭头显示在正确的位置。
\documentclass{article}
\usepackage{booktabs,tikz}
\newcommand\tikzmark[1]{\tikz[remember picture] \node (#1) {};}
\begin{document}
\begin{tabular}{lrr}
\toprule
& Aantal Zetels & Aantal Zetels \\
Strategie & Vrouwen & Mannen \\
\midrule
a \tikzmark{a} & 10 & 0 \\
b & 4 & 6 \\
a & 8 & 2 \\
b & 5 & 5 \\
a & 7 & 3 \\
b \tikzmark{b} & 6 & 4 \\
\bottomrule
\end{tabular}
\tikz[remember picture,overlay] \draw[->] (a.center -| b.center) -- (b.center);
\end{document}
答案2
解决方案如下pstricks
:
\documentclass[a4paper, x11names]{article}
\usepackage{array, rotating, booktabs}
\usepackage{pst-node}
\usepackage{auto-pst-pdf}
\begin{document}
\begin{postscript}%
\begin{tabular}{lcrr}
\toprule
& & Aantal Zetels & Aantal Zetels \\
\multicolumn{2}{l}{ Strategie} & Vrouwen & Mannen \\
\midrule
a & \pnode{B} & 10 & 0 \\
b & & 4 & 6 \\
a & & 8 & 2 \\
b & & 5 & 5 \\
a & & 7 & 3 \\
b & \Rnode{E} & 6 & 4 \\
\bottomrule
\ncline[arrows=->, arrowinset=0.12, offset=-6pt]{B}{E}
\end{tabular}
\end{postscript}
\end{document}