\begin{frame}
\frametitle{Methodology}
\documentclass[a4paper, 8pt]{article}
\usepackage{multirow}
\begin{document}
\begin{table}
\centering
\begin{tabular}{|l|l|}
\cline{2-2}
\multicolumn{1}{l|}{\textbf{Variable}} & \textbf{Definition} \\
\hline
\textbf{Dependent Variables} & \\
\hline
Stunting & {[}(weight/height) standard deviation]*100; Z-score below -2 \\
\hline
ARI & had cough last 2 weeks/short or rapid breath/discomfortable chest \\
\hline
\textbf{Independent Variables} & \\
\hline
Cooking location & 0= if outdoor and 1= if indoor \\
\hline
Fuel type & 0= non-smoke producing/clean fuel(lpg, natural gas, biogas, coal, and charcoal) , 1=smoke producing/solid fuel(kerosene, wood, straw, shrubs, grass, animal dung) \\
\hline
Smoke exposure risk (SER) & high SER (if smoke-producing cooking fuels = 1 and indoor cooking = 1), moderate SER (if smoke-producing cooking fuels = 1 and outdoor cooking = 0), and low SER (if non-smoke-producing cooking fuels = 0 and indoor cooking = 1) \\
\hline
Child's age (in Months) & 0= if "0-12", 1= if "13-24", 3=if "25-36", 4= if "37-48", 5= if "48-below 60" \\
\hline
Male Child & 1= if yes, 0=if no \\
\hline
Child's Birth Order & \\
\hline
Child Size during birth & 0=if very large, 1=larger than average, 2=average, 3=smaller than average, 5=very small \\
\hline
Wealth index & ( 0= if poorest, 1= if poorer, 2=if middle, 3= if richer, 4=if richest \\
\hline
Mother's age at the time of her first delivery (in years) & 0= if "below 21", 1= if "21-30", 3=if "31-40", 4= if "41-48" \\
\hline
Mother's education & 0= "no education", 1="primary dropout", 2="primary completed, 3="secondary dropout", 4="secondary", 5="higher" \\
\hline
Mother's smoking status & 1= if yes, 0=if no \\
\hline
Antenatal Care & 1=if WHO recommended 8 or more visits, 0= if less than 8 visits \\
\hline
Region (Division) & 7 divisions; Barisal=1, Chittagong=2, Dhaka=3, Khulna=4, Rajshahi=5, Rangpur=6 and Sylhet=7 \\
\hline
Living Urban & 1=if yes, 0=if no \\
\hline
\end{tabular}
\end{table}
\end{frame}
答案1
我认为您的主要问题是表格的列太宽,因此表格不适合文本块的边界。
如果这个猜测是正确的,我建议您从 a 环境切换tabular
到 atabularx
环境,将其总宽度设置为\textwidth
,并允许两列自动换行。此外,由于第二列包含的内容比第一列多得多,因此第二列应该比第一列宽。
我还将取消所有垂直线和大多数水平线。为了帮助读者区分单元格之间的划分,以下代码还提供了自动悬挂缩进。
以下解决方案采用article
文档类。对于其他文档类(例如,类),它可能不是最佳的beamer
。
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{tabularx,ragged2e,booktabs}
\newcolumntype{L}[1]{%
>{\RaggedRight\hsize=#1\hsize\hangafter=1\hangindent=1em}X}
\begin{document}
\noindent
\begin{tabularx}{\textwidth}{@{} L{0.6} L{1.4} @{}} % 0.6+1.4=2
\toprule
Variable & Definition \\
\midrule
Dependent Variables & \\
\cmidrule(r){1-1}
Stunting & [(weight/height) standard deviation]${}\times100$; Z-score below $-2$ \\
ARI & had cough last 2 weeks\slash short or rapid breath\slash discomfortable chest \\
\addlinespace
Independent Variables & \\
\cmidrule(r){1-1}
Cooking location & 0 if outdoor, 1 if indoor \\
Fuel type & 0 = non-smoke producing\slash clean fuel(lpg, natural gas, biogas, coal, and charcoal), 1 = smoke producing\slash solid fuel (kerosene, wood, straw, shrubs, grass, animal dung) \\
Smoke exposure risk (SER) & high SER (if smoke-producing cooking fuels = 1 and indoor cooking = 1); moderate SER (if smoke-producing cooking fuels = 1 and outdoor cooking = 0); and low SER (if non-smoke-producing cooking fuels = 0 and indoor cooking = 1) \\
Child's age (in months) & 0 if ``0--12'', 1 if ``13--24'', 3 if ``25--36'', 4 if ``37--48'', 5 if ``48--below 60'' \\
Male Child & 1 if yes, 0 if no \\
Child's Birth Order & (really nothing?)\\
Child Size during birth & 0 if very large, 1 if larger than average, 2 if average, 3 if smaller than average, 5 if very small \\
Wealth index & 0 if poorest, 1 if poorer, 2 if middle, 3 if richer, 4 if richest \\
Mother's age at the time of her first delivery, in years & 0 if ``below 21'', 1 if ``21--30'', 3= if ``31--40'', 4= if ``41--48'' \\
Mother's education & 0 if ``no education'', 1 if ``primary dropout'', 2 if ``primary completed, 3 if ``secondary dropout'', 4 if ``secondary'', 5 if ``higher'' \\
Mother's smoking status & 1 if yes, 0 if no \\
Antenatal Care & 1 if WHO recommended 8 or more visits, 0 if less than 8 visits \\
Region (Division) & Seven divisions: Barisal=1, Chittagong=2, Dhaka=3, Khulna=4, Rajshahi=5, Rangpur=6 and Sylhet=7 \\
Living Urban & 1 if yes, 0 if no \\
\bottomrule
\end{tabularx}
\end{document}