Elsarticle.cls: Difference between revisions

From STMDocs
Jump to navigation Jump to search
Line 204: Line 204:
<code>\newtheorem</code> command formats a theorem in LaTeX's default style with italicized font, bold font for theorem heading, theorem number at the right hand side of the theorem heading. It also optionally accepts an argument which will be printed as an extra heading in parentheses. The following text will show you how some text enclosed between <code>\begin{thm} . . . \end{thm}</code> will look like.  
<code>\newtheorem</code> command formats a theorem in LaTeX's default style with italicized font, bold font for theorem heading, theorem number at the right hand side of the theorem heading. It also optionally accepts an argument which will be printed as an extra heading in parentheses. The following text will show you how some text enclosed between <code>\begin{thm} . . . \end{thm}</code> will look like.  


<table border="1" cellspacing="3" cellpadding="3">
<tr><td>
[[Image:Els3.png]]
</td></tr></table>


<code>\newdefinition</code> command is same in all respects as its <code>\newtheorem</code> counterpart except that the font shape is roman instead of italic. Both <code>\newdefinition</code> and <code>\newtheorem</code> commands automatically defines counters for the environments defined. See the output of of <code>\begin{rmk} . . . \end{rmk}</code> which is given below.
<code>\newdefinition</code> command is same in all respects as its <code>\newtheorem</code> counterpart except that the font shape is roman instead of italic. Both <code>\newdefinition</code> and <code>\newtheorem</code> commands automatically defines counters for the environments defined. See the output of of <code>\begin{rmk} . . . \end{rmk}</code> which is given below.
<table border="1" cellspacing="3" cellpadding="3">
<tr><td>
[[Image:Els4.png]]
</td></tr></table>


<code>\newproof</code> command is for defining proof environments with upright font shape. No counters are defined. See the output of <code>\begin{pot} . . . \end{pot}</code> which is given below.
<code>\newproof</code> command is for defining proof environments with upright font shape. No counters are defined. See the output of <code>\begin{pot} . . . \end{pot}</code> which is given below.
<table border="1" cellspacing="3" cellpadding="3">
<tr><td>
[[Image:Els5.png]]
</td></tr></table>


Users can also make use of <code>amsthm.sty</code> which will override all the default definitions described above.
Users can also make use of <code>amsthm.sty</code> which will override all the default definitions described above.

Revision as of 14:56, 10 June 2009

Introduction

elsarticle.cls is a thoroughly rewritten document class for formatting LaTeX submissions to Elsevier journals. The class uses the environments and commands defined in LaTeX kernel without change to the signature so that clashes with other contributed LaTeX packages like hyperref.sty, preview-latex.sty, etc., will be minimal. elsarticle.cls is primarily built upon the default article.cls. The class depends on the following packages for its proper functionality:

  1. pifont.sty for openstar in the title footnotes.
  2. natbib.sty for citation processing.
  3. geometry.sty for margin settings.
  4. fleqn.clo for left aligned equations.
  5. graphicx.sty for graphics inclusion.
  6. txfonts.sty optional font package, if document is to be formatted with Times and compatible math fonts.
  7. hyperref.sty optional packages if hyper linking is required in the document.

All the above packages are part of any standard LaTeX installation. Therefore, the users need not be bothered about downloading any extra packages. Further, users are free to make use of \textsc{ams} math packages like, amsmath.sty, amsthm.sty, amssymb.sty, amsfonts.sty, etc., if they want. All these packages work in tandem with elsarticle.cls without any problems.

Major Differences

Following are the major differences between elsarticle.cls and its predecesor package, elsart.cls:

  • elsarticle.cls is built upon article.cls while elsart.cls is not. elsart.cls redefines many of the commands in the LaTeX classes/kernel, which can possibly cause surprising clashes with other contributed LaTeX packages.
  • Provides preprint document formatting by default, and optionally formats the document as per the final style of models 1+, 3+ and 5+ of Elsevier journals.
  • Some easier hooks for formatting list and theorem environments are provided while people can still use amsthm.sty package.
  • natbib.sty is the main citation processing package which can comprehensively handle all kinds of citations and works perfectly with hyperref.sty in combination with hypernat.sty.
  • Long title pages are processed correctly in preprint and final formats.

Installation

