The first line of my latex file is:


latex fails with the following error:

LaTeX Error: File `ectaart.cls' not found.

I copied that file to (on my Ubuntu system):

  • /usr/local/share/texmf
  • /usr/local/share/texmf/tex
  • /usr/local/share/texmf/tex/latex
  • /usr/local/texlive/2012/texmf
  • /usr/local/texlive/2012/texmf/tex
  • /usr/local/texlive/2012/texmf/tex/latex
  • /var/lib/texmf
  • /var/lib/texmf/tex
  • /var/lib/texmf/tex/latex

None of these options worked.

Where should this file go?

(And why doesn't Latex tell me where it looked for the file?)

  • 3
    Did you run texhash after installing the file?
    – Joseph Wright
    Commented Nov 28, 2013 at 8:01
  • I ran texhash several times. I had to do this as root because when I did this as myself I got permission errors. Commented Nov 28, 2013 at 8:52
  • @ErelSegalHalevi I do not get it. For me, it worked without any slightest bit of problem. Download from e-publications.org/ecta/support/download/ectaart.zip, unzip the file inside a folder ecaart, copy the complete folder to /usr/local/share/texmf/tex/latex/, run sudo texhash, worked like a charm. Here is the relevant line from log file, /usr/local/share/texmf/tex/latex/ectaart/ectaart.cls. Though it did complain about, Unused global option(s): [english]. I am using Ubuntu 12.04, BTW.
    – Masroor
    Commented Nov 28, 2013 at 9:39
  • Your 'local' texmf is, ~/texmf; but as this is a LaTeX file, you need to put it in the right subdirectory, sc.: ~/texmf/tex/latex. If you like well-designed directory hierarchies, you could do: mkdir ~/texmf/tex/latex/ectaart and put it there. Note that texmf folder must mimic the system TDS, so a corresponding .bib file would be put in, ~/texmf/bibtex/bib and the .bst in ~/texmf/bibtex/bst. There are a bunch of questions on this site that answer this general question of 'where' more fully.
    – jon
    Commented Nov 28, 2013 at 15:04

2 Answers 2


TeX's first step is to parse the current/working folder for files that are needed. This covers everything from .tex, .sty, .cls, image files, and everything else. If this fails, TeX searches the index made when you run texhash. This index contains the folder and file locations of your TeX distribution in the form of an elementary "hash table" that is used as a lookup. Actually, it's just an alphabetical list of files by folder. Since TeX can be installed wherever you want to, such an accessible table is necessary to identify the locations of the sources. Under TeX Live, this file (ls-R, named based on a Recursive folder listing) is located in your */texmf-dist folder and has the following form:






You can see how this matches the folder structure:

enter image description here

Only the above two locations are searched, in that order, when looking for files.

Note that, even if you place source files inside the TDS (TeX Distribution Structure), it won't be picked up automatically unless you run texhash. ls-R has to be updated to include your newly-placed files, otherwise the files won't be found.

Another reference: Where do I place my own .sty files, to make them available to all my .tex files?


After several hours of frustration I finally decided to put the file "ectaart.cls" in the same folder of my LaTeX file, and it worked! I know it is not the standard way to do this, but I really tried all other options.

  • 2
    This is actually a totally OK way to do this for custom or uncommon class files—just so you know :-) Commented Dec 28, 2013 at 15:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .