表格中頂規則與垂直線之間的間隙

表格中頂規則與垂直線之間的間隙

在本次 MWE 中

\documentclass[]{article}
\usepackage{amsmath}
\usepackage{booktabs}%added 8/16/2019
\setlength\heavyrulewidth{0.5ex}

\begin{document}            
\small
\begin{tabular}[c]{|p{1.5in}|p{4in}|}
\toprule
Problem&1\\\hline 
ODE            &${\frac {\rm d}{{\rm d}x}}y \left( x \right) =1+2\,x$\\\hline 
ODE degree     &1\\\hline 
Number of solutions &1\\\hline 
CAS classification &quadrature\\\hline 
Program classification&{\footnotesize [separable]}\\\hline 
Solved? &yes\\\hline
Verified? &yes\\ 
\bottomrule
\end{tabular}
\normalsize

\end{document}

我需要縮小輸出中顯示的差距:

數學圖形

如何修改上述 MWE 來彌補這些差距?

使用 TL 2019

答案1

\Xhline這是包中使用的不同方法makecell

在此輸入影像描述

\documentclass[]{article}
\usepackage{amsmath}

\usepackage{makecell}


\begin{document}

\small
\begin{tabular}[c]{|p{1.5in}|p{4in}|}
\Xhline{0.5ex}
Problem&1\\\hline 
ODE            &${\frac {\rm d}{{\rm d}x}}y \left( x \right) =1+2\,x$\\\hline 
ODE degree     &1\\\hline 
Number of solutions &1\\\hline 
CAS classification &quadrature\\\hline 
Program classification&{\footnotesize [separable]}\\\hline 
Solved? &yes\\\hline
Verified? &yes\\ 
\Xhline{0.5ex}
\end{tabular}
\normalsize

\end{document}

使用該套件並遵循手冊booktabs中的指南的範例booktabs

如果您始終牢記兩個簡單的準則,您就不會犯太大的錯誤: 1. 永遠不要使用垂直標尺。

可能如下圖所示:

在此輸入影像描述

\documentclass[]{article}
\usepackage{amsmath}
\usepackage{booktabs}

\begin{document}

\begin{tabular}[c]{ll}
\midrule
Problem & 1 \\ \addlinespace
ODE            &${\frac {\rm d}{{\rm d}x}}y \left( x \right) =1+2\,x$\\ \addlinespace
ODE degree     &1\\  \addlinespace
Number of solutions &1\\ \addlinespace
CAS classification &quadrature\\ \addlinespace
Program classification&{\footnotesize [separable]}\\  \addlinespace
Solved? &yes\\ \addlinespace
Verified? &yes\\ 
\bottomrule
\end{tabular}

\end{document}

相關內容