增加表格行高

增加表格行高

我有以下代码:

\usepackage{tabularx,array}
\usepackage{tabu}
\begin{tabular}{| c | c | c | c | }
    \hline
    $n$ & $nP_\star=(x_n,y_n)$ & $z(nP_\star)$  & $\boxtimes$ / $\Box$ \\ \hline
    $\vdots$ & $\vdots$ & $\vdots$ & $\boxtimes$ \\ \hline
$-10$ & $\bigg(\dfrac{56424579}{207025}, \dfrac{414903626892}{94196375}\bigg)$ & $2^{24} \cdot 3^{36} \cdot 5^{-32} \cdot 7^{-32} \cdot 13^{-32} \cdot  19^2 \cdot 29 \cdot 41 \cdot 83^2 \cdot 137^4 \cdot 661 \cdot 2677 \cdot 107581 \cdot 165713^{12} \cdot 631292953$ & $\boxtimes$ \\ \hline
$-9$ & $\bigg(\dfrac{-1094394}{18769}, \dfrac{500465142}{2571353}\bigg)$ & $2^{36} \cdot 3^{48} \cdot 11^{12} \cdot 13 \cdot 19^4 \cdot 37^2 \cdot 127^{12} \cdot 137^{-32} \cdot 9377 \cdot 96181 \cdot 1997236169$ & $\boxtimes$ \\ \hline
$-8$ & $\bigg(\dfrac{32971}{361}, \dfrac{-4894012}{6859}\bigg)$ & $2^{28} \cdot 3^6 \cdot 11^2 \cdot 19^{-32} \cdot 37^4 \cdot 61^{12} \cdot 101^{12} \cdot 397 \cdot 1061 \cdot 21937$ & $\boxtimes$ \\ \hline
$-7$ & $\bigg(\dfrac{20499}{1369}, \dfrac{418284}{50653}\bigg)$ & $2^{32} \cdot 3^{44} \cdot 5^{14} \cdot 7^{14} \cdot 13^{12} \cdot 37^{-32} \cdot 41 \cdot 433 \cdot 101873$ & $\boxtimes$ \\ \hline
 \end{tabular}

我这里有两个问题。

  1. 我需要增加行高,因为我的第二列由分数坐标组成,空间看起来很紧。我尝试使用,\vspace但不幸的是,它留下了相当大的空隙,看起来不太合适。

  2. 我的表格由 4 列组成。不知何故,由于第三列的数据太长,它被截断了。我尝试\\在数据的末尾使用,但它似乎将数据的后面部分发送到了另一列。有没有办法让它看起来更好?

还附有一张图片。在此处输入图片描述

答案1

我建议您在分子和分母项中插入(印刷)支柱;每行一个支柱就足够了。

在此处输入图片描述

\documentclass{article}

%% Define a few struts
%% (from code by Claudio Beccari in TeX and TUG News, Vol. 2, 1993)
\newcommand\Tstrut{\rule{0pt}{2.9ex}}       % "top" strut
\newcommand\Bstrut{\rule[-1.3ex]{0pt}{0pt}} % "bottom" strut
\newcommand\TBstrut{\Tstrut\Bstrut}         % "top and bottom" strut

\usepackage{amsmath,amssymb}
\usepackage[a4paper,margin=1in]{geometry} % set page parameters
\usepackage{rotating} % for "sideways" environment

\begin{document}
\begin{sideways} % switch to landscape mode
\noindent
$\begin{array}{| c | c | c | c | }
    \hline
    n\TBstrut & nP_\star=(x_n,y_n) & z(nP_\star)  & \boxtimes / \Box \\ \hline
    \vdots & \vdots & \vdots & \boxtimes \\ \hline
