我正在写我的硕士论文,我有一些表格要包含在文件中,但我遇到了这部分问题,我想这就是我收到错误的原因:扫描使用时文件结束\Gscale@box@dd
。我只是想用粗体字体显示一些行,但不知何故它不起作用。这是我的代码:
\begin{table}[h!]
\centering
\resizebox{\textwidth}{!}{%
\begin{tabular}{rrrrrrrrrrr}
\hline
& \textbf{2009} & \textbf{2010} & \textbf{2011} & \textbf{2012} &
\textbf{2013} & \textbf{2014} & \textbf{2015} & \textbf{2016} & \textbf{2017}
& \textbf{2018} & \textbf{CAGR\_{5}} \\
\hline
EBIT & 289 & 5.094 & 8.018 & 8.300 & 7.978 & 9.118 & 9.593 & 9.386 & 9.899 &
9.121 & \textbf{0.01\%}\\
EBIT*(1-T) = NOPLAT & 147 & 3.407 & 5.329 & 5.437 & 5.3860 & 6.092 & 6.652 &
6.711 & 8.044 & 6.728 & \textbf{2.01\%}\\
Depreciation and Amortisation & 3.603 & 3.861 & 3.654 & 3.716 & 3.832 & 4.323
& 4.686 & 4.998 & 4.822 & 5.113 & \textbf{3.41\%}\\
\textbf{Gross cash flow} & \textbf{3.750} & \textbf{7.268} & \textbf{8.983} &
\textbf{9.153} & \textbf{9.218} & \textbf{10.415} & \textbf{11.338} &
\textbf{11.709} & \textbf{12.866} & \textbf{11.841} & \textbf{2.6\%}\\
Changes in Working Capital & 1.802 & -403 & -1.615 & 1.755 & 986 & -551 &
-293 & -104 & 166 & -573 & \textbf{0.79\%}\\
Capex & -3.302 & -3.208 & -3.626 & -5.194 & -6.671 & -6.063 & -5.851 & -5.813
& -7.082 & -7.649 & \textbf{4.76\%}\\
\textbf{Free Cash Flows to Firm} & \textbf{2.250} & \textbf{3.657} &
\textbf{3.742} & \textbf{5.714} & \textbf{3.533} & \textbf{3.801} &
\textbf{5.194} & \textbf{5.792} & \textbf{5.950} & \textbf{3.619} &
\textbf{-0.97\%} \\
\hline
\end{tabular}}
\end{table}
谢谢!
答案1
以下是表格的三个不同版本:
\documentclass{article}
\usepackage{geometry}
\usepackage{graphicx}
%%%%% For table 2 %%%%%
\usepackage{tabularx}
%%%%% For table 2-3 %%%%%
\usepackage{booktabs}
%%%%% For table 3 %%%%%
\usepackage{pdflscape}
\begin{document}
\begin{table}
\centering
\caption{Added the missing column specifier to make the table compilable. I do not recommend the use of resizebox to make a table fit into the text width.}
\resizebox{\textwidth}{!}{%
\begin{tabular}{rrrrrrrrrrrr}
\hline
& \textbf{2009} & \textbf{2010} & \textbf{2011} & \textbf{2012} &
\textbf{2013} & \textbf{2014} & \textbf{2015} & \textbf{2016} & \textbf{2017}
& \textbf{2018} & \textbf{CAGR\_{5}} \\
\hline
EBIT & 289 & 5.094 & 8.018 & 8.300 & 7.978 & 9.118 & 9.593 & 9.386 & 9.899 &
9.121 & \textbf{0.01\%}\\
EBIT*(1-T) = NOPLAT & 147 & 3.407 & 5.329 & 5.437 & 5.3860 & 6.092 & 6.652 &
6.711 & 8.044 & 6.728 & \textbf{2.01\%}\\
Depreciation and Amortisation & 3.603 & 3.861 & 3.654 & 3.716 & 3.832 & 4.323
& 4.686 & 4.998 & 4.822 & 5.113 & \textbf{3.41\%}\\
\textbf{Gross cash flow} & \textbf{3.750} & \textbf{7.268} & \textbf{8.983} &
\textbf{9.153} & \textbf{9.218} & \textbf{10.415} & \textbf{11.338} &
\textbf{11.709} & \textbf{12.866} & \textbf{11.841} & \textbf{2.6\%}\\
Changes in Working Capital & 1.802 & -403 & -1.615 & 1.755 & 986 & -551 &
-293 & -104 & 166 & -573 & \textbf{0.79\%}\\
Capex & -3.302 & -3.208 & -3.626 & -5.194 & -6.671 & -6.063 & -5.851 & -5.813
& -7.082 & -7.649 & \textbf{4.76\%}\\
\textbf{Free Cash Flows to Firm} & \textbf{2.250} & \textbf{3.657} &
\textbf{3.742} & \textbf{5.714} & \textbf{3.533} & \textbf{3.801} &
\textbf{5.194} & \textbf{5.792} & \textbf{5.950} & \textbf{3.619} &
\textbf{-0.97\%} \\
\hline
\end{tabular}}
\end{table}
\begin{table}
\footnotesize \setlength{\tabcolsep}{2pt}
\caption{With the use of tabularx to introduce automatic linebreaks in the first column. I have also replaced the hlines by rules from the booktabs package and decreased the horizontal wite space between columns as well as the font size. Lastly, I have used math mode for minus signs.}
\begin{tabularx}{\textwidth}{>{\raggedright\arraybackslash}Xrrrrrrrrrrr}
\toprule
& \textbf{2009} & \textbf{2010} & \textbf{2011} & \textbf{2012} &
\textbf{2013} & \textbf{2014} & \textbf{2015} & \textbf{2016} & \textbf{2017}
& \textbf{2018} & \textbf{CAGR\_{5}} \\
\midrule
EBIT & 289 & 5.094 & 8.018 & 8.300 & 7.978 & 9.118 & 9.593 & 9.386 & 9.899 &
9.121 & \textbf{0.01\%}\\
EBIT*(1-T) = NOPLAT & 147 & 3.407 & 5.329 & 5.437 & 5.3860 & 6.092 & 6.652 &
6.711 & 8.044 & 6.728 & \textbf{2.01\%}\\
Depreciation and Amortisation & 3.603 & 3.861 & 3.654 & 3.716 & 3.832 & 4.323
& 4.686 & 4.998 & 4.822 & 5.113 & \textbf{3.41\%}\\
\textbf{Gross cash flow} & \textbf{3.750} & \textbf{7.268} & \textbf{8.983} &
\textbf{9.153} & \textbf{9.218} & \textbf{10.415} & \textbf{11.338} &
\textbf{11.709} & \textbf{12.866} & \textbf{11.841} & \textbf{2.6\%}\\
Changes in Working Capital & 1.802 & $-403$ & $-1.615$ & 1.755 & 986 & $-551$ &
$-293$ & $-104$ & 166 & $-573$ & \textbf{0.79\%}\\
Capex & $-3.302$ & $-3.208$ & $-3.626$ & $-5.194$ & $-6.671$ & $-6.063$ & $-5.851$ & $-5.813$
& $-7.082$ & $-7.649$ & \textbf{4.76\%}\\
\textbf{Free Cash Flows to Firm} & \textbf{2.250} & \textbf{3.657} &
\textbf{3.742} & \textbf{5.714} & \textbf{3.533} & \textbf{3.801} &
\textbf{5.194} & \textbf{5.792} & \textbf{5.950} & \textbf{3.619} &
\textbf{-0.97\%} \\
\bottomrule
\end{tabularx}
\end{table}
\begin{landscape}
\begin{table}
\small
\setlength{\tabcolsep}{0pt}
\caption{On a landscape page the table fits perfectly fine into the textwidth even without adding linebreaks in the first column if one slightly reduces the font size and the tabcolsep.}
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}lrrrrrrrrrrr}
\toprule
& \textbf{2009} & \textbf{2010} & \textbf{2011} & \textbf{2012} &
\textbf{2013} & \textbf{2014} & \textbf{2015} & \textbf{2016} & \textbf{2017}
& \textbf{2018} & \textbf{CAGR\_{5}} \\
\midrule
EBIT & 289 & 5.094 & 8.018 & 8.300 & 7.978 & 9.118 & 9.593 & 9.386 & 9.899 &
9.121 & \textbf{0.01\%}\\
EBIT*(1-T) = NOPLAT & 147 & 3.407 & 5.329 & 5.437 & 5.3860 & 6.092 & 6.652 &
6.711 & 8.044 & 6.728 & \textbf{2.01\%}\\
Depreciation and Amortisation & 3.603 & 3.861 & 3.654 & 3.716 & 3.832 & 4.323
& 4.686 & 4.998 & 4.822 & 5.113 & \textbf{3.41\%}\\
\textbf{Gross cash flow} & \textbf{3.750} & \textbf{7.268} & \textbf{8.983} &
\textbf{9.153} & \textbf{9.218} & \textbf{10.415} & \textbf{11.338} &
\textbf{11.709} & \textbf{12.866} & \textbf{11.841} & \textbf{2.6\%}\\
Changes in Working Capital & 1.802 & $-403$ & $-1.615$ & 1.755 & 986 & $-551$ &
$-293$ & $-104$ & 166 & $-573$ & \textbf{0.79\%}\\
Capex & $-3.302$ & $-3.208$ & $-3.626$ & $-5.194$ & $-6.671$ & $-6.063$ & $-5.851$ & $-5.813$
& $-7.082$ & $-7.649$ & \textbf{4.76\%}\\
\textbf{Free Cash Flows to Firm} & \textbf{2.250} & \textbf{3.657} &
\textbf{3.742} & \textbf{5.714} & \textbf{3.533} & \textbf{3.801} &
\textbf{5.194} & \textbf{5.792} & \textbf{5.950} & \textbf{3.619} &
\textbf{-0.97\%} \\
\bottomrule
\end{tabular*}
\end{table}
\end{landscape}
\end{document}