![使用 elsarticle 如何将手稿和补充/支持信息写入一个文件?或者如何创建中间文档标题页?](https://linux22.com/image/434914/%E4%BD%BF%E7%94%A8%20elsarticle%20%E5%A6%82%E4%BD%95%E5%B0%86%E6%89%8B%E7%A8%BF%E5%92%8C%E8%A1%A5%E5%85%85%2F%E6%94%AF%E6%8C%81%E4%BF%A1%E6%81%AF%E5%86%99%E5%85%A5%E4%B8%80%E4%B8%AA%E6%96%87%E4%BB%B6%EF%BC%9F%E6%88%96%E8%80%85%E5%A6%82%E4%BD%95%E5%88%9B%E5%BB%BA%E4%B8%AD%E9%97%B4%E6%96%87%E6%A1%A3%E6%A0%87%E9%A2%98%E9%A1%B5%EF%BC%9F.png)
在撰写论文时,通常将论文主体和支持信息写在一个文件中会很有帮助,这样可以利用 LaTeX 的参考功能。
然而,这确实需要在附录/支持信息开头的中间添加第二个前言。
如何为 elsarcticle 类实现这一点?
答案1
我通过浏览 .cls 文件,以某种有点古怪的方式弄清楚了这一点。它对我的目的有用。只需像平常一样写论文,当你看到附录时,你需要包含一堆命令来重新打印稍微修改过的标题。
\documentclass{elsarticle}
\usepackage{titletoc}
\usepackage{lipsum} % just to demonstration
% your paper goes here
% ...
\bibliographystyle{elsarticle-num}
\bibliography{library}
%%%%%%%%%%%%%%%%%%%%
%%%%% APPENDIX %%%%%
%%%%%%%%%%%%%%%%%%%%
\appendix
%\nolinenumbers % if you are using lineo package
\newpage
\setcounter{section}{0}
\setcounter{page}{1}
\setcounter{figure}{0}
\setcounter{equation}{0}
\renewcommand{\thesection}{S\arabic{section}}
\renewcommand{\thepage}{s\arabic{page}}
\renewcommand{\thetable}{S\arabic{table}}
\renewcommand{\thefigure}{S\arabic{figure}}
% most counters defined by elsarticle (just in case), important here is affn
% \setcounter{ead}{0}
% \setcounter{tnote}{0}
% \setcounter{fnote}{0}
% \setcounter{cnote}{0}
% \setcounter{author}{0}
\setcounter{affn}{0}
\resetTitleCounters
% Remove the title so we can fill a new one in
\makeatletter
\let\@title\@empty
\makeatother
\title{Supplementary Data for: The Paper title again}
% I'm using the abstract environment to put a table of contents
\makeatletter
\renewenvironment{abstract}{\global\setbox\absbox=\vbox\bgroup
\hsize=\textwidth\def\baselinestretch{1}%
\noindent\unskip\textbf{Contents}
\par\medskip\noindent\unskip}
{\egroup}
% here we modify the footnote on the title page to reflect that these are supporting info
\def\ps@pprintTitle{%
\let\@oddhead\@empty
\let\@evenhead\@empty
\def\@oddfoot{\footnotesize\itshape
Supplementary Data for \ifx\@journal\@empty Elsevier
\else\@journal\fi\hfill\today}%
\let\@evenfoot\@oddfoot}
\makeatother
% making the new TOC for the SI
\startlist{toc}
\begin{abstract}
\vspace{-48pt}
\printlist{toc}{}{\section*{}}
\end{abstract}
\maketitle
\section*{}
\parindent0pt
% your content starts here
\section{Demonstration of something in more detail}
\lipsum[1-5]
\section{Another thing I would like to show}
\lipsum[4-8]
\section{More stuff}
\lipsum[9-10]
\end{document}
然后,在文档中间,您会得到一个漂亮的标题页,其中包含您的支持信息,您可以继续添加内容并使用您想要的所有交叉引用。它看起来是这样的: