0

I have a table with 22 columns which I want to fit in a landscape mode page. Currently, following an advice found in this forum, I am using the "adjustbox" page with the following codes. Although this code produces a table in landscape mode, the table fonts are too small. Could you please suggest me a way to enlarge the font size while keeping the table fitted to the page?

\afterpage{%
\clearpage% Flush earlier floats (otherwise order might not be correct)
\thispagestyle{empty}% empty page style (?)
\begin{landscape}% Landscape page
    \centering % Center table
\begin{adjustbox}{width=\textwidth,totalheight=\textheight,keepaspectratio}
 % your table
    \begin{tabular}{lccccccccccccccccccccr}
        \toprule
        Model & NumPar & AIC & Rank & BIC & Rank & LogL & Rank & MSE1 & Rank & MSE2 & Rank & QLike & Rank & R2Log & Rank MAD2 & Rank & MAD1 & Rank & HMSE & Rank  \\
        \midrule
        1 & 2 & 3 & 4
    \end{tabular}
  \end{adjustbox}
    \captionof{table}{Table caption}% Add 'table' caption
\end{landscape}
\clearpage% Flush page
}

Thanks for your time.

  • the usual advice is never apply scaling to tables. (also you don't need the \clearpage before or after landscape) – David Carlisle Oct 27 '17 at 18:53
1

You did not say how large your page was so hard to know how much to shrink the table (examples should always be complete documents as below, to answer such questions) but this runs with no over full box

\documentclass{article}

\usepackage{pdflscape,afterpage,booktabs,caption}

\begin{document}

\afterpage{%
\begin{landscape}% Landscape page
\thispagestyle{empty}% empty page style (?)
\setlength\tabcolsep{3pt}
    \centering % Center table
  \small
 % your table
    \hspace*{-18mm}%
    \begin{tabular}{@{}lccccccccccccccccccccr@{}}
        \toprule
        Model & NumPar & AIC & Rank & BIC & Rank & LogL & Rank & MSE1 & Rank & MSE2 & Rank & QLike & Rank & R2Log & Rank MAD2 & Rank & MAD1 & Rank & HMSE & Rank  \\
        \midrule
        1 & 2 & 3 & 4
    \end{tabular}%
    \hspace*{-12mm}%

    \captionof{table}{Table caption}% Add 'table' caption
\end{landscape}
}
\end{document}
  • Thank you so much for your valuable time and help. This solved my problem. – TRa Oct 27 '17 at 22:41

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.