Edit:
As supplement to Bernard answer and extension of my comments.
With resizing your table to \textwidth
in landscape orientation means that you you shrink your table to \textwidth
of portrait page and consequently you will have a lot os empti space before and after table.
To be table of full width of landscape orientation, than you need to resize it to \textheight
. However, this is already done with
\begin{tabularx}{\linewidth}{...}
so there is no need for use \resizebox
.
It seems that (concluding from your MWE) to set table in normal portrait page orientation and eventually reduce font size in table. If table is to tall, than you need considering ltablex
package.
Regarding columns width in tabularx
see my comment above:
If you change width of X column types, then the sum of new sizes had
to be integer number (what in your case is not: m + s + s + m + b = .4
+ .2 +.2 + .4 + 1 = 2.2; for example correct values are .3 + .2 +.2 + .3 + 1 = 2)
Considering this rule but with different values, in portrait orientation you table heads looks as follows:
\documentclass{article}
\usepackage{tabularx}
\usepackage{geometry}
\usepackage{showframe}
\renewcommand*\ShowFrameColor{\color{red}}
\begin{document}
\noindent
\begin{table}
\setlength\tabcolsep{3pt}
\begin{tabularx}{\linewidth}{|>{\hsize=0.5\hsize}X|
>{\hsize=0.4\hsize}X|
>{\hsize=0.4\hsize}X|
>{\hsize=0.3\hsize}X|
>{\hsize=1.4\hsize}X|}
\hline
Variable Name & Years\newline Available & Model(s) & Source & Notes\\
\hline
\end{tabularx}
\end{table}
\end{document}
In the case of use ltablex
package, than above MWE should be extended to the something like this:
\documentclass{article}
\usepackage{geometry}
\usepackage{ltablex}
\usepackage{showframe}
\renewcommand*\ShowFrameColor{\color{red}}
\begin{document}
\noindent
{
\setlength\tabcolsep{3pt}
\keepXColumns
\begin{tabularx}{\linewidth}{|>{\hsize=0.5\hsize}X|
>{\hsize=0.4\hsize}X|
>{\hsize=0.4\hsize}X|
>{\hsize=0.3\hsize}X|
>{\hsize=1.4\hsize}X|}
\caption{my table}
\label{my huge tablew} \\
\hline
Variable Name & Years\newline Available & Model(s) & Source & Notes\\
\hline
\endfirsthead
\hline
Variable Name & Years\newline Available & Model(s) & Source & Notes\\
\hline
\endhead
\hline
\multicolumn{5}{r}{continue on the next page}
\endfoot
\hline
\endlastfoot
% table content
a & b & c & d & \\
a & b & c & d &
\end{tabularx}
}
\end{document}
which gives:
Above MWE you can use also in landscape orientation. In this case you need to enclose table (all inside curly braces around table in above MWE) in \begin{landscape} ... \end{landscape}
resizebox
) in landscape to be wide only text width (of portrait page)?\textwidth
is determined by article orientation which is srill portrait! If you change width ofX
column types, then the sum of new sizes had to be integer number (what in your case is not:m + s + s + m + b = .4 + .2 +.2 + .4 + 1 = 2.2
; for example correct values are.3 + .2 +.2 + .3 + 1 = 2
).\resizebox
to the table, scaling tables should only be done as an absolute last resort.