减少表格段落中的跳行数

减少表格段落中的跳行数

我制作了一个表格,其中一个单元格作为 p{5.5cm} 段落。

现在,为了不占用太多空间,我将字体大小减小到了脚本大小,但是表格并没有像预期的那样垂直缩小,我认为这是因为 lineskip 参数造成的。我怎样才能调整单元格“Berechnung”中的 lineskip?

\documentclass[11pt]{amsart}
\usepackage{geometry}         % See geometry.pdf to learn the layout options. There are lots.
\geometry{a4paper}            % ... or a4paper or a5paper or ...     
\begin{document}


  \begin{minipage}[t]{\textwidth}
Erweiterter Euklidischer Algorithmus:\\
      \begin{tabular}{|c|c|c|c|c|c|c|c|p{5.5cm}|}\hline % Quelle: http://johannes-bauer.com/compsci/eea/?a=7&b=60&submit=Berechnen
        A       & B         & Q         & R         & S         & T         & U         & V         & Berechnung:   \\ \hline
        60  & 7     &       &       & 1     & 0     & 0     & 1     & Startwerte \\ \hline
        60  & 7     & 8     & 4     & 0     & 1     & 1     & -8        & \begin{scriptsize}
        Q = A / B = 60 / 7 = 8\newline R = A \% B = 60 \% 7 = 4 \newline $S = U_{alt} = 0$ \newline $T = V_{alt} = 1$ \newline 
        $U = S_{alt} - (Q \cdot U_{alt}) = 1 - (8 \cdot 0) = 1$ \newline $V = T_{alt} - (Q \cdot V_{alt}) = 0 - (8 \cdot 1) = -8$  \end{scriptsize}\\ \hline
        7       & 4     & 1         & 3     & 1     & -8        & -1        & 9     & \begin{scriptsize}
        $A = B_{alt}$ \newline $B = R_{alt}$ \newline Q = A / B = 7 / 4 = 1 \newline R = A \% B = 7 \% 4 = 3 \newline 
        $S = U_{alt} = 1$ \newline $T = V_{alt} = -8$ \newline $U = S_{alt} - (Q \cdot U_{alt}) = 0 - (1 \cdot 1) = -1$ \newline 
        $V = T_{alt} - (Q \cdot V_{alt}) = 1 - (1 \cdot -8) = 9$\end{scriptsize}\\ \hline
        4       & 3     & 1         & 1     & -1        & 9     & 2     & -17   & \begin{scriptsize}
        $A = B_{alt}$ \newline $B = R_{alt}$ \newline Q = A / B = 4 / 3 = 1 \newline R = A \% B = 4 \% 3 = 1 \newline 
        $S = U_{alt} = -1$ \newline $T = V_{alt} = 9$ \newline $U = S_{alt} - (Q \cdot U_{alt}) = 1 - (1 \cdot -1) = 2$ \newline 
        $V = T_{alt} - (Q \cdot V_{alt}) = -8 - (1 \cdot 9) = -17$\end{scriptsize}\\ \hline
                & 1     &       &       & 2     & -17   &       &       & Ergebnisse\\ \hline\hline 
      \end{tabular}
  \end{minipage}%

\end{document} 

答案1

我建议您使用tabularx宽度设置为 的环境\textwidth,而不是使用tabular嵌套在minipage宽度设置为 的环境中的环境\textwidth

为了简化表格材料的输入,我建议您自动将最后一列中的所有内容设置为字体大小。(这可以通过发布\normalsize指令逐一覆盖。)此设置的一个有益的副作用是,当您选择较小的字体大小时,行距也会减小。

在此处输入图片描述

\documentclass[11pt,a4paper]{amsart}
\usepackage{geometry,tabularx}

\begin{document}
\noindent
\begin{tabularx}{\textwidth}{| *{8}{c|} >{\scriptsize\arraybackslash}X |}
\multicolumn{9}{l}{Erweiterter Euklidischer Algorithmus}\\
        \hline
        A & B & Q & R & S & T & U & V & \normalsize Berechnung   \\
        \hline
        60  & 7 & & & 1 & 0 & 0 & 1 & \normalsize Startwerte \\ \hline
        60  & 7 & 8 & 4 & 0 & 1 & 1 & $-8$  &
        $Q = A / B = 60 / 7 = 8$\newline
        $R = A \% B = 60 \% 7 = 4$ \newline
        $S = U_{alt} = 0$ \newline
        $T = V_{alt} = 1$ \newline
        $U = S_{alt} - (Q \cdot U_{alt}) = 1 - (8 \cdot 0) = 1$ \newline
        $V = T_{alt} - (Q \cdot V_{alt}) = 0 - (8 \cdot 1) = -8$ \\
        \hline
        7 & 4 & 1 & 3 & 1 & $-8$ & $-1$ & 9 &
        $A = B_{alt}$ \newline
        $B = R_{alt}$ \newline
        $Q = A / B = 7 / 4 = 1$ \newline
        $R = A \% B = 7 \% 4 = 3$ \newline
        $S = U_{alt} = 1$ \newline
        $T = V_{alt} = -8$ \newline
        $U = S_{alt} - (Q \cdot U_{alt}) = 0 - (1 \cdot 1) = -1$ \newline
        $V = T_{alt} - (Q \cdot V_{alt}) = 1 - (1 \cdot -8) = 9$\\
        \hline
        4 & 3 & 1 & 1 & $-1$ & 9 & 2 & $-17$ &
        $A = B_{alt}$ \newline
        $B = R_{alt}$ \newline
        $Q = A / B = 4 / 3 = 1$ \newline
        $R = A \% B = 4 \% 3 = 1$ \newline
        $S = U_{alt} = -1$ \newline
        $T = V_{alt} = 9$ \newline
        $U = S_{alt} - (Q \cdot U_{alt}) = 1 - (1 \cdot -1) = 2$ \newline
        $V = T_{alt} - (Q \cdot V_{alt}) = -8 - (1 \cdot 9) = -17$\\
        \hline
        & 1 & & & 2 & $-17$ & & & \normalsize Ergebnisse\\
        \hline
\end{tabularx}
\end{document}

相关内容