
Ich habe derzeit eine Tabelle, die etwas gewachsen ist und nicht mehr in den vorgesehenen Bereich passt. Da ich davon ausgehe, dass diese Tabelle in Zukunft weiter wachsen wird, muss ich sie seitenumbrechbar machen, ohne dabei ihren aktuellen Stil zu verlieren. Es gibt viele Beiträge darüber, wie man seitenumbrechbare Tabellen erstellt, aber ich konnte keine der Lösungen verwenden, die ich gefunden habe, weil ich entweder Fehler bekam, die ich nicht verstehen konnte, oder die endgültige Ausgabe nicht wie beabsichtigt aussah.
Ich teile unten ein MWE, das meine aktuelle (nicht zerstörbare) Tabelle sowie einen Screenshot der von ihr erzeugten Ausgabe zeigt. Das MWE erstellt eine Listenumgebung, die ich dann bei Bedarf aufrufe. Mein Ziel istum diese Ausgabe zu replizieren, aber sicherzustellen, dass die Tabelle korrekt umbricht (anstatt zu springen), wenn sie einen Seitenumbruch erreicht.
\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}
Vielen Dank an alle für Ihre Zeit.
Antwort1
Sie müssen nicht das ganze Zeug in eine tabellarische Umgebung kapseln. Sie können das Format jedes einzelnen \entry
durch Ihre Makros definieren. Das \smallskip
Folgende \hbox
ist natürlich seitenumbruchfähig.
\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}
Antwort2
Ich denke, alles was Sie tun müssen, ist
das Paket laden
longtable
und die Anweisungen erteilen\setlength\LTleft{0pt}
und\setlength\LTright{0pt}
in der Präambel undErsetzen Sie in der Definition der Umgebung
\begin{tabular*}{\textwidth}
„mit\begin{longtable}
“ und „\end{tabular*}
mit“ .\end{longtable}
entrylist
Optional können Sie die \noindent
Direktive am Anfang der Umgebungsdefinition löschen entrylist
.
longtable
Weitere Informationen zu den Längenparametern finden Sie \LTleft
in Abschnitt 5 „Anpassung“ des Benutzerhandbuchs \LTright
.
Antwort3
Verwenden 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}