5 กันยายน 2557

ตั้ง ScriBus ให้รับ Render Frame เป็น XeLaTeX

ScriBus  เป็นโปรแกรมสำหรับจัดเรียงพิมพ์ แต่จะใช้งาน render frame เป็น pdfLaTeX ถ้าต้องการใช้งานฟอนต์ไทย ควรจะตั้งให้ใช้งานเป็น XeLaTeX ดีกว่า

1)  File/Preferences.../ External Tools  แล้วค่า LaTeX เป็น
                   xelatex --interaction=nonstopmode




2) เมื่อแทรก render frame เข้ามาแล้ว ให้ทำการ edit source..


    แล้วตั้งค่า Header

\usepackage{amsmath}
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\usepackage{polyglossia}
\XeTeXlinebreaklocale "th"
\XeTeXlinebreakskip = 0pt plus 1pt
\setmainfont{Angsana New}


 ในช่วง Enter Code ใช้ใส่คำสั่ง XeLaTeX ปกติ แต่ใช้การกำหนดฟอนต์ตามตัวอย่าง

\section*{คู่มือ}
วางภาษาไทย \XeLaTeX ลงไปได้เหงื่อออกนิดหน่อย \\
ถ้าเห็นภาษาไทยได้แสดงว่าคุณทำสำเร็จแล้ว อ่ะอ่ะ
\\
\[J = \int r^2 \mathrm{d}m \]
\font\thai="LilyUPC:script=thai" at 14pt \thai $x^2+4$ ทดสอบภาษาไทย Test English Language



3) ตอน ส่งออกเป็นไฟล์ pdf ให้เลือกแบบ Embeded pdf คือฝัง pdf ไปเลยจะได้ชัด ๆ


ได้ผลลัพธ์ดังแสดง

 


ไม่ค่อยละเอียด ผมบันทึกไว้กันลืมสำหรับตัวเองครับ อ่ะอ่ะ


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}