LaTeX 有提供許多種不同的文件格式, 例如 hello.tex 的格式就是 article, 另外我們還指定了一個參數:12pt, 它的意思是設定內文字型大小為 12 points。 以下是另一個簡單的例子:
\documentclass[12pt, a4paper]{article} \begin{document} Hello, world. \end{document}
設定 LaTeX 文件之格式與參數的語法為:
\documentclass[參數]{格式}其中可使用的參數與格式有關, 標準的格式有 article、report、book、slides、letter 等。 在此我們只介紹 article 排版格式。而此格式可以使用的參數如下:
10pt | 內定文字的大小;亦即內文字型為 10 point, 基準線之間距、段落之縮排與間距、各類標題字型,都有一定的規範 |
---|---|
11pt | 以內定文字放大 10%,也就是 1.1 倍; 亦即內文字型為 11 point,其他配套之間距與字型皆放大 10% |
12pt | 以內定文字放大 20%,也就是 1.2 倍; 亦即內文字型為 12 point,其他配套之間距與字型皆放大 20% |
letterpaper | 內定以美國信紙規格 [8.5in x 11in] 來排版 |
a4paper | 以國際標準 A4 紙張規格 [210mm X 297mm] 來排版 |
假如您故意將格式名稱打錯,例如:article 打成 articl, 則編譯它的時候會出現:
! LaTeX Error: File `articl.cls' not found. Type X to quit orto proceed, or enter new name. (Default extension: cls) Enter file name: