You are on page 1of 2

輸出結果

內文 ABC123, 內文 ABC123, 內文 ABC123, 內文 ABC123;


內文 ABC123, 內文 ABC123, 內文 ABC123, 內文 ABC123;
內文 ABC123, 內文 ABC123, 內文 ABC123, 內文 ABC123;
PV = nRT 我唯一記得的化學式

原始碼
\documentclass[10pt]{article}
\usepackage[T1]{fontenc}
\usepackage{txfonts}% 設定數學式為 Times Roman
\usepackage{xunicode,xltxtra,fontspec}% 引入 xelatex 相關 package
\usepackage[boldfont]{xCJK}% 引入 xCJK packge。至於 boldfont 請
看先前說明。

%xetex 的一些基本設定
\XeTeXinputencoding "utf8"
\XeTeXdefaultencoding "utf8"
\XeTeXlinebreaklocale "zh"

%利用 fontspec 設定英文字型


\setmainfont[Mapping=tex-text]{TeX Gyre Termes}
\setsansfont[Mapping=tex-text,Scale=0.92]{TeX Gyre Heros}
\setmonofont[Ligatures=NoCommon,Scale=0.9,Kerning=Off]{TeX Gyre Cursor}

%利用 xCJK 與 fontspec 設定中文字型


\setCJKmainfont[
Scale=1,
ItalicFont={AR PL New Kai},
ItalicFeatures={Scale=0.96},
BoldFont={AR PL New Sung},
BoldFeatures={FakeBold=2,LetterSpace=-40},
BoldItalicFont={AR PL New Kai},
BoldItalicFeatures={FakeBold=2,FakeSlant=0.18,LetterSpace=-40},
]{AR PL New Sung}
\setCJKmonofont{AR PL New Sung}

1
\begin{document}
\begin{CJK}{UTF8}{bsmi}
\CJKtilde

\normalfont
內文~ABC123,
{\bfseries 內文~ABC123},
{\itshape 內文~ABC123},
{\bfseries\itshape 內文~ABC123};

\sffamily
內文~ABC123,
{\bfseries 內文~ABC123},
{\itshape 內文~ABC123},
{\bfseries\itshape 內文~ABC123};

\ttfamily
內文~ABC123,
{\bfseries 內文~ABC123},
{\itshape 內文~ABC123},
{\bfseries\itshape 內文~ABC123};

\[PV=nRT\;\mbox{我唯一記得的化學式}\]
\clearpage
\end{CJK}
\end{document}

You might also like