summaryrefslogtreecommitdiff
path: root/language/mongolian
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-12-17 03:00:34 +0000
committerNorbert Preining <norbert@preining.info>2019-12-17 03:00:34 +0000
commit6cbf49c3ed1a2881b7fccbc67eccb5532d196b74 (patch)
treee10650965a513dcd7cce09c1278cddac7130009b /language/mongolian
parent37daa3ac1d4eccb1903a4d5001f50f0612f873e4 (diff)
CTAN sync 201912170300
Diffstat (limited to 'language/mongolian')
-rw-r--r--language/mongolian/xecyrmongolian/README11
-rw-r--r--language/mongolian/xecyrmongolian/xecyrmongolian.dtx224
-rw-r--r--language/mongolian/xecyrmongolian/xecyrmongolian.ins53
-rw-r--r--language/mongolian/xecyrmongolian/xecyrmongolian.pdfbin0 -> 63187 bytes
4 files changed, 288 insertions, 0 deletions
diff --git a/language/mongolian/xecyrmongolian/README b/language/mongolian/xecyrmongolian/README
new file mode 100644
index 0000000000..a9e25631f0
--- /dev/null
+++ b/language/mongolian/xecyrmongolian/README
@@ -0,0 +1,11 @@
+The 'xecyrmongolian' package can be used to produce
+documents in Cyrillic Mongolian using either XeLaTeX
+or LuaLaTeX. The command \setlanguage can be used to
+load alternative hyphenation patterns so to be able to
+create multilingual documents.
+
+16/12/2019
+
+Apostolos Syropoulos Bat-erdene Altangerel
+Xanthi, Greece Ulaanbaatar, Mongolia
+asyropoulos@yahoo.com echingiss@gmail.com
diff --git a/language/mongolian/xecyrmongolian/xecyrmongolian.dtx b/language/mongolian/xecyrmongolian/xecyrmongolian.dtx
new file mode 100644
index 0000000000..aa297e5c36
--- /dev/null
+++ b/language/mongolian/xecyrmongolian/xecyrmongolian.dtx
@@ -0,0 +1,224 @@
+%% \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 \~}
+%%
+%\iffalse
+%
+% (c) Copyright 2019 Apostolos Syropoulos Bat-erdene Altangerel
+% This program can be redistributed and/or modified under the
+% terms of the LaTeX Project Public License Distributed from
+% http://www.latex-project.org/lppl.txt; either
+% version 1.3c of the License, or any later version.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% Please report errors or suggestions for improvement to
+%
+% Apostolos Syropoulos (asyropoulos@yahoo.com)
+%
+%\fi
+% \CheckSum{228}
+% \iffalse This is a Metacomment
+%
+%<xecyrmongolian, >\ProvidesFile{xecyrmongolian.sty}
+%
+%<xecyrmongolian, > [2019/12/14 v1.0.0 Package `xecyrmongolian.sty']
+%
+% \begin{macrocode}
+%<*driver>
+\documentclass{ltxdoc}
+\GetFileInfo{xecyrmongolian.drv}
+\usepackage{xltxtra}
+\usepackage{fullpage}
+\begin{document}
+\setmainfont[Mapping=tex-text]{Arno Pro}
+\setmonofont{UM Typewriter}
+\setsansfont[Mapping=tex-text]{GFS Neohellenic}
+ \DocInput{xecyrmongolian.dtx}
+\end{document}
+%</driver>
+% \end{macrocode}
+% \fi
+%\StopEventually{}
+%\title{Mongolian Cyrillic Support for\\ \XeLaTeX\ and Lua\LaTeX}
+%\author{Apostolos Syropoulos\\
+% Xanthi, Greece\\
+% \texttt{asyropoulos@yahoo.com} \and
+% Bat-erdene Altangerel\\
+% Ulaanbaatar, Mongolia\\
+% \texttt{echingiss@gmail.com}
+%}
+% \date{2019/12/14}
+%\maketitle
+% \begin{abstract}
+% The \textsf{xecyrmongolian} package provides basic support for Mongolian Cyrillic so to be able
+% to prepare documents with either \XeLaTeX or Lua\LaTeX.
+%\end{abstract}
+%
+%\section{Introduction}
+%
+% The package \textsf{xecyrmongolian} has been designed for people who want to prepare documents whose
+% main language is Mongolian Cyrillic and want to typeset their work with either \XeLaTeX or Lua\LaTeX.
+% The package allows users to load other hyphenation patterns so to be able to create trully
+% multilingial documents. In addition, all standard enumerations use the Cyrillic alphabet used in
+% Mongolia. The following simple \LaTeX\ code is a typical usage example of the package.
+%\begin{verbatim}
+% \documentclass[a4paper]{article}
+% \usepackage{xltxtra}
+% \usepackage{enumitem}
+% \usepackage{xecyrmongolian}
+% \begin{document}
+% \setmainfont{MenkGarqagTig.ttf} % or any font you like
+% \begin{enumerate}[label=(\Alph*)]
+% \item an apple
+% \item a banana
+% \item a carrot
+% \item a durian
+% \end{enumerate}
+% \Useg{12}
+% \end{document}
+%\end{verbatim}
+% \section{The Source Code}
+% First we define the various strings that correspond to the standard \LaTeX\ captions.
+% \begin{macrocode}
+%<*xecyrmongolian>
+\message{Package `xecyrmongolian' version 1.0.0 by ^^J%
+ Apostolos Syropoulos and Bat-erdene Altangerel}
+\def\prefacename{Оршил}%
+\def\refname{Ашигласан ном}%
+\def\abstractname{Товчлол}%
+\def\bibname{Ашигласан номзүй}%
+\def\chaptername{Бүлэг}%
+\def\appendixname{Хавсралт}%
+\def\contentsname{Гарчиг}%
+\def\listfigurename{Зургийн жагсаалт}%
+\def\listtablename{Хүснэгтийн жагсаалт}%
+\def\indexname{Товъёог}%
+\def\figurename{Зураг}%
+\def\tablename{Хүснэгт}%
+\def\partname{Хэсэг}%
+\def\enclname{Оруулах}%
+\def\ccname{Мэдэгдэл}%
+\def\headtoname{}%
+\def\pagename{Хуудас}%
+\def\seename{Үзнэ үү}%
+\def\alsoname{мөн үзнэ үү}%
+\def\proofname{Баталгаа:}%
+\def\glossaryname{Тайлбар}%
+% \end{macrocode}
+% \begin{macro}{\Useg}
+% \begin{macro}{\useg}
+% Next, we define the macros |\Useg| and |\useg| that are the Mongolian counterpart of |\Alph| and
+% |\alph|, respectively. However, these commands should not be used in enumerations, etc. It
+% is better to make the |\Alph| commands to produce Cyrillic letters by giving the command
+% |\usegalph|. The behavior of this command is the default behavior of the package.
+% \begin{macrocode}
+\def\Useg#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 Я\else\@ctrerr\fi}
+\def\useg#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 я\else\@ctrerr\fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% The previous commands do not work if their argument is a counter. And since we may want to
+% use them in enumeration or to number chapters, we introduce the following commands that work
+% properly when their arguments are counters.
+% \begin{macrocode}
+\def\useg@mong#1{\expandafter\useg\expandafter{\the#1}}
+\def\Useg@mong#1{\expandafter\Useg\expandafter{\the#1}}
+% \end{macrocode}
+% \begin{macro}{\mongmonth}
+% Now we redefine |\today| so as to produce dates in Mongolian. The
+% names of months are defined by the macro |\mongmonth|.
+% \begin{macrocode}
+\def\mongmonth{%
+ \ifcase\month\or 1-р ~сарын\or 2-р ~сарын\or 3-р ~сарын\or 4-р ~сарын\or
+ 5-р ~сарын\or 6-р ~сарын\or 7-р ~сарын\or 8-р ~сарын\or 9-р ~сарын\or
+ 10-р ~сарын\or 11-р ~сарын\or 12-р ~сарын\fi}
+\def\today{\number\year~оны~\mongmonth\space \number\day}
+% \end{macrocode}
+% \end{macro}
+% Lua\LaTeX\ and \XeLaTeX\ have different ways to load hyphenation patterns. Package
+% \textsf{luahyphenrules} by Javier Bezos facilitates this process for people who
+% want to use Lua\LaTeX\ and the ``traditional'' way to load hyphenation patterns.
+% To ensure proper inclusion of LuaTeX staff, I use the following ``idiom'':
+% \begin{center}
+% |\ifx\directlua\undefined |\texttt{\textit{non Lua\LaTeX\ code}}|\else |%
+% \texttt{\textit{Lua\LaTeX\ code}}|\fi|
+% \end{center}
+% \begin{macrocode}
+\ifx\directlua\undefined\else\RequirePackage{luahyphenrules}\fi
+% \end{macrocode}
+% The code that follows loads the hyphenation patterns. The \XeLaTeX\ code
+% is quite standard and depends on the \textsf{babel} pattern loading mechanism, while the
+% Lua\LaTeX\ code uses the |\HyphenRules| macro, which has essentially the functionality
+% of the |\selectlanguage| macro.
+% \begin{macrocode}
+\ifx\directlua\undefined%
+ \language\l@mongolian\else\HyphenRules{mongolian}\fi%
+% \end{macrocode}
+% By default the Mongolian alphabetic enumeration is used instead of enumerations with Latin letters.
+% \begin{macrocode}
+\let\latin@alph\@alph
+\let\latin@Alph\@Alph
+\let\@alph\useg@mong
+\let\@Alph\Useg@mong
+% \end{macrocode}
+% \begin{macro}{\nousegalph}
+% \begin{macro}{\usegalph}
+% If for some reason, the user needs to have the original enumeration back, then the user should used
+% the command |\nousegalph|. And if she wants to switch back, then she has to use the |\usegalph|
+% command:
+% \begin{macrocode}
+\def\nousegalph{%
+ \let\@alph\latin@alph
+ \let\@Alph\latin@Alph}
+\def\usegalph{%
+ \let\@alph\useg@mong
+ \let\@Alph\Useg@mong}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\setlanguage}
+% We provide the |\setlanguage| command which
+% activates the hypehnation patterns of some other language. It is similar
+% to babel's |\selectlanguage|, but we opted to use a new name to avoid possible name conflicts.
+% Valid arguments include |monogreek|, |mongolian|, and |american|. As was noted
+% previously, package \textsf{luahyphenrules} provides the command |\HyphenRules| which has exactly
+% the same functionality as this command. So when using Lua\LaTeX\ users will actually use the
+% |\HyphenRules| command. And since the main language of the documenyt will be Mongolian, we
+% have to load the Mongolian hypehnation patterns.
+% \begin{macrocode}
+\ifx\directlua\undefined%
+ \def\setlanguage#1{%
+ \expandafter\ifx\csname l@#1\endcsname\relax%
+ \typeout{^^J Error: No hyphenation pattern for language #1 loaded,}%
+ \typeout{ default hyphenation patterns are used.^^J}%
+ \language=0%
+ \else\language=\csname l@#1\endcsname\fi}
+\else
+ \let\setlanguage\HyphenRules
+\fi
+\setlanguage{mongolian}
+%</xecyrmongolian>
+% \end{macrocode}
+% \end{macro}
+% \Finale
diff --git a/language/mongolian/xecyrmongolian/xecyrmongolian.ins b/language/mongolian/xecyrmongolian/xecyrmongolian.ins
new file mode 100644
index 0000000000..2b0a6a4294
--- /dev/null
+++ b/language/mongolian/xecyrmongolian/xecyrmongolian.ins
@@ -0,0 +1,53 @@
+%% Copyright 2019 Apostolos Syropoulos and Bat-erdene Altangerel
+%%
+%% This file is part of the `xecyrmongolian' package.
+%% You are not allowed to modify its contents.
+%%
+\def\filedate{2019/12/14}
+\def\batchfile{xecyrmongolian.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\preamble
+
+ (c) Copyright 2019 Apostolos Syropoulos and Bat-erdene Altangerel
+ This program can be redistributed and/or modified under the
+ terms of the LaTeX Project Public License Distributed from
+ http://www.latex-project.org/lppl.txt; either
+ version 1.3c of the License, or any later version.
+
+ This work has the LPPL maintenance status `maintained'.
+
+ Please report errors or suggestions for improvement to
+
+ Apostolos Syropoulos (asyropoulos@yahoo.com)
+
+\endpreamble
+
+
+\keepsilent
+
+\generate{\generateFile{xecyrmongolian.sty}{f}{\from{xecyrmongolian.dtx}{xecyrmongolian}}}
+\postamble
+\endpostamble
+\Msg{**********************************************************}
+\Msg{* To finish installation you have to copy}
+\Msg{* the generated .sty file in the appropriate}
+\Msg{* directory and then to rehash your TeX system}
+\Msg{* Happy Mongolian (Xe|Lua)LaTeXing!}
+\Msg{**********************************************************}
+\endinput
diff --git a/language/mongolian/xecyrmongolian/xecyrmongolian.pdf b/language/mongolian/xecyrmongolian/xecyrmongolian.pdf
new file mode 100644
index 0000000000..142177d57b
--- /dev/null
+++ b/language/mongolian/xecyrmongolian/xecyrmongolian.pdf
Binary files differ