我现在已经收到此错误一段时间了,但似乎无法修复它?!这是我的代码 - 由于此错误,我的表格甚至无法加载。
\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}
答案1
缩放表格几乎无法控制字体大小。这里我使用了\footnotesize
你想要的最小字体。这会延伸到页边距,但使用学科知识,您可能可以缩短第一列标题并使其适合。或者将现有标题换成更窄的列,但让表格占两页。
\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}
答案2
对 David Carlisle 的版本稍作改进,带有threeparttable
和makecell
: 的表格现在可以“自然”地放入边距中:
\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}