summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/thaispec
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-02-25 21:29:06 +0000
committerKarl Berry <karl@freefriends.org>2018-02-25 21:29:06 +0000
commitc866cc1cc9d403e1ea81bea28950da1ac62494a7 (patch)
treefef0def1378bea30a0f9b9b23388ae7f1742d81d /Master/texmf-dist/tex/latex/thaispec
parenteaeb7e1215c6dac950bfdc884c48478ea36afdc3 (diff)
thaispec (25feb18)
git-svn-id: svn://tug.org/texlive/trunk@46741 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/thaispec')
-rw-r--r--Master/texmf-dist/tex/latex/thaispec/thaispec.sty57
1 files changed, 47 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/latex/thaispec/thaispec.sty b/Master/texmf-dist/tex/latex/thaispec/thaispec.sty
index ebbc72734cb..25f728265b7 100644
--- a/Master/texmf-dist/tex/latex/thaispec/thaispec.sty
+++ b/Master/texmf-dist/tex/latex/thaispec/thaispec.sty
@@ -11,7 +11,7 @@
%%
%% 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.
+%% of this license or (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
@@ -38,8 +38,27 @@
%% Right bracket \] Circumflex \^ Underscore \_
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
+%%\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{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}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{thaispec}[2018/02/23 thaispec version 0.1]
+\ProvidesPackage{thaispec}[2018/02/25 version 0.2 thaispec]
\RequirePackage{kvoptions}
\RequirePackage[no-math]{fontspec}
@@ -48,7 +67,6 @@
\RequirePackage{polyglossia}
\RequirePackage[calc]{datetime2}
\RequirePackage{xstring}
-\RequirePackage{fp-basic, fp-snap}
\RequirePackage{afterpackage}
\RequirePackage{xpatch}
@@ -61,8 +79,19 @@ prefix=THL@
\DeclareStringOption[TeX Gyre Heros]{sansfont}[TeX Gyre Heros]
\DeclareStringOption[TeX Gyre Cursor]{monofont}[TeX Gyre Cursor]
+\DeclareVoidOption{math}{%
+\RequirePackage{mathtools}
+\RequirePackage{amssymb}
+\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}
\DeclareStringOption[default]{thmcount}[default]
@@ -73,7 +102,9 @@ prefix=THL@
\XeTeXlinebreaklocale "th"
\XeTeXlinebreakskip = 0pt plus 0pt
+\ifTHL@sloppy
\sloppy
+\fi
\defaultfontfeatures{Mapping=tex-text}
\ifTHL@texgyrefont
@@ -95,14 +126,16 @@ prefix=THL@
\setdefaultlanguage{english}
\setotherlanguage{thai}
+\ifTHL@thaicaption
\AtBeginDocument\captionsthai
+\fi
\@ifclassloaded{beamer}
-{
-}
-{
-%% Normally set onehalf spacing
+{}
+{%
+\ifTHL@thaispacing
\onehalfspacing
+\fi
}
\def\thaialph#1{\expandafter\thalph\csname c@#1\endcsname}
@@ -148,13 +181,16 @@ prefix=THL@
{12}{ธันวาคม}
}}
-\newcommand{\dtyearbd}{\FPadd{\tmpdtyearbd}{\DTMfetchyear{now}}{543}\FPclip{\rtmpdtyearbd}{\tmpdtyearbd}พ.ศ.\;\rtmpdtyearbd}
+\newcounter{yearbd}
+\setcounter{yearbd}{\DTMfetchyear{now}}
+\addtocounter{yearbd}{543}
\AtBeginDocument{
-\def\Today{\dtdow\;\DTMfetchday{now}\;\dtmonth\;\dtyearbd}
-\def\today{\DTMfetchday{now}\;\dtmonth\;\dtyearbd}
+\def\Today{\dtdow\ \DTMfetchday{now}\ \dtmonth\ พ.ศ. \theyearbd}
+\def\today{\DTMfetchday{now}\ \dtmonth\ พ.ศ. \theyearbd}
}
+\ifTHL@thaithm
\AfterPackage{amsthm}{%
\IfStrEqCase{\THL@thmcount}{%
{default}{%
@@ -272,6 +308,7 @@ prefix=THL@
}%
\xpatchcmd{\@thm}{\thm@headpunct{.}}{\thm@headpunct{}}{}{}
}
+\fi
\endinput
%%