I’ve always used tabularx without any problem, but now out of nothing it doesn’t make \textwidth anymore and I don't understand why (last time I opened my document, everything was fine). Could you tell me please what’s the problem?
\documentclass[a4paper, 11pt, pointlessnumbers, xcolor=dvipsnames]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\usepackage{latexsym}
\usepackage{tabularx}
\usepackage{ltablex}
\usepackage{amssymb}
\usepackage{booktabs}
\babeltags{ger=ngerman}
\usepackage{array, booktabs, boldline}
\begin{document}
\noindent
\def\arraystretch{1.5}
\begin{tabularx}{\textwidth}{>{\raggedright\arraybackslash}p{2.5cm}>{\raggedright\arraybackslash}X>{\raggedright\arraybackslash}X>{\raggedright\arraybackslash}X}
\hlineB{2}
\textsf{\textbf{Addition}} & Avant tout & Ensuite & Pour conclure \\
\hlineB{2}
\end{tabularx}
\end{document}
Best Answer
Your document example can be compile without any error or warnins, i.e. it works as expected
You should be aware, that
ltablex
has a features that in cases, when contents in columns are shorter as would be atX
column when onlytabularx
is loaded, reduce their width to natural width of columns contents (what happens in your case).Your problems can be solved on two ways:
ltablex
package and use some other package which combinelongtable
andtabularx
, for examplexltabular
ltablex
, than add\keepXColumns
to document preamble:(red lines indicate text borders)