[Tex/LaTex] tabularx with different column widths

tabularxwidth

\documentclass{article}
\usepackage{tabularx}
\usepackage{lscape}

\newcolumntype{b}{X}
\newcolumntype{s}{>{\hsize=.2\hsize}X}
\newcolumntype{m}{>{\hsize=.4\hsize}X}

\begin{document}
\begin{landscape}

\noindent\resizebox{\textwidth}{!}{%
\begin{tabularx}{\linewidth}{m s s m b}
Variable Name & Years Available & Model(s) & Source & Notes\\

\end{tabularx}
%}
\end{landscape}
\end{document} 

Edit:
I would like to use tabularx because the text in my "Notes" section is long, and I would like the text to wrap easily.

In addition, I have many rows, so I decided to include \resizebox to make all the text fit in one page

Best Answer

I suppose you want the m column type width should be 40 % of the b type width, and the s type width half the m type width. The way you calculated the coefficients is not correct: the sum of the coefficients should be equal to the number of columns, and they should have this relation of proportionality. This yields coefficients approximately equal, in increasing order, to 0.45, 0.90, 2.3.

I do not see why you should use \resizebox. It should be avoided as much as possible, as it also changes the font size and may yield unreadable text. Comment aside, the namers of the new column types is not well chosen, as m and b are already defined by the array package, and you'll have conflicts sooner or later.

\documentclass{article}
\usepackage{tabularx}
\usepackage{lscape}
 \newcolumntype{b}{>{\hsize=2.3\hsize}X}
\newcolumntype{s}{>{\hsize=.45\hsize}X}
\newcolumntype{m}{>{\hsize=.9\hsize}X}

\begin{document}

\begin{landscape}
  \noindent
  \begin{tabularx}{\linewidth}{|m| s| s| m| b|}
    \hline
    Variable Name & Years Available & Model(s) & Source & Notes \\
    \hline
  \end{tabularx}
\end{landscape}

\end{document}

enter image description here

Related Question