% !TEX TS-program = xelatex
% !TEX encoding = UTF-8

% This is a simple template for a XeLaTeX document using the "article" class,
% with the fontspec package to easily select fonts.

\documentclass[12pt, a4paper]{article} % use larger type; default would be 10pt
\usepackage{fontspec} % Font selection for XeLaTeX; see fontspec.pdf for documentation
\defaultfontfeatures{Mapping=tex-text} % to support TeX conventions like ``---''
\usepackage{xunicode} % Unicode support for LaTeX character names (accents, European chars, etc)
\usepackage{xltxtra} % Extra customizations for XeLaTeX
\usepackage{amsmath, amssymb}
\usepackage{enumerate}
\usepackage{graphicx, subfig, float} % support the \includegraphics command and options
\usepackage{array, booktabs}
\usepackage{color, xcolor}
\usepackage{longtable}
\usepackage{colortbl}                          %.............................................表格標題註解之巨集套件

%\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots.
\usepackage[left=1.5in,right=1in,top=1in,bottom=1in]{geometry} 
%\geometry{a4paper} % or letterpaper (US) or a5paper or....
%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent
%-----------------------------------------------------------------------------------------------------------------------
%  主字型設定
%\setmainfont{新細明體}  % set the main body font (\textrm)
\setmainfont
	[
	%ItalicFont = Times New Roman,
	BoldFont = Times New Roman,  						% 這個設定將影響數學式裡的粗體。
	BoldItalicFont =Times New Roman
	]{新細明體} 
%\setmainfont{華康仿宋體W4}								% 任何在本電腦上的字型都可以使用
%\setmainfont{CWTEX}										% 自行安裝的字型 CwTex 明體
%\setmainfont{CWTEX-F}
\setsansfont{Arial}
%\setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Gill Sans}
\setmonofont{Courier New}
%\setmonofont[Scale=MatchLowercase]{Andale Mono}

% 其他字型
\newfontfamily{\E}{Cambria}								% 套用在英文字母
\newfontfamily{\A}{Arial}
\newfontfamily{\C}[Scale=0.9]{Cambria}
\newfontfamily{\T}{Times New Roman}
\newfontfamily{\TT}[Scale=0.8]{Times New Roman}
\newfontfamily{\B}{微軟正黑體}
\newfontfamily{\S}[Scale=0.8]{新細明體}				% 縮小版

%\newfontfamily{\K}{標楷體}                           	% Windows 下的標楷體
%\newfontfamily{\K}{Kaiti TC Regular}            	% Mac OS 下的標楷體
%\newfontfamily{\F}{CWTEX-F}                      	% CwTex 仿宋體
%\newfontfamily{\CB}{CWTEX-BB}					 	% CwTex 粗黑體
%\newfontfamily{\CK}{CWTEX-K}   					% CwTex 楷體
%\newfontfamily{\CR}{CWTEX-R}
%-----------------------------------------------------------------------------------------------------------------------
\XeTeXlinebreaklocale "zh"                  %這兩行一定要加，中文才能自動換行
\XeTeXlinebreakskip = 0pt plus 1pt     %這兩行一定要加，中文才能自動換行
%-----------------------------------------------------------------------------------------------------------------------
\newcommand{\cw}{\texttt{cw}\kern-.6pt\TeX}	% 這是 cwTex 的 logo 文字
\newcommand{\imgdir}{images/}						% 設定圖檔的位置
%\newtheorem{thm}{定理}                       				% 將 Theorem 改為國字「定理」
\renewcommand{\tablename}{表}						% 改變表格標號文字為中文的「表」（預設為 Table）
\renewcommand{\figurename}{圖}						% 改變圖片標號文字為中文的「圖」（預設為 Figure）
\definecolor{slight}{gray}{0.9}								% 設定顏色