1

I don't understand with when using ltablex tabularx do not spread the width pass in argument :

code without ltablex :

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[frenchb]{babel}
\usepackage{array}
%\usepackage{ltablex}
\usepackage{tabularx}

\begin{document}

\noindent
\rule{\linewidth}{6pt}
\\
\\
\noindent
\begin{tabularx}{\linewidth}{X|X|X}
  Date & Version & Description \\ \hline
  07/01/2016 & 0.1 & Init \\
  07/01/2016 & 0.2 & test \\
\end{tabularx}

\end{document}

result :

enter image description here

code with ltablex :

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[frenchb]{babel}
\usepackage{array}
\usepackage{ltablex}
\usepackage{tabularx}

\begin{document}

\noindent
\rule{\linewidth}{6pt}
\\
\\
\noindent
\begin{tabularx}{\linewidth}{X|X|X}
  Date & Version & Description \\ \hline
  07/01/2016 & 0.1 & Init \\
  07/01/2016 & 0.2 & test \\
\end{tabularx}

\end{document}

result :

enter image description here

4

ltablex redefines tabularx in lots of ways one is that, by default it turns X columns into l columns for small tables. It probably shouldn't do that but it does, it has a command to turn that off. texdoc ltablex page 1: \keepXColumns

That said, while automatically changing X is probably unfortunate I would not use tabularx for a table that does not have paragraphs of text, it is designed to adjust the width for linebreaking within columns so doesn't really do anything very useful for tables with single-line data.

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.