I have texlive-latex-base and texlive-latex-recommended installed in my Ubuntu 14.04. I am trying to compile this document:

\documentclass[11pt,oneside]{ article }

Hello world!

with xelatex, so I type:

$ xelatex test.tex test.pdf

but it throws this error:

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

However, I can find article.cls in the correct folder /usr/share/texlive/texmf-dist/tex/latex/base/, so I have no idea what's goinf wrong.

It throws a couple more errors like ! LaTeX Error: Missing \begin{document}. and ! LaTeX Error: The font size command \normalsize is not defined: there is probably something wrong with the class file., however it generates a pdf file with a Hello world! printed in.

Why is xelatex not finding the article class? I have surfed these forums but couldn't find any solution.


  • 1
    Welcome to TeX.SX! TeX is sensitive to spaces, so it should be {article}, not { article }. – egreg Sep 21 '14 at 15:57

Well, triming the whitespace before and after article can eliminate the errors and compile successfully. Just replace

\documentclass[11pt,oneside]{ article }


  • Thank you, I tried to vote you (and the previous commenter) and accept your answer but I need 15 reputation for that, so I will be glad if somebody with more reputation could do that for me. – Xirux Nefer Sep 21 '14 at 16:10
  • @XiruxNefer You can accept the answer by clicking on the greyed out checkmark by the vote counter. Nobody can accept the answer but you. (However, you cannot up-vote it without more reputation - you are right about that.) – cfr Sep 21 '14 at 16:17
  • Note that this answer is essentially egreg's comment, which was posted 10 minutes earlier. It would have been more appropriate to suggest that egreg turn that comment into an answer rather than posting those instructions as an answer yourself. – cfr Sep 21 '14 at 16:19
  • Just for the record, I am not Justin Yang. – Xirux Nefer Sep 21 '14 at 16:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.