p{5.5cm} 문단으로 셀 1개로 표를 만들었습니다.
이제 많은 공간을 차지하지 않기 위해 글꼴 크기를 scriptsize로 줄였지만 lineskip 매개변수 때문에 테이블이 예상대로 세로로 줄어들지 않는 것 같습니다. "Berechnung" 셀에서 라인 스킵을 어떻게 조정할 수 있나요?
\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}