
나는 하나의 열로 구성된 긴 테이블을 그리고 있습니다. 표를 그렸는데 셀 크기가 너무 큽니다. 셀 크기를 어떻게 줄일 수 있나요? 그리고 나는 왼쪽 모서리가 아닌 페이지 오른쪽 모서리에 다음 페이지에 줄이 계속 이어지도록 하고 싶었습니다. 내가 어떻게 해. 내 코드는 다음과 같습니다. 오류 이미지를 첨부했습니다.
\begingroup
\setcellgapes{3pt}
\makegapedcells
\begin{xltabular}{\linewidth}{ |l||*{1}{>{\hskip 1em}X|} }
%\begin{xltabular}{ |p{3 cm}||p{3.8cm}| }
\caption{Simulation data of overall system}
\label{tab:overalldata}\\
\Xhline{1pt}
\makecell[t]{System parameters}
& \mcx{Simulation data}\\
\Xhline{0.6pt}
\endfirsthead
%\caption[]{Data comparison of steady state and transient simulation} \\
\Xhline{1pt}
\makecell{System parameters}
& \mcx{Simulation data}\\
\Xhline{0.6pt}
\endhead
\Xhline{0.6pt}
\multicolumn{4}{r}{\small\textit{Continue on the next page}}
\endfoot
\Xhline{1pt}
\endlastfoot
Pel\_Boiler (\si{KW}) &92.572\\
N\_STEAM\_RECY (\si{mol/s}) &1.686\\
Pel\_SH (\si{KW}) &66.869 \\
T\_AC\_OUT (\si{K}) &945.732\\
T\_CC\_OUT (\si{K}) &885.8513695\\
\hline
\end{xltabular}
\endgroup
답변1
나는 당신이 다음과 같은 것을 찾고 있다고 생각합니다.
위의 표에는 사용된 패키지 longtable
와 siunitx
패키지가 나와 있습니다. xparse
대신 을 사용하여 새 명령을 정의하는 데 사용됩니다 \multicolumn{...}{...}{<content>}
. 표시된 결과에는 다음 MWE의 최소한 4개의 컴파일이 필요합니다.
\documentclass{article}
\usepackage[skip=1ex]{caption}
\usepackage{cellspace, longtable}
\setlength\cellspacetoplimit{3pt}
\setlength\cellspacebottomlimit{3pt}
\usepackage{siunitx}
\sisetup{per-mode=symbol}
\usepackage{xparse}
\NewExpandableDocumentCommand\mcc{O{|Cc|}m}
{\multicolumn{2}{#1}{#2}}
\NewExpandableDocumentCommand\mcl{O{c}m}
{\multicolumn{1}{#1}{#2}}
\begin{document}
\begin{longtable}{| Cr s[table-unit-alignment = left]
| S[zero-decimal-to-integer,
round-mode=places,
round-precision=3]
|}
\caption{Simulation data of overall system.}
\label{tab:s:align} \\
\hline
\mcc{System parameters} & {value} \\
\hline
\endfirsthead
\caption[]{Simulation data of overall system.} \\
\hline
\mcc{System parameters} & {value} \\
\hline
\endhead
\hline
\mcl{} & \mcc[r]{\footnotesize{Continue on the next page}}
\endfoot
\hline
\endlastfoot
% table body
Pel\_Boiler & \kilo\watt & 92.572 \\
N\_STEAM\_RECY & \mol\per\second & 1.686 \\
Pel\_SH & \kilo\watt & 66.869 \\
T\_AC\_OUT & \kelvin & 945.732 \\
T\_CC\_OUT & \kelvin & 885.8513695 \\
\end{longtable}
\end{document}
편집하다:
형식 지정 과 MWE 열에 makegapedcells
정의된 매크로 사이의 비호환성으로 인해 패키지는 셀에 수직 공간을 추가하기 위해 로 대체되었습니다 .makecell
s
S
makecell
cellspace
이제 열에 반올림 옵션도 추가되었습니다 S
.