Math & Science! LaTeX Error: File `elsart.cls' not found.

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
tk2
Posts: 3
Joined: Mon Oct 21, 2013 8:39 pm

! LaTeX Error: File `elsart.cls' not found.

Post by tk2 »

Im using Texmaker 3.4 on Ubuntu 13.04. I downloaded all files from http://tug.ctan.org/tex-archive/macros/ ... lsarticle/ and saved into elsarticle directory. Then, I run command:

Code: Select all

latex elsarticle.ins 
got such files:

Code: Select all

elsarticle.cls       elsarticle-num-names.bst        elsarticle-template-3a-num.tex  elsarticle-template-num.tex  model1-num-names.bst   model6-num-names.bst
elsarticle.dtx       elsarticle-template-1a-num.tex  elsarticle-template-3-num.tex   elsdoc.pdf                   model2-names.bst       numcompress.sty
elsarticle-harv.bst  elsarticle-template-1b-num.tex  elsarticle-template-4-harv.tex  manifest.txt                 model3a-num-names.bst  README
elsarticle.ins       elsarticle-template-1c-num.tex  elsarticle-template-5-harv.tex  model1a-num-names.bst        model3-num-names.bst
elsarticle.log       elsarticle-template-1-num.tex   elsarticle-template-6-num.tex   model1b-num-names.bst        model4-names.bst
elsarticle-num.bst   elsarticle-template-2-harv.tex  elsarticle-template-harv.tex    model1c-num-names.bst        model5-names.bst
then did, copied it all into:

Code: Select all

