7

I try to use Latex with Thai language. I found a few problems.

  1. \usepackage[Lenny]{fncychap}does not completely support Thai font. (TH Sarabun New is an opentype font)

  2. \bibliography{bib} do not support Thai font.

There is something wrong with my preamble.

\documentclass[a4paper,12pt,twoside,onecolumn,openright,final]{memoir}

% Page Setup
\setlrmarginsandblock{3.81cm}{2.54cm}{*}
\setulmarginsandblock{2.54cm}{2.54cm}{*}
\checkandfixthelayout

% Header & Footer Setup
\nouppercaseheads
\makepagestyle{mystyle}
\setlength{\headwidth}{\dimexpr\textwidth}
\makerunningwidth{mystyle}{\headwidth}

% Header
\makeevenhead{mystyle}{\itshape\leftmark}{}{}
\makeoddhead{mystyle}{}{}{\itshape\leftmark}
% Footer
\makeevenfoot{mystyle}{}{\thepage}{}
\makeoddfoot{mystyle}{}{\thepage}{}

\makeatletter
% Text at Header
\makepsmarks{mystyle}{    %
\createmark{chapter}{left}{shownumber}{\@chapapp\ }{.\ }}
\makeatother

%%% Chapter Page
\makepagestyle{plain}
\makerunningwidth{plain}{\headwidth}
\makeevenfoot{plain}{}{\thepage}{}
\makeoddfoot{plain}{}{\thepage}{}

\pagestyle{mystyle}

% Add Package
\usepackage{amsfonts}
%\usepackage{amsmath}
\usepackage{mathtools}

\usepackage{amssymb}
\usepackage{amsthm}
\setcounter{MaxMatrixCols}{30}
\usepackage{breqn}

\usepackage{graphics}
\usepackage{graphicx}
\usepackage{wrapfig}

\usepackage{rotating}

\usepackage[Lenny]{fncychap}     %********************

% Font Setup
\usepackage{xltxtra}
\usepackage{fontspec}
\defaultfontfeatures{Scale=1.35}
\setmainfont[Script=Thai]{TH Sarabun New}     % Thai alphabet
\XeTeXlinebreaklocale “th_TH”     % Thai alphabet
\XeTeXlinebreakskip = 0pt plus 1pt
\renewcommand{\baselinestretch}{1.4}

% Add Package For Thai Page Number
\usepackage{polyglossia}
\setdefaultlanguage[numerals=arabic]{thai}     % Thai alphabet
\newfontfamily{\thaifont}[Script=Thai]{TH Sarabun New:script=thai}     % Thai alphabet

%    %    % Set section number depth of ToC
\setsecnumdepth{subsection}
\settocdepth{subsection}

\usepackage{natbib}

\usepackage[
colorlinks=true,
linkcolor=blue,
citecolor=green,
anchorcolor=cyan,
filecolor=red,
urlcolor=blue,
bookmarksnumbered=true,
pdfview=FitB
]{hyperref}

\usepackage{lipsum}

% Begin of Document
\begin{document}

\frontmatter

% Table of  Contents
\tableofcontents
\newpage
\listoftables
\newpage
\listoffigures
\newpage

\mainmatter
% Chapter
\chapter{Chapter title = ชื่อบท}     %Thai alphabet
\section{Section title 1 = ส่วนที่ 1}     %Thai alphabet
การสังเคราะห์ข้อมูลน้ำฝนรายวันแบบ สโตแคสติคโดยใช้ลูกโซ่มาร์คอฟ ชนิดสองสถานะ และฟังก์ชันการแจกแจงแบบต่อเนื่อง\\
means\\
Stochastic Generation of Daily Rainfall Using Two-state Markov Chain and Continuous Distribution Functions\\
\cite{AP2011}

% Bibliography     %********************
\bibliographystyle{chicago}
\bibliography{bib}

\end{document} 

bib file:

@article{AP2011,
  title={การสังเคราะห์ข้อมูลน้ำฝนรายวันแบบ สโตแคสติคโดยใช้ลูกโซ่มาร์คอฟ ชนิดสองสถานะ และฟังก์ชันการแจกแจงแบบต่อเนื่อง = Stochastic Generation of Daily Rainfall Using Two-state Markov Chain and Continuous Distribution Functions},
  author={Asasuppakit, Praopun},
  year={2011}
} 

Figures showed Chapter 1 and Bibliography

Chapter page showed a fine page, but it still has some errors when running XeLatex. Bibliography did not show anything.

Chapter 1

Bib

Moriambar
  • 11,466
Langevin
  • 319
  • The problem with fncychap is that it uses the deprecated command \rm; add oldfontcommands to the options passed to the memoir class. This if you really want the Lenny chapter style, which is, in my opinion, very poorly designed. For the bibliography problem, without a minimal example it's impossible to say anything. However, BibTeX doesn't support alphabets different from Latin (and with many limitations for diacritics, too). – egreg Jun 08 '13 at 21:48
  • @egreg Thank you for your comment. I edited my code already. For fncychap, I tried to use a chapter style on my work. Lenny chapter style Is one of my attempts. I will find out how to make it. – Langevin Jun 09 '13 at 01:22

1 Answers1

2

I found this a link which can fix my trouble relating to my question

2. \bibliography{bib} do not support Thai font.

\documentclass[12pt,a4paper]{article}
\usepackage{xltxtra}
\usepackage{polyglossia}
\usepackage[top=25mm, bottom=20mm, left=25mm, right=20mm]{geometry}
\XeTeXlinebreaklocale "th"
\XeTeXlinebreakskip = 0pt plus 1pt
\defaultfontfeatures{Scale=1.23}
\title{ชื่อบทความ}
%% ใช้ร่วมกับ polyglossia เพื่อให้ได้วันที่ภาษาไทย
\setdefaultlanguage{thai}
\newfontfamily{\thaifont}[Script=Thai]{TH SarabunPSK}
\begin{document}
\fontspec[
ItalicFont={TH SarabunPSK Italic},
BoldFont={TH SarabunPSK Bold},
BoldItalicFont={TH SarabunPSK Bold Italic},
]{TH SarabunPSK}
\maketitle
\section*{ลองดูสิ}
ศึกษา \TeX\ อย่างละเอียด ให้ดู \cite{DK86} ถ้าต้องการเขียนสมการคณิตศาสตร์ให้ดู \cite{DK89}. แต่ถ้าเป็นของอาจารย์จักรี ลองอ้างอิงกับเล่มนี้ \cite{จักรีRC54} ดูนะครับ
\bibliographystyle{plain}
\bibliography{testBibXeTex}
\end{document}

testBibXeTex.bib

@book{DK86, 
author = "D.E. Knuth",  
title = "The {\TeX}book",   
publisher = "Addison Wesley",   
year = 1986 
}   
@article{DK89,  
author = "D.E. Knuth",  
title = "Typesetting Concrete Mathematics", 
journal = "TUGboat",    
volume = 10,    
number = 1, 
pages = "31--36",   
month = apr,    
year = 1989 
}   
@book{จักรีRC54,    
author = "จักรี ติยะวงศ์สุวรรณ",    
title = "การออกแบบโครงสร้างคอนกรีตเสริมเหล็ก",  
publisher = "มปพ",  
year = 2554 
}   

Credit: http://withxetex.blogspot.com/2011/11/bibtex-xelatex.html

จักรี ติยะวงศ์สุวรรณ

Mr.Chakkree Tiyawongsuwan

Langevin
  • 319
  • 1
    it's not so much that bibtex doesn't support "thai font"s, rather that it only supports 7-bit ascii by default. the work-around makes it support thai in utf-8, but it will have no chance of sorting entries -- you need to go to biber/biblatex for that, aiui. – wasteofspace Jul 10 '13 at 09:38