diff options
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/thaispec/thaispec.sty | 278 |
1 files changed, 278 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/thaispec/thaispec.sty b/Master/texmf-dist/tex/latex/thaispec/thaispec.sty new file mode 100644 index 00000000000..ebbc72734cb --- /dev/null +++ b/Master/texmf-dist/tex/latex/thaispec/thaispec.sty @@ -0,0 +1,278 @@ +%% +%% This is file `thaispec.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% thaispec.dtx (with options: `thaispec.sty,package') +%% +%% thaispec.dtx +%% Copyright 2018 Ratthaprom Promkam +%% +%% 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 +%% 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. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Ratthaprom Promkam. +%% +%% This work consists of the files thaispec.dtx and thaispec.ins and the derived file thaispec.sty. +%% +%% \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 \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{thaispec}[2018/02/23 thaispec version 0.1] + +\RequirePackage{kvoptions} +\RequirePackage[no-math]{fontspec} +\RequirePackage[Latin, Thai]{ucharclasses} +\RequirePackage{setspace} +\RequirePackage{polyglossia} +\RequirePackage[calc]{datetime2} +\RequirePackage{xstring} +\RequirePackage{fp-basic, fp-snap} +\RequirePackage{afterpackage} +\RequirePackage{xpatch} + +\SetupKeyvalOptions{ +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{thainum}{\renewcommand{\thesection}{\thainum{section}}} +\DeclareBoolOption[true]{texgyrefont} + +\DeclareStringOption[default]{thmcount}[default] + +\ProcessKeyvalOptions{THL} + + +\newcommand{\testvar}{\THL@thmcount} + +\XeTeXlinebreaklocale "th" +\XeTeXlinebreakskip = 0pt plus 0pt +\sloppy +\defaultfontfeatures{Mapping=tex-text} + +\ifTHL@texgyrefont +\setmainfont{\THL@mainfont} +\setsansfont{\THL@sansfont} +\setmonofont{\THL@monofont} +\else +\setmainfont[Scale=1.23]{\THL@thaifont} +\fi + +\newfontfamily{\thaifont}[Scale=MatchUppercase,Mapping=tex-text]{\THL@thaifont} + +\newenvironment{thailang} +{\thaifont} +{} + +\setTransitionTo{Thai}{\begin{thailang}} +\setTransitionFrom{Thai}{\end{thailang}} + +\setdefaultlanguage{english} +\setotherlanguage{thai} +\AtBeginDocument\captionsthai + +\@ifclassloaded{beamer} +{ +} +{ +%% Normally set onehalf spacing +\onehalfspacing +} + +\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 +} + +\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}{ธันวาคม} +}} + +\newcommand{\dtyearbd}{\FPadd{\tmpdtyearbd}{\DTMfetchyear{now}}{543}\FPclip{\rtmpdtyearbd}{\tmpdtyearbd}พ.ศ.\;\rtmpdtyearbd} +\AtBeginDocument{ +\def\Today{\dtdow\;\DTMfetchday{now}\;\dtmonth\;\dtyearbd} +\def\today{\DTMfetchday{now}\;\dtmonth\;\dtyearbd} +} + + +\AfterPackage{amsthm}{% +\IfStrEqCase{\THL@thmcount}{% +{default}{% +\newtheorem{theorem}{ทฤษฎีบท} +\newtheorem{lemma}[theorem]{บทตั้ง} +\newtheorem{corollary}[theorem]{บทแทรก} +\newtheorem{proposition}[theorem]{ทฤษฎีบทประกอบ} +\theoremstyle{definition} +\newtheorem{definition}[theorem]{บทนิยาม} +\newtheorem{undefinedterm}[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*{undefinedterm}{อนิยาม} +\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{undefinedterm}[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{undefinedterm}[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{undefinedterm}[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{undefinedterm}[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{undefinedterm}[definition]{อนิยาม} +\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{undefinedterm}[definition]{อนิยาม} +\newtheorem{axiom}[definition]{สัจพจน์} +\newtheorem{example}{ตัวอย่าง} +\theoremstyle{remark} +\newtheorem{remark}{หมายเหตุ}[chapter] +\newtheorem{note}{บันทึก}[chapter] +}% +}% +\xpatchcmd{\@thm}{\thm@headpunct{.}}{\thm@headpunct{}}{}{} +} + +\endinput +%% +%% End of file `thaispec.sty'. |