[Tex/LaTex] Adjustbox on a landscape page makes a table too small

adjustboxscalingtables

I am trying to use adjustbox to scale down a table that is too large for a landscape page, but when I use it, the scaled table is much smaller than it needs to be relative to the size of the page. Any idea what I am doing wrong?

Below is an example that shows the issue. The same table is shown both using adjustbox and without.

\documentclass[letterpaper,12pt,oneside]{article}
\usepackage{booktabs,pdflscape,adjustbox}

\begin{document}

\begin{landscape}

some filler text. some filler text. some filler text. some filler text. some filler text. some filler text. some filler text. some filler text. some filler text. some filler text. some filler text. some filler text. some filler text. some filler text. some filler text. some filler text. some filler text.  

\begin{table}[t]

\begin{adjustbox}{max width=\textheight}
\begin{tabular}{*{5}{l}}
\toprule
   & \multicolumn{2}{c}{Women} & \multicolumn{2}{c}{Men} \\\cmidrule(lr){2-3}\cmidrule(lr){4-5}
                     & Person-  &    & Person-  &  \\
                     &  month  &  Unique & month  &  Unique \\
Sample restrictions  & records  &  individuals & records  &  individuals \\
\midrule
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXxx          & xxxxxx & xxxxx & xxxxx & xxxxx \\
\bottomrule
\end{tabular}
\end{adjustbox}
\end{table}
\end{landscape}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% now same table without adjustbox
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\clearpage
\begin{landscape}
\begin{table}[t]
\begin{tabular}{*{5}{l}}
\toprule
   & \multicolumn{2}{c}{Women} & \multicolumn{2}{c}{Men} \\\cmidrule(lr){2-3}\cmidrule(lr){4-5}
                     & Person-  &    & Person-  &  \\
                     &  month  &  Unique & month  &  Unique \\
Sample restrictions  & records  &  individuals & records  &  individuals \\
\midrule
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXxx          & xxxxxx & xxxxx & xxxxx & xxxxx \\
\bottomrule
\end{tabular}
\end{table}
\end{landscape}

\end{document}

Best Answer

max width=\textheight}

lscape sets \textheight locally to be the new height but you want the local width so use \linewidth instead.

Related Question