3

I am getting this error for a while now, and I can't seem to fix it?! Here is my code - my table won't even load because of this error.

\documentclass{article}
\usepackage{hyperref}
\usepackage{graphicx}
\begin{document}
\begin{table}[ht]
\centering % used for centering table
\caption{Parameter Estimates} % title of Table
\resizebox{\textwidth}{!}{
\begin{tabular}{|l|l|l|l|} % centered columns (4 columns)
\hline\hline %inserts double horizontal lines
Description & Parameter & Estimate(per day) & Source \\ [0.5ex] % inserts table %heading
\hline % inserts single horizontal line
\hline
Population of Andhra Pradesh, Tamil Nadu, Maharashtra, and Karnataka & N & 330,308,167 & CIA World Factbook \\ \hline
Ratio of above population in India population & Scale & 0.2671651242 & Calculated \\ \hline
\multicolumn{4}{|c|}{\textbf{INITIAL CONDITIONS (POPULATIONS)}} \\ \hline
HIV-susceptible, TB-susceptible & $X_{SS}(0)$ & 192,941,151 & Calculated \\ \hline
HIV-susceptible, TB-infected & $X_{ST}(0)$ & 132,478,723 & Calculated \\ \hline
HIV+, TB-susceptible & $X_{HS}(0)$ & 2,422,951 & Calculated \\ \hline
Co-infected & $X_{HT}(0)$ & 1,817,998 & Calculated \\ \hline
HIV-susceptible, TB-treatment (1st stage) & $X_{S+T_T^{(1)}}(0)$ & 161,501 & Calculated \\ \hline
HIV-susceptible, TB-treatment (2nd stage) & $X_{S+T_T^{(2)}}(0)$ & 161,501 & Calculated \\ \hline
HIV-susceptible, TB-cured & $X_{S+T_T^{(3)}}(0)$ & 145,865 & Calculated \\ \hline
HIV+, TB-cured & $X_{H+T_T^{(3)}}(0)$ & 117 & AIDSInfo Online Database \\ \hline
HIV+, TB-treatment (1st stage) & $X_{H+T_T^{(1)}}(0)$ & 7,953 & AIDSInfo Online Database \\ \hline
HIV+, TB-treatment (2nd stage) & $X_{H+T_T^{(2)}}(0)$ & 7,953 & Calculated \\ \hline
HIV-treatment, TB-treatment (1st stage) & $X_{H_T+T_T^{(1)}}(0)$ & 3,445 & UNAIDS Global report (2013) \\ \hline
HIV-treatment, TB-treatment (2nd stage) & $X_{H_T+T_T^{(2)}}(0)$ & 3,445 & Assumption \\ \hline
HIV-treatment, TB-cured & $X_{H_{T_1}}(0)$ & 3,032 & Worldbank data \\ \hline
HIV-treatment, no history of TB & $X_{H_{T_2}}(0)$ & 152,450 & WHO 2013 Global TB Report \\ \hline
HIV-treatment, paradoxical IRIS & $X_{IRIS}(0)$ & 82 & A5221 Stride Study \\ \hline
\multicolumn{4}{|l|}{\textbf{ADDITIONAL PARAMETERS}} \\ \hline
Recruitment/maturation rate & $\Lambda$ & 531,062 & CIA World Factbook \\ \hline
Natural death rate & $\mu$ & 3.9138943e-5 & \url{http://planningcommission.nic.in/data/datatable/0306/table%20226.pdf} \\ \hline
AIDS death rate & $\mu_H$ & 1.3698630e-3 & Long et al. (2008) \\ \hline
TB death rate & $\mu_T$ & 5.4794521e-4 & Long et al. (2008) \\ \hline
Paradoxical IRIS death rate & $\mu_{IRIS}$ & 4.8947959e-5 & Laureillard et al. (2011) \\ \hline
HIV sufficient contact rate & $\beta$ & 4.6575342e-4 & Long et al. (2008) \\ \hline
TB sufficient contact rate & $\tau$ & 1.0958904e-2 & Long et al. (2008) \\ \hline
HIV regular treatment rate & $\lambda_H$ & 1 & Varied \\ \hline
HIV early treatment rate & $\lambda_{H_1}$ & 0 & Varied \\ \hline
HIV late treatment rate & $\lambda_{H_2}$ & 1 & Varied \\ \hline
TB regular treatment rate & $\lambda_T$ & 1 & Varied \\ \hline
TB treatment stage transition rate (Stage 1 to Stage 2) & $\lambda_{T_1}$ & 1.6666667e-2 & Calculated \\ \hline
TB treatment stage transition rate (Stage 2 to Stage 3) & $\lambda_{T_2}$ & 8.3333333e-3 & Calculated \\ \hline
Rate of occurrence of paradoxical IRIS & $\gamma$ & 2.7528463e-4 & Bonnet et al. (2013) \\ \hline
Modification parameter & $\psi$ & 0.15 & Varied \\ \hline
Modification parameter & $\alpha$ & 0.075 & Estimated \\ \hline
\end{tabular}
}
\end{table}
\end{document}

2 Answers2

3

Scaling the table gives you little control over the font size. Here I've used \footnotesize which is really as small as you want to go. This bleeds into the margins but using subject knowledge you can probably abbreviate the first column headings and make it fit. Alternatively wrapping the existing headings to a narrower column but letting the table go to two pages.

enter image description here

\documentclass{article}
\usepackage{hyperref}
\usepackage{graphicx,array}
\begin{document}
\begin{table}[t]
{
\centering % used for centering table
\vspace{-2cm}
\caption{Parameter Estimates} % title of Table
\setlength\extrarowheight{2pt}

\footnotesize

\hspace*{-2cm}\begin{tabular}{@{}|>{\raggedright}p{6cm}|l|l|l|} % centered columns (4 columns)
\hline\hline %inserts double horizontal lines
Description & Parameter & Estimate(per day) & Source \\ [0.5ex] % inserts table %heading
\hline % inserts single horizontal line
\hline
Population of Andhra Pradesh, Tamil Nadu, Maharashtra, and Karnataka & N & 330,308,167 & CIA World Factbook \\ \hline
Ratio of above population in India population & Scale & 0.2671651242 & Calculated \\ \hline
\multicolumn{4}{|c|}{\textbf{INITIAL CONDITIONS (POPULATIONS)}} \\ \hline
HIV-susceptible, TB-susceptible & $X_{SS}(0)$ & 192,941,151 & Calculated \\ \hline
HIV-susceptible, TB-infected & $X_{ST}(0)$ & 132,478,723 & Calculated \\ \hline
HIV+, TB-susceptible & $X_{HS}(0)$ & 2,422,951 & Calculated \\ \hline
Co-infected & $X_{HT}(0)$ & 1,817,998 & Calculated \\ \hline
HIV-susceptible, TB-treatment (1st stage) & $X_{S+T_T^{(1)}}(0)$ & 161,501 & Calculated \\ \hline
HIV-susceptible, TB-treatment (2nd stage) & $X_{S+T_T^{(2)}}(0)$ & 161,501 & Calculated \\ \hline
HIV-susceptible, TB-cured & $X_{S+T_T^{(3)}}(0)$ & 145,865 & Calculated \\ \hline
HIV+, TB-cured & $X_{H+T_T^{(3)}}(0)$ & 117 & AIDSInfo Online Database \\ \hline
HIV+, TB-treatment (1st stage) & $X_{H+T_T^{(1)}}(0)$ & 7,953 & AIDSInfo Online Database \\ \hline
HIV+, TB-treatment (2nd stage) & $X_{H+T_T^{(2)}}(0)$ & 7,953 & Calculated \\ \hline
HIV-treatment, TB-treatment (1st stage) & $X_{H_T+T_T^{(1)}}(0)$ & 3,445 & UNAIDS Global report (2013) \\ \hline
HIV-treatment, TB-treatment (2nd stage) & $X_{H_T+T_T^{(2)}}(0)$ & 3,445 & Assumption \\ \hline
HIV-treatment, TB-cured & $X_{H_{T_1}}(0)$ & 3,032 & Worldbank data \\ \hline
HIV-treatment, no history of TB & $X_{H_{T_2}}(0)$ & 152,450 & WHO 2013 Global TB Report \\ \hline
HIV-treatment, paradoxical IRIS & $X_{IRIS}(0)$ & 82 & A5221 Stride Study \\ \hline
\multicolumn{4}{|l|}{\textbf{ADDITIONAL PARAMETERS}} \\ \hline
Recruitment/maturation rate & $\Lambda$ & 531,062 & CIA World Factbook \\ \hline
Natural death rate & $\mu$ & 3.9138943e-5 & \textsuperscript{(1)} \\ \hline
AIDS death rate & $\mu_H$ & 1.3698630e-3 & Long et al. (2008) \\ \hline
TB death rate & $\mu_T$ & 5.4794521e-4 & Long et al. (2008) \\ \hline
Paradoxical IRIS death rate & $\mu_{IRIS}$ & 4.8947959e-5 & Laureillard et al. (2011) \\ \hline
HIV sufficient contact rate & $\beta$ & 4.6575342e-4 & Long et al. (2008) \\ \hline
TB sufficient contact rate & $\tau$ & 1.0958904e-2 & Long et al. (2008) \\ \hline
HIV regular treatment rate & $\lambda_H$ & 1 & Varied \\ \hline
HIV early treatment rate & $\lambda_{H_1}$ & 0 & Varied \\ \hline
HIV late treatment rate & $\lambda_{H_2}$ & 1 & Varied \\ \hline
TB regular treatment rate & $\lambda_T$ & 1 & Varied \\ \hline
TB treatment stage transition rate (Stage 1 to Stage 2) & $\lambda_{T_1}$ & 1.6666667e-2 & Calculated \\ \hline
TB treatment stage transition rate (Stage 2 to Stage 3) & $\lambda_{T_2}$ & 8.3333333e-3 & Calculated \\ \hline
Rate of occurrence of paradoxical IRIS & $\gamma$ & 2.7528463e-4 & Bonnet et al. (2013) \\ \hline
Modification parameter & $\psi$ & 0.15 & Varied \\ \hline
Modification parameter & $\alpha$ & 0.075 & Estimated \\ \hline
\end{tabular}\hspace*{-2cm}

}

\raggedright
\textsuperscript{(1)}
\url{http://planningcommission.nic.in/data/datatable/0306/table%20226.pdf}
\end{table}
\end{document}
David Carlisle
  • 757,742
3

A slight improvement to David Carlisle's version, with threeparttable and makecell: table now fits ‘naturally’ into the margins:

\documentclass{article}
\usepackage{hyperref}
\usepackage{graphicx,array}
\usepackage[showframe,  no marginpar]{geometry}
\usepackage{threeparttable, caption}
\captionsetup{font = footnotesize}
\usepackage{makecell}
\renewcommand\cellalign{lc}
\renewcommand\theadalign{lc}

\begin{document}

\begin{table}[t]
\centering % used for centering table
\caption{Parameter Estimates} % title of Table
\setlength\extrarowheight{2pt}
\footnotesize
\begin{threeparttable}
\noindent%
\begin{tabular}{@{}|>{\raggedright}l|l|l|l|} % centered columns (4 columns)
\hline\hline %inserts double horizontal lines
\thead{Description} &\thead{ Parameter} & \thead{Estimate\\(per day)} & \thead{Source} \\ [0.5ex] % inserts table %heading
\hline % inserts single horizontal line
\hline
\makecell{Population of Andhra Pradesh,Tamil Nadu,\\ Maharashtra, and Karnataka} & N & 330,308,167 & CIA World Factbook \\ \hline
\makecell{Ratio of above population\\ in India population} & Scale & 0.2671651242 & Calculated \\ \hline
\multicolumn{4}{|c|}{\textbf{INITIAL CONDITIONS (POPULATIONS)}} \\ \hline
HIV-susceptible, TB-susceptible & $X_{SS}(0)$ & 192,941,151 & Calculated \\ \hline
HIV-susceptible, TB-infected & $X_{ST}(0)$ & 132,478,723 & Calculated \\ \hline
HIV+, TB-susceptible & $X_{HS}(0)$ & 2,422,951 & Calculated \\ \hline
Co-infected & $X_{HT}(0)$ & 1,817,998 & Calculated \\ \hline
\makecell{HIV-susceptible, TB-treatment \\(1st stage)} & $X_{S+T_T^{(1)}}(0)$ & 161,501 & Calculated \\ \hline
\makecell{HIV-susceptible, TB-treatment\\ (2nd stage)} & $X_{S+T_T^{(2)}}(0)$ & 161,501 & Calculated \\ \hline
HIV-susceptible, TB-cured & $X_{S+T_T^{(3)}}(0)$ & 145,865 & Calculated \\ \hline
HIV+, TB-cured & $X_{H+T_T^{(3)}}(0)$ & 117 & AIDSInfo Online Database \\ \hline
\makecell{HIV+, TB-treatment \\(1st stage)} & $X_{H+T_T^{(1)}}(0)$ & 7,953 & AIDSInfo Online Database \\ \hline
\makecell{HIV+, TB-treatment\\ (2nd stage)} & $X_{H+T_T^{(2)}}(0)$ & 7,953 & Calculated \\ \hline
\makecell{HIV-treatment, TB-treatment \\ (1st stage)} & $X_{H_T+T_T^{(1)}}(0)$ & 3,445 & UNAIDS Global report (2013) \\ \hline
\makecell{HIV-treatment, TB-treatment\\ (2nd stage)} & $X_{H_T+T_T^{(2)}}(0)$ & 3,445 & Assumption \\ \hline
HIV-treatment, TB-cured & $X_{H_{T_1}}(0)$ & 3,032 & Worldbank data \\ \hline
HIV-treatment, no history of TB & $X_{H_{T_2}}(0)$ & 152,450 & WHO 2013 Global TB Report \\ \hline
HIV-treatment, paradoxical IRIS & $X_{IRIS}(0)$ & 82 & A5221 Stride Study \\ \hline
\multicolumn{4}{|l|}{\textbf{ADDITIONAL PARAMETERS}} \\ \hline
Recruitment/maturation rate & $\Lambda$ & 531,062 & CIA World Factbook \\ \hline
Natural death rate & $\mu$ & 3.9138943e-5 & \tnote{\textsuperscript{(1)}} \\ \hline
AIDS death rate & $\mu_H$ & 1.3698630e-3 & Long et al. (2008) \\ \hline
TB death rate & $\mu_T$ & 5.4794521e-4 & Long et al. (2008) \\ \hline
Paradoxical IRIS death rate & $\mu_{IRIS}$ & 4.8947959e-5 & Laureillard et al. (2011) \\ \hline
HIV sufficient contact rate & $\beta$ & 4.6575342e-4 & Long et al. (2008) \\ \hline
TB sufficient contact rate & $\tau$ & 1.0958904e-2 & Long et al. (2008) \\ \hline
HIV regular treatment rate & $\lambda_H$ & 1 & Varied \\ \hline
HIV early treatment rate & $\lambda_{H_1}$ & 0 & Varied \\ \hline
HIV late treatment rate & $\lambda_{H_2}$ & 1 & Varied \\ \hline
TB regular treatment rate & $\lambda_T$ & 1 & Varied \\ \hline
\makecell{TB treatment stage transition rate\\ (Stage 1 to Stage 2)} & $\lambda_{T_1}$ & 1.6666667e-2 & Calculated \\ \hline
\makecell{TB treatment stage transition rate\\ (Stage 2 to Stage 3)} & $\lambda_{T_2}$ & 8.3333333e-3 & Calculated \\ \hline
Rate of occurrence of paradoxical IRIS & $\gamma$ & 2.7528463e-4 & Bonnet et al. (2013) \\ \hline
Modification parameter & $\psi$ & 0.15 & Varied \\ \hline
Modification parameter & $\alpha$ & 0.075 & Estimated \\ \hline
\end{tabular}
\vspace{1.5ex}
\begin{tablenotes}
  \item[\textsuperscript{(1)}]
\url{http://planningcommission.nic.in/data/datatable/0306/table%20226.pdf}
\end{tablenotes}
\end{threeparttable}
\end{table}

\end{document} 

enter image description here

Bernard
  • 271,350