I have a (horizontally) big table constructed with table
, ThreePartTable
and longtabu
. I want it to fit in a single page. For that I am trying to increase margins with adjustwidth
, then expanding the length of the table using 1.1\textwidth
, see code example below.
However, all the adjustment seems to be applied to the right margin, thus for example {adjustwidth}{-1cm}{}
yields the same output as adjustwidth{}{-1cm}
. Similarly, {adjustwidth}{-1cm}{-1cm}
, {adjustwidth}{-2cm}{}
and {adjustwidth}{}{-2cm}
all generate the same output, with all margin reduction done on the right of the page, so that the original left alignment of the table remains unchanged.
Bottom line is that I want to increase margins to allow the table to fit into one page, while keeping it centered in the page. Can anybody point out as to why the below code is not achieving this?
Code example:
\documentclass{article}
\usepackage{booktabs}
\usepackage{chngpage}
\usepackage{float}
\usepackage{longtable}
\usepackage{tabu}
\usepackage{threeparttablex}
\begin{document}
\begin{adjustwidth}{-1cm}{-1cm}
\begin{table}[H]
\scriptsize
\centering
\begin{ThreePartTable}
\begin{longtabu} to 1.1\textwidth
{X[0.5,C]
X[1.75,L]
X[1.2,L]
X[1.175,L]
X[2.325,L]
X[0.75,C]
X[0.9,C]}
\rowfont[c]{\bfseries}
Field1
& Field2
& Field3
& Field4
& Field5
& Field6\tnote{1}
& Field7\tnote{2,3}
\\
\toprule
\endhead
\bottomrule
\endfoot
\bottomrule
\\
\endlastfoot
Field1.Value1
& Field2.Value1
& Field3.Value1
& Field4.Value1
& Field5.Value1
& Field6.Value1
& Field7.Value1
\\
[...]
\bottomrule
\end{longtabu}
\begin{tablenotes}
\item[1] FootNote1
\item[2] FootNote2
\item[3] Footnote3
\end{tablenotes}
\end{ThreePartTable}
\captionsetup{font=normal}
\caption{Caption1}
\label{tab:table_1}
\end{table}
\end{adjustwidth}
\end{document}
\documentclass{article}
to the top, it fails to compile, due to missing\toprule
and unknown float optionH
. For the former probably you are using something likebooktab
.article
class plus some additional formatting. My assumption is that it is not having any impact on this issue... I have added anarticle
initialization to my question. I have also addedbooktabs
as a package, I think that is the right one (lot of colleagues working on this doc and everyone adding their own packages so it can be difficult to identify all required packages...).float
in case it is the one which enables theH
option.caption
package. Anyway, there are several problems here. First is that floats don't work with adjustwidth, second is that how adjustwidth works seems not to work well with the table environments you are using.