cp . /usr/share/texmf/tex/latex/elsevier/*
and run, as root:

Code: Select all

texhash
But when I try to make a simple pdf, on console (typing

Code: Select all

latex example.tex
or using TexMaker, I got such error: ! LaTeX Error: File `elsart.cls' not found.

Heres a tex file I want to compile:

Code: Select all

% Template article for preprint document class `elsart'
% with harvard style bibliographic references
% SP 2006/04/26
   
\documentclass{elsart}

\usepackage{multirow}
\usepackage{multicol}
\usepackage{algorithmic}

\usepackage{savesym}
\savesymbol{AND} 
 \usepackage{graphics}
 \usepackage{graphicx}
 \usepackage{epsfig}

\usepackage{amssymb}

\begin{document}
\begin{frontmatter}
\end{frontmatter}
\end{document}
And my log file:

Code: Select all

This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian) (format=pdflatex 2013.10.21)  21 OCT 2013 20:39
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**file.tex
(./file.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, po
lish, portuguese, loaded.

! LaTeX Error: File `elsart.cls' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: cls)

Enter file name: 
! Emergency stop.
<read *> 
         
l.6 ^^M
       
*** (cannot \read from terminal in nonstop modes)

 
Here is how much of TeX's memory you used:
 10 strings out of 495009
 190 string characters out of 3180581
 45123 words of memory out of 3000000
 3298 multiletter control sequences out of 15000+200000
 3640 words of font info for 14 fonts, out of 3000000 for 9000
 36 hyphenation exceptions out of 8191
 10i,0n,7p,70b,8s stack positions out of 5000i,500n,10000p,200000b,50000s
!  ==> Fatal error occurred, no output PDF file produced!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

! LaTeX Error: File `elsart.cls' not found.

Post by localghost »

The class is called elsarticle. Regardless of that you should install classes and packages by the package manager of your TeX distribution. TeX Live from the Ubuntu repositoriesis not shipped with this package manager. But elsarticle should be available though.

Remarks:
  • Think about installing a vanilla TeX Live 2013 either from DVD or over the net by the net installer.
  • No need to load graphicx and graphics. The former one loads the latter one. And drop the obsolete epsfig.

Best regards and welcome to the board
Thorsten
tk2
Posts: 3
Joined: Mon Oct 21, 2013 8:39 pm

! LaTeX Error: File `elsart.cls' not found.

Post by tk2 »

Thanks for help! Changed my code a little bit with your suggestions but now have different problem. My example tex file which I want to compile now:

Code: Select all

% Template article for preprint document class `elsart'
\documentclass[preprint, 12pt]{elsarticle}

\makeatletter
\def\@author#1{\g@addto@macro\elsauthors{\normalsize%
    \def\baselinestretch{1}%
    \upshape\authorsep#1\unskip\textsuperscript{%
      \ifx\@fnmark\@empty\else\unskip\sep\@fnmark\let\sep=,\fi
      \ifx\@corref\@empty\else\unskip\sep\@corref\let\sep=,\fi
      }%
    \def\authorsep{\unskip,\space}%
    \global\let\@fnmark\@empty
    \global\let\@corref\@empty  %% Added
    \global\let\sep\@empty}%
    \@eadauthor={#1}
}
\makeatother

\usepackage{multirow}
\usepackage{multicol}
\usepackage{algorithmic}

\usepackage{savesym}
\savesymbol{AND} 
 \usepackage{graphics}
 \usepackage{graphicx}
 \usepackage{epsfig}

\usepackage{amssymb}

\begin{document}

\begin{frontmatter}

\title{title}
\author[1]{JoeDoe\corauthref{cor}}
\cortext[cor1]{Corresponding author}
\ead{JoeDoe}
\author[1,2]{JoeDoe}
\author[3]{JoeDoe}
\address[1]{JoeDoe.} 
\address[2]{JoeDoe.} 
\address[3]{JoeDoe} 


\begin{abstract}
Abstract .....
\end{abstract}

\begin{keyword}
% keywords here, in the form: keyword \sep keyword
\end{keyword}

\end{frontmatter}
% main text
\section{}
\subsection{}
\subsection{}
\section{}
\subsection{}
\section{}
\section{)
\section{Conclusions}
\begin{thebibliography}{90}
\end{thebibliography}

\end{document}

Gives me errors:

Code: Select all

This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian) (format=pdflatex 2013.10.21)  21 OCT 2013 20:57
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**test.tex
(./test.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, po
lish, portuguese, loaded.
(/usr/share/texmf/tex/latex/elsevier/elsarticle.cls
Document Class: elsarticle 2009/09/17, 1.2.0: Elsevier Ltd
\@bls=\dimen102
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo
File: size12.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen103
)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)

(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty
Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
\KV@toks@=\toks14
)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
Package: graphics 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)

(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty
Package: trig 1999/03/16 v1.09 sin cos tan (DPC)
)
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/graphics.cfg
File: graphics.cfg 2010/04/23 v1.9 graphics configuration of TeX Live
)
Package graphics Info: Driver file: pdftex.def on input line 91.

(/usr/share/texlive/texmf-dist/tex/latex/pdftex-def/pdftex.def
File: pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX

(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty
Package: infwarerr 2010/04/08 v1.3 Providing info/warning/error messages (HO)
)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty
Package: ltxcmds 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
)
\Gread@gobject=\count87
))
\Gin@req@height=\dimen104
\Gin@req@width=\dimen105
)
(/usr/share/texlive/texmf-dist/tex/latex/psnfss/pifont.sty
Package: pifont 2005/04/12 PSNFSS-v9.2a Pi font support (SPQR) 
LaTeX Font Info:    Try loading font information for U+pzd on input line 63.

(/usr/share/texlive/texmf-dist/tex/latex/psnfss/upzd.fd
File: upzd.fd 2001/06/04 font definitions for U/pzd.
)
LaTeX Font Info:    Try loading font information for U+psy on input line 64.

(/usr/share/texlive/texmf-dist/tex/latex/psnfss/upsy.fd
File: upsy.fd 2001/06/04 font definitions for U/psy.
))
\c@tnote=\count88
\c@fnote=\count89
\c@cnote=\count90
\c@ead=\count91
\c@author=\count92
\@eadauthor=\toks15
\c@affn=\count93
\absbox=\box26
\keybox=\box27
\Columnwidth=\dimen106
\space@left=\dimen107
\els@boxa=\box28
\els@boxb=\box29
\leftMargin=\dimen108
\@enLab=\toks16
\@sep=\skip43
\@@sep=\skip44
 (./test.spl)
(/usr/share/texlive/texmf-dist/tex/latex/natbib/natbib.sty
Package: natbib 2010/09/13 8.31b (PWD, AO)
\bibhang=\skip45
\bibsep=\skip46
LaTeX Info: Redefining \cite on input line 694.
\c@NAT@ctr=\count94
)
\splwrite=\write3
\openout3 = `test.spl'.

)
(/usr/share/texlive/texmf-dist/tex/latex/multirow/multirow.sty
\bigstrutjot=\dimen109
)
(/usr/share/texlive/texmf-dist/tex/latex/tools/multicol.sty
Package: multicol 2011/06/27 v1.7a multicolumn formatting (FMi)
\c@tracingmulticols=\count95
\mult@box=\box30
\multicol@leftmargin=\dimen110
\c@unbalance=\count96
\c@collectmore=\count97
\doublecol@number=\count98
\multicoltolerance=\count99
\multicolpretolerance=\count100
\full@width=\dimen111
\page@free=\dimen112
\premulticols=\dimen113
\postmulticols=\dimen114
\multicolsep=\skip47
\multicolbaselineskip=\skip48
\partial@page=\box31
\last@line=\box32
\mult@rightbox=\box33
\mult@grightbox=\box34
\mult@gfirstbox=\box35
\mult@firstbox=\box36
\@tempa=\box37
\@tempa=\box38
\@tempa=\box39
\@tempa=\box40
\@tempa=\box41
\@tempa=\box42
\@tempa=\box43
\@tempa=\box44
\@tempa=\box45
\@tempa=\box46
\@tempa=\box47
\@tempa=\box48
\@tempa=\box49
\@tempa=\box50
\@tempa=\box51
\@tempa=\box52
\@tempa=\box53
\c@columnbadness=\count101
\c@finalcolumnbadness=\count102
\last@try=\dimen115
\multicolovershoot=\dimen116
\multicolundershoot=\dimen117
\mult@nat@firstbox=\box54
\colbreak@box=\box55
\multicol@sort@counter=\count103
)
(/usr/share/texlive/texmf-dist/tex/latex/algorithms/algorithmic.sty
Package: algorithmic 2009/08/24 v0.1 Document Style `algorithmic'

(/usr/share/texlive/texmf-dist/tex/latex/base/ifthen.sty
Package: ifthen 2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)
)
\c@ALC@unique=\count104
\c@ALC@line=\count105
\c@ALC@rem=\count106
\c@ALC@depth=\count107
\ALC@tlm=\skip49
\algorithmicindent=\skip50
)
(/usr/share/texlive/texmf-dist/tex/latex/savesym/savesym.sty

LaTeX Warning: You have requested package `savesym',
               but the package provides `savesymbol'.

Package: savesymbol 2003/06/01 v1.1 Saves and restores symbols
) (/usr/share/texlive/texmf-dist/tex/latex/graphics/epsfig.sty
Package: epsfig 1999/02/16 v1.7a (e)psfig emulation (SPQR)
\epsfxsize=\dimen118
\epsfysize=\dimen119
)
(/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amssymb.sty
Package: amssymb 2009/06/22 v3.00

(/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amsfonts.sty
Package: amsfonts 2009/06/22 v3.00 Basic AMSFonts support
\@emptytoks=\toks17
\symAMSa=\mathgroup4
\symAMSb=\mathgroup5
LaTeX Font Info:    Overwriting math alphabet `\mathfrak' in version `bold'
(Font)                  U/euf/m/n --> U/euf/b/n on input line 96.
)) (./test.aux)
\openout1 = `test.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 31.
LaTeX Font Info:    ... okay on input line 31.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 31.
LaTeX Font Info:    ... okay on input line 31.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 31.
LaTeX Font Info:    ... okay on input line 31.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 31.
LaTeX Font Info:    ... okay on input line 31.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 31.
LaTeX Font Info:    ... okay on input line 31.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 31.
LaTeX Font Info:    ... okay on input line 31.

(/usr/share/texlive/texmf-dist/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count108
\scratchdimen=\dimen120
\scratchbox=\box56
\nofMPsegments=\count109
\nofMParguments=\count110
\everyMPshowfont=\toks18
\MPscratchCnt=\count111
\MPscratchDim=\dimen121
\MPnumerator=\count112
\makeMPintoPDFobject=\count113
\everyMPtoPDFconversion=\toks19
) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
Package: pdftexcmds 2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO
)

(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty
Package: ifluatex 2010/03/01 v1.3 Provides the ifluatex switch (HO)
Package ifluatex Info: LuaTeX not detected.
)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty
Package: ifpdf 2011/01/30 v2.3 Provides the ifpdf switch (HO)
Package ifpdf Info: pdfTeX in PDF mode is detected.
)
Package pdftexcmds Info: LuaTeX not detected.
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode found.
)
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
Package: epstopdf-base 2010/02/09 v2.5 Base part for package epstopdf

(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/grfext.sty
Package: grfext 2010/08/19 v1.1 Manage graphics extensions (HO)

(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty
Package: kvdefinekeys 2011/04/07 v1.3 Define keys (HO)
))
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty
Package: kvoptions 2011/06/30 v3.11 Key value format for package options (HO)

(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
Package: kvsetkeys 2012/04/25 v1.16 Key value parser (HO)

(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty
Package: etexcmds 2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
Package etexcmds Info: Could not find \expanded.
(etexcmds)             That can mean that you are not using pdfTeX 1.50 or
(etexcmds)             that some package has redefined \expanded.
(etexcmds)             In the latter case, load this package earlier.
)))
Package grfext Info: Graphics extension search list:
(grfext)             [.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPE
G,.JBIG2,.JB2,.eps]
(grfext)             \AppendGraphicsExtensions on input line 452.

(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg
File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv
e
))
LaTeX Font Info:    Try loading font information for U+msa on input line 54.

(/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsa.fd
File: umsa.fd 2009/06/22 v3.00 AMS symbols A
)
LaTeX Font Info:    Try loading font information for U+msb on input line 54.

(/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd
File: umsb.fd 2009/06/22 v3.00 AMS symbols B
)
! Undefined control sequence.
\@elseads ... \texttt {JoeDoe} (JoeDoe\corauthref 
                                                  {cor})\def \eadsep {\unski...
l.54 \end{frontmatter}
                      
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Undefined control sequence.
\elsauthors ...ch {1}\authorsep JoeDoe\corauthref 
                                                  {cor}\unskip \textsuperscr...
l.54 \end{frontmatter}
                      
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

)
Runaway argument?
{) \par \section {Conclusions} \par \par \begin {thebibliography}{90}\ETC.
! File ended while scanning use of \@xdblarg.
<inserted text> 
                \par 
<*> test.tex
            
I suspect you have forgotten a `}', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type `E' or `X' now and fix your file.

! Emergency stop.
<*> test.tex
            
*** (job aborted, no legal \end found)

 
Here is how much of TeX's memory you used:
 2676 strings out of 495009
 35135 string characters out of 3180581
 90679 words of memory out of 3000000
 5812 multiletter control sequences out of 15000+200000
 12490 words of font info for 48 fonts, out of 3000000 for 9000
 36 hyphenation exceptions out of 8191
 38i,7n,30p,234b,186s stack positions out of 5000i,500n,10000p,200000b,50000s
!  ==> Fatal error occurred, no output PDF file produced!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

! LaTeX Error: File `elsart.cls' not found.

Post by localghost »

The macro \corauthref is not defined because not provided by this class. I suggest to drop your additional code at first, look at the class manual and start over with your custom formatting. For upcoming questions please open new topics or use the forum search to find possible solutions.

The primary problem seems to be solved so that you can accept the answer that led you to the solution.
tk2
Posts: 3
Joined: Mon Oct 21, 2013 8:39 pm

! LaTeX Error: File `elsart.cls' not found.

Post by tk2 »

Hmm, but the problem is with

Code: Select all

\end{frontmatter}
at least TeXMaker shows undefined symbol on lines with frontmatter. How to solve this?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

! LaTeX Error: File `elsart.cls' not found.

Post by localghost »

The last \section command has a closing ) instead of a correct }. The syntax highlighter of the forum indicates this, too.
Post Reply