texlive[46741] Master/texmf-dist: thaispec (25feb18)

commits+karl at tug.org commits+karl at tug.org
Sun Feb 25 22:29:07 CET 2018


Revision: 46741
          http://tug.org/svn/texlive?view=revision&revision=46741
Author:   karl
Date:     2018-02-25 22:29:06 +0100 (Sun, 25 Feb 2018)
Log Message:
-----------
thaispec (25feb18)

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	2018-02-25 21:28:52 UTC (rev 46740)
+++ trunk/Master/texmf-dist/doc/latex/thaispec/README.md	2018-02-25 21:29:06 UTC (rev 46741)
@@ -1,12 +1,6 @@
 # thaispec
 Thai Language Typesetting in XeLaTeX
 
-# Version
-0.1 [2018-FEB-23]
-
-# Author
-Ratthaprom Promkam
-
 ## Prerequisite
 Thai national fonts, i.e., SIPAFonts (See https://github.com/epsilonxe/sipafonts)
 
@@ -29,10 +23,11 @@
 \usepackage[thaifont = <SYSTEM THAI FONT NAME>]{thaispec}
 ```
 Moreover, the package give you options to choose any system wide fonts for
-```mainfont```,```sansfont```, ```monofont``` too
+`mainfont`, `sansfont` and  `monofont` too
 
+For additional usage or more options, see the documentation.
 
-## Credit
+## Credits
 This package is motivated by a set of LaTex commands for typesetting Thai documents
 provided by Dittaya Wanvarie from Chulalongkorn University.
 (See http://pioneer.netserv.chula.ac.th/~wdittaya/)

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	2018-02-25 21:28:52 UTC (rev 46740)
+++ trunk/Master/texmf-dist/source/latex/thaispec/thaispec.dtx	2018-02-25 21:29:06 UTC (rev 46741)
@@ -1,11 +1,11 @@
 %\iffalse
-% thaispec.dtx generated using makedtx version 0.94b (c) Nicola Talbot
+% thaispec.dtx generated using makedtx version 1.2 (c) Nicola Talbot
 % Command line args:
 %   -doc "thaispec.tex"
+%   -author "Ratthaprom Promkam"
 %   -src "thaispec\.sty=>thaispec.sty"
-%   -author "Ratthaprom Promkam"
 %   thaispec
-% Created on 2018/2/23 22:01
+% Created on 2018/2/25 18:17
 %\fi
 %\iffalse
 %<*package>
@@ -38,14 +38,56 @@
 %!TEX outputDirectory = OutputDir
 %!TEX spellcheck = en_US
 %!TEX encoding = UTF-8
+%!TEX enableShellEscape = yes
 
-\documentclass[a4paper,10pt]{article}
-\usepackage{thaispec}
-\usepackage{mathtools,amssymb,amsthm}
+\documentclass{article}
 
-\title{บทความภาษาไทย}
-\author{ชื่อผู้แต่ง}
+\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{\showex}[1]{\par\vspace{0mm}\noindent{Example:}\par\noindent\texttt{#1}}
+\newcommand{\printcenter}[1]{\par\begin{center}#1\end{center}\par\noindent}
+
+\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 at me.com}}}
+\date{Version 0.2 from February 25, 2018}
+
 \begin{document}
 \DocInput{thaispec.dtx}
 \end{document}
@@ -52,80 +94,194 @@
 %</driver>
 %\fi
 %\maketitle
-%คอนดักเตอร์ซีริลลิกคลอไรด์ ลินุกซ์ออกเทนดอปเพลอร์ไพธอนฮิรางานะ ไอพ็อดแอพพลิเคชัน
-%อินทิเกรตออกเทนแพลตฟอร์มดิจิตอล ไลเซนส์เวิร์กสเตชันไฮโดรลิกพาเนล พาร์ทิชันแท็กโมบายล์กูเกิลแล็ปท็อป
-%พาราโบลาโพรเซสเซอร์ พร็อกซีอินพุทแท็บ เซ็กเมนต์มัลแวร์ออกเทน เดลไฟไมถิลีทัชแพดชิป
-%ซีริลลิกโปรโตคอลเคอราตินแกนีมีด เทอร์โมฮาร์ดดิสก์ เทฟลอน กิกะไบต์สแต็กชิคุนกุนยา
-%เมลเอ็กซ์โพเนนเชียลไดออกไซด์ฟีโรโมนไบต์
 %
-%เวกเตอร์ดีวีดีอินทิเกรตฮาร์ดแวร์ ธาลัสซีเมียกราฟิกแล็ปท็อปสปายแวร์ลิงก์โน้ตบุ๊ค
-%บลูเรย์เทฟลอนลินุกซ์โปรเซสเซอร์ ทรานแซ็กชันเวิร์คสเตชั่นไมถิลี อัปเดตดีบั๊กไอคอนแอนิเมชัน
-%พิกเซลอีเมลโพรโทคอลพร็อกซีสแกนเนอร์ กูเกิ้ลลินุกซ์แอพพลิเคชั่นมอดูล
-%ไฟล์เดลไฟริงโทนอาร์กิวเมนต์คลิปอาร์ต อูบุนตูโน้ตบุ๊คอัปโหลดแอสเซมเบลอร์
-%ไดเรกทอรีซัพพอร์ทไอโฟน มัลติทัชสล็อตอีเมล์พาเนลเน็ตเวิร์คยูนิโคดเรียลไทม์
+%This package allows you to input Thai characters directly to \LaTeX\ documents
+%and choose any (system wide) Thai fonts for typesetting in \XeLaTeX.
+%It also tries to appropriately justify paragraphs with no more external tools.
 %
-%\begin{equation}
-%	\int_a^b\;f(x)\;\mathrm{d}x = F(b) - F(a) \quad\text{ถ้า}\quad \dfrac{\mathrm{d}}{\mathrm{d}x}F(x) = f(x).
-%\end{equation}
-%\section{หัวข้อแรก}
-%ไลบรารีไอโฟนซีดีรอมเราเตอร์บิทเอนจิน ยูนิโคดบัฟเฟอร์เวิร์กสเตชั่น
-%โมบายล์เบราว์เซอร์์แอนะล็อกแพลตฟอร์ม
-%เอาต์พุตมัลติทัชแฮ็กเกอร์ไอโฟน เดลไฟแพกเก็ตเวิร์คสเตชั่นเวิร์คสเตชัน
-%บลูทูธอินเทอร์เฟซ เวิร์คสเตชัน เบราว์เซอร์บลูเรย์เอาท์พุตเน็ตเวิร์คมัลติ
-%ทวีตโค้ดซอฟท์แวร์ดอสโน้ตบุ๊กอีเมล์ บลูทูธพารามิเตอร์โมบายล์เอาต์พุต ชิปฟีเจอร์ทรานแซ็คชัน
-%\begin{equation}
-%	\dfrac{\mathrm{d}}{\mathrm{d}x}\sin(2x) = 2\cos(2x).
-%\end{equation}
+%\tableofcontents
 %
-%\begin{definition}
-%เซ็กเมนต์ฟอสซิลครอสโนวาไดนามิคพาราเซตามอล ไฮเพอร์โบลาคูลอมบ์
-%ควอนตัมปฏิยานุพันธ์ไดนามิคโซนาร์เวกเตอร์ไดนามิกส์
-%ไดนามิกส์ควอนตัม ไททันไฮดรอลิกเทอร์โมยูเรียซิลิเกต ไฮเพอร์โบลาวีก้าไพรเมตเนกาตีฟ
-%เมทริกซ์เซ็กเมนต์ โมเมนตัมแอสพาร์แตมเมตริกซ์
-%\end{definition}
 %
-%\begin{theorem}
-%ไทฟอยด์ดอปเพลอร์เพอร์ออกไซด์ ฟิชชันฮิวมัสไดออกไซด์เอทานอล
-%ไดนามิคโอเซลทามิเวียร์เทฟลอนวีก้า อีโบลาแคโรทีนเมตริกซ์ออกเทน พันธุศาสตร์ยูริกอัลตราซาวนด์เคอราติน
-%อีโบล่าควอนตัม ดอปเปลอร์โพลาไรซ์มอนอกไซด์เวก้าอินทิกรัล ทามิฟลูทามิฟลูจุลชีววิทยาโครมาโทกราฟีฟอสซิล
-%ซัลไฟด์ฟิชชันกลีเซอรีนเอทิลีนแคสสินี ไดนามิกฟอสซิลทามิฟลูแอสพาร์แตม
-%\end{theorem}
+%\section{Prerequisite}
+%The package use \texttt{TH Sarabun New} font by default to typeset Thai characters
+%which included in the collection of Thai national fonts
+%\footnote{Thai national fonts, a.k.a. \texttt{SIPAFonts}.
+%See \url{https://github.com/epsilonxe/sipafonts}}.
+%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{หัวข้อที่สอง}
-%เกตเวย์เอาต์พุทโหลด ไฟร์วอลล์สแปมเอาท์พุตอีเมลเวอร์ชวล
-%ไลบรารีพร็อกซีแอปพลิเคชันโปรเซสพร็อกซี ดิจิทัลแอนิเมชั่นไอพ็อด ไดโอดซอร์สเดลไฟเน็ตบุ๊ค
-%โฮสต์กราฟิกเอาท์พุตคอมไพเลอร์ อินพุทดาวน์โหลด แอสเซมเบลอร์อินเทอร์เน็ตเดเบียนเคอร์เซอร์อัพโหลด
-%เฟิร์มแวร์โพรโทคอลไลบรารีเอนจินโน้ตบุค โค้ดเชลล์ริงโทน แอพพลิเคชั่นมอนิเตอร์อีเมลสปายแวร์ไฟล์
-%เทเลคอมเน็ตเวิร์กโฮสต์โหลด
-%\begin{table}[!ht]
-%\begin{center}
-%\begin{tabular}{|c|c|}
+%\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.
+%
+%\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.
+%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}
+%This will typeset the document by setting \texttt{mainfont} to \texttt{TH Sarabun New}.
+%
+%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}}
+%\caption{Loading options in \texttt{thaispec} package.} \label{table:loading_options}\\
 %\hline
-%\textbf{ไลบรารีพร็อกซี} & \textbf{โค้ดเชลล์ริงโทน}\\ \hline
-%ดิจิตอลมินิมอล & $\tan(2x)-16x^2$ \\ \hline
-%อลูมิเนียมไลบรารี & $\cos(x^2)$ \\ \hline
-%\end{tabular}
-%\caption{ไลบรารีเอนจินโน้ตบุค}
-%\end{center}
-%\end{table}
-%ไฮดรอกไซด์พาร์ทิชัน เบงกาลี แล็ปท็อปกุมภาพันธ์พร็อกซีแคสสินี ตุลาคมทรานแซ็กชั่น
-%แพลตฟอร์มไดโอดอัปเดตพารามิเตอร์โพลาไรซ์ ไฟเบอร์เจ๊บอแรกซ์ดิจิทัล คลิกเยลลี่สงบสุขโมดูล
-%พาเนลเมตริกซ์ คอนโดมิเนียมคลัสเตอร์ เวิร์คสเตชั่น แท็บไอซีแฮปปี้ยีสต์ซัลฟิวริก โน้ตบุ๊กสงบสุขแอสพาร์แตม
-%ดิสเครดิตเตี๊ยมคลอไรด์สวาฮิลีสแกนเนอร์ ออโรร่าไบต์ฮันกึลสปีชีส์อัลตราซาวด์ อารบิกกิกะไบต์
-%แพตเทิร์นบาร์บีคิวมีเดียริงโทน
+%\textbf{Options}  & \textbf{Features}
+%\\ \hline
+%\endfirsthead
+%\caption{(continued) Loading options in \texttt{thaispec} package.}\\
+%\hline
+%\textbf{Options}  & \textbf{Features}
+%\\ \hline
+%\endhead
 %
-%กลีเซอรีนโน้ตบุค ชิพฟีโรโมนละตินอินเทอร์เฟซ เกตเวย์คอเลสเตอรอลแพตช์วีเจ ฮิวมัสโบกี้โนวาเวิร์ลด์
-%แจ๊กพอตป๋าไอโฟนทามิฟลูคอมพ์ ไดเรกทอรีเจ็ตทัชแพดคลาสโฮสต์ บอแรกซ์ไชน่าแบนด์วิดท์พอร์ทจุลชีววิทยา
-%ซัลฟิวริกเทคโนแครตโมเมนตัมโฮสต์ สต๊อคยีสต์โอริยา ภูมิทัศน์ดอสแคมเปญ เวกเตอร์คอเลสเตอรอลบึ้มสเปก
-%เปียโนฟิวชันไอพ็อดมิถุนายนชิคุนกุนยา นายพรานอินพุตพอร์ทปูอัด
+%\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}
+%  \\
+%\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 with \TeX\ Gyre fonts,
+%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,
+%texgyrefont = false,
+%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.
+%
+%\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
@@ -134,7 +290,7 @@
 %    \end{macrocode}
 %\fi
 \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}
@@ -143,7 +299,6 @@
 \RequirePackage{polyglossia}
 \RequirePackage[calc]{datetime2}
 \RequirePackage{xstring}
-\RequirePackage{fp-basic, fp-snap}
 \RequirePackage{afterpackage}
 \RequirePackage{xpatch}
 
@@ -157,8 +312,21 @@
 \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]
 
@@ -172,7 +340,9 @@
 % Set Thai language
 \XeTeXlinebreaklocale "th"
 \XeTeXlinebreakskip = 0pt plus 0pt
+\ifTHL at sloppy
 \sloppy
+\fi
 \defaultfontfeatures{Mapping=tex-text}
 
 
@@ -198,19 +368,22 @@
 
 \setdefaultlanguage{english}
 \setotherlanguage{thai}
+\ifTHL at thaicaption
 \AtBeginDocument\captionsthai
+\fi
 
 % In case of Beamer class
 \@ifclassloaded{beamer}
-{
-% TODO: Serif math font in beamer
-}
-{
-%% Normally set onehalf spacing
+{}
+{%
+\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{%
@@ -258,15 +431,19 @@
 {12}{ธันวาคม}
 }}
 
-\newcommand{\dtyearbd}{\FPadd{\tmpdtyearbd}{\DTMfetchyear{now}}{543}\FPclip{\rtmpdtyearbd}{\tmpdtyearbd}พ.ศ.\;\rtmpdtyearbd}
+\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\;\dtyearbd}
-\def\today{\DTMfetchday{now}\;\dtmonth\;\dtyearbd}
+\def\Today{\dtdow\ \DTMfetchday{now}\ \dtmonth\ พ.ศ. \theyearbd}
+\def\today{\DTMfetchday{now}\ \dtmonth\ พ.ศ. \theyearbd}
 }
 
 
 % Thai theorem environments
 
+\ifTHL at thaithm
 \AfterPackage{amsthm}{%
 \IfStrEqCase{\THL at thmcount}{%
 {default}{%
@@ -384,8 +561,8 @@
 }%
 \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	2018-02-25 21:28:52 UTC (rev 46740)
+++ trunk/Master/texmf-dist/source/latex/thaispec/thaispec.ins	2018-02-25 21:29:06 UTC (rev 46741)
@@ -1,4 +1,4 @@
-% thaispec.ins generated using makedtx version 0.94b 2018/2/23 22:01
+% thaispec.ins generated using makedtx version 1.2 2018/2/25 18:17
 \input docstrip
 
 \preamble
@@ -8,7 +8,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

Modified: trunk/Master/texmf-dist/tex/latex/thaispec/thaispec.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/thaispec/thaispec.sty	2018-02-25 21:28:52 UTC (rev 46740)
+++ trunk/Master/texmf-dist/tex/latex/thaispec/thaispec.sty	2018-02-25 21:29:06 UTC (rev 46741)
@@ -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 @@
 \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 @@
 
 \XeTeXlinebreaklocale "th"
 \XeTeXlinebreakskip = 0pt plus 0pt
+\ifTHL at sloppy
 \sloppy
+\fi
 \defaultfontfeatures{Mapping=tex-text}
 
 \ifTHL at texgyrefont
@@ -95,14 +126,16 @@
 
 \setdefaultlanguage{english}
 \setotherlanguage{thai}
+\ifTHL at thaicaption
 \AtBeginDocument\captionsthai
+\fi
 
 \@ifclassloaded{beamer}
-{
-}
-{
-%% Normally set onehalf spacing
+{}
+{%
+\ifTHL at thaispacing
 \onehalfspacing
+\fi
 }
 
 \def\thaialph#1{\expandafter\thalph\csname c@#1\endcsname}
@@ -148,13 +181,16 @@
 {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 at thaithm
 \AfterPackage{amsthm}{%
 \IfStrEqCase{\THL at thmcount}{%
 {default}{%
@@ -272,6 +308,7 @@
 }%
 \xpatchcmd{\@thm}{\thm at headpunct{.}}{\thm at headpunct{}}{}{}
 }
+\fi
 
 \endinput
 %%



More information about the tex-live-commits mailing list