23 กรกฎาคม 2557

Template สำหรับ XeLaTeX ปรับปรุง 2557

บันทึกเก็บไว้ใช้งาน ตอนนี้ตั้ง ภาคผนวกให้เป็น ก ข ค แต่ยังไม่สวย แล้วก็ ไม่ต้องตั้งค่า fontspec สำหรับตัวเอียงแล้ว


\documentclass[a4paper]{book}
\usepackage{xltxtra}
\usepackage{polyglossia}
\usepackage[top=25mm, bottom=20mm, left=25mm, right=25mm]{geometry}
\usepackage[titletoc,toc,title]{appendix}

\XeTeXlinebreaklocale "th"
\XeTeXlinebreakskip = 0pt plus 1pt
\setmainfont{TH Sarabun New}

\defaultfontfeatures{Scale=1.23}

\renewcommand{\baselinestretch}{1.2}

\setdefaultlanguage{thai}

\newfontfamily{\thaifont}[Script=thai]{TH Sarabun New}

\begin{document}


\frontmatter

\pagenumbering{thaialph}
\tableofcontents

\mainmatter

\chapter{บทแรก}
\section{บทนำ}

\noindent

ป้า กะ ปู่ กู้อีจู้ ตัวปกติ\\
{\itshape ป้า กะ ปู่ กู้อีจู้ ตัวเอียง} \\
{\bfseries ป้า กะ ปู่ กู้อีจู้ ตัวหนา } \\
{\bfseries\itshape ป้า กะ ปู่ กู้อีจู้ ตัวหนาเอียง} \\

ทดสอบใช้คำสั่ง \LaTeXe{}\\

ป้า กะ ปู่ กู้อีจู้ ไฟฟ้า ปัญญา ตัวปกติ\\
\textbf{ป้า กะ ปู่ กู้อีจู้ ไฟฟ้า ปัญญา ตัวหนา}\\
\textit{ป้า กะ ปู่ กู้อีจู้ ไฟฟ้า ปัญญา ตัวเอียง}\\
\textsl{ป้า กะ ปู่ กู้อีจู้ ไฟฟ้า ปัญญา ตัวเอน}\\
\textbf{\textit{ป้า กะ ปู่ กู้อีจู้ ตัวหนาเอียง}}\\
%%\texttt{ป้า กะ ปู่ กู้อีจู้ ไฟฟ้า ปัญญา ตัวพิมพ์}

\chapter{บทสอง}

\section{บทนำ}
xxxx xxxxx xxxxx
\chapter{บทสาม}
\section{บทนำ}
xxxx xxxxx xxxxx

%% \backmatter %% ใช้ไม่ได้ หายหมด


%% ยังไม่ดีมาก แต่ก็ได้ ก ข ค

\begin{appendices}
\renewcommand*{\thechapter}{\thaiAlph{chapter}}
\chapter{ทดสอบภาคผนวก} %% ---------------------
\chapter{ทดสอบภาคผนวกอีกที} %% ---------------------
\end{appendices}

\end{document}