TeX - LaTeX Asked by David Purton on March 26, 2021
I’m using ltablex
to make a long tablularx
environment. I notice that it seems to centre the table across the page rather than putting it inline like tabularx
does. This causes problems for me because I want the table as part of an enumerate
list.
How can I make the table return to being set inline?
documentclass{article}
usepackage[a6paper,landscape,margin=3cm]{geometry}
usepackage{booktabs,ltablex}
keepXColumns
begin{document}
begin{enumerate}
item Some text.
begin{tabularx}{linewidth}{XX}
toprule
a & b
midrule
a & b
midrule
a & b
midrule
a & b
midrule
a & b
midrule
a & b
midrule
a & b
midrule
a & b
midrule
a & b
bottomrule
end{tabularx}
end{enumerate}
end{document}
Page 1:
Page 2:
ltablex
for comparisonThis was created just with usepackage{booktabs,tabularx}
. Notice that the table lines up with the text in the enumerate environment:
Try the following:
documentclass{article}
usepackage[a6paper,landscape,margin=3cm]{geometry}
usepackage{booktabs,ltablex}
keepXColumns
%---------------- show page layout. don't use in a real document!
usepackage{showframe}
renewcommandShowFrameLinethickness{0.15pt}
renewcommand*ShowFrameColor{color{red}}
%---------------------------------------------------------------%
begin{document}
begin{enumerate}
item Some text.
{
setlengthLTleftfill
setlengthLTright{0pt}
begin{tabularx}{linewidth}{XX}
toprule
a & b
midrule
a & b
midrule
a & b
midrule
a & b
midrule
a & b
midrule
a & b
midrule
a & b
midrule
a & b
midrule
a & b
bottomrule
end{tabularx}
}
end{enumerate}
end{document}
Correct answer by Zarko on March 26, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP