
現在、少し大きくなり、本来のスペースに収まらなくなったテーブルがあります。このテーブルは今後も大きくなり続けることが予想されるため、現在のスタイルを維持しながらページ区切り可能にする必要があります。ページ区切り可能なテーブルを作成する方法については多くの投稿がありますが、理解できないエラーが発生したり、最終出力が意図したとおりに見えなかったりするため、私が見つけた解決策はどれも使用できませんでした。
以下に、現在の(非破壊的な)テーブルと、それが生成する出力のスクリーンショットを示すMWEを共有します。MWEはリスト環境を作成し、必要に応じて呼び出すことができます。私の目標はこの出力を再現しますが、ページ区切りに達するたびにテーブルが正しく分割される(ジャンプしない)ことを確認します。。
\documentclass[a4paper]{article}
\begin{document}
\newenvironment{entrylist}{%
\noindent
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}rl}
}{%
\end{tabular*}
}
\newcommand{\entry}[4]{%
\parbox[t]{1.75cm}{#1\raggedleft}&\parbox[t]{\dimexpr\textwidth-2\tabcolsep-1.75cm}{\strut%
\textbf{#2}%
\hfill%
{\footnotesize #3\par\strut}%
#4\vspace{\parsep}%
}\\}
\begin{entrylist}
\entry
{XXXX}
{Fancy stuff 1}
{Fancy stuff 1}
{Fancy stuff 1}
\entry
{YYYY}
{Fancy stuff 2}
{Fancy stuff 2}
{Fancy stuff 2}
\entry
{ZZZZ}
{Fancy stuff 3}
{Fancy stuff 3}
{Fancy stuff 3}
\end{entrylist}
\end{document}
皆様、お時間をいただきありがとうございました。
答え1
\entry
すべてを表形式の環境にカプセル化する必要はありません。マクロによってそれぞれのフォーマットを定義できます。もちろん、それ\smallskip
以降はページ区切り可能です。\hbox
\newdimen\colsep \colsep=1em
\def\topbox#1#2{\vtop{\parindent=0pt \hsize=\dimexpr#1\relax #2}}
\def\entry#1#2#3#4{\par
\hbox{\topbox{1.75cm}{#1\raggedleft}\kern\colsep
\topbox{\hsize-2\colsep-1.75cm}{{\bf#2}\hfill {\footnotesize#3}\endgraf#4\strut}}
\smallskip
}
\entry
{XXXX}
{Fancy stuff 1}
{Fancy stuff 1}
{Fancy stuff 1}
\entry
{YYYY}
{Fancy stuff 2}
{Fancy stuff 2}
{Fancy stuff 2}
\entry
{ZZZZ}
{Fancy stuff 3}
{Fancy stuff 3}
{Fancy stuff 3}
答え2
あなたがすべきことは
パッケージをロードし
longtable
て指示を発行し\setlength\LTleft{0pt}
、\setlength\LTright{0pt}
プリアンブルで環境の定義内
\begin{tabular*}{\textwidth}
で を に\begin{longtable}
、\end{tabular*}
を に置き換えます。\end{longtable}
entrylist
オプションで、環境\noindent
定義の先頭にあるディレクティブを削除することもできますentrylist
。
長さパラメータと機能longtable
の詳細については、ユーザー ガイドのセクション 5「調整」を参照してください。\LTleft
\LTright
答え3
使用longtable
。
\documentclass[a4paper]{article}
\usepackage{longtable,array}
\usepackage{lipsum} % for nonsense text
\usepackage{showframe} % for showing the page boundaries
\newlength{\entrylistwidth}
\setlength{\entrylistwidth}{1.75cm}
\newenvironment{entrylist}{%
\begin{longtable}{
@{}
w{l}{\entrylistwidth}
p{\dimexpr\textwidth-2\tabcolsep-\entrylistwidth}
@{}
}
}{\end{longtable}}
\newcommand{\entry}[4]{%
#1 & \textbf{#2}\hfill{\footnotesize #3\par}#4\\\noalign{\vspace{\parsep}}%
}
\begin{document}
\begin{entrylist}
\entry
{XXXX}
{Fancy stuff 1}
{Fancy stuff 1}
{\lipsum[1][1-3]}
\entry
{YYYY}
{Fancy stuff 2}
{Fancy stuff 2}
{\lipsum[2][1-3]}
\entry
{ZZZZ}
{Fancy stuff 3}
{Fancy stuff 3}
{\lipsum[3][1-3]}
\entry
{ZZZZ}
{Fancy stuff 3}
{Fancy stuff 3}
{\lipsum[3][1-3]}
\entry
{ZZZZ}
{Fancy stuff 3}
{Fancy stuff 3}
{\lipsum[3][1-3]}
\entry
{ZZZZ}
{Fancy stuff 3}
{Fancy stuff 3}
{\lipsum[3][1-3]}
\entry
{ZZZZ}
{Fancy stuff 3}
{Fancy stuff 3}
{\lipsum[3][1-3]}
\entry
{ZZZZ}
{Fancy stuff 3}
{Fancy stuff 3}
{\lipsum[3][1-3]}
\entry
{ZZZZ}
{Fancy stuff 3}
{Fancy stuff 3}
{\lipsum[3][1-3]}
\entry
{ZZZZ}
{Fancy stuff 3}
{Fancy stuff 3}
{\lipsum[3][1-3]}
\entry
{ZZZZ}
{Fancy stuff 3}
{Fancy stuff 3}
{\lipsum[3][1-3]}
\entry
{ZZZZ}
{Fancy stuff 3}
{Fancy stuff 3}
{\lipsum[3][1-3]}
\entry
{ZZZZ}
{Fancy stuff 3}
{Fancy stuff 3}
{\lipsum[3][1-3]}
\entry
{ZZZZ}
{Fancy stuff 3}
{Fancy stuff 3}
{\lipsum[3][1-3]}
\entry
{ZZZZ}
{Fancy stuff 3}
{Fancy stuff 3}
{\lipsum[3][1-3]}
\entry
{ZZZZ}
{Fancy stuff 3}
{Fancy stuff 3}
{\lipsum[3][1-3]}
\entry
{ZZZZ}
{Fancy stuff 3}
{Fancy stuff 3}
{\lipsum[3][1-3]}
\entry
{ZZZZ}
{Fancy stuff 3}
{Fancy stuff 3}
{\lipsum[3][1-3]}
\entry
{ZZZZ}
{Fancy stuff 3}
{Fancy stuff 3}
{\lipsum[3][1-3]}
\entry
{ZZZZ}
{Fancy stuff 3}
{Fancy stuff 3}
{\lipsum[3][1-3]}
\entry
{ZZZZ}
{Fancy stuff 3}
{Fancy stuff 3}
{\lipsum[3][1-3]}
\entry
{ZZZZ}
{Fancy stuff 3}
{Fancy stuff 3}
{\lipsum[3][1-3]}
\entry
{ZZZZ}
{Fancy stuff 3}
{Fancy stuff 3}
{\lipsum[3][1-3]}
\end{entrylist}
\end{document}