The package is available at author resources page at Elsevier Science. It can also be found in any of the nodes of the Comprehensive TeX Archive Network (CTAN), one of the primary nodes being http://www.ctan.org. Please grab the elsarticle.dtx which is the composite class with documentation and elsarticle.ins which is the LaTeX installer file. When we compile the elsarticle.ins with LaTeX it provides the class file, elsarticle.cls by stripping off all the documentation from the *.dtx file. The class may be moved or copied to a place, usually, $TEXMF/tex/latex/elsevier/, or a folder which will be read by LaTeX during document compilation. The TeX file database needs updation after moving/copying class file. Usually, we use commands like mktexlsr or texhash depending upon the distribution and operating system.

Usage

The class should be loaded with the command: <geshi lang="latex">

\documentclass[<options>]{elsarticle}

</geshi> where the options can be the following:

preprint
default options which formats the document for submission to Elsevier journals.
review
similar to preprint option, but increases the baselineskip to facilitate easier review process.
1p
formats to the look and feel of the final format of model 1+ journals. This is always single column style.
3p
formats to the look and feel of the final format of model 3+ journals. If the journal is a two column model use twocolumn option in combination.
5p
formats for model 5+ journals. This is always two column style.
authoryear
author-year citation style of natbib.sty. If you want to add extra options of natbib.sty, you may use the options as a comma delimited strings as argument to \biboptions command. An example would be:

<geshi lang="latex">

\biboptions{longnamesfirst,angle,semicolon}

</geshi>

number
numbered citation style. Extra options can be loaded with \biboptions command.
longtitle
if front matter is unusually long, use this option to split the title page across pages with correct placing of title and author footnotes in the first page.
times
loads txfonts.sty if available in the system to use Times and compatible math fonts.
  • All options of article.cls can be used with this document class.
  • The default options loaded are a4paper, 10pt, oneside, onecolumn and preprint.

Front matter

There are two types of front matter coding — (1) each author is connected to an affiliation with a footnote marker; hence all authors are grouped together and affiliations follow; (2) authors of same affiliations are grouped together and the relevant affiliation follows this group. An example coding of the first type is provided below:

<geshi lang="latex">

\title{This is a specimen title\tnoteref{t1,t2}}
\tnotetext[t1]{This document is a collaborative effort.}
\tnotetext[t2]{The second title footnote which is a longer 
   longer than the first one and with an intention to fill
   in up more than one line while formatting.} 
