LaTeX 編譯器會將 所有空白當作一個空格 來處理。 所謂「空白」 (white space) 是連續任意多個空格或跳格,以及一列結束的後面。 而 LaTeX 編譯器認為 兩次 Enter,也就是一個空列 是一個段落的結束 (也就是下一個段落的開始)。 其例子如下:
\documentclass[12pt,a4paper]{article} \begin{document} This is the first paragraph. \LaTeX\ does not care about the extra spaces or tabs. And each newline is equivalent with a space. So the leading white spaces in source code are ignored. If a line is too long, \LaTeX\ wraps it automatically. This is the second paragraph. \end{document}
編譯完以後預覽會看到類似以下的結果:
可見 LaTeX 不理會多餘的空白,而且會自動選擇最佳折到下一列的位置。This is the first paragraph. LaTeX does not care about the extra spaces or tabs. And each newline is equivalent with a space. So the leading white spaces in source code are ignored. If a line is too long, LaTeX wraps it automatically. This is the second paragraph.
前面範例出現了 \LaTeX\ 那是兩個指令 \LaTeX 和 \ (反斜線後面跟一個空格) 寫在一起。 請讀者先接受這樣的特殊型態,以後再說明。
張鈞威 (02/08/23) --- 02/12/11 (單)