8

Here an extra vertical space is added before the tabularx environment (you can see that by comparing it with the same document compiled w/o ltablex package and with the \keepXColumns line commented out. How do I get rid of that extra space?

\documentclass{article}

\usepackage{blindtext,booktabs,cmap,ltablex,tabularx}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\keepXColumns

\begin{document}

\section*{Random Section}

\begin{tabularx}{\textwidth}{lX}
\toprule
1 & \blindtext \\
2 & \blindtext \\
\bottomrule
\end{tabularx}

\end{document}
| improve this question | | | | |
7

Normally tabularx is like tabular and is an inline table set as part of the current line of the paragraph, so has no external spacing.

This package changes them all to be longtable essentially that is display environments set in vertical mode. So they are never part of the current line, and the space before is the controlled by, for example

\setlength\LTpre{3in}

You could reduce this, but the layout is still fundamentally different.

(ltxtable is a different combination of tabularx and longtable that doesn't have this feature.)

| improve this answer | | | | |
  • I see... but the \setlength\LTpre{0pt} hack works so thank you! – Egor Tensin Sep 12 '13 at 17:08
  • What is the difference between ltxtable and ltablex? – skan Feb 18 '16 at 16:51
  • 1
    @skan both merge tabularx and longtable but done by different people. Since I wrote one of them, I'm not the person to provide an objective review:-) – David Carlisle Feb 18 '16 at 16:53
  • OK, thank you. I've also read that tabu is newer but if I check its last update was a really long time ago – skan Feb 18 '16 at 19:59
  • @skan tabu has other issues but define "long time ago" my ltxtable package seems to be dated 1995/12/11 which some people might consider to be a long time ago as well:-) tabu is dated 2011/02/26 which seems quite recent to me:-) – David Carlisle Feb 18 '16 at 20:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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