
我已經texlive-latex-base
安裝texlive-latex-recommended
在我的 Ubuntu 14.04 中。我正在嘗試編譯這個文檔:
\documentclass[11pt,oneside]{ article }
\usepackage{fontspec}
\begin{document}
Hello world!
\end{document}
使用 xelatex,所以我輸入:
$ xelatex test.tex test.pdf
但它會拋出這個錯誤:
! LaTeX Error: File ` article .cls' not found.
但是,我可以article.cls
在正確的資料夾中找到/usr/share/texlive/texmf-dist/tex/latex/base/
,所以我不知道出了什麼問題。
它會拋出更多錯誤,例如! LaTeX Error: Missing \begin{document}.
和! LaTeX Error: The font size command \normalsize is not defined: there is probably something wrong with the class file.
,但是它會產生一個帶有 Hello world! 的 pdf 檔案。印在.
為什麼 xelatex 找不到文章類?我瀏覽了這些論壇但找不到任何解決方案。
乾杯!
答案1
那麼,修剪前後的空格article
就可以消除錯誤並編譯成功。只需更換
\documentclass[11pt,oneside]{ article }
和
\documentclass[11pt,oneside]{article}