<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%\iffalse
% thaispec.dtx generated using makedtx version 1.2 (c) Nicola Talbot
% Command line args:
%   -doc "thaispec.tex"
%   -author "Ratthaprom_Promkam"
%   -src "thaispec\.sty=&gt;thaispec.sty"
%   thaispec
% Created on 2021/3/2 0:13
%\fi
%\iffalse
%&lt;*package&gt;
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&amp;
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \&lt;
%%   Equals        \=     Greater than  \&gt;     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%&lt;/package&gt;
%\fi
% \iffalse
% Doc-Source file to use with LaTeX2e
% Copyright (C) 2021 Ratthaprom_Promkam, all rights reserved.
% \fi
% \iffalse
%&lt;*driver&gt;
\documentclass{article}

\usepackage[thaispacing=false,thaicaption=false]{thaispec}
\usepackage{metalogo}
\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=black,
    filecolor=magenta,
    urlcolor=blue,
}
%\usepackage{listings}
\usepackage{color}
\usepackage{longtable}
\usepackage{minted}


\newcommand{\pkgname}{\texttt{thaispec}}
\newcommand{\showdefault}[1]{\par\vspace{0mm}\noindent{Default:}\par\noindent\texttt{#1}}
\newcommand{\showex}[1]{\par\vspace{0mm}\noindent{Example:}\par\noindent\texttt{#1}}
\newcommand{\printcenter}[1]{\par\begin{center}#1\end{center}\par\noindent}
\newcommand{\myoption}[4]{{\texttt{#1}}&amp;{#2}{\showdefault{#3}}{\showex{#4}}\\}
\newcommand{\showoption}[2]{{\noindent\texttt{#1}}&amp;{#2}\\\hline}


\newcommand{\mopt}{%
frame=single,
linenos=true,
autogobble=true,
}

%\lstdefinestyle{tex}{%
%language=[LaTeX]{TeX},
%basicstyle=\ttfamily\small\color{red},
%keywordstyle=\bfseries\color{black},
%frame=single,
%backgroundcolor=\color{white},
%extendedchars=true,
%inputencoding=utf8,
%breaklines=true,
%postbreak=\mbox{\textcolor{red}{$\hookrightarrow$}\space},
%showstringspaces=true,
%}

%\lstset{style=tex}

\newminted{latex}{frame=single}

\title{The \pkgname\ package: \\Thai language typesetting in \XeLaTeX}
\author{Ratthaprom Promkam\\{\texttt{\small ratthaprom@me.com}}}
\date{Version 2021.03.01}

\begin{document}
\DocInput{thaispec.dtx}
\end{document}
%&lt;/driver&gt;
%\fi
%\maketitle
%
%This package allows you to input Thai characters directly to \LaTeX\ documents
%and choose any (system wide) Thai fonts for typesetting via \XeLaTeX.
%It also tries to appropriately justify paragraphs with no more external tools.
%
%\tableofcontents
%
%
%\section{Prerequisite}
%The package requires \texttt{TH Sarabun New} \footnote{Thai national fonts, a.k.a. \texttt{SIPAFonts}.
%See \url{https://github.com/epsilonxe/sipafonts}}, included in the collection of Thai national fonts, by default to typeset Thai characters.
%The following \LaTeX\ package are essentially required for the default option: \texttt{fontspec}, \texttt{ucharﾂｭclasses}, \texttt{polyﾂｭglosﾂｭsia}, \texttt{setspace}, \texttt{kvopﾂｭtions}, and \texttt{xpatch}.
%
%\section{Installation}
%Although the \texttt{thaispec} packages are included in all major \LaTeX\ distributions, you may need to manually install or upgrade to the latest version.
% 
%In a case that it is neither installed nor outdated, please visit \url{https://github.com/epsilonxe/latex} to download the latest version of \texttt{thaispec.sty} and put it in your working directory.
%
%More conveniently, but require familiar to command line interface, 
%please run the following commands to install or update to the most recent version of \texttt{thaipsec} via TexLive Manager. 
%However, you may need administrator right to launch these commands.
%So consider to add \texttt{sudo} before each of the following commands.
%
%\begin{minted}{bash}
%$tlmgr install thaispec 
%$tlmgr update thaispec    
%\end{minted}
%
%\section{Recommendation}
%Install the collection of Thai national fonts said above.
%Python and \texttt{pygments} are also recommended to be installed if syntax highlight needed in the document.
%
%\section{Package loading}
%In the preamble, add the command
%\begin{minted}[frame=single]{latex}
%\usepackage{thaispec}
%\end{minted}
%then you can input Thai characters in the document and typeset the document as usual.
%This will typeset the document by choosing \texttt{TH Sarabun New} for all Thai characters.
%The package also predefines \texttt{\textbackslash today} and \texttt{\textbackslash Today}
%for today Thai date printing in short and long formats respectively.
%The Latin character will be typeseted as usual.
%% By default the package set \texttt{thaifont} to \texttt{TH Sarabun New},
%% while set \texttt{mainfont}, \texttt{sansfont} and \texttt{monofont} to \TeX\ Gyre fonts.
%
%% In case \TeX\ Gyre font family is not system wide installed, the package should be loaded
%% with the following option:
%% \begin{minted}[frame=single]{LaTeX}
%% \usepackage[texgyrefont = false]{thaispec}
%% \end{minted}
%
%
%\section{Loading options}
%This section lists additional loading options by their features.
%Multiple options can be loaded with the following command.
%\begin{minted}[frame=single]{LaTeX}
%\usepackage[option_1, option_2, ...]{thaispec}
%\end{minted}
%The below table lists available options in the latest version.
%
%\renewcommand{\arraystretch}{1.8}
%\begin{longtable}{l p{9cm}}
%\caption{Loading options in \texttt{thaispec} package.} \label{table:loading_options}\\
%\hline
%\textbf{Options}  &amp; \textbf{Features}
%\\ \hline
%\endfirsthead
%\caption{(continued) Loading options in \texttt{thaispec} package.}\\
%\hline
%\textbf{Options}  &amp; \textbf{Features}
%\\ \hline
%\endhead
%
%\hline
%\endfoot
%
%
%\showoption{thainum}{
%Uses Thai numbers for almost all number digits which is disable by default. 
%Use \mint{LaTeX}|\usepackage[thainum]{thaipsec}|
%to activate this option.
%}
%\showoption{math}{
%Additionally load the following packages:
%\texttt{mathtools}, \texttt{amssymb}, \texttt{amsthm}, \texttt{mathspec} orderly.
%Moreover it sets various theorem environments like definition, theorem, corollary to Thai.
%If your document consists of math objects, this option is then recommended. 
%Use \mint{LaTeX}|\usepackage[math]{thaispec}| 
%to activate this option.
%}
%\showoption{thaifont}{
%Choose the selected Thai font for Thai charaters typeseting.
%For example, use
%\mint{LaTeX}|\usepackage[thaifont = Angsana New]{thaispec}| 
%to choose font named \texttt{Angsana New}.
%Note that the selected font must be installed to the system before loading the package.
%}
%\showoption{sloppy}{
%This option is for fairly better Thai justified paragraphs which is enable by default.
%In case this option gives a bad justified output, try 
%\mint{LaTeX}|\usepackage[sloopy=false]{thaispec}| to disable this option.
%}
%\showoption{thaispacing}{
%Mostly single spacing is too tight for Thai paragraph.
%By defalut this package is loaded with one and a half spacing.
%In case this option gives a bad justified output, try 
%\mint{LaTeX}|\usepackage[thaispacing=false]{thaispec}| to disable this option, i.e., 
%This sets single spacing for all paragraphs.
%}
%\showoption{thaicaption}{
%The package sets various captions in Thai.
%This includes captions of chapter, section and table of contents.
%It is activated by default. 
%If you do not want this, use 
%\mint{LaTeX}|\usepackage[thaicaption=false]{thaispec}| to disable this option.
%}
%
%  % \texttt{thainum}
%  % &amp; Uses Thai numbers for almost all number digits.
%  % It is untoggled by defalut.
%  % \\
%  % \texttt{math}
%  % &amp; Additionally load the following packages:
%  % \texttt{mathtools}, \texttt{amssymb}, \texttt{amsthm}, \texttt{mathspec} orderly.
%
%  % Normally \pkgname\ package loads \texttt{fontspec}\ with \texttt{no-math}\ option.
%  % If your document consists of math objects, this option is then recommended.
%  % \\
%  % \texttt{thaifont = &lt;SYSTEM\_FONT\_NAME&gt;}
%  % &amp; Choose a system font for Thai characters.
%  % \showex{thaifont = TH Sarabun New}
%  % \\
%  % \texttt{mainfont = &lt;SYSTEM\_FONT\_NAME&gt;}
%  % &amp; Choose a font for \texttt{mainfont} corresponding to \texttt{fontspec} package.
%  % \showex{thaifont = TeX Gyre Termes}
%  % \\
%  % \texttt{sansfont = &lt;SYSTEM\_FONT\_NAME&gt;}
%  % &amp; Choose a font for \texttt{sansfont} corresponding to \texttt{fontspec} package.
%  % \showex{thaifont = TeX Gyre Heros}
%  % \\
%  % \texttt{monofont = &lt;SYSTEM\_FONT\_NAME&gt;}
%  % &amp; Choose a font for \texttt{monofont} corresponding to \texttt{fontspec} package.
%  % \showex{thaifont = TeX Gyre Cursors}
%  % \\
%  % \texttt{thaithm = &lt;BOOL&gt;}
%  % &amp; After loading \texttt{amsthm} package, \texttt{thaispec} package automatically defines
%  % a set of theorem-like environments with Thai heading by default.
%  % The automatic defined environments includes
%  % \texttt{theorem}, \texttt{lemma}, \texttt{corollary},
%  % \texttt{definition}, \texttt{axiom}, \texttt{undefinedterm},
%  % \texttt{example}, \texttt{remark} and \texttt{note}.
%  % If you prefer to set them yourself, just set its value to \texttt{false}.
%  % \showex{thaithm = true}
%  % \\
%  % \texttt{thmcount = &lt;VALUE&gt;}
%  % &amp; If the option \texttt{thaithm = true} is prefered,
%  % this package set the counter independently for each automatic defined environments.
%  % The value of \texttt{&lt;VALUE&gt;} can be one of the following:
%  % \texttt{default}, \texttt{no}, \texttt{full}, \texttt{section},
%  % \texttt{chapter}, \texttt{kind}, \texttt{kind-section}, and \texttt{kind-chapter}.
%  % \showex{thmcount = default}
%  % \\
%\end{longtable}
%
%\section{Usage Examples}
%The following example is a basic example of using \texttt{thaispec} package.
%It is loaded with the default setting for typesetting in \XeLaTeX, i.e.,
%only Thai characters are typesetted with \texttt{TH Sarabun New} font,
%other charaters are typesetted as usual,
%and paragraphs are justified by \texttt{\textbackslash sloppy} macro.
%%\begin{lstlisting}[style=tex,numbers=left]
%%\documentclass{article}
%%\usepackage{thaispec}
%%\begin{document}
%%\section{Thai 犧�犧ｲ犧ｩ犧ｲ犹�ｸ伶ｸ｢}
%%Thai charaters can be input directly like this 犧伶ｸ扉ｸｪ犧ｭ犧壟ｸ≒ｸｲ犧｣犧樅ｸｴ犧｡犧樅ｹ呉ｸ�犧ｲ犧ｩ犧ｲ犹�ｸ伶ｸ｢犹�ｸ吭ｹ犧ｭ犧≒ｸｪ犧ｲ犧｣ \XeLaTeX\
%%
%%\end{lstlisting}
%\begin{minted}[
%frame=single,
%linenos=true,
%autogobble=true,
%highlightlines={2}
%]{LaTeX}
%\documentclass{article}
%\usepackage{thaispec}
%\begin{document}
%\section{犧�犧ｲ犧ｩ犧ｲ犹�ｸ伶ｸ｢}
%犧伶ｸ扉ｸｪ犧ｭ犧壟ｸ≒ｸｲ犧｣犧樅ｸｴ犧｡犧樅ｹ呉ｸ�犧ｲ犧ｩ犧ｲ犹�ｸ伶ｸ｢犹�ｸ吭ｹ犧ｭ犧≒ｸｪ犧ｲ犧｣ \XeLaTeX
%
%\end{minted}
%In order to use another Thai font face for any charaters in a math document without
%\texttt{\textbackslash sloppy} macro,
%the following example can be used to achieve the goal.
%%\begin{lstlisting}[style=tex,numbers=left]
%%\documentclass{article}
%%\usepackage[math,
%%thaifont = Tahoma,
%%texgyrefont = false,
%%sloppy = false]{thaispec}
%%\begin{document}
%%\section{Math 犧�犧ｲ犧ｩ犧ｲ犹�ｸ伶ｸ｢}
%%Thai charaters can be input directly like this 犧伶ｸ扉ｸｪ犧ｭ犧壟ｸ≒ｸｲ犧｣犧樅ｸｴ犧｡犧樅ｹ呉ｸ�犧ｲ犧ｩ犧ｲ犹�ｸ伶ｸ｢犹�ｸ吭ｹ犧ｭ犧≒ｸｪ犧ｲ犧｣ $ax^2+bx+c=0$
%%
%%\end{lstlisting}
%\begin{minted}[%
%frame=single,
%linenos=true,
%autogobble=true,
%highlightlines={2-5}
%]{LaTeX}
%\documentclass{article}
%\usepackage[math, thaifont = Tahoma, sloppy = false]{thaispec}
%\begin{document}
%\section{Math 犧�犧ｲ犧ｩ犧ｲ犹�ｸ伶ｸ｢}
%犧≒ｸｲ犧｣犧樅ｸｴ犧｡犧樅ｹ呉ｸ�犧ｲ犧ｩ犧ｲ犹�ｸ伶ｸ｢犹�ｸ吭ｹ犧ｭ犧≒ｸｪ犧ｲ犧｣ $ax^2+bx+c=0$
%
%\end{minted}
%
%
%\section{Known Issues}
%\subsection{Incorrect Thai characters with \texttt{listing} package}
%If you typeset some codes consisting of Thai characters in \texttt{lstlisting} environment provided by \texttt{listing} package, this will possibly cause you a problem with incorrect Thai characters.
%The recommendation is choosing \texttt{minted} package instead of \texttt{listing} package.
%However you need to additionally install \texttt{pygments} python module in order to use \texttt{minted} package.
%If you do not install \texttt{pygments}, try using
%\begin{minted}[frame=single]{shell}
%$ pip install pygments
%\end{minted}
%Moreover, you need to enable shell-escape when typeset the document.
%For example, use
%\begin{minted}[frame=single]{shell}
%$ xelatex -shell-escape your-tex-file.tex
%\end{minted}
%to typeset your tex file.
%
%\subsection{TexPad in macOS}
%As said above, the shell-escape must be enabled.
%Additionally, the \emph{Hide Intermediate Files} option must be disable and copy the pygment launcher to \texttt{/usr/local/bin}.
%The launcher can be located with the command
%\begin{minted}[frame=single]{shell}
%$ which pygments
%\end{minted}
%Instead of copying the launcher directly, one may put its symbolic link to \texttt{/usr/local/bin}.
%If there is an error due to \texttt{minted} package, we recommend to delete the minted output directory prior typesetting.
%
%\section{Credits}
%This package is motivated by a set of \LaTeX\ commands for typesetting Thai documents
%provided by Dittaya Wanvarie
%\footnote{See {\url{http://pioneer.netserv.chula.ac.th/~wdittaya/}} in \LaTeX\ section.} from Chulalongkorn University.
%
%\section{License}
%This work may be distributed and/or modified under the
%conditions of the LaTeX Project Public License, either version 1.3
%of this license of (at your option) any later version.
%The latest version of this license is in
%\printcenter{\url{http://www.latex-project.org/lppl.txt}}
%and version 1.3 or later is part of all distributions of LaTeX
%version 2005/12/01 or later.
%
%
%
%
%
%\StopEventually{}
%\section{The Code}
%\iffalse
%    \begin{macrocode}
%&lt;*thaispec.sty&gt;
%    \end{macrocode}
%\fi
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{thaispec}[version 2021.03.01]

\RequirePackage{kvoptions}
\RequirePackage[no-math]{fontspec}
\RequirePackage[Latin, Thai]{ucharclasses}
\RequirePackage{setspace}
\RequirePackage{polyglossia}
% \RequirePackage[calc]{datetime2}
\RequirePackage{xstring}
% \RequirePackage{afterpackage}
\RequirePackage{xpatch}

% Key-Value Options
\SetupKeyvalOptions{
family=THL,
prefix=THL@
}

\DeclareStringOption[TH Sarabun New]{thaifont}[TH Sarabun New]

\DeclareVoidOption{math}{%
\RequirePackage{mathtools}
\RequirePackage{amssymb}
\RequirePackage{amsthm}
\RequirePackage{mathspec}
}

\DeclareVoidOption{thainum}{\renewcommand{\thesection}{\thainum{section}}}

\DeclareBoolOption[true]{sloppy}
\DeclareBoolOption[true]{thaispacing}
\DeclareBoolOption[true]{thaicaption}
\DeclareBoolOption[false]{beamerthmcount}

\DeclareStringOption[default]{thmcount}[default]

\ProcessKeyvalOptions{THL}


% TeX Commands

\newcommand{\thaispecver}{2021.03.01}


% Set Thai language
\XeTeXlinebreaklocale "th"
\XeTeXlinebreakskip = 0pt plus 0pt

\ifTHL@sloppy
\sloppy
\fi

\defaultfontfeatures{Mapping=tex-text}


% Select Thai fonts
% \setmainfont[Scale=1.23]{\THL@thaifont}

% Control English/Thai Fonts
\newfontfamily{\thaifont}[Scale=MatchUppercase,Mapping=tex-text]{\THL@thaifont}

\newenvironment{thailang}
{\thaifont}
{}

\setTransitionTo{Thai}{\begin{thailang}}
\setTransitionFrom{Thai}{\end{thailang}}

\setdefaultlanguage{english}
\setotherlanguage{thai}

\ifTHL@thaicaption
\AtBeginDocument\captionsthai
\addto\captionsenglish{%
  \renewcommand{\proofname}{犧樅ｸｴ犧ｪ犧ｹ犧謂ｸ吭ｹ迎%
  \renewcommand{\chaptername}{犧壟ｸ伶ｸ伶ｸｵ犹�}%
  \renewcommand{\contentsname}{犧ｪ犧ｲ犧｣犧壟ｸｱ犧閤%
  \renewcommand{\listfigurename}{犧ｪ犧ｲ犧｣犧壟ｸｱ犧財ｸ｣犧ｹ犧巵ｸ�犧ｲ犧栲%
  \renewcommand{\listtablename}{犧ｪ犧ｲ犧｣犧壟ｸｱ犧財ｸ歩ｸｲ犧｣犧ｲ犧�}%
  \renewcommand{\figurename}{犧｣犧ｹ犧巵ｸ�犧ｲ犧栲%
  \renewcommand{\tablename}{犧歩ｸｲ犧｣犧ｲ犧�}%
  \renewcommand{\refname}{犹犧ｭ犧≒ｸｪ犧ｲ犧｣犧ｭ犹霞ｸｲ犧�ｸｭ犧ｴ犧�}%
}
\fi


% Define Thai alpha/number/digit for enumerated items
\def\thaialph#1{\expandafter\thalph\csname c@#1\endcsname}
\def\thalph#1{%
    \ifcase#1\or 犧―or 犧�\or 犧Ыor 犧Ⅸor 犧�\or 犧噂or 犧浬or 犧欺or
    犧圭or 犧構or 犧蚕or 犧十or 犧申or 犧曾or 犧箪or 犧貼or 犧能or 犧表or 犧暴or 犧予or 犧禄or 犧兔or
    犧喀or 犧媾or 犧彌or 犧拿or 犧杤or 犧歃or 犧�\or 犧｡\or 犧｢\or 犧｣\or 犧､\or 犧･\or 犧ｦ\or 犧ｧ\or
    犧ｨ\or 犧ｩ\or 犧ｪ\or 犧ｫ\or 犧ｬ\or 犧ｭ\else 犧ｮ\else\xpg@ill@value{#1}{thalph}\fi}
\def\thainum#1{\expandafter\thainumber\csname c@#1\endcsname}
\def\thainumber#1{%
    \thaidigits{\number#1}%
}
\def\thaidigits#1{\expandafter\thdigits #1@ }
\def\thdigits#1{%
    \ifx @#1% then terminate
    \else
    \ifx0#1犹申else\ifx1#1犹曾else\ifx2#1犹箪else\ifx3#1犹貼else\ifx4#1犹能else\ifx5#1犹表else\ifx6#1犹暴else\ifx7#1犹予else\ifx8#1犹禄else\ifx9#1犹兔else#1\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
    \expandafter\thdigits
    \fi
}

% Define Thai datetime
% \today - Print today in short format d-M-Y(BD)
% \Today - Print today in long format dow-d-M-Y(BD)

% \DTMsavenow{now}
% \newcommand{\dtdow}{\IfStrEqCase{\DTMfetchdow{now}}{{0}{犧ｧ犧ｱ犧吭ｸ謂ｸｱ犧吭ｸ伶ｸ｣犹迎
% {1}{犧ｧ犧ｱ犧吭ｸｭ犧ｱ犧�ｸ�ｸｲ犧｣}
% {2}{犧ｧ犧ｱ犧吭ｸ樅ｸｸ犧�}
% {3}{犧ｧ犧ｱ犧吭ｸ樅ｸ､犧ｫ犧ｱ犧ｪ犧壟ｸ扉ｸｵ}
% {4}{犧ｧ犧ｱ犧吭ｸｨ犧ｸ犧≒ｸ｣犹迎
% {5}{犧ｧ犧ｱ犧吭ｹ犧ｪ犧ｲ犧｣犹迎
% {6}{犧ｧ犧ｱ犧吭ｸｭ犧ｲ犧伶ｸｴ犧歩ｸ｢犹迎
% }}

% \newcommand{\dtmonth}{\IfStrEqCase{\DTMfetchmonth{now}}{{1}{犧｡犧≒ｸ｣犧ｲ犧�ｸ｡}
% {2}{犧≒ｸｸ犧｡犧�犧ｲ犧樅ｸｱ犧吭ｸ倨ｹ迎
% {3}{犧｡犧ｵ犧吭ｸｲ犧�ｸ｡}
% {4}{犹犧｡犧ｩ犧ｲ犧｢犧凩
% {5}{犧樅ｸ､犧ｩ犧�犧ｲ犧�ｸ｡}
% {6}{犧｡犧ｴ犧籾ｸｸ犧吭ｸｲ犧｢犧凩
% {7}{犧≒ｸ｣犧≒ｸ錫ｸｲ犧�ｸ｡}
% {8}{犧ｪ犧ｴ犧�ｸｫ犧ｲ犧�ｸ｡}
% {9}{犧≒ｸｱ犧吭ｸ｢犧ｲ犧｢犧凩
% {10}{犧歩ｸｸ犧･犧ｲ犧�ｸ｡}
% {11}{犧樅ｸ､犧ｨ犧謂ｸｴ犧≒ｸｲ犧｢犧凩
% {12}{犧倨ｸｱ犧吭ｸｧ犧ｲ犧�ｸ｡}
% }}

% \newcounter{yearbd}
% \setcounter{yearbd}{\DTMfetchyear{now}}
% \addtocounter{yearbd}{543}
% %\newcommand{\dtyearbd}{\FPadd{\tmpdtyearbd}{\DTMfetchyear{now}}{543}\FPclip{\rtmpdtyearbd}{\tmpdtyearbd}犧�.犧ｨ.\;\rtmpdtyearbd}
% \AtBeginDocument{
% \def\Today{\dtdow\ \DTMfetchday{now}\ \dtmonth\ 犧�.犧ｨ. \theyearbd}
% \def\today{\DTMfetchday{now}\ \dtmonth\ 犧�.犧ｨ. \theyearbd}
% }


% In beamer
\@ifclassloaded{beamer}
{
\let\theorem\relax
\let\c@theorem\relax
\let\lemma\relax
\let\corollary\relax
\let\definition\relax
\let\example\relax
\let\note\relax

\ifTHL@beamerthmcount
    \setbeamertemplate{theorems}[numbered]
\fi

}
{%
\ifTHL@thaispacing
\onehalfspacing
\fi
}

% In article class
\@ifclassloaded{article}
{
\renewcommand{\THL@thmcount}{section}
}
{}

% In book
\@ifclassloaded{book}
{
\renewcommand{\THL@thmcount}{chapter}
}
{}

% In report
\@ifclassloaded{report}
{
\renewcommand{\THL@thmcount}{chapter}
}
{}


% Thai theorem environments
\@ifpackageloaded{amsthm}
{%
\IfStrEqCase{\THL@thmcount}{%
{default}{%
\newtheorem{theorem}{犧伶ｸ､犧ｩ犧錫ｸｵ犧壟ｸ抑
\newtheorem{lemma}[theorem]{犧壟ｸ伶ｸ歩ｸｱ犹霞ｸ�}
\newtheorem{corollary}[theorem]{犧壟ｸ伶ｹ≒ｸ伶ｸ｣犧±
\newtheorem{proposition}[theorem]{犧伶ｸ､犧ｩ犧錫ｸｵ犧壟ｸ伶ｸ巵ｸ｣犧ｰ犧≒ｸｭ犧嘲
\theoremstyle{definition}
\newtheorem{definition}[theorem]{犧壟ｸ伶ｸ吭ｸｴ犧｢犧ｲ犧｡}
\newtheorem{axiom}[theorem]{犧ｪ犧ｱ犧謂ｸ樅ｸ謂ｸ吭ｹ迎
\newtheorem{example}[theorem]{犧歩ｸｱ犧ｧ犧ｭ犧｢犹謂ｸｲ犧�}
\theoremstyle{remark}
\newtheorem*{remark}{犧ｫ犧｡犧ｲ犧｢犹犧ｫ犧歩ｸｸ}
\newtheorem*{note}{犧壟ｸｱ犧吭ｸ伶ｸｶ犧±
}%
{no}{%
\newtheorem*{theorem}{犧伶ｸ､犧ｩ犧錫ｸｵ犧壟ｸ抑
\newtheorem*{lemma}{犧壟ｸ伶ｸ歩ｸｱ犹霞ｸ�}
\newtheorem*{corollary}{犧壟ｸ伶ｹ≒ｸ伶ｸ｣犧±
\newtheorem*{proposition}{犧伶ｸ､犧ｩ犧錫ｸｵ犧壟ｸ伶ｸ巵ｸ｣犧ｰ犧≒ｸｭ犧嘲
\theoremstyle{definition}
\newtheorem*{definition}{犧壟ｸ伶ｸ吭ｸｴ犧｢犧ｲ犧｡}
\newtheorem*{axiom}{犧ｪ犧ｱ犧謂ｸ樅ｸ謂ｸ吭ｹ迎
\newtheorem*{example}{犧歩ｸｱ犧ｧ犧ｭ犧｢犹謂ｸｲ犧�}
\theoremstyle{remark}
\newtheorem*{remark}{犧ｫ犧｡犧ｲ犧｢犹犧ｫ犧歩ｸｸ}
\newtheorem*{note}{犧壟ｸｱ犧吭ｸ伶ｸｶ犧±
}%
{full}{%
\newtheorem{theorem}{犧伶ｸ､犧ｩ犧錫ｸｵ犧壟ｸ抑
\newtheorem{lemma}[theorem]{犧壟ｸ伶ｸ歩ｸｱ犹霞ｸ�}
\newtheorem{corollary}[theorem]{犧壟ｸ伶ｹ≒ｸ伶ｸ｣犧±
\newtheorem{proposition}[theorem]{犧伶ｸ､犧ｩ犧錫ｸｵ犧壟ｸ伶ｸ巵ｸ｣犧ｰ犧≒ｸｭ犧嘲
\theoremstyle{definition}
\newtheorem{definition}[theorem]{犧壟ｸ伶ｸ吭ｸｴ犧｢犧ｲ犧｡}
\newtheorem{axiom}[theorem]{犧ｪ犧ｱ犧謂ｸ樅ｸ謂ｸ吭ｹ迎
\newtheorem{example}[theorem]{犧歩ｸｱ犧ｧ犧ｭ犧｢犹謂ｸｲ犧�}
\theoremstyle{remark}
\newtheorem{remark}{犧ｫ犧｡犧ｲ犧｢犹犧ｫ犧歩ｸｸ}
\newtheorem{note}{犧壟ｸｱ犧吭ｸ伶ｸｶ犧±
}%
{section}{%
\newtheorem{theorem}{犧伶ｸ､犧ｩ犧錫ｸｵ犧壟ｸ抑[section]
\newtheorem{lemma}[theorem]{犧壟ｸ伶ｸ歩ｸｱ犹霞ｸ�}
\newtheorem{corollary}[theorem]{犧壟ｸ伶ｹ≒ｸ伶ｸ｣犧±
\newtheorem{proposition}[theorem]{犧伶ｸ､犧ｩ犧錫ｸｵ犧壟ｸ伶ｸ巵ｸ｣犧ｰ犧≒ｸｭ犧嘲
\theoremstyle{definition}
\newtheorem{definition}[theorem]{犧壟ｸ伶ｸ吭ｸｴ犧｢犧ｲ犧｡}
\newtheorem{axiom}[theorem]{犧ｪ犧ｱ犧謂ｸ樅ｸ謂ｸ吭ｹ迎
\newtheorem{example}[theorem]{犧歩ｸｱ犧ｧ犧ｭ犧｢犹謂ｸｲ犧�}
\theoremstyle{remark}
\newtheorem*{remark}{犧ｫ犧｡犧ｲ犧｢犹犧ｫ犧歩ｸｸ}
\newtheorem*{note}{犧壟ｸｱ犧吭ｸ伶ｸｶ犧±
}%
{chapter}{%
\newtheorem{theorem}{犧伶ｸ､犧ｩ犧錫ｸｵ犧壟ｸ抑[chapter]
\newtheorem{lemma}[theorem]{犧壟ｸ伶ｸ歩ｸｱ犹霞ｸ�}
\newtheorem{corollary}[theorem]{犧壟ｸ伶ｹ≒ｸ伶ｸ｣犧±
\newtheorem{proposition}[theorem]{犧伶ｸ､犧ｩ犧錫ｸｵ犧壟ｸ伶ｸ巵ｸ｣犧ｰ犧≒ｸｭ犧嘲
\theoremstyle{definition}
\newtheorem{definition}[theorem]{犧壟ｸ伶ｸ吭ｸｴ犧｢犧ｲ犧｡}
\newtheorem{axiom}[theorem]{犧ｪ犧ｱ犧謂ｸ樅ｸ謂ｸ吭ｹ迎
\newtheorem{example}[theorem]{犧歩ｸｱ犧ｧ犧ｭ犧｢犹謂ｸｲ犧�}
\theoremstyle{remark}
\newtheorem*{remark}{犧ｫ犧｡犧ｲ犧｢犹犧ｫ犧歩ｸｸ}
\newtheorem*{note}{犧壟ｸｱ犧吭ｸ伶ｸｶ犧±
}%
{kind}{%
\newtheorem{theorem}{犧伶ｸ､犧ｩ犧錫ｸｵ犧壟ｸ抑
\newtheorem{lemma}[theorem]{犧壟ｸ伶ｸ歩ｸｱ犹霞ｸ�}
\newtheorem{corollary}[theorem]{犧壟ｸ伶ｹ≒ｸ伶ｸ｣犧±
\newtheorem{proposition}[theorem]{犧伶ｸ､犧ｩ犧錫ｸｵ犧壟ｸ伶ｸ巵ｸ｣犧ｰ犧≒ｸｭ犧嘲
\theoremstyle{definition}
\newtheorem{definition}{犧壟ｸ伶ｸ吭ｸｴ犧｢犧ｲ犧｡}
\newtheorem{axiom}[definition]{犧ｪ犧ｱ犧謂ｸ樅ｸ謂ｸ吭ｹ迎
\newtheorem{example}{犧歩ｸｱ犧ｧ犧ｭ犧｢犹謂ｸｲ犧�}
\theoremstyle{remark}
\newtheorem{remark}{犧ｫ犧｡犧ｲ犧｢犹犧ｫ犧歩ｸｸ}
\newtheorem{note}{犧壟ｸｱ犧吭ｸ伶ｸｶ犧±
}%
{kind-section}{%
\newtheorem{theorem}{犧伶ｸ､犧ｩ犧錫ｸｵ犧壟ｸ抑[section]
\newtheorem{lemma}[theorem]{犧壟ｸ伶ｸ歩ｸｱ犹霞ｸ�}
\newtheorem{corollary}[theorem]{犧壟ｸ伶ｹ≒ｸ伶ｸ｣犧±
\newtheorem{proposition}[theorem]{犧伶ｸ､犧ｩ犧錫ｸｵ犧壟ｸ伶ｸ巵ｸ｣犧ｰ犧≒ｸｭ犧嘲
\theoremstyle{definition}
\newtheorem{definition}{犧壟ｸ伶ｸ吭ｸｴ犧｢犧ｲ犧｡}[section]
\newtheorem{axiom}[definition]{犧ｪ犧ｱ犧謂ｸ樅ｸ謂ｸ吭ｹ迎
\newtheorem{example}{犧歩ｸｱ犧ｧ犧ｭ犧｢犹謂ｸｲ犧�}
\theoremstyle{remark}
\newtheorem{remark}{犧ｫ犧｡犧ｲ犧｢犹犧ｫ犧歩ｸｸ}[section]
\newtheorem{note}{犧壟ｸｱ犧吭ｸ伶ｸｶ犧±[section]
}%
{kind-chapter}{%
\newtheorem{theorem}{犧伶ｸ､犧ｩ犧錫ｸｵ犧壟ｸ抑[chapter]
\newtheorem{lemma}[theorem]{犧壟ｸ伶ｸ歩ｸｱ犹霞ｸ�}
\newtheorem{corollary}[theorem]{犧壟ｸ伶ｹ≒ｸ伶ｸ｣犧±
\newtheorem{proposition}[theorem]{犧伶ｸ､犧ｩ犧錫ｸｵ犧壟ｸ伶ｸ巵ｸ｣犧ｰ犧≒ｸｭ犧嘲
\theoremstyle{definition}
\newtheorem{definition}{犧壟ｸ伶ｸ吭ｸｴ犧｢犧ｲ犧｡}[chapter]
\newtheorem{axiom}[definition]{犧ｪ犧ｱ犧謂ｸ樅ｸ謂ｸ吭ｹ迎
\newtheorem{example}{犧歩ｸｱ犧ｧ犧ｭ犧｢犹謂ｸｲ犧�}
\theoremstyle{remark}
\newtheorem{remark}{犧ｫ犧｡犧ｲ犧｢犹犧ｫ犧歩ｸｸ}[chapter]
\newtheorem{note}{犧壟ｸｱ犧吭ｸ伶ｸｶ犧±[chapter]
}%
}%
\xpatchcmd{\@thm}{\thm@headpunct{.}}{\thm@headpunct{}}{}{}
}
{}


% \endinput
% END OF PACKAGE ----------------------------%\iffalse
%    \begin{macrocode}
%&lt;/thaispec.sty&gt;
%    \end{macrocode}
%\fi
%\Finale
\endinput
</pre></body></html>