Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Below is the MWE for a table spanning multiple pages. I like how this works generally, but the last row is awkwardly left on a lonely page. In the actual document there are many sections more rows, and the ones without text are always treated like the were huge.

What am I missing? Is this just something I have to live with, or is there an alternative markup (still using tables)?

\documentclass[11pt, a4paper]{article}

% DOCUMENT LAYOUT
\usepackage{geometry}
\usepackage{xtab}
\usepackage{lipsum}
\usepackage{layout}
\geometry{a4paper, right=3cm, textheight=22cm, marginparsep=0.5cm, marginparwidth=3.5cm, left=2cm, footskip=3.5cm}

% XTABLE
% --- For paragraph headings
\newcommand{\doom}[1]{%
\footnotesize{#1}}
% --- For "old section" titles
\newcommand{\dope}[1]{%
\LARGE{#1}}

% TABULAR -- MAKE LINES LESS CRAMPED
\renewcommand{\arraystretch}{1.5}
\renewcommand{\tabcolsep}{0.2cm}

\begin{document}

\begin{mpxtabular}{r p{\textwidth}}
&\dope{Hello}\\
\verb|6.5| & \doom{Commitment 4}
\\
&
\lipsum[1]
\\
\\
\verb|6.0| & \doom{Commitment 2}
\\
&
\lipsum[2]
\\
\\
\verb|6.5| & \doom{Commitment 1}
\\
&
\lipsum[1]
\\
\\
\verb|6.0| & \doom{Commitment }
\\
&
\\
\\
\end{mpxtabular}
\end{document}

Regards

share|improve this question
    
xtab estimates the current position with a generous overshooting. This is particularly evident if you use a reduced font size for the table. –  egreg Mar 27 '13 at 16:46
    
Makes sense, but is there any way I can manipulate this? –  anaheim Mar 27 '13 at 16:57
1  
@anaheim This worked for me, from the xtab manual: The command \xentrystretch{decimal-fraction} can be used before a table to modify the amount of vertical space apparently consumed by each entry in the subsequent table(s). The default is \xentrystretch{0.1} which species a 10% overestimate in the vertical space. –  Mobius Pizza May 13 '13 at 11:02

1 Answer 1

up vote 4 down vote accepted

I'm not sure exactly what xtab is doing here but after fixing a few things in your input, this works:

Every line was overfull as the second column was \textwidth wide which left nowhere for the first column.

Font size commands such as \LARGE need a syntax {\LARGE#1\par} not \LARGE{#1}

\tabcolsep is a length not a macro so should be set with \setlength.

\documentclass[11pt, a4paper]{article}

% DOCUMENT LAYOUT
\usepackage{geometry}
\usepackage{xtab}
\usepackage{lipsum}
\usepackage{layout}
\geometry{a4paper, right=3cm, textheight=22cm, marginparsep=0.5cm, marginparwidth=3.5cm, left=2cm, footskip=3.5cm}

% XTABLE
% --- For paragraph headings
\newcommand{\doom}[1]{%
{\footnotesize#1\par}}
% --- For "old section" titles
\newcommand{\dope}[1]{%
{\LARGE#1\par}}

% TABULAR -- MAKE LINES LESS CRAMPED
\renewcommand{\arraystretch}{1.5}
\setlength{\tabcolsep}{0.2cm}

\begin{document}

\begin{mpxtabular}{p{42pt} p{\dimexpr\textwidth-42pt - 4\tabcolsep\relax}}
&\dope{Hello}\\
\verb|6.5| & \doom{Commitment 4}\\
&
\lipsum[1]\\
\mbox{}\\
\verb|6.0| & \doom{Commitment 2}\\
&
\lipsum[2]\\
\mbox{}\\
\verb|6.5| & \doom{Commitment 1}\\
&
\lipsum[1]\\
\mbox{}\\
\verb|6.0| & \doom{Commitment }%
\end{mpxtabular}
\end{document}
share|improve this answer
    
Thats beautiful! What is the mbox{} in the table for? Cheers –  anaheim Mar 28 '13 at 14:38
1  
@user27293 the mbox{} puts things in a bit more stable state before `\` I'm not sure they are needed now with the other changes but I added them originally to the example and they seemed to help xtab a bit. –  David Carlisle Mar 28 '13 at 14:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.