I'm trying to make a longtabu
that is wider than the textwidth
at a certain moment. I've tried different things always ending up with a different problem:
First possibility:
If I use the adjustwidth
environment the longtabu does not align correctly. The left margin stays fixed and the right margin gets out of the page. This in contrast, if I do the exact same thing to make a tabu
(instead of longtabu
), it works perfectly. I think using the adjustwidth
is the best way to go, but I can't manage to get it working.
Second possibility:
I've found a solution using the fullwidth
package. That package does the trick, but using endhead and endfirsthead is completely ignored. So it does not help me either, because I need that.
Final possibility:
Using the geometry
package does the trick, but that package adds a pagebreak when I start using it, I can't have that. It has to be directly under some text, which has a narrower textwidth
.
Cheers.
I add a little example:
\documentclass[a4paper]{article}
\usepackage{longtable}
\usepackage{chngpage}
\usepackage{lipsum}
\usepackage{tabu}
\begin{document}
\section{This is the original textwidth.}
\lipsum[1]
\section{This is the width I need for my longtabu}
\begin{adjustwidth}{-1in}{-1in}
\begin{tabu} to \linewidth {*{13}{|X[l]} |}
01 & 02 & 03 & 04 & 05 & 06 & 07 & 08 & 09 & 10 & 11 & 12 & 13 \\
01 & 02 & 03 & 04 & 05 & 06 & 07 & 08 & 09 & 10 & 11 & 12 & 13 \\
01 & 02 & 03 & 04 & 05 & 06 & 07 & 08 & 09 & 10 & 11 & 12 & 13 \\
01 & 02 & 03 & 04 & 05 & 06 & 07 & 08 & 09 & 10 & 11 & 12 & 13 \\
\end{tabu}
\end{adjustwidth}
\section{This is what happens}
\begin{adjustwidth}{-1in}{-1in}
\begin{longtabu} to \linewidth {*{13}{|X[l]} |}
01 & 02 & 03 & 04 & 05 & 06 & 07 & 08 & 09 & 10 & 11 & 12 & 13 \\
01 & 02 & 03 & 04 & 05 & 06 & 07 & 08 & 09 & 10 & 11 & 12 & 13 \\
01 & 02 & 03 & 04 & 05 & 06 & 07 & 08 & 09 & 10 & 11 & 12 & 13 \\
01 & 02 & 03 & 04 & 05 & 06 & 07 & 08 & 09 & 10 & 11 & 12 & 13 \\
\end{longtabu}
\end{adjustwidth}
\end{document}
Best Answer
longtable
lets you set the left and right margins but unfortunately thetabu
wrapper aroundlongtable
always passes in an optional argument which sets the margins to0pt
or\fill
depending on thelcr
alignment.So for
longtabu
as well as setting the margins to-1in
you need to patchtabu
not to defaultc
alignment (which would reset them back to\fill
).