有个用excel画的表格,怎么在\LaTeX
代码里复制出来?难点在最上面那条线和最下面那条线,是双线,线宽不一样。
答案1
\documentclass{article}
\usepackage{booktabs}
\begin{document}
{\setlength\doublerulesep{0.4pt} %%<-- sep between consecutive rules, begin group
\begin{tabular}{ccc}
\toprule[1pt]\midrule[0.3pt]
Here & there & where \\\cmidrule{2-3}
& some & thing \\ \midrule
1 & 2 & 3 \\
4 & 5 & 6 \\
3 & 4 & 6 \\\midrule[0.3pt]\bottomrule[1pt]
\end{tabular}
} %% end group for \doublerulesep so that effect is local
\end{document}
为了保持一致性,可以定义一个新命令:
\documentclass{article}
\usepackage{booktabs}
\usepackage{xcolor}
\newcommand{\dtoprule}{\specialrule{1pt}{0pt}{0.4pt}%
\specialrule{0.3pt}{0pt}{\belowrulesep}%
}
\newcommand{\dbottomrule}{\specialrule{0.3pt}{0pt}{0.4pt}%
\specialrule{1pt}{0pt}{\belowrulesep}%
}
\begin{document}
\begin{tabular}{ccc}
\dtoprule
Here & there & where \\\cmidrule{2-3}
& some & thing \\ \midrule[0.5pt]
1 & 2 & 3 \\
4 & 5 & 6 \\
3 & 4 & 6 \\\dbottomrule
\end{tabular}
\end{document}