1
\documentclass[12pt,a4paper,twoside]{report}

\usepackage[a4paper,width=150mm,top=25mm,bottom=25mm,bindingoffset=6mm]{geometry}
\usepackage{multirow, array, makecell}
\usepackage[counterclockwise]{rotating}

\begin{document}

\begin{sidewaystable}[ht]
\centering
\caption{XXX}
\resizebox{\textwidth}{!}{
\begin{tabular}{l|rrr|rrrr}
\cline{1-7}
\multirow{2}{*}{Crop} & \multicolumn{3}{c|}{XXX} & \multicolumn{3}{c}{XXX} & \\ \cline{2-7}
~ &\multicolumn{1}{c}{2014} & \multicolumn{1}{c}{2015} & \multicolumn{1}{c|}{2016} & \multicolumn{1}{c}{2014} & \multicolumn{1}{c}{2015} & \multicolumn{1}{c}{2016} & \\
\cline{1-7}
AAA     &    24,588,220     &    21,025,436     &    28,467,038     &   -67.9   &   -14.49  &   35.39    &  \\  \cline{1-7}
BBB &   2.58    &   4.22    &   3.87    &   -57.26  &   39.94   &   24.11   &  \\   \cline{1-7}
CCC         &   9.01    &   7.95    &   6.31    &   -56.24  &   -24.60  &   7.45    &  \\   \cline{1-7}
DDD\textsuperscript{a}      &   9.39    &   6.95    &   11.90   &   -56.36  &   -36.69  &   131.70  &  \\   \cline{1-7}
EEE\textsuperscript{b}      &   0.88    &   1.27    &   1.22    &   -81.66  &   22.59   &   30.39 &     \\  \cline{1-7}
FFF\textsuperscript{c}      &   1.67    &   1.57    &   0.41    &   -53.84  &   -19.56  &   -64.81  &  \\   \cline{1-7}
GGG     &   0.08    &   0.10    &   0.10    &   -55.45  &   4.81    &   31.06   &  \\   \cline{1-7}
HHH &   0.19    &   0.23    &   0.25    &   -58.07  &   1.18    &   50.99   &  \\   \cline{1-7}
III     &   0.49    &   0.30    &   1.36    &   -54.92  &   -47.45  &   512.85  &  \\   \cline{1-7}
JJJ     &   58.76   &   60.18   &   55.56   &   -73.22  &   -12.43  &   25.00   &  \\   \cline{1-7}
KKK     &   1.12    &   1.14    &   0.25    &   -67.91  &   -12.79  &   -69.96  &  \\   \cline{1-7}
LLL     &   11.73   &   11.92   &   16.10   &   -51.17  &   -13.05  &   82.84   &  \\   \cline{1-7}
MMM     &   0.08    &   0.06    &   0.03    &   -71.80  &   -30.15  &   -31.65  &  \\   \cline{1-7}
NNN     &   0.00    &   0.01    &   0.02    &   84.98   &   -375.02 &   62.81   &  \\   \cline{1-7}
OOO\textsuperscript{d}  &   0.32    &   0.61    &   0.40    &   -44.05  &   60.23   &   -11.52  &  \\   \cline{1-7}
PPP     &   0.55    &   0.29    &   0.27    &   1709.83 &   -55.80  &   27.74   &  \\   \cline{1-7}
QQQ     &   0.05    &   0.00    &   0.02    &   9.08    &   0.00    &   0.00    &  \\   \cline{1-7}
RRR\textsuperscript{e}      &   0.17    &   0.12    &   0.35    &   -39.81  &   -36.64  &   288.47  &  \\   \cline{1-7}
SSS     &   1.17    &   1.87    &   0.86    &   -51.92  &   36.97   &   -37.69  &  \\   \cline{1-7}
TTT     &   1.76    &   1.20    &   0.71    &   -33.79  &   -41.36  &   -19.71  &  \\ \cline{1-7}
\multicolumn{8}{l}{\textit{Some text here}} \\
\multicolumn{8}{l}{\textbf{Footnotes:}}\\
\multicolumn{8}{l}{(a) Footnote a}\\
\multicolumn{8}{l}{(b) Footnote b}\\
\multicolumn{8}{l}{(c) Footnote c}\\
\multicolumn{8}{l}{(d) Footnote d}\\
\multicolumn{8}{l}{(e) Footnote e}\\
\multicolumn{8}{l}{\textbf{Other notes:}} \\
\multicolumn{8}{l}{\makecell[l]{(1) Double line text here ........................................................................................................................................................ \\ ..................................}} \\
\multicolumn{8}{l}{(2) Single line text here}\\
\end{tabular}}
\end{sidewaystable}

\end{document}

The output goes beyond the left and right margins. I thought that resizebox can make sure this does not happen. Could it be because I used it together with sidewaystable?

Thank you.

  • For the footnotes in the table you might be interested in the threeparttable package. Apart from that, I'd recommend to not use resizebox to make a table fit into the textwidth as it causes inconsistent font sizes. Instead you could manually decrease the font size or change the horizontal spacing between adjacent columns. – leandriis Oct 16 '19 at 5:19
  • With and also without the use of resizebox, I get the following (or a very similar) output: i.stack.imgur.com/Q9Ova.png Is this similar to what you get? You could easily fit the table onto a portrait page. Would that be ok for you? – leandriis Oct 16 '19 at 5:50
  • Thanks, @leandriis – Kenneth Oct 16 '19 at 7:45
