Best option: Recommended
Your first option should be to install the package which is part of TeX Live itself. If you installed TeX Live from upstream (recommended), you should already have it if you installed a full distribution. If not, you can use tlmgr to install it.
If you installed TeX Live through your distro's package manager (e.g. apt or yum or pacman or...), then you have to find out which package your distro's packagers put elsarticle in. Install that.
If none of that is an option or if, for some reason, your distro packages only part of TeX Live, you can install the package manually.
Manual option
For a manual install, choose one of two places:
- your local TEXMF tree, TEXMFLOCAL: this will make them available system-wide;
- your personal TEXMF tree, TEXMFHOME: they will be available only to you.
To find out where these trees are, use
kpsewhich -var TEXMFLOCAL
or
kpsewhich -var TEXMFHOME
The easiest option is to put the files in your personal tree, TEXMFHOME.
You will need to create a suitable structure. For example:
mkdir -p $(kpsewhich TEXMFHOME)/tex/latex/elsarticle
mkdir -p $(kpsewhich TEXMFHOME)/bibtex/bst/elsarticle
mkdir -p $(kpsewhich TEXMFHOME)/doc/latex/elsarticle
Now unpack the archive you downloaded from CTAN and move all the .bst files into $(kpsewhich TEXMFHOME)/bibtex/bst/elsarticle, the .cls into $(kpsewhich TEXMFHOME)/tex/latex/elsarticle and the documentation into $(kpsewhich TEXMFHOME)/doc/latex/elsarticle.
Then you are done. It is perfectly normal for TEXMFHOME not to exist if you've never used it before.
If you prefer to install into your local TEXMF tree, replace TEXMFHOME with TEXMFLOCAL, run the commands above with root privileges, if necessary, and then run
mktexlsr $(kpsewhich TEXMFLOCAL)
No equivalent step is required if you use your personal TEXMF tree, which is why that is a lot easier.
elsarticlepart of the distros? – yo' Aug 19 '15 at 22:40elsarticlealready in my distro. – abcd Aug 19 '15 at 22:41.texdocuments in Emacs and using the command i mentioned to generate.pdffiles from them. – abcd Aug 19 '15 at 22:51