报错 Missing number, treated as zero.

2019-08-20 15:47发布

报错 Missing number, treated as zero. 和 Undefined control sequence.按照elsevier模板写的,表格总是报错,求教应该如何修改。\doc...

报错 Missing number, treated as zero. 和 Undefined control sequence.

按照elsevier模板写的,表格总是报错,求教应该如何修改。

\documentclass[review]{elsarticle}


\usepackage{lineno,hyperref}

\modulolinenumbers[5]

\usepackage{amssymb}

\usepackage{graphicx}


\journal{Journal of \LaTeX\ Templates}


\bibliographystyle{elsarticle-num}


\begin{document}




\begin{table*}

\caption{Key input variables and DCF main values of Scheme 1}

\begin{tabular*}{\tblwidth}{@{} lll@{} }


\toprule

Variables         &  Values          &  Definition/resource\\


\midrule

CapEx-MGO &  0                  &  Initial investment using MGO\\ 

Price-MGO &  \$570/ton    & Using the average price of MGO (Singapore)\\

Usage-MGO & 40 000 tons  & MGO annual usage\\

Discount rate &11\%              & Weighted average cost of capital(WACC) is the company's weighted cost of capital, including all sources of capital: equity and debt. It represents the discount rate of estimated cash flows (Block, 2011; Bennouna et al., 2010).

\bottomrule


\end{tabular*}


\end{table*}

\end{document}

3条回答
代码细节问题很多,比如缺少 booktabs,比如 参数里的宽度 是一个不知道什么东西,改成这样: ```tex \documentclass[review]{elsarticle} \usepackage{booktabs} \usepackage{lineno,hyperref} \modulolinenumbers[5] \usepackage{amssymb} \usepackage{graphicx} \journal{Journal of \LaTeX\ Templates} \bibliographystyle{elsarticle-num} \begin{document} \begin{table} \caption{Key input variables and DCF main values of Scheme 1} \begin{tabular}{\textwidth}{@{} lll@{} } \toprule Variables & Values & Definition/resource\ \midrule CapEx-MGO & 0 & Initial investment using MGO\ Price-MGO & \$570/ton & Using the average price of MGO (Singapore)\ Usage-MGO & 40 000 tons & MGO annual usage\ Discount rate &11\% & Weighted average cost of capital(WACC) is the company’s weighted cost of capital, including all sources of capital: equity and debt. It represents the discount rate of estimated cash flows (Block, 2011; Bennouna et al., 2010).\ \bottomrule \end{tabular} \end{table} \end{document} ``` 作者追问:2019-08-22 15:04 谢谢,按照你给出的方案,问题已经解决了。还有一个问题想要请教。表格的溢出问题要如何解决? ```tex \documentclass[review]{elsarticle} \usepackage{lineno,hyperref} \usepackage{booktabs} \usepackage{tabularx} \modulolinenumbers[5] \usepackage{amssymb} \usepackage{graphicx} \journal{Journal of \LaTeX\ Templates} \bibliographystyle{elsarticle-num} \begin{document} \begin{table} \caption{Key input variables and DCF main values of Scheme 1} \begin{tabular}{\textwidth}{@{} lllllllllllllllll@{}} \toprule \ &Year0 &Year1 &Year2 &Year3 &Year4 &Year5 &Year6 &Year7 &Year8 &Year9 &Year10 &Year11 &Year12 &Year13 &Year14 &Year15\ \midrule CapEx &-6.26 &- &- &- &- &- &- &- &- &- &- &- &- &- &- &- \ Spread-saving &- &7.16 &5.94 &4.77 &3.67 &2.62 &2.42 &2.22 &2.03 &1.83 &1.64 &1.45 &1.26 &1.08 &0.89 &0.71 \ Discount-spread &- &0.55 &0.52 &0.48 &0.44 &0.41 &0.37 &0.33 &0.29 &0.26 &0.22 &0.18 &0.15 &0.11 &0.07 &0.04 \ Total &-6.26 &7.71 &6.45 &5.25 &4.11 &3.02 &2.79 &2.55 &2.32 &2.09 &1.86 &1.64 &1.41 &1.19 &0.97 &0.75 \ \bottomrule \end{tabular} \end{table} \end{document} ```

作者追问:2019-08-20 16:03

谢谢,按照你给出的方案,问题已经解决了。还有一个问题想要请教。表格的溢出问题要如何解决?


\documentclass[review]{elsarticle}

\usepackage{lineno,hyperref}


\usepackage{booktabs} 


\usepackage{tabularx} 


\modulolinenumbers[5]

\usepackage{amssymb}

\usepackage{graphicx}

\journal{Journal of \LaTeX\ Templates}

\bibliographystyle{elsarticle-num}


\begin{document}


\begin{table*}

\caption{Key input variables and DCF main values of Scheme 1}

\begin{tabular*}{\textwidth}{@{}  lllllllllllllllll@{}}

\toprule

\  &Year0 &Year1 &Year2   &Year3   &Year4   &Year5  &Year6  &Year7   &Year8   &Year9   &Year10 &Year11  &Year12  &Year13  &Year14 &Year15\\

\midrule

CapEx         &-6.26 &- &- &- &- &- &- &- &- &- &- &- &- &- &- &-  \\

Spread-saving &\- &7.16  &5.94  &4.77 &3.67  &2.62 &2.42 &2.22 &2.03 &1.83  &1.64 &1.45 &1.26 &1.08  &0.89  &0.71 \\

Discount-spread &\- &0.55      &0.52 &0.48  &0.44 &0.41 &0.37 &0.33  &0.29 &0.26  &0.22  &0.18 &0.15 &0.11 &0.07 &0.04 \\

Total    &-6.26 &7.71 &6.45 &5.25 &4.11 &3.02  &2.79 &2.55 &2.32 &2.09  &1.86 &1.64 &1.41 &1.19 &0.97   &0.75  \\

\bottomrule

\end{tabular*}


\end{table*}

\end{document}


一周热门 更多>