1

As leandriis advised, you have to change the table footnote tags per threeparttable format, and set the table in little bit small font size may solve the issue, updated MWE follows:

\documentclass[12pt,a4paper,twoside]{report}

\usepackage[a4paper,width=150mm,top=25mm,bottom=25mm,bindingoffset=6mm]{geometry}
\usepackage{multirow, array, makecell}
\usepackage[counterclockwise]{rotating}
\usepackage{threeparttable}

\begin{document}

\begin{sidewaystable}[ht]
\centering
\caption{XXX}
\begin{threeparttable}
\small\begin{tabular}{l|rrr|rrrr}
\cline{1-7}
\multirow{2}{*}{Crop} & \multicolumn{3}{c|}{XXX} & \multicolumn{3}{c}{XXX} & \\ \cline{2-7}
~ &\multicolumn{1}{c}{2014} & \multicolumn{1}{c}{2015} & \multicolumn{1}{c|}{2016} & \multicolumn{1}{c}{2014} & \multicolumn{1}{c}{2015} & \multicolumn{1}{c}{2016} & \\
\cline{1-7}
AAA     &    24,588,220     &    21,025,436     &    28,467,038     &   $-$67.9   &   $-$14.49  &   35.39    &  \\  \cline{1-7}
BBB &   2.58    &   4.22    &   3.87    &   $-$57.26  &   39.94   &   24.11   &  \\   \cline{1-7}
CCC         &   9.01    &   7.95    &   6.31    &   $-$56.24  &   $-$24.60  &   7.45    &  \\   \cline{1-7}
DDD\textsuperscript{a}      &   9.39    &   6.95    &   11.90   &   $-$56.36  &   $-$36.69  &   131.70  &  \\   \cline{1-7}
EEE\textsuperscript{b}      &   0.88    &   1.27    &   1.22    &   $-$81.66  &   22.59   &   30.39 &     \\  \cline{1-7}
FFF\textsuperscript{c}      &   1.67    &   1.57    &   0.41    &   $-$53.84  &   $-$19.56  &   $-$64.81  &  \\   \cline{1-7}
GGG     &   0.08    &   0.10    &   0.10    &   $-$55.45  &   4.81    &   31.06   &  \\   \cline{1-7}
HHH &   0.19    &   0.23    &   0.25    &   $-$58.07  &   1.18    &   50.99   &  \\   \cline{1-7}
III     &   0.49    &   0.30    &   1.36    &   $-$54.92  &   $-$47.45  &   512.85  &  \\   \cline{1-7}
JJJ     &   58.76   &   60.18   &   55.56   &   $-$73.22  &   $-$12.43  &   25.00   &  \\   \cline{1-7}
KKK     &   1.12    &   1.14    &   0.25    &   $-$67.91  &   $-$12.79  &   $-$69.96  &  \\   \cline{1-7}
LLL     &   11.73   &   11.92   &   16.10   &   $-$51.17  &   $-$13.05  &   82.84   &  \\   \cline{1-7}
MMM     &   0.08    &   0.06    &   0.03    &   $-$71.80  &   $-$30.15  &   $-$31.65  &  \\   \cline{1-7}
NNN     &   0.00    &   0.01    &   0.02    &   84.98   &   $-$375.02 &   62.81   &  \\   \cline{1-7}
OOO\textsuperscript{d}  &   0.32    &   0.61    &   0.40    &   $-$44.05  &   60.23   &   $-$11.52  &  \\   \cline{1-7}
PPP     &   0.55    &   0.29    &   0.27    &   1709.83 &   $-$55.80  &   27.74   &  \\   \cline{1-7}
QQQ     &   0.05    &   0.00    &   0.02    &   9.08    &   0.00    &   0.00    &  \\   \cline{1-7}
RRR\textsuperscript{e}      &   0.17    &   0.12    &   0.35    &   $-$39.81  &   $-$36.64  &   288.47  &  \\   \cline{1-7}
SSS     &   1.17    &   1.87    &   0.86    &   $-$51.92  &   36.97   &   $-$37.69  &  \\   \cline{1-7}
TTT     &   1.76    &   1.20    &   0.71    &   $-$33.79  &   $-$41.36  &   $-$19.71  &  \\ \cline{1-7}
\end{tabular}
\begin{tablenotes}[flushleft]\footnotesize
\item[]\textit{Some text here}\\
\item[]{\textbf{Footnotes:}}
\item[(a)] Footnote a
\item[(b)] Footnote b
\item[(c)] Footnote c
\item[(d)] Footnote d
\item[(e)] Footnote e
\item[]\textbf{Other notes:}
\item[(1)] Double line text here ........................................................................................................................................................ \\ .................................. \\
\item[(2)] Single line text here
\end{tablenotes}
\end{threeparttable}
\end{sidewaystable}

\end{document}

PS: I've changed all hyphens into minus symbol, hope this is correct. Apart from if you do decimal align then the output looks better (here, I just followed your tags simply)...

  • Thanks for posting the code and changing the hyphens to minus – Kenneth Oct 16 '19 at 7:47

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.