From 332f1b5c403c5e8c5f9aff8dbb00989c5609dd26 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Wed, 30 Mar 2016 15:54:25 +0200 Subject: added README.tex; cleaning up --- README.tex | 83 +++++++++++++++++++++++ arabluatex.dtx | 4 +- arabluatex.ins | 6 +- arabluatex.lua | 10 +-- arabluatex_fullvoc.lua | 63 ++++++++--------- arabluatex_novoc.lua | 28 +++----- arabluatex_trans.lua | 178 +++++++++++++++++++++++-------------------------- arabluatex_voc.lua | 84 +++++++++-------------- 8 files changed, 241 insertions(+), 215 deletions(-) create mode 100644 README.tex diff --git a/README.tex b/README.tex new file mode 100644 index 0000000..916eb0e --- /dev/null +++ b/README.tex @@ -0,0 +1,83 @@ +\documentclass{article} + +\usepackage{fontspec,luatextra} + +\title{The arabluatex package} +\author{Robert Alessi} +\usepackage{hyperref} + +\begin{document} +\maketitle + +\section*{Overview} +\label{sec:overview} +This package provides for \LuaLaTeX\ an Arab{\TeX}-like interface to +generate Arabic writing from an \textsc{ascii} transliteration. It is +particularly well-suited for complex documents such as technical +documents or critical editions where a lot of left-to-right commands +intertwine with Arabic writing. arabluatex is able to +process any Arab\TeX\ input notation. Its output can be set in the +same modes of vocalization as Arab\TeX, or in different roman +transliterations. It further allows many typographical refinements. It +will eventually interact with some other packages yet to come to +produce from \verb|.tex| source files, in addition to printed books, +\texttt{TEI xml} compliant critical editions and/or lexicons that can +be searched, analyzed and correlated in various ways. + +\section*{License and disclamer} +Copyright \textcopyright\ 2016 Robert Alessi + +\addcontentsline{toc}{section}{License and disclamer} Please send +error reports and suggestions for improvements to Robert Alessi: +\begin{itemize} +\item email: \url{alessi@robertalessi.net} +\item website: \url{http://www.robertalessi.net/arabluatex} +\end{itemize} + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. + +This release of arabluatex consists of the following +source files: +\begin{itemize} +\item \verb|arabluatex.ins| +\item \verb|arabluatex.dtx| +\item \verb|arabluatex.lua| +\item \verb|arabluatex_voc.lua| +\item \verb|arabluatex_fullvoc.lua| +\item \verb|arabluatex_novoc.lua| +\item \verb|arabluatex_trans.lua| +\item \verb|arabluatex.bib| +\end{itemize} + +\section*{Installation} +\label{sec:installation} +\begin{enumerate} +\item run \verb+lualatex arabluatex.ins+ to produce the + \verb+arabluatex.sty+ file; +\item To finish the installation you have to move the following files +into a directory searched by LaTeX. See the FAQ on CTAN at +/help/uk-tex-faq for more on this: +\begin{itemize} +\item \verb|arabluatex.sty| +\item \verb|arabluatex.lua| +\item \verb|arabluatex_voc.lua| +\item \verb|arabluatex_fullvoc.lua| +\item \verb|arabluatex_novoc.lua| +\item \verb|arabluatex_trans.lua| +\end{itemize} +\end{enumerate} + +\end{document} \ No newline at end of file diff --git a/arabluatex.dtx b/arabluatex.dtx index 89501d9..7321576 100644 --- a/arabluatex.dtx +++ b/arabluatex.dtx @@ -1,5 +1,5 @@ % \iffalse meta-comment -% copyright (C) 2016 Robert Alessi +% Copyright (C) 2016 Robert Alessi % % Please send error reports and suggestions for improvements to % Robert Alessi @@ -164,6 +164,8 @@ % \end{abstract} % % \section*{License and disclamer} +% Copyright \textcopyright\ 2016 Robert Alessi +% % \addcontentsline{toc}{section}{License and disclamer} Please send % error reports and suggestions for improvements to Robert Alessi: % \begin{compactitem} diff --git a/arabluatex.ins b/arabluatex.ins index 614184f..30e6d92 100644 --- a/arabluatex.ins +++ b/arabluatex.ins @@ -1,4 +1,4 @@ -%% copyright (C) 2016 Robert Alessi +%% Copyright (C) 2016 Robert Alessi %% %% Please send error reports and suggestions for improvements to %% Robert Alessi @@ -38,7 +38,7 @@ This is a generated file. -copyright (C) 2016 Robert Alessi +Copyright (C) 2016 Robert Alessi Please send error reports and suggestions for improvements to Robert Alessi @@ -75,7 +75,7 @@ This release of 'arabluatex' consists of the following source files: \Msg{***********************************************************} \Msg{*} \Msg{* To finish the installation you have to move the following} -\Msg{* file(s) into a directory searched by LaTeX. See the FAQ on} +\Msg{* files into a directory searched by LaTeX. See the FAQ on} \Msg{* CTAN at /help/uk-tex-faq for more on this.} \Msg{*} \Msg{* \space\space arabluatex.sty} diff --git a/arabluatex.lua b/arabluatex.lua index 15ddeef..f6597e8 100644 --- a/arabluatex.lua +++ b/arabluatex.lua @@ -1,7 +1,7 @@ --[[ This file is part of the `arabluatex' package -copyright (C) 2016 Robert Alessi +Copyright (C) 2016 Robert Alessi Please send error reports and suggestions for improvements to Robert Alessi @@ -371,11 +371,3 @@ function cap(str) end return str end - ---print(processvoc("'at_A .sadIquN 'il_A ju.hA ya.tlubu min-hu .himAra-hu li-yarkiba-hu fI safraTiN qa.sIraTiN wa-qAla la-hu sawfa 'u`Idu-hu 'ilay-ka fI 'l-masA'i wa-'adfa`u la-ka 'ujraTaN 'at_A .sadIquN 'il_A ju.hA ya.tlubu min-hu .himAra-hu li-yarkiba-hu fI safraTiN qa.sIraTiN wa-qAla la-hu sawfa 'u`Idu-hu 'ilay-ka fI 'l-masA'i wa-'adfa`u la-ka 'ujraTaN")) ---print(arbnum("bop 0123456789")) ---print(processvoc("daxala \\arb[novoc]{mubtasimaN}")) ---print(processvoc("\\emph{daxala} \\arb[novoc]{mufakkiruN}\\Footnote{\\arb{kataba \\arb[novoc]{mubtasimaN}} Je pense que c'est bien \\arb{kataba}} faqa.t")) ---print(processvoc("daxala \\abjad{45} mubtasimaN")) ---print(process("daxala\\Footnote{Et là c'est toujours \\arb{mubtasimaN}?")) ---print(process("\\emph{daxala}\\Footnote{texte arabe: \\arb{\\emph{kataba}}} \\textbf{\\emph{mubtasimaN}} faqa.t")) diff --git a/arabluatex_fullvoc.lua b/arabluatex_fullvoc.lua index d9e9f04..317d607 100644 --- a/arabluatex_fullvoc.lua +++ b/arabluatex_fullvoc.lua @@ -1,7 +1,7 @@ --[[ This file is part of the `arabluatex' package -copyright (C) 2016 Robert Alessi +Copyright (C) 2016 Robert Alessi Please send error reports and suggestions for improvements to Robert Alessi @@ -60,14 +60,6 @@ hamzafv = { {a="(%W)(')([ua])", b="%1أ%3"}, {a="(%W)(')(i)", b="%1إ%3"}, -- final --- {a="([Iy])(')(aN)$", b="%1ئ%3"}, --- {a="([Iy])(')(aN)(%W)", b="%1ئ%3%4"}, --- {a="([^uai])(')([uai]N?)$", b="%1ء%3"}, --- {a="([^uai])(')([uai]N?)(%W)", b="%1ء%3%4"}, --- {a="([UI])(')([uai])$", b="%1ء%3"}, --- {a="([UI])(')([uai])(%W)", b="%1ء%3%4"}, --- {a="([UI])(')([uai]N?)$", b="%1ء%3"}, --- {a="([UI])(')([uai]N?)(%W)", b="%1ء%3%4"}, -- ^say'aN and .zim'aN are special orthographies {a="(%^say)(%')(aN)", b="%1ئ%3"}, {a="(.zi?m)(%')(aN)", b="%1ئ%3"}, @@ -219,7 +211,8 @@ digraphsfv = { {a="(aw)(%s)(\"?[uai])", b="%1u%2ٱ"}, {a="(ay)(%s)(\"?[uai])", b="%1i%2ٱ"}, {a="([uai]%-)(\"?[uai])", b="%1ٱ"}, -- hyphen + initial alif without hamza - {a="([%_]?[uaiUAIY])(%s)(\"?[uai])", b="%1%2ٱ"}, -- initial alif without hamza + -- initial alif without hamza + {a="([%_]?[uaiUAIY])(%s)(\"?[uai])", b="%1%2ٱ"}, {a="^([uai])", b="ا%1"}, -- initial alif without hamza {a="(%s)([uai])", b="%1ا%2"}, -- initial alif without hamza {a="%-%-", b="ـ"}, @@ -295,29 +288,29 @@ digraphsfv = { } singlefv = { - {a="b", b="ب"}, - {a="t", b="ت"}, - {a="j", b="ج"}, - {a="x", b="خ"}, - {a="d", b="د"}, - {a="r", b="ر"}, - {a="z", b="ز"}, - {a="s", b="س"}, - {a="f", b="ف"}, - {a="`", b="ع"}, - {a="f", b="ف"}, - {a="q", b="ق"}, - {a="k", b="ك"}, - {a="l", b="ل"}, - {a="m", b="م"}, - {a="n", b="ن"}, - {a="h", b="ه"}, - {a="w", b="و"}, - {a="y", b="ي"}, - {a="T", b="ة"}, - {a="\"$", b=""}, - {a="\"(%W)", b="%1"}, - {a="\"([^uaiUAI])", b="%1"}, - {a="([^0-9])%-([^0-9])", b="%1%2"}, - {a="B", b="ـ"}, + {a="b", b="ب"}, + {a="t", b="ت"}, + {a="j", b="ج"}, + {a="x", b="خ"}, + {a="d", b="د"}, + {a="r", b="ر"}, + {a="z", b="ز"}, + {a="s", b="س"}, + {a="f", b="ف"}, + {a="`", b="ع"}, + {a="f", b="ف"}, + {a="q", b="ق"}, + {a="k", b="ك"}, + {a="l", b="ل"}, + {a="m", b="م"}, + {a="n", b="ن"}, + {a="h", b="ه"}, + {a="w", b="و"}, + {a="y", b="ي"}, + {a="T", b="ة"}, + {a="\"$", b=""}, + {a="\"(%W)", b="%1"}, + {a="\"([^uaiUAI])", b="%1"}, + {a="([^0-9])%-([^0-9])", b="%1%2"}, + {a="B", b="ـ"}, } diff --git a/arabluatex_novoc.lua b/arabluatex_novoc.lua index 8a5a7ed..d8e1248 100644 --- a/arabluatex_novoc.lua +++ b/arabluatex_novoc.lua @@ -1,7 +1,7 @@ --[[ This file is part of the `arabluatex' package -copyright (C) 2016 Robert Alessi +Copyright (C) 2016 Robert Alessi Please send error reports and suggestions for improvements to Robert Alessi @@ -82,7 +82,7 @@ tanwinnv = { {a="uNU", b="و"}, {a="aNU", b="وا"}, {a="iNU", b="و"}, - -- assimilations (begin) + -- assimilations (begin). These are good but may not apply here. -- {a="(uN)(%s)([rlmnwy])", b="|%2%3%3"}, -- {a="(aN)(_A)(%s)([rlmnwy])", b="ى%3%4%4"}, -- {a="(aN)(Y)(%s)([rlmnwy])", b="ى%3%4%4"}, @@ -127,22 +127,10 @@ longvnv = { } shortvnv = { - {a="\"u", b="ُ"}, - {a="\"a", b="َ"}, - {a="\"i", b="ِ"}, - {a="u", b=""}, - {a="a", b=""}, - {a="i", b=""} + {a="\"u", b="ُ"}, + {a="\"a", b="َ"}, + {a="\"i", b="ِ"}, + {a="u", b=""}, + {a="a", b=""}, + {a="i", b=""} } - --- return { --- raw = raw, --- hamza = hamza, --- trigraphs = trigraphs, --- tanwin = tanwin, --- digraphs = digraphs, --- single = single, --- longv = longv, --- shortv = shortv, --- null =null --- } diff --git a/arabluatex_trans.lua b/arabluatex_trans.lua index 8d62362..99d3712 100644 --- a/arabluatex_trans.lua +++ b/arabluatex_trans.lua @@ -1,7 +1,7 @@ --[[ This file is part of the `arabluatex' package -copyright (C) 2016 Robert Alessi +Copyright (C) 2016 Robert Alessi Please send error reports and suggestions for improvements to Robert Alessi @@ -33,6 +33,40 @@ nulltr = { {a="%|", b=""} } +-- cap +captr = { + -- dmg (defaut); loc as well + {a="ā", b="Ā"}, + {a="b", b="B"}, + {a="t", b="T"}, + {a="ṯ", b="Ṯ"}, + {a="ǧ", b="Ǧ"}, + {a="ḥ", b="Ḥ"}, + {a="ḫ", b="Ḫ"}, + {a="d", b="D"}, + {a="ḏ", b="Ḏ"}, + {a="r", b="R"}, + {a="z", b="Z"}, + {a="s", b="S"}, + {a="š", b="Š"}, + {a="ṣ", b="Ṣ"}, + {a="ḍ", b="Ḍ"}, + {a="ṭ", b="Ṭ"}, + {a="ẓ", b="Ẓ"}, + {a="ġ", b="Ġ"}, + {a="f", b="F"}, + {a="q", b="Q"}, + {a="k", b="K"}, + {a="l", b="L"}, + {a="m", b="M"}, + {a="n", b="N"}, + {a="h", b="H"}, + {a="w", b="W"}, + {a="ū", b="Ū"}, + {a="y", b="Y"}, + {a="ī", b="Ī"} +} + -- dmg hamzatrdmg = { @@ -210,27 +244,27 @@ digraphstrdmg = { } singletrdmg = { - {a="b", b="b"}, - {a="t", b="t"}, - {a="j", b="ǧ"}, - {a="x", b="ḫ"}, - {a="d", b="d"}, - {a="r", b="r"}, - {a="z", b="z"}, - {a="s", b="s"}, - {a="`", b="ʿ"}, - {a="f", b="f"}, - {a="q", b="q"}, - {a="k", b="k"}, - {a="l", b="l"}, - {a="m", b="m"}, - {a="n", b="n"}, - {a="h", b="h"}, - {a="w", b="w"}, - {a="y", b="y"}, - {a="T", b="t"}, - {a="\"", b=""}, - {a="B", b=""} + {a="b", b="b"}, + {a="t", b="t"}, + {a="j", b="ǧ"}, + {a="x", b="ḫ"}, + {a="d", b="d"}, + {a="r", b="r"}, + {a="z", b="z"}, + {a="s", b="s"}, + {a="`", b="ʿ"}, + {a="f", b="f"}, + {a="q", b="q"}, + {a="k", b="k"}, + {a="l", b="l"}, + {a="m", b="m"}, + {a="n", b="n"}, + {a="h", b="h"}, + {a="w", b="w"}, + {a="y", b="y"}, + {a="T", b="t"}, + {a="\"", b=""}, + {a="B", b=""} } longvtrdmg = { @@ -241,9 +275,9 @@ longvtrdmg = { } shortvtrdmg = { - {a="u", b="u"}, - {a="a", b="a"}, - {a="i", b="i"} + {a="u", b="u"}, + {a="a", b="a"}, + {a="i", b="i"} } -- loc @@ -408,27 +442,27 @@ digraphstrloc = { } singletrloc = { - {a="b", b="b"}, - {a="t", b="t"}, - {a="j", b="j"}, - {a="x", b="kh"}, - {a="d", b="d"}, - {a="r", b="r"}, - {a="z", b="z"}, - {a="s", b="s"}, - {a="`", b="`"}, - {a="f", b="f"}, - {a="q", b="q"}, - {a="k", b="k"}, - {a="l", b="l"}, - {a="m", b="m"}, - {a="n", b="n"}, - {a="h", b="h"}, - {a="w", b="w"}, - {a="y", b="y"}, - {a="T", b="t"}, - {a="\"", b=""}, - {a="B", b=""} + {a="b", b="b"}, + {a="t", b="t"}, + {a="j", b="j"}, + {a="x", b="kh"}, + {a="d", b="d"}, + {a="r", b="r"}, + {a="z", b="z"}, + {a="s", b="s"}, + {a="`", b="`"}, + {a="f", b="f"}, + {a="q", b="q"}, + {a="k", b="k"}, + {a="l", b="l"}, + {a="m", b="m"}, + {a="n", b="n"}, + {a="h", b="h"}, + {a="w", b="w"}, + {a="y", b="y"}, + {a="T", b="t"}, + {a="\"", b=""}, + {a="B", b=""} } longvtrloc = { @@ -439,57 +473,11 @@ longvtrloc = { } shortvtrloc = { - {a="u", b="u"}, - {a="a", b="a"}, - {a="i", b="i"} + {a="u", b="u"}, + {a="a", b="a"}, + {a="i", b="i"} } finaltrloc = { {a="ʾ", b="'"}, } - --- cap -captr = { - -- dmg (defaut); loc as well - {a="ā", b="Ā"}, - {a="b", b="B"}, - {a="t", b="T"}, - {a="ṯ", b="Ṯ"}, - {a="ǧ", b="Ǧ"}, - {a="ḥ", b="Ḥ"}, - {a="ḫ", b="Ḫ"}, - {a="d", b="D"}, - {a="ḏ", b="Ḏ"}, - {a="r", b="R"}, - {a="z", b="Z"}, - {a="s", b="S"}, - {a="š", b="Š"}, - {a="ṣ", b="Ṣ"}, - {a="ḍ", b="Ḍ"}, - {a="ṭ", b="Ṭ"}, - {a="ẓ", b="Ẓ"}, - {a="ġ", b="Ġ"}, - {a="f", b="F"}, - {a="q", b="Q"}, - {a="k", b="K"}, - {a="l", b="L"}, - {a="m", b="M"}, - {a="n", b="N"}, - {a="h", b="H"}, - {a="w", b="W"}, - {a="ū", b="Ū"}, - {a="y", b="Y"}, - {a="ī", b="Ī"} -} - --- return { --- raw = raw, --- hamza = hamza, --- trigraphs = trigraphs, --- tanwin = tanwin, --- digraphs = digraphs, --- single = single, --- longv = longv, --- shortv = shortv, --- null =null --- } diff --git a/arabluatex_voc.lua b/arabluatex_voc.lua index 2660ed8..4983ad0 100644 --- a/arabluatex_voc.lua +++ b/arabluatex_voc.lua @@ -1,7 +1,7 @@ --[[ This file is part of the `arabluatex' package -copyright (C) 2016 Robert Alessi +Copyright (C) 2016 Robert Alessi Please send error reports and suggestions for improvements to Robert Alessi @@ -92,14 +92,6 @@ hamza = { {a="(%W)(')([ua])", b="%1أ%3"}, {a="(%W)(')(i)", b="%1إ%3"}, -- final --- {a="([Iy])(')(aN)$", b="%1ئ%3"}, --- {a="([Iy])(')(aN)(%W)", b="%1ئ%3%4"}, --- {a="([^uai])(')([uai]N?)$", b="%1ء%3"}, --- {a="([^uai])(')([uai]N?)(%W)", b="%1ء%3%4"}, --- {a="([UI])(')([uai])$", b="%1ء%3"}, --- {a="([UI])(')([uai])(%W)", b="%1ء%3%4"}, --- {a="([UI])(')([uai]N?)$", b="%1ء%3"}, --- {a="([UI])(')([uai]N?)(%W)", b="%1ء%3%4"}, -- ^say'aN and .zim'aN are special orthographies {a="(%^say)(%')(aN)", b="%1ئ%3"}, {a="(.zi?m)(%')(aN)", b="%1ئ%3"}, @@ -312,31 +304,31 @@ digraphs = { } single = { - {a="b", b="ب"}, - {a="t", b="ت"}, - {a="j", b="ج"}, - {a="x", b="خ"}, - {a="d", b="د"}, - {a="r", b="ر"}, - {a="z", b="ز"}, - {a="s", b="س"}, - {a="f", b="ف"}, - {a="`", b="ع"}, - {a="f", b="ف"}, - {a="q", b="ق"}, - {a="k", b="ك"}, - {a="l", b="ل"}, - {a="m", b="م"}, - {a="n", b="ن"}, - {a="h", b="ه"}, - {a="w", b="و"}, - {a="y", b="ي"}, - {a="T", b="ة"}, - {a="\"$", b="ْ"}, - {a="\"(%W)", b="ْ%1"}, - {a="\"([^uaiUAI])", b="ْ%1"}, - {a="([^0-9])%-([^0-9])", b="%1%2"}, - {a="B", b="ـ"} + {a="b", b="ب"}, + {a="t", b="ت"}, + {a="j", b="ج"}, + {a="x", b="خ"}, + {a="d", b="د"}, + {a="r", b="ر"}, + {a="z", b="ز"}, + {a="s", b="س"}, + {a="f", b="ف"}, + {a="`", b="ع"}, + {a="f", b="ف"}, + {a="q", b="ق"}, + {a="k", b="ك"}, + {a="l", b="ل"}, + {a="m", b="م"}, + {a="n", b="ن"}, + {a="h", b="ه"}, + {a="w", b="و"}, + {a="y", b="ي"}, + {a="T", b="ة"}, + {a="\"$", b="ْ"}, + {a="\"(%W)", b="ْ%1"}, + {a="\"([^uaiUAI])", b="ْ%1"}, + {a="([^0-9])%-([^0-9])", b="%1%2"}, + {a="B", b="ـ"} } longv = { @@ -351,12 +343,12 @@ longv = { } shortv = { - {a="\"u", b=""}, - {a="\"a", b=""}, - {a="\"i", b=""}, - {a="u", b="ُ"}, - {a="a", b="َ"}, - {a="i", b="ِ"} + {a="\"u", b=""}, + {a="\"a", b=""}, + {a="\"i", b=""}, + {a="u", b="ُ"}, + {a="a", b="َ"}, + {a="i", b="ِ"} } punctuation = { @@ -376,15 +368,3 @@ null = { {a="%|", b=""}, {a="([^0-9])(%-)", b="%1"} } - --- return { --- raw = raw, --- hamza = hamza, --- trigraphs = trigraphs, --- tanwin = tanwin, --- digraphs = digraphs, --- single = single, --- longv = longv, --- shortv = shortv, --- null =null --- } -- cgit v1.2.3