
답변1
나는 첫 번째 테이블에서 두 가지 주요 과제를 인식합니다.
텍스트 블록 안에 맞추는 방법은 무엇입니까? 기본
tabular
환경에서는 이 17열 테이블이 실제로 적합하다는 보장이 없습니다.헤더 줄("프로세스 ID...")을 어떻게 조판하나요?
이러한 과제를 해결하려면 아래 코드에서와 같이 (a) tabular*
너비가 로 설정된 환경 \textwidth
과 (b) 지시문을 사용하는 것이 좋습니다 . \multicolumn
참고로 저는 숫자를 왼쪽 정렬보다는 오른쪽 정렬로 했습니다.
세 번째 과제는 전체 표 형식 자료를 밝은 회색 배경으로 렌더링하는 방법일 수 있습니다. 아래 코드에서는 제안된 기술을 사용했습니다.이 답변이 문제를 해결하기 위해.
두 번째 테이블에 관해서는 숫자 자료를 중괄호로 둘러싸인 (수학적) 행렬로 설정하는 것이 옳지 않다고 말하고 싶습니다. 훨씬 더 중요한 것은 헤더 셀을 해당 열과 정렬하는 것입니다. 이와 별도로, 가독성을 위해 해당 소수점 표시의 숫자를 정렬하는 것이 중요하다고 말하고 싶습니다. 따라서 4개의 "실제" 데이터 열에 대해 패키지 의 열 유형 tabular
과 함께 환경을 사용하겠습니다 .S
siunitx
\documentclass{article}
\usepackage{booktabs,siunitx,xcolor}
\definecolor{lightgray}{gray}{0.85} % define a suitable version of "light gray"
\newcommand\mytab[1]{\smash{%
\begin{tabular}[t]{@{}c@{}}#1\end{tabular}}}
\begin{document}
\noindent
\begingroup % localize scope of next two instructions
\setlength\tabcolsep{0pt} % make LaTeX figure out inter-column whitespace
\setlength\fboxsep{0pt} % see https://tex.stackexchange.com/a/63897/5001
\colorbox{lightgray}{%
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} *{17}{r}}
\toprule
\multicolumn{6}{@{}l}{Process ID: 3939}\\[0.5ex]
105 & 104& 104& 106& 105& 104& 104& 106& 105& 104& 104& 106& 5& 4& 5& 5 &0 \\
40 & 41 & \dots \\
3 & 3 & \dots \\
3 & 12 & \dots \\
\bottomrule
\end{tabular*}}
\endgroup
\bigskip
\begin{center}
\begin{tabular}{@{}c *{2}{S[table-format=1.3]}
c *{2}{S[table-format=1.3]} @{}}
\toprule
\mytab{Distinct\\System Call} &
\multicolumn{5}{c}{Trace} \\
\cmidrule(l){2-6}
& {1} & {2} & & {$m-1$} & {$m$} \\
\midrule
1 & 0.051 & 0.055 & \dots & 0.049 & 0.051 \\
2 & 0.122 & 0.125 & \dots & \\
&{\vdots}&{\vdots}&{\vdots}& \\
155& 0.101 & 0.1 & \dots & \\
167& 0.03 & 0.03 & \dots & 0.02 & 0.03 \\
\bottomrule
\end{tabular}
\end{center}
\end{document}