forked from yan9a/LaTeX_Myanmar_Language
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathburmese.sty
83 lines (79 loc) · 2.8 KB
/
burmese.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
\ProvidesPackage{burmese}[2017/02/27 Burmese Language Package]
% A style for burmese language reports
% Author: Yan Naing Aye
% https://github.com/yan9a/LaTeX_Myanmar_Language
\RequirePackage{fontspec}
%-----------------------------------------------------------------
\DeclareOption{MyanmarText}{
\setmainfont{Myanmar Text}
}
\DeclareOption{Pyidaungsu}{
\setmainfont{Pyidaungsu}
}
\DeclareOption{Padauk}{
\setmainfont{Padauk}
}
\ExecuteOptions{MyanmarText}
\ProcessOptions\relax
%-----------------------------------------------------------------
\makeatletter
\def\@burmesenumber#1{\expandafter\@@burmesenumber\number#1\@nil}
\def\@@burmesenumber#1{%
\ifx#1\@nil
\else
\char\numexpr#1+"1040\relax
\expandafter\@@burmesenumber\fi}
\def\burmesecounter#1{\expandafter\@burmesenumber\csname c@#1\endcsname}
\def\burmesenumeral#1{\@@burmesenumber#1\@nil}
\makeatother
%-----------------------------------------------------------------
\newcommand{\mmmonthname}[1][]{
\ifcase
#1
\or ဇန်နဝါရီ
\or ဖေဖော်ဝါရီ
\or မတ်
\or ဧပြီ
\or မေ
\or ဇွန်
\or ဇူလိုင်
\or သြဂုတ်
\or စက်တင်ဘာ
\or အောက်တိုဘာ
\or နိုဝင်ဘာ
\or ဒီဇင်ဘာ
\fi
}
\makeatletter
\let\c@year\year
\makeatother
%\setcounter{year}{2017}
\renewcommand{\THEYEAR}{\burmesecounter{year}}
\renewcommand{\monthname}{\mmmonthname}
%-----------------------------------------------------------------
\renewcommand{\bibname}{အကိုးအကားများ}%change Bibliography
\renewcommand{\contentsname}{မာတိကာ}
\renewcommand{\listfigurename}{ပုံများ}
\renewcommand{\listtablename}{ဇယားများ}
\renewcommand{\chaptername}{အခန်း}
\renewcommand{\figurename}{ပုံ}
\renewcommand{\lstlistingname}{စာရင်း}
\renewcommand{\abstractname}{အနှစ်ချုပ်}
\renewcommand{\tablename}{ဇယား}
%-----------------------------------------------------------------
\renewcommand{\thepage}{\burmesecounter{page}}
\renewcommand{\thechapter}{\burmesecounter{chapter}}
\renewcommand{\thesection}{\burmesecounter{chapter}.\burmesecounter{section}}
\renewcommand{\thesubsection}{\burmesecounter{chapter}.\burmesecounter{section}.\burmesecounter{subsection}}
\renewcommand{\thefigure}{\burmesecounter{chapter}.\burmesecounter{figure}}
\renewcommand{\thetable}{\burmesecounter{chapter}.\burmesecounter{table}}
\renewcommand{\theequation}{\burmesecounter{chapter}.\burmesecounter{equation}}
%-----------------------------------------------------------------
\let\oldpagenumbering\pagenumbering
\renewcommand{\pagenumbering}[1]{
\oldpagenumbering{#1}
\ifthenelse{\equal{#1}{arabic}}{
\renewcommand{\thepage}{\burmesecounter{page}}
}{}
}
\endinput