\author[rvt]{C.V.~Radhakrishnan\corref{cor1}\fnref{fn1}}
\ead{cvr@river-valley.com}
\author[rvt,focal]{K.~Bazargan\fnref{fn2}}
\ead{kaveh@river-valley.com}
\author[els]{S.~Pepping\corref{cor2}\fnref{fn1,fn3}}
\ead[url]{http://www.elsevier.com}
\cortext[cor1]{Corresponding author}
\cortext[cor2]{Principal corresponding author}
\fntext[fn1]{This is the specimen author footnote.}
\fntext[fn2]{Another author footnote, but a little more longer.}
\fntext[fn3]{Yet another author footnote. Indeed, you can have
   any number of author footnotes.}
\address[rvt]{River Valley Technologies, SJP Building,
   Cotton Hills, Trivandrum, Kerala, India 695014}
\address[focal]{River Valley Technologies, 9, Browns Court,
   Kennford, Exeter, United Kingdom}
\address[els]{Central Application Management,
   Elsevier, Radarweg 29, 1043 NX\\
   Amsterdam, Netherlands}

</geshi>

Output of the above TeX sources will look like the following:


Els1.png


Most of the commands like \title, \author, \address are self explanatory. Various components are linked each other by a label–reference mechanism, for instance, title footnote is linked to the title with a footnote mark generated by referring to the \label string of the \tnotetext. We have used similar commands like \tnoteref (to link title note to title); \corref (to link corresponding author text to corresponding author); \fnref (to link footnote text to the relevant author names). TeX needs two compilations to resolve the footnote marks in the preamble part. Given below are the syntax of various note marks and note texts. <geshi lang="latex">

\tnoteref{<label(s)>}
\corref{<label(s)>}
\fnref{<label(s)>}                                                                                 
\tnotetext[<label>]{<title note text>}
\cortext[<label>]{<corresponding author note text>}
\fntext[<label>]{<author footnote text>}

</geshi> where <label(s)> can be either one or more comma delimited label strings. The optional arguments to the \author command holds the ref label(s) of the address(es) to which the author is affiliated while each \address command can have an optional argument of a label. In the same manner, \tnotetext, \fntext, \cortext will have optional arguments as their respective labels and note text as their mandatory argument.

The following example code provides the markup of the second type of author-affiliation. <geshi lang="latex"> \author{C.V.~Radhakrishnan\corref{cor1}\fnref{fn1}}

\ead{cvr@river-valley.com}
\address{River Valley Technologies, SJP Building,
   Cotton Hills, Trivandrum, Kerala, India 695014}

</geshi> <geshi lang="latex"> \author{K.~Bazargan\fnref{fn2}}

\ead{kaveh@river-valley.com}
\address{River Valley Technologies, 9, Browns Court, Kennford,
   Exeter, United Kingdom}

</geshi> <geshi lang="latex"> \author{S.~Pepping\fnref{fn1,fn3}}

\ead[url]{http://www.elsevier.com}
\address{Central Application Management,
   Elsevier, Radarweg 43, 1043 NX Amsterdam, Netherlands}

</geshi> <geshi lang="latex"> \cortext[cor1]{Corresponding author} \fntext[fn1]{This is the first author footnote.} \fntext[fn2]{Another author footnote, this is a very long footnote and

  it should be a really long footnote. But this footnote is not yet
  sufficiently long enough to make two lines of footnote text.}

\fntext[fn3]{Yet another author footnote.} </geshi> Output of the above TeX sources will look like the following:


Els2.png


The front matter part has further environments like \begin{abstract} . . . \end{abstract} and \begin{keyword} ... \end{keyword} which contain the abstract and keywords respectively. Keywords can be marked up in the following manner: <geshi lang="latex"> \begin{keyword}

 quadruple exiton \sep polariton \sep WGM
 \PACS 71.35.-y \sep 71.35.Lk \sep 71.36.+c

\end{keyworkd} </geshi> Each keyword shall be separated by \sep command. PACS and MSC classifications shall be provided in the keyword environment with the commands \PACS and \MSC respectively. \MSC accepts an optional argument to accommodate future revisions. eg., \MSC[2008]. The default is 2000.

Floats

Figures may be included using the command, \includegraphics in combination with or without its several options to further control the graphic. \includegraphics is provided by graphic[s,x].sty which is part of any standard LaTeX distribution. graphicx.sty is loaded by default. LaTeX accepts figures in postscript format while pdfLaTeX accepts *.pdf, *.mps (metapost), *.jpg and *.png formats. pdfLaTeX does not accept graphic files in postscript format.

The table environment is handy for marking up tabular material. If users want to use multirow.sty, array.sty, etc., to fine control/enhance the tables, they are welcome to load any package of their choice and elsarticle.cls will work in combination with all loaded packages.

Theorem and theorem like environments

elsarticle.cls provides a few hooks to format theorems and theorem like environments with ease. In all commands the options that are used with \newtheorem command will work exactly in the same manner. elsarticle.cls provides three commands to format theorem or theorem like environments: <geshi lang="latex"> \newtheorem{thm}{Theorem} \newtheorem{lem}[thm]{Lemma} \newdefinition{rmk}{Remark} \newproof{pf}{Proof} \newproof{pot}{Proof of Theorem \ref{thm2}} </geshi>

\newtheorem command formats a theorem in LaTeX's default style with italicized font, bold font for theorem heading, theorem number at the right hand side of the theorem heading. It also optionally accepts an argument which will be printed as an extra heading in parentheses. The following text will show you how some text enclosed between \begin{thm} . . . \end{thm} will look like.

Els3.png

\newdefinition command is same in all respects as its \newtheorem counterpart except that the font shape is roman instead of italic. Both \newdefinition and \newtheorem commands automatically defines counters for the environments defined. See the output of of \begin{rmk} . . . \end{rmk} which is given below.

Els4.png

\newproof command is for defining proof environments with upright font shape. No counters are defined. See the output of \begin{pot} . . . \end{pot} which is given below.

Els5.png

Users can also make use of amsthm.sty which will override all the default definitions described above.