여러 페이지에 걸쳐 있는 테이블이 있다고 가정합니다.
\documentclass[DIV=8]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{booktabs,array,ragged2e,longtable}
\newcolumntype{P}[1]{>{\RaggedRight\arraybackslash}p{#1\textwidth}}
\usepackage{enumitem}
%% Create a very compact itemized list environment
\newlist{mylist}{itemize}{1}
\setlist[mylist]{label=\textbullet, nosep, wide,
leftmargin=*, % hanging indentation
before=\vspace{-0.50\baselineskip},
after =\vspace{-0.8\baselineskip}}
\begin{document}
% keep scope of longtable-related instructions local to current TeX group
\begingroup
\setlength\tabcolsep{0pt} % <--- important
\setlength\LTleft{0pt}
\setlength\LTright{0pt}
\begin{longtable}{@{\extracolsep{\fill}}P{0.38}P{0.38}P{0.2}}
\caption{My caption} \label{my-label}\\
\toprule
Column 1 & Column 2 & Column 3 \\
\midrule
\endfirsthead
\multicolumn{3}{l}{(Table \ref{my-label}, cont'd)}\\ % re-state table number
\addlinespace
\toprule
Column 1 & Column 2 & Column 3 \\
\midrule
\endhead
\bottomrule
\addlinespace
\multicolumn{3}{r}{(cont'd on next page)}\\
\endfoot
\bottomrule
\endlastfoot
\begin{mylist}
\item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita
\item Lorem ipsum dolor sit
\item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
\end{mylist} &
\begin{mylist}
\item Lorem ipsum dolor sit amet, consetetur sadipscing
\item Lorem ipsum dolor sit
\item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
\item Lorem ipsum
\end{mylist} &
\begin{mylist}
\item Lorem ipsum
\item Lorem ipsum
\end{mylist} \\
\addlinespace
\begin{mylist}
\item Lorem ipsum dolor sit amet, consetetur sadipscing
\item Lorem ipsum dolor sit
\item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
\end{mylist} &
\begin{mylist}
\item Lorem ipsum dolor sit amet, consetetur sadipscing
\item Lorem ipsum dolor sit
\item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
\item Lorem ipsum
\item Lorem ipsum
\end{mylist} &
\begin{mylist}
\item Lorem ipsum
\item Lorem ipsum
\end{mylist} \\
\addlinespace
\begin{mylist}
\item Lorem ipsum dolor sit amet, consetetur sadipscing
\item Lorem ipsum dolor sit
\item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
\end{mylist} &
\begin{mylist}
\item Lorem ipsum dolor sit amet, consetetur sadipscing
\item Lorem ipsum dolor sit
\item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
\item Lorem ipsum
\item Lorem ipsum
\end{mylist} &
\begin{mylist}
\item Lorem ipsum
\item Lorem ipsum
\end{mylist} \\
\addlinespace
\begin{mylist}
\item Lorem ipsum dolor sit amet, consetetur sadipscing
\item Lorem ipsum dolor sit
\item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
\end{mylist} &
\begin{mylist}
\item Lorem ipsum dolor sit amet, consetetur sadipscing
\item Lorem ipsum dolor sit
\item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
\item Lorem ipsum
\item Lorem ipsum
\end{mylist} &
\begin{mylist}
\item Lorem ipsum
\item Lorem ipsum
\end{mylist} \\
%\addlinespace % omit if at page break
\begin{mylist}
\item Lorem ipsum dolor sit amet, consetetur sadipscing
\item Lorem ipsum dolor sit
\item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
\end{mylist} &
\begin{mylist}
\item Lorem ipsum dolor sit amet, consetetur sadipscing
\item Lorem ipsum dolor sit
\item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
\item Lorem ipsum
\item Lorem ipsum
\end{mylist} &
\begin{mylist}
\item Lorem ipsum
\item Lorem ipsum
\end{mylist} \\
\end{longtable}
\endgroup % end of TeX group that encases the 'longtable' material
\end{document}
세로 모드에서 테이블이 내 텍스트 너비보다 넓어야 합니다. geometry
제안된 대로 패키지 사용여기테이블이 새 페이지에서 시작되기 때문에 실행 불가능합니다. 그래도 내 텍스트 흐름 내에 갖고 싶습니다. 긴 테이블을 텍스트 폭보다 넓게 만드는 방법이 있나요?
답변1
답변2
xltabular
동일한 이름의 환경으로 패키지를 사용하십시오 .
\documentclass[DIV=8,captions=tableabove]{scrartcl}
[...]
\usepackage{booktabs,array,ragged2e,xltabular}
\newcolumntype{P}[1]{>{\RaggedRight}p{#1\textwidth}}
\usepackage{enumitem}
\newlist{mylist}{itemize}{1}
\setlist[mylist]{label=\textbullet, nosep, wide,
leftmargin=*, % hanging indentation
before=\vspace{-0.50\baselineskip},
after =\vspace{-0.8\baselineskip}}
\begin{document}
\begingroup
\setlength\tabcolsep{2pt}
\begin{xltabular}{\linewidth}{@{} >{\RaggedRight}X >{\RaggedRight}X P{0.22} @{} }
\caption{My caption} \label{my-label}\\
\toprule
...