From 4f58a04bac374894a50724aa34f44f3dd46298c1 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 10 Jul 2019 20:28:34 +0000 Subject: thaispec (10jul19) git-svn-id: svn://tug.org/texlive/trunk@51598 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/thaispec/thaispec.sty | 80 +++++++++++++++-------- 1 file changed, 53 insertions(+), 27 deletions(-) (limited to 'Master/texmf-dist/tex/latex/thaispec') diff --git a/Master/texmf-dist/tex/latex/thaispec/thaispec.sty b/Master/texmf-dist/tex/latex/thaispec/thaispec.sty index 0390fea0cfb..43f55494761 100644 --- a/Master/texmf-dist/tex/latex/thaispec/thaispec.sty +++ b/Master/texmf-dist/tex/latex/thaispec/thaispec.sty @@ -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,21 +90,19 @@ prefix=THL@ \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] \ProcessKeyvalOptions{THL} -\newcommand{\testvar}{\THL@thmcount} - \XeTeXlinebreaklocale "th" \XeTeXlinebreakskip = 0pt plus 0pt \ifTHL@sloppy @@ -107,13 +110,6 @@ prefix=THL@ \fi \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} @@ -130,14 +126,6 @@ prefix=THL@ \AtBeginDocument\captionsthai \fi -\@ifclassloaded{beamer} -{} -{% -\ifTHL@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 @@ prefix=THL@ \def\today{\DTMfetchday{now}\ \dtmonth\ พ.ศ. \theyearbd} } -\ifTHL@thaithm +\@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 +} + +\@ifclassloaded{article} +{ +\renewcommand{\THL@thmcount}{section} +} +{} + +\@ifclassloaded{book} +{ +\renewcommand{\THL@thmcount}{chapter} +} +{} + +\@ifclassloaded{report} +{ +\renewcommand{\THL@thmcount}{chapter} +} +{} + \@ifpackageloaded{amsthm} {% \IfStrEqCase{\THL@thmcount}{% @@ -307,8 +333,8 @@ prefix=THL@ }% }% \xpatchcmd{\@thm}{\thm@headpunct{.}}{\thm@headpunct{}}{}{} -}{} -\fi +} +{} \endinput %% -- cgit v1.2.3