texlive[51598] Master/texmf-dist: thaispec (10jul19)

commits+karl at tug.org commits+karl at tug.org
Wed Jul 10 22:28:34 CEST 2019


Revision: 51598
          http://tug.org/svn/texlive?view=revision&revision=51598
Author:   karl
Date:     2019-07-10 22:28:34 +0200 (Wed, 10 Jul 2019)
Log Message:
-----------
thaispec (10jul19)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/thaispec/README.md
    trunk/Master/texmf-dist/doc/latex/thaispec/thaispec.pdf
    trunk/Master/texmf-dist/source/latex/thaispec/thaispec.dtx
    trunk/Master/texmf-dist/source/latex/thaispec/thaispec.ins
    trunk/Master/texmf-dist/tex/latex/thaispec/thaispec.sty

Modified: trunk/Master/texmf-dist/doc/latex/thaispec/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/thaispec/README.md	2019-07-10 20:28:23 UTC (rev 51597)
+++ trunk/Master/texmf-dist/doc/latex/thaispec/README.md	2019-07-10 20:28:34 UTC (rev 51598)
@@ -11,27 +11,11 @@
 ## Prerequisite
 Thai national fonts, i.e., SIPAFonts (See https://github.com/epsilonxe/sipafonts)
 
-## Recommendation
-Install TeX Gyre font family (Possibly included with your TeX distribution)
-
 ## Usage
-If you already have TeX Gyre font family, just simply add the preamble
+Just simply add the preamble
 ```
 \usepackage{thaispec}
 ```
-Otherwise
-```
-\usepackage[texgyrefont=false]{thaispec}
-```
-This package allows you to input Thai characters directly to ```.tex``` file,
-and choose any Thai fonts to be used in the document.
-In order to choose the font, please make sure that the font is system wide, then use
-```
-\usepackage[thaifont = <SYSTEM THAI FONT NAME>]{thaispec}
-```
-Moreover, the package give you options to choose any system wide fonts for
-`mainfont`, `sansfont` and  `monofont` too
-
 For additional usage or more options, see the documentation.
 
 ## Credits
@@ -40,7 +24,7 @@
 (See http://pioneer.netserv.chula.ac.th/~wdittaya/)
 
 ## License
-Copyright 2018 Ratthaprom Promkam
+Copyright Ratthaprom Promkam
 
 This work may be distributed and/or modified under the
 conditions of the LaTeX Project Public License, either version 1.3

Modified: trunk/Master/texmf-dist/doc/latex/thaispec/thaispec.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/thaispec/thaispec.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/thaispec/thaispec.dtx	2019-07-10 20:28:23 UTC (rev 51597)
+++ trunk/Master/texmf-dist/source/latex/thaispec/thaispec.dtx	2019-07-10 20:28:34 UTC (rev 51598)
@@ -2,10 +2,10 @@
 % thaispec.dtx generated using makedtx version 1.2 (c) Nicola Talbot
 % Command line args:
 %   -src "thaispec\.sty=>thaispec.sty"
+%   -doc "thaispec.tex"
 %   -author "Ratthaprom_Promkam"
-%   -doc "thaispec.tex"
 %   thaispec
-% Created on 2018/3/9 18:44
+% Created on 2019/7/4 22:02
 %\fi
 %\iffalse
 %<*package>
@@ -28,7 +28,7 @@
 %\fi
 % \iffalse
 % Doc-Source file to use with LaTeX2e
-% Copyright (C) 2018 Ratthaprom_Promkam, all rights reserved.
+% Copyright (C) 2019 Ratthaprom_Promkam, all rights reserved.
 % \fi
 % \iffalse
 %<*driver>
@@ -50,9 +50,13 @@
 
 
 \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}}&{#2}{\showdefault{#3}}{\showex{#4}}\\}
+\newcommand{\showoption}[2]{{\noindent\texttt{#1}}&{#2}\\\hline}
 
+
 \newcommand{\mopt}{%
 frame=single,
 linenos=true,
@@ -78,7 +82,7 @@
 
 \title{The \pkgname\ package: \\Thai language typesetting in \XeLaTeX}
 \author{Ratthaprom Promkam\\{\texttt{\small ratthaprom at me.com}}}
-\date{Version 0.3 from March 9, 2018}
+\date{Version 0.4 from July 4, 2019}
 
 \begin{document}
 \DocInput{thaispec.dtx}
@@ -88,7 +92,7 @@
 %\maketitle
 %
 %This package allows you to input Thai characters directly to \LaTeX\ documents
-%and choose any (system wide) Thai fonts for typesetting in \XeLaTeX.
+%and choose any (system wide) Thai fonts for typesetting via \XeLaTeX.
 %It also tries to appropriately justify paragraphs with no more external tools.
 %
 %\tableofcontents
@@ -102,10 +106,13 @@
 %At least this font must be installed to system wide in order to use this package.
 %Moreover the following \LaTeX\ package are essentially required for the default option: \texttt{fontspec}, \texttt{uchar­classes}, \texttt{poly­glos­sia}, \texttt{setspace}, \texttt{date­time2}, \texttt{kvop­tions}, \texttt{after­pack­age}, \texttt{xstring}, and \texttt{xpatch}.
 %
+%\section{Installation}
+%The \texttt{thaispec} packages are included in all major \LaTeX distributions.
+%In case it is not installed, please visit \url{https://github.com/epsilonxe/latex}} to download the latest version of \texttt{thaispec.sty} and put it in your working directory.
+%
 %\section{Recommendation}
-%Install the collection of Thai national font said above and also \TeX\ Gyre font family
-%which possibly already included with your \TeX\ distribution.
-%These are basically assumed to be installed prior loading the package.
+%Install the collection of Thai national font said above.
+%Python and \textt{pygments} are also recommended to be installed to typeset Thai documents which some syntax highlighted codes are needed.
 %
 %\section{Package loading}
 %In the preamble, add the command
@@ -113,24 +120,30 @@
 %\usepackage{thaispec}
 %\end{minted}
 %then you can input Thai characters in the document and typeset the document 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.
+%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:
+%% 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[texgyrefont = false]{thaispec}
+%\usepackage[option_1, option_2, ...]{thaispec}
 %\end{minted}
-%This will typeset the document by setting \texttt{mainfont} to \texttt{TH Sarabun New}.
+%The below table lists available options in the latest version.
 %
-%The package also predefines \texttt{\textbackslash today} and \texttt{\textbackslash Today}
-%for today Thai date printing in short and long formats respectively.
-%
-%\section{Loading options}
-%This section lists additional loading options by their features as follows.
-%The examples in the list are default and also initialized values for those options.
 %\renewcommand{\arraystretch}{1.8}
-%\begin{longtable}{l p{5.8cm}}
+%\begin{longtable}{l p{9cm}}
 %\caption{Loading options in \texttt{thaispec} package.} \label{table:loading_options}\\
 %\hline
 %\textbf{Options}  & \textbf{Features}
@@ -144,51 +157,93 @@
 %
 %\hline
 %\endfoot
-%  \texttt{thainum}
-%  & Uses Thai numbers for almost all number digits.
-%  It is untoggled by defalut.
-%  \\
-%  \texttt{math}
-%  & 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 = <SYSTEM\_FONT\_NAME>}
-%  & Choose a system font for Thai characters.
-%  \showex{thaifont = TH Sarabun New}
-%  \\
-%  \texttt{mainfont = <SYSTEM\_FONT\_NAME>}
-%  & Choose a font for \texttt{mainfont} corresponding to \texttt{fontspec} package.
-%  \showex{thaifont = TeX Gyre Termes}
-%  \\
-%  \texttt{sansfont = <SYSTEM\_FONT\_NAME>}
-%  & Choose a font for \texttt{sansfont} corresponding to \texttt{fontspec} package.
-%  \showex{thaifont = TeX Gyre Heros}
-%  \\
-%  \texttt{monofont = <SYSTEM\_FONT\_NAME>}
-%  & Choose a font for \texttt{monofont} corresponding to \texttt{fontspec} package.
-%  \showex{thaifont = TeX Gyre Cursors}
-%  \\
-%  \texttt{thaithm = <BOOL>}
-%  & 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 = <VALUE>}
-%  & If the option \texttt{thaithm = true} is prefered,
-%  this package set the counter independently for each automatic defined environments.
-%  The value of \texttt{<VALUE>} 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}
-%  \\
+%
+%\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}
+%  % & Uses Thai numbers for almost all number digits.
+%  % It is untoggled by defalut.
+%  % \\
+%  % \texttt{math}
+%  % & 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 = <SYSTEM\_FONT\_NAME>}
+%  % & Choose a system font for Thai characters.
+%  % \showex{thaifont = TH Sarabun New}
+%  % \\
+%  % \texttt{mainfont = <SYSTEM\_FONT\_NAME>}
+%  % & Choose a font for \texttt{mainfont} corresponding to \texttt{fontspec} package.
+%  % \showex{thaifont = TeX Gyre Termes}
+%  % \\
+%  % \texttt{sansfont = <SYSTEM\_FONT\_NAME>}
+%  % & Choose a font for \texttt{sansfont} corresponding to \texttt{fontspec} package.
+%  % \showex{thaifont = TeX Gyre Heros}
+%  % \\
+%  % \texttt{monofont = <SYSTEM\_FONT\_NAME>}
+%  % & Choose a font for \texttt{monofont} corresponding to \texttt{fontspec} package.
+%  % \showex{thaifont = TeX Gyre Cursors}
+%  % \\
+%  % \texttt{thaithm = <BOOL>}
+%  % & 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 = <VALUE>}
+%  % & If the option \texttt{thaithm = true} is prefered,
+%  % this package set the counter independently for each automatic defined environments.
+%  % The value of \texttt{<VALUE>} 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}
@@ -195,7 +250,7 @@
 %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 with \TeX\ Gyre fonts,
+%other charaters are typesetted as usual,
 %and paragraphs are justified by \texttt{\textbackslash sloppy} macro.
 %%\begin{lstlisting}[style=tex,numbers=left]
 %%\documentclass{article}
@@ -239,10 +294,7 @@
 %highlightlines={2-5}
 %]{LaTeX}
 %\documentclass{article}
-%\usepackage[math,
-%thaifont = Tahoma,
-%texgyrefont = false,
-%sloppy = false]{thaispec}
+%\usepackage[math, thaifont = Tahoma, sloppy = false]{thaispec}
 %\begin{document}
 %\section{Math ภาษาไทย}
 %การพิมพ์ภาษาไทยในเอกสาร $ax^2+bx+c=0$
@@ -255,6 +307,16 @@
 %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.
 %
 %\section{Credits}
 %This package is motivated by a set of \LaTeX\ commands for typesetting Thai documents
@@ -282,7 +344,7 @@
 %    \end{macrocode}
 %\fi
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{thaispec}[2018/03/29 version 0.3 thaispec]
+\ProvidesPackage{thaispec}[2019/07/03 version 0.4 thaispec]
 
 \RequirePackage{kvoptions}
 \RequirePackage[no-math]{fontspec}
@@ -299,12 +361,9 @@
 family=THL,
 prefix=THL@
 }
+
 \DeclareStringOption[TH Sarabun New]{thaifont}[TH Sarabun New]
-\DeclareStringOption[TeX Gyre Termes]{mainfont}[TeX Gyre Termes]
-\DeclareStringOption[TeX Gyre Heros]{sansfont}[TeX Gyre Heros]
-\DeclareStringOption[TeX Gyre Cursor]{monofont}[TeX Gyre Cursor]
 
-
 \DeclareVoidOption{math}{%
 \RequirePackage{mathtools}
 \RequirePackage{amssymb}
@@ -311,14 +370,13 @@
 \RequirePackage{amsthm}
 \RequirePackage{mathspec}
 }
+
 \DeclareVoidOption{thainum}{\renewcommand{\thesection}{\thainum{section}}}
 
-
-\DeclareBoolOption[true]{texgyrefont}
-\DeclareBoolOption[true]{thaithm}
 \DeclareBoolOption[true]{sloppy}
 \DeclareBoolOption[true]{thaispacing}
 \DeclareBoolOption[true]{thaicaption}
+\DeclareBoolOption[false]{beamerthmcount}
 
 \DeclareStringOption[default]{thmcount}[default]
 
@@ -327,7 +385,6 @@
 
 % TeX Commands
 
-\newcommand{\testvar}{\THL at thmcount}
 
 % Set Thai language
 \XeTeXlinebreaklocale "th"
@@ -339,15 +396,8 @@
 
 
 % Select Thai fonts
-\ifTHL at texgyrefont
-\setmainfont{\THL at mainfont}
-\setsansfont{\THL at sansfont}
-\setmonofont{\THL at monofont}
-\else
-\setmainfont[Scale=1.23]{\THL at thaifont}
-\fi
+% \setmainfont[Scale=1.23]{\THL at thaifont}
 
-
 % Control English/Thai Fonts
 \newfontfamily{\thaifont}[Scale=MatchUppercase,Mapping=tex-text]{\THL at thaifont}
 
@@ -364,18 +414,7 @@
 \AtBeginDocument\captionsthai
 \fi
 
-% In case of Beamer class
-\@ifclassloaded{beamer}
-{}
-{%
-\ifTHL at thaispacing
-\onehalfspacing
-\fi
-}
 
-
-
-
 % Define Thai alpha/number/digit for enumerated items
 \def\thaialph#1{\expandafter\thalph\csname c@#1\endcsname}
 \def\thalph#1{%
@@ -433,8 +472,51 @@
 }
 
 
+% In beamer
+\@ifclassloaded{beamer}
+{
+\let\theorem\relax
+\let\c at theorem\relax
+\let\lemma\relax
+\let\corollary\relax
+\let\definition\relax
+\let\example\relax
+\let\note\relax
+
+\ifTHL at beamerthmcount
+    \setbeamertemplate{theorems}[numbered]
+\fi
+
+}
+{%
+\ifTHL at thaispacing
+\onehalfspacing
+\fi
+}
+
+% In article class
+\@ifclassloaded{article}
+{
+\renewcommand{\THL at thmcount}{section}
+}
+{}
+
+% In book
+\@ifclassloaded{book}
+{
+\renewcommand{\THL at thmcount}{chapter}
+}
+{}
+
+% In report
+\@ifclassloaded{report}
+{
+\renewcommand{\THL at thmcount}{chapter}
+}
+{}
+
+
 % Thai theorem environments
-\ifTHL at thaithm
 \@ifpackageloaded{amsthm}
 {%
 \IfStrEqCase{\THL at thmcount}{%
@@ -552,9 +634,10 @@
 }%
 }%
 \xpatchcmd{\@thm}{\thm at headpunct{.}}{\thm at headpunct{}}{}{}
-}{}
-\fi
+}
+{}
 
+
 \endinput
 %\iffalse
 %    \begin{macrocode}

Modified: trunk/Master/texmf-dist/source/latex/thaispec/thaispec.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/thaispec/thaispec.ins	2019-07-10 20:28:23 UTC (rev 51597)
+++ trunk/Master/texmf-dist/source/latex/thaispec/thaispec.ins	2019-07-10 20:28:34 UTC (rev 51598)
@@ -1,10 +1,10 @@
-% thaispec.ins generated using makedtx version 1.2 2018/3/9 18:44
+% thaispec.ins generated using makedtx version 1.2 2019/7/4 22:02
 \input docstrip
 
 \preamble
 
  thaispec.dtx
- Copyright 2018 Ratthaprom_Promkam
+ Copyright 2019 Ratthaprom_Promkam
 
  This work may be distributed and/or modified under the
  conditions of the LaTeX Project Public License, either version 1.3

Modified: trunk/Master/texmf-dist/tex/latex/thaispec/thaispec.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/thaispec/thaispec.sty	2019-07-10 20:28:23 UTC (rev 51597)
+++ trunk/Master/texmf-dist/tex/latex/thaispec/thaispec.sty	2019-07-10 20:28:34 UTC (rev 51598)
@@ -7,7 +7,7 @@
 %% thaispec.dtx  (with options: `thaispec.sty,package')
 %% 
 %%  thaispec.dtx
-%%  Copyright 2018 Ratthaprom_Promkam
+%%  Copyright 2019 Ratthaprom_Promkam
 %% 
 %%  This work may be distributed and/or modified under the
 %%  conditions of the LaTeX Project Public License, either version 1.3
@@ -38,6 +38,13 @@
 %%   Right bracket \]     Circumflex    \^     Underscore    \_
 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
 %%   Right brace   \}     Tilde         \~}
+%% 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}
 %%\begin{lstlisting}[style=tex,numbers=left]
 %%\documentclass{article}
 %%\usepackage{thaispec}
@@ -58,7 +65,7 @@
 %%
 %%\end{lstlisting}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{thaispec}[2018/03/29 version 0.3 thaispec]
+\ProvidesPackage{thaispec}[2019/07/03 version 0.4 thaispec]
 
 \RequirePackage{kvoptions}
 \RequirePackage[no-math]{fontspec}
@@ -74,10 +81,8 @@
 family=THL,
 prefix=THL@
 }
+
 \DeclareStringOption[TH Sarabun New]{thaifont}[TH Sarabun New]
-\DeclareStringOption[TeX Gyre Termes]{mainfont}[TeX Gyre Termes]
-\DeclareStringOption[TeX Gyre Heros]{sansfont}[TeX Gyre Heros]
-\DeclareStringOption[TeX Gyre Cursor]{monofont}[TeX Gyre Cursor]
 
 \DeclareVoidOption{math}{%
 \RequirePackage{mathtools}
@@ -85,13 +90,13 @@
 \RequirePackage{amsthm}
 \RequirePackage{mathspec}
 }
+
 \DeclareVoidOption{thainum}{\renewcommand{\thesection}{\thainum{section}}}
 
-\DeclareBoolOption[true]{texgyrefont}
-\DeclareBoolOption[true]{thaithm}
 \DeclareBoolOption[true]{sloppy}
 \DeclareBoolOption[true]{thaispacing}
 \DeclareBoolOption[true]{thaicaption}
+\DeclareBoolOption[false]{beamerthmcount}
 
 \DeclareStringOption[default]{thmcount}[default]
 
@@ -98,8 +103,6 @@
 \ProcessKeyvalOptions{THL}
 
 
-\newcommand{\testvar}{\THL at thmcount}
-
 \XeTeXlinebreaklocale "th"
 \XeTeXlinebreakskip = 0pt plus 0pt
 \ifTHL at sloppy
@@ -107,13 +110,6 @@
 \fi
 \defaultfontfeatures{Mapping=tex-text}
 
-\ifTHL at texgyrefont
-\setmainfont{\THL at mainfont}
-\setsansfont{\THL at sansfont}
-\setmonofont{\THL at monofont}
-\else
-\setmainfont[Scale=1.23]{\THL at thaifont}
-\fi
 
 \newfontfamily{\thaifont}[Scale=MatchUppercase,Mapping=tex-text]{\THL at thaifont}
 
@@ -130,14 +126,6 @@
 \AtBeginDocument\captionsthai
 \fi
 
-\@ifclassloaded{beamer}
-{}
-{%
-\ifTHL at thaispacing
-\onehalfspacing
-\fi
-}
-
 \def\thaialph#1{\expandafter\thalph\csname c@#1\endcsname}
 \def\thalph#1{%
     \ifcase#1\or ก\or ข\or ค\or ง\or จ\or ฉ\or ช\or ซ\or
@@ -189,7 +177,45 @@
 \def\today{\DTMfetchday{now}\ \dtmonth\ พ.ศ. \theyearbd}
 }
 
-\ifTHL at thaithm
+\@ifclassloaded{beamer}
+{
+\let\theorem\relax
+\let\c at theorem\relax
+\let\lemma\relax
+\let\corollary\relax
+\let\definition\relax
+\let\example\relax
+\let\note\relax
+
+\ifTHL at beamerthmcount
+    \setbeamertemplate{theorems}[numbered]
+\fi
+
+}
+{%
+\ifTHL at thaispacing
+\onehalfspacing
+\fi
+}
+
+\@ifclassloaded{article}
+{
+\renewcommand{\THL at thmcount}{section}
+}
+{}
+
+\@ifclassloaded{book}
+{
+\renewcommand{\THL at thmcount}{chapter}
+}
+{}
+
+\@ifclassloaded{report}
+{
+\renewcommand{\THL at thmcount}{chapter}
+}
+{}
+
 \@ifpackageloaded{amsthm}
 {%
 \IfStrEqCase{\THL at thmcount}{%
@@ -307,8 +333,8 @@
 }%
 }%
 \xpatchcmd{\@thm}{\thm at headpunct{.}}{\thm at headpunct{}}{}{}
-}{}
-\fi
+}
+{}
 
 \endinput
 %%



More information about the tex-live-commits mailing list