xelatex 找不到article.cls,但它存在

xelatex 找不到article.cls,但它存在

我已經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}

相關內容