I recently downloaded MacTeX-2015 and wrote a very short file which I called test.tex:
\documentclass{article}
\begin{document}
Hello world.
\[ e^{2\pi i} = 1. \]
\end{document}
I opened the file in TeXShop, where it compiled and generated a PDF just fine. However, when I opened Terminal and told it "pdflatex test.tex", I got the following error message:
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2015/01/01>
Babel <3.9l> and hyphenation patterns for 79 languages loaded.
! LaTeX Error: File `article.cls' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: cls)
Enter file name:
I found that the required file, article.cls, lived at /usr/local/texlive/2015/texmf-dist/tex/latex/base/article.cls, so I entered this as the file name Terminal was asking for. I then got the following message:
Enter file name: /usr/local/texlive/2015/texmf-dist/tex/latex/base/article.cls
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
! LaTeX Error: File `size10.clo' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: clo)
I repeated what I did before and told Terminal that size10.clo lives at /usr/local/texlive/2015/texmf-dist/tex/latex/base/size10.clo, after which Terminal decided to cooperate and gave me a perfectly normal pdf.
My question is this: why can't LaTeX find the files it needs to build my PDF, and what can I do to fix this besides manually telling it where all of the files are? I've tried uninstalling and reinstalling MacTex several times, but to no avail. I also tried telling Terminal "sudo texhash" on a friend's suggestion, but that didn't fix my problem either. I'm new to LaTeX and don't know much about computers, so I would appreciate if you could explain what's going on in non-technical terms. Thanks so much in advance!
path
is simply something that says "look in those folders for this information".LaTeX2e <2015/01/01>
is too old for for an up to date texlive 2015 release (should be 2016/03/31) check you haven''t got a local installation masking the recently installed version