-10 & \biggl(\dfrac{\Tstrut56424579}{\Bstrut207025}, \dfrac{414903626892}{94196375}\biggr) & 2^{24} \cdot 3^{36} \cdot 5^{-32} \cdot 7^{-32} \cdot 13^{-32} \cdot  19^2 \cdot 29 \cdot 41 \cdot 83^2 \cdot 137^4 \cdot 661 \cdot 2677 \cdot 107581 \cdot 165713^{12} \cdot 631292953 & \boxtimes \\ \hline
-9 & \biggl(\dfrac{\Tstrut{-1094394}}{\Bstrut18769}, \dfrac{500465142}{2571353}\biggr) & 2^{36} \cdot 3^{48} \cdot 11^{12} \cdot 13 \cdot 19^4 \cdot 37^2 \cdot 127^{12} \cdot 137^{-32} \cdot 9377 \cdot 96181 \cdot 1997236169 & \boxtimes \\ \hline
-8 & \biggl(\dfrac{\Tstrut32971}{\Bstrut361}, \dfrac{-4894012}{6859}\biggr) & 2^{28} \cdot 3^6 \cdot 11^2 \cdot 19^{-32} \cdot 37^4 \cdot 61^{12} \cdot 101^{12} \cdot 397 \cdot 1061 \cdot 21937 & \boxtimes \\ \hline
-7 & \biggl(\dfrac{\Tstrut20499}{\Bstrut1369}, \dfrac{418284}{50653}\biggr) & 2^{32} \cdot 3^{44} \cdot 5^{14} \cdot 7^{14} \cdot 13^{12} \cdot 37^{-32} \cdot 41 \cdot 433 \cdot 101873 & \boxtimes \\ \hline
 \end{array}$
\end{sideways}
\end{document}

答案2

放入序言中:

\usepackage{tabls}

在此处输入图片描述

\documentclass[landscape]{article}
\usepackage{amsmath}
\usepackage{amssymb,geometry}
\usepackage{tabls}
\begin{document}

\begin{tabular}{| c | c | c | c | }
    \hline
    $n$ & $nP_\star=(x_n,y_n)$ & $z(nP_\star)$  & $\boxtimes$ / $\Box$ \\ \hline
    $\vdots$ & $\vdots$ & $\vdots$ & $\boxtimes$ \\ \hline
    $-10$ & $\bigg(\dfrac{56424579}{207025}, \dfrac{414903626892}{94196375}\bigg)$ & $2^{24} \cdot 3^{36} \cdot 5^{-32} \cdot 7^{-32} \cdot 13^{-32} \cdot  19^2 \cdot 29 \cdot 41 \cdot 83^2 \cdot 137^4 \cdot 661 \cdot 2677 \cdot 107581 \cdot 165713^{12} \cdot 631292953$ & $\boxtimes$ \\ \hline
    $-9$ & $\bigg(\dfrac{-1094394}{18769}, \dfrac{500465142}{2571353}\bigg)$ & $2^{36} \cdot 3^{48} \cdot 11^{12} \cdot 13 \cdot 19^4 \cdot 37^2 \cdot 127^{12} \cdot 137^{-32} \cdot 9377 \cdot 96181 \cdot 1997236169$ & $\boxtimes$ \\ \hline
    $-8$ & $\bigg(\dfrac{32971}{361}, \dfrac{-4894012}{6859}\bigg)$ & $2^{28} \cdot 3^6 \cdot 11^2 \cdot 19^{-32} \cdot 37^4 \cdot 61^{12} \cdot 101^{12} \cdot 397 \cdot 1061 \cdot 21937$ & $\boxtimes$ \\ \hline
    $-7$ & $\bigg(\dfrac{20499}{1369}, \dfrac{418284}{50653}\bigg)$ & $2^{32} \cdot 3^{44} \cdot 5^{14} \cdot 7^{14} \cdot 13^{12} \cdot 37^{-32} \cdot 41 \cdot 433 \cdot 101873$ & $\boxtimes$ \\ \hline
\end{tabular}

\end{document}

答案3

从您的序言可以看出,您的文档还使用了包tabu。因此,您可以利用这一点。通过使用 tabu\extrarowsep宏,例如:

{
\extrarowsep=2ex
\begin{tabu}{|c | c | c | c | }
...
\end{tabu}
}

您将获得(仅显示表格的左侧部分):

在此处输入图片描述

答案4

cellspace包就是为此而制作的:它使您能够定义一个最小单元格与上方和下方单元格之间的垂直间距,有点像tabls,但没有它的缺点。或者,您可以只在行之间使用水平线booktabs及其\addlinespace命令:

\documentclass{article}
\usepackage[hmargin=1cm]{geometry}
\usepackage{cellspace}
\setlength\cellspacetoplimit{4pt}
\setlength\cellspacebottomlimit{4pt}

\usepackage{booktabs}
\setlength\defaultaddspace{2ex}
\usepackage{amssymb, amsmath}
\usepackage{tabularx,array}
\usepackage{tabu}

\begin{document}

\footnotesize
\begin{tabular}{| *{4}{Sc|}}
  \hline
  $n$ & $nP_\star=(x_n,y_n)$ & $z(nP_\star)$ & $\boxtimes$ / $\Box$ \\ \hline
  $\vdots$ & $\vdots$ & $\vdots$ & $\boxtimes$ \\ \hline
  $-10$ & $\bigg(\dfrac{56424579}{207025}, \dfrac{414903626892}{94196375}\bigg)$ & $2^{24} \cdot 3^{36} \cdot 5^{-32} \cdot 7^{-32} \cdot 13^{-32} \cdot 19^2 \cdot 29 \cdot 41 \cdot 83^2 \cdot 137^4 \cdot 661 \cdot 2677 \cdot 107581 \cdot 165713^{12} \cdot 631292953$ & $\boxtimes$ \\ \hline
  $-9$ & $\bigg(\dfrac{-1094394}{18769}, \dfrac{500465142}{2571353}\bigg)$ & $2^{36} \cdot 3^{48} \cdot 11^{12} \cdot 13 \cdot 19^4 \cdot 37^2 \cdot 127^{12} \cdot 137^{-32} \cdot 9377 \cdot 96181 \cdot 1997236169$ & $\boxtimes$ \\ \hline
  $-8$ & $\bigg(\dfrac{32971}{361}, \dfrac{-4894012}{6859}\bigg)$ & $2^{28} \cdot 3^6 \cdot 11^2 \cdot 19^{-32} \cdot 37^4 \cdot 61^{12} \cdot 101^{12} \cdot 397 \cdot 1061 \cdot 21937$ & $\boxtimes$ \\ \hline
  $-7$ & $\bigg(\dfrac{20499}{1369}, \dfrac{418284}{50653}\bigg)$ & $2^{32} \cdot 3^{44} \cdot 5^{14} \cdot 7^{14} \cdot 13^{12} \cdot 37^{-32} \cdot 41 \cdot 433 \cdot 101873$ & $\boxtimes$ \\ \hline
\end{tabular}
\vskip1cm

\begin{tabular}{ *{4}{c}}
  \toprule
  $n$ & $nP_\star=(x_n,y_n)$ & $z(nP_\star)$ & $\boxtimes$ / $\Box$ \\
  \midrule
  $\vdots$ & $\vdots$ & $\vdots$ & $\boxtimes$ \\
  \addlinespace
  $-10$ & $\bigg(\dfrac{56424579}{207025}, \dfrac{414903626892}{94196375}\bigg)$ & $2^{24} \cdot 3^{36} \cdot 5^{-32} \cdot 7^{-32} \cdot 13^{-32} \cdot 19^2 \cdot 29 \cdot 41 \cdot 83^2 \cdot 137^4 \cdot 661 \cdot 2677 \cdot 107581 \cdot 165713^{12} \cdot 631292953$ & $\boxtimes$ \\
  \addlinespace
  $-9$ & $\bigg(\dfrac{-1094394}{18769}, \dfrac{500465142}{2571353}\bigg)$ & $2^{36} \cdot 3^{48} \cdot 11^{12} \cdot 13 \cdot 19^4 \cdot 37^2 \cdot 127^{12} \cdot 137^{-32} \cdot 9377 \cdot 96181 \cdot 1997236169$ & $\boxtimes$ \\
  \addlinespace
  $-8$ & $\bigg(\dfrac{32971}{361}, \bigg(\dfrac{-4894012}{6859}\bigg)$ & $2^{28} \cdot 3^6 \cdot 11^2 \cdot 19^{-32} \cdot 37^4 \cdot 61^{12} \cdot 101^{12} \cdot 397 \cdot 1061 \cdot 21937$ & $\boxtimes$ \\
  \addlinespace
  $-7$ & $\bigg(\dfrac{20499}{1369}, \dfrac{418284}{50653}\bigg)$ & $2^{32} \cdot 3^{44} \cdot 5^{14} \cdot 7^{14} \cdot 13^{12} \cdot 37^{-32} \cdot 41 \cdot 433 \cdot 101873$ & $\boxtimes$ \\
  \bottomrule
\end{tabular}

\end{document} 

在此处输入图片描述

相关内容