2012年3月26日 星期一

[lyx] Lyx 的中文筆記

在 Lyx 中輸入中文其實很簡單。因為 Lyx 現在都直接支援 unicode 所以,直接打出來就好。但是要輸出有中文的 PDF 就比較麻煩了。不過需要設定一些東西:一部分的設定是關於文件(Document)的設定,另外的是 Lyx 自己的設定(Preference)。以下分開說明。

Part I : Document setup.

<1> 打開 Document > Settings...


<2> 設定 Language 中的 Encoding 設定成某種 unicode 例如說:
  • Unicode (XeTeX) (utf8)
  • Unicode (CJK) (utf8)
  • Unicode (utf8)


<3>加入 LaTeX Preamble 如下:
\usepackage{fontspec,xltxtra,xunicode}
\defaultfontfeatures{Mapping=tex-text}
\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt
\newfontfamily{\c}{LiHei Pro}
\newfontfamily{\ch}{LiSong Pro}


Part II : Preference setup.

<1> 打開 Preference



<2> 設定 File formats

為了 XeTeX, 請將 Default Output Format 設定成 PDF (XeTeX),至於 Format 要不要設定成 LaTeX (XeTeX) 倒是無所謂。

沒有留言:

張貼留言