![Thai template example with polyglossia and xelatex](https://writelatex.s3.amazonaws.com/published_ver/11151.jpeg?X-Amz-Expires=14400&X-Amz-Date=20240630T122256Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAWJBOALPNFPV7PVH5/20240630/us-east-1/s3/aws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=fc7a65c4256a3fa0590802340a07fc926f8ba5dbacfa1ca6f6c0f602da1d08e8)
Thai template example with polyglossia and xelatex
Author
LianTze Lim
Last Updated
5 лет назад
License
Creative Commons CC BY 4.0
Abstract
Thai template example with polyglossia and xelatex
![Thai template example with polyglossia and xelatex](https://writelatex.s3.amazonaws.com/published_ver/11151.jpeg?X-Amz-Expires=14400&X-Amz-Date=20240630T122256Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAWJBOALPNFPV7PVH5/20240630/us-east-1/s3/aws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=fc7a65c4256a3fa0590802340a07fc926f8ba5dbacfa1ca6f6c0f602da1d08e8)
Thai template example with polyglossia and xelatex
\documentclass[12pt]{article}
\usepackage{polyglossia}
\setdefaultlanguage[numerals=thai]{thai}
\newfontfamily{\thaifont}{Norasi}[Script=Thai]
\newfontfamily{\thaifontsf}{Garuda}[Script=Thai]
\newfontfamily{\thaifonttt}{Noto Sans Thai}
\XeTeXlinebreaklocale "th"
\setotherlanguage{english}
\newfontfamily\englishfont{FreeSerif}[Ligatures=TeX]
\renewfontfamily\sffamilylatin{FreeSans}[Ligatures=TeX]
\renewfontfamily\ttfamilylatin{FreeMono}
\usepackage{hyperref}
\renewcommand{\UrlFont}{\ttfamilylatin}
\title{ตัวอย่างเช่นไทย}
\author{Lim Lian Tze}
\begin{document}
\maketitle
\tableofcontents
\section{บทนำ}
คอรัปชันจุ๊ยโปรดิวเซอร์ สถาปัตย์จ๊าบ แจ็กพ็อต ม้าหินอ่อน ซากุระคันถธุระ ฟีดสตาร์ท งี้ บอยคอตอิ่มแปร้สังโฆคำสาปแฟนซี ศิลปวัฒนธรรมไฟลท์จิ๊กโก๋กับดัก เจลพล็อตมาม่าซากุระดีลเลอร์ ซีนดัมพ์ แฮปปี้ เอ๊าะอุรังคธาตุซิม ฟินิกซ์เทรลเล่อร์อวอร์ด แคนยอนสมาพันธ์ ครัวซองฮัมอาข่าเอ็กซ์เพรส
\begin{otherlanguage}{english}
Some maths and some English: $\sqrt{x + y - \alpha \times 2}$
\end{otherlanguage}
\textsf{ฟินิกซ์เทรลเล่อร์อวอร์ด} \textenglish{\sffamily `Sans-serif' Thai font!}
\begin{otherlanguage}{english}
A list of available Thai fonts on the Overleaf server can be found at \url{https://www.overleaf.com/help/193#!Thai}. You can upload your own .otf and .ttf fonts to use them with XeLaTeX.
\end{otherlanguage}
\end{document}