我正在尝试使用 elsarticle 类编译 latex 文件。我正在浏览 elsevier 文章模板:
\documentclass[review]{elsarticle}
\usepackage{lineno,hyperref}
\modulolinenumbers[5]
\journal{Journal of \LaTeX\ Templates}
\bibliographystyle{elsarticle-num}
\begin{document}
\begin{frontmatter}
\title{Elsevier \LaTeX\ template\tnoteref{mytitlenote}}
\tnotetext[mytitlenote]{Fully documented templates are available in the elsarticle package on \href{http://www.ctan.org/tex-archive/macros/latex/contrib/elsarticle}{CTAN}.}
\author{Elsevier\fnref{myfootnote}}
\address{Radarweg 29, Amsterdam}
\fntext[myfootnote]{Since 1880.}
\author[mymainaddress,mysecondaryaddress]{Elsevier Inc}
\ead[url]{www.elsevier.com}
\author[mysecondaryaddress]{Global Customer Service\corref{mycorrespondingauthor}}
\cortext[mycorrespondingauthor]{Corresponding author}
\ead{[email protected]}
\address[mymainaddress]{1600 John F Kennedy Boulevard, Philadelphia}
\address[mysecondaryaddress]{360 Park Avenue South, New York}
\begin{abstract}
This template helps you to create a properly formatted \LaTeX\ manuscript.
\end{abstract}
\begin{keyword}
\texttt{elsarticle.cls}\sep \LaTeX\sep Elsevier \sep template
\MSC[2010] 00-01\sep 99-00
\end{keyword}
\end{frontmatter}
\linenumbers
\section{The Elsevier article class}
\paragraph{Installation} If the document class \emph{elsarticle} is not available on your computer, you can download and install the system package \emph{texlive-publishers} (Linux) or install the \LaTeX\ package \emph{elsarticle} using the package manager of your \TeX\ installation, which is typically \TeX\ Live or Mik\TeX.
\paragraph{Usage} Once the package is properly installed, you can use the document class \emph{elsarticle} to create a manuscript. Please make sure that your manuscript follows the guidelines in the Guide for Authors of the relevant journal. It is not necessary to typeset your manuscript in exactly the same way as an article, unless you are submitting to a camera-ready copy (CRC) journal.
\paragraph{Functionality} The Elsevier article class is based on the standard article class and supports almost all of the functionality of that class. In addition, it features commands and options to format the
\begin{itemize}
\item document style
\item baselineskip
\item front matter
\item keywords and MSC codes
\item theorems, definitions and proofs
\item lables of enumerations
\item citation style and labeling.
\end{itemize}
\section{Front matter}
The author names and affiliations could be formatted in two ways:
\begin{enumerate}[(1)]
\item Group the authors per affiliation.
\item Use footnotes to indicate the affiliations.
\end{enumerate}
See the front matter of this document for examples. You are recommended to conform your choice to the journal you are submitting to.
\section{Bibliography styles}
There are various bibliography styles available. You can select the style of your choice in the preamble of this document. These styles are Elsevier styles based on standard styles like Harvard and Vancouver. Please use Bib\TeX\ to generate your bibliography and include DOIs whenever available.
Here are two sample references: \cite{Feynman1963118,Dirac1953888}.
\section*{References}
\bibliography{mybibfile}
\end{document}
我收到以下错误:
! Missing number, treated as zero.
<to be read again>
\X@mytitlenote
l.40 \end{frontmatter}
它显然指的是标题注释。事实上,如果我从标题中删除以下几行,一切就都正常了。
\tnoteref{mytitlenote}}
\tnotetext[mytitlenote]{Fully documented templates are available in the elsarticle package on \href{http://www.ctan.org/tex-archive/macros/latex/contrib/elsarticle}{CTAN}.
关于如何解决这个问题,您有什么建议吗?提前致谢。
答案1
不知道为什么,这是我第一次使用这个,但是经过这些步骤后,它就起作用了,我所能做的就是将??? 放在我的头部步骤 1 下:
\title{Elsevier \LaTeX template\tnoteref{}}
编译,然后步骤2:
\title{Elsevier \LaTeX template\tnoteref{mytitlenote}}
编译,步骤3:
\title{Elsevier \LaTeX\ template\tnoteref{mytitlenote}}
完成了!它起作用了,所以我认为问题可能来自编译器,而不是代码或软件配置,顺便说一下,我使用的是 Tex live 2018。