6

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}
7

max width=\textheight}

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

| improve this answer | |
  • This works well. I should have mentioned that I had tried using \textwidth instead of \textheight, but got the same result. Why does \linewidth work, then? – Scott B Sep 2 '13 at 21:04
  • @ScottB I switched \textheight, \linewidth and \columnwidth to the new orientation but I left \textwidth referring to the original width as lscape keeps the page head and foot and several page head styles use \textwidth in their layout and would break if it changed. – David Carlisle Sep 2 '13 at 21:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.