latex表格竖线短小booktabs问题解决
(2018-01-17 14:50:04)Latex疑难咨询,付费服务,介意勿扰!
\renewcommand{\cmidrulesep}{0mm} %定义两条相邻\cmidrule之间的间隔
\setlength{\aboverulesep}{0mm}
%在线条[不包括\toprule]上面增加一段垂直距离,此处为0mm
\setlength{\belowrulesep}{0mm}
%在线条[不包括\bottomrule]下面增加一条垂直距离,此处为0mm
\setlength{\abovetopsep}{0cm}
%在线条\toprule上面,即表格与上面的文字之间的距离。
\setlength{\belowbottomsep}{0cm}%在线条\bottomrule下面,即表格与下面的文字之间的距离。
xelatex.exe
\documentclass[30pt,a4paper]{article}
%页面设置
\usepackage{geometry}
\geometry{left=2cm,right=2cm,top=4cm,bottom=2.5cm}
%字体设置
\usepackage[slantfont,boldfont]{xeCJK}
\setCJKmainfont{SimSun}
\setmainfont{Times New Roman}
%设置表格居中格式
\usepackage{array}
%设置表格颜色
\usepackage[table]{xcolor}
%设置表格高度
\renewcommand\arraystretch{1.5}
%
\usepackage{booktabs}
% \abovetopsep=0em
%行间距
%颜色
\definecolor{mygrey}{RGB}{242,242,242}
\begin{document}
\section{样本信息}
\large
\flushleft
\renewcommand{\cmidrulesep}{0mm} %定义两条相邻\cmidrule之间的间隔
\setlength{\aboverulesep}{0mm}
%在线条[不包括\toprule]上面增加一段垂直距离,此处为0mm
\setlength{\belowrulesep}{0mm}
%在线条[不包括\bottomrule]下面增加一条垂直距离,此处为0mm
\setlength{\abovetopsep}{0cm}
%在线条\toprule上面,即表格与上面的文字之间的距离。
\setlength{\belowbottomsep}{0cm}%在线条\bottomrule下面,即表格与下面的文字之间的距离。
\begin{tabular}{p{8cm}|p{8cm}}
\rowcolor{mygrey}
\toprule[2pt]
姓名:李三&性别:男 \\
\rowcolor{mygrey}
\midrule
年龄:69岁&联系方式:13364631698 \\
\midrule
\rowcolor{mygrey}
\multicolumn{2}{l}{联系方式:}\\
\bottomrule[1.5pt]
\end{tabular}
\renewcommand{\baselinestretch}{1.5}
\end{document}