From e23d740f2c94f7e105eabade859149e559038104 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Thu, 10 Mar 2016 20:21:12 +0100 Subject: writing documentation (continued) + added quoting u|a|i --- arabluatex.bib | 32 +++++++++++++++++++++++--- arabluatex.dtx | 61 +++++++++++++++++++++++++++++++++++++++++--------- arabluatex_fullvoc.lua | 4 +++- arabluatex_novoc.lua | 3 +++ arabluatex_voc.lua | 7 +++++- 5 files changed, 91 insertions(+), 16 deletions(-) diff --git a/arabluatex.bib b/arabluatex.bib index cd56afc..1023e84 100644 --- a/arabluatex.bib +++ b/arabluatex.bib @@ -20,14 +20,40 @@ % Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA % 02111-1307, USA. -@package{pkg:arabtex, +@software{pkg:arabtex, author = {Lagally, Klaus}, maintainer = {Lagally, Klaus}, title = {Arab\TeX}, + indextitle = {Arab\TeX}, date = {2004-11-03}, - version = {4.00}, + version = {4.00}, url = - {http://mirrors.ctan.org/language/arabic/arabtex/doc/html/arabtex.htm}, + {http://mirrors.ctan.org/language/arabic/arabtex/doc/html/arabtex.htm}, subtitle = {Typesetting Arabic and Hebrew}, titleaddon = {User Manual Version 4.00} } + +@software{pkg:amiri, + author = {Hosny, Khaled}, + maintainer = {Hosny, Khaled}, + title = {Amiri}, + indextitle = {Amiri}, + date = {2015-09-20}, + url = {http://www.amirifont.org/} +} + +@MVBook{Wright, + author = {Wright, W. LL.D}, + title = {A Grammar of the Arabic Language}, + indextitle = {Grammar of the Arabic Language, A}, + year = 1896, + editor = {Robertson Smith, W. and de Goeje, M. J.}, + editortype = {reviser}, + edition = 3, + volumes = 2, + pagination = {none}, + publisher = {Librairie du Liban}, + location = {Beirut}, + annote = {New impression, 1996} +} + diff --git a/arabluatex.dtx b/arabluatex.dtx index 797af14..54e5024 100644 --- a/arabluatex.dtx +++ b/arabluatex.dtx @@ -44,18 +44,25 @@ \usepackage{hypdoc} \hypersetup{colorlinks, allcolors=blue} \usepackage{multicol} -\newcommand{\package}[1]{\textsf{#1}} \usepackage{paralist} \setdefaultitem{\textendash}{\textendash}{\textendash}{\textendash} \usepackage{longtable} \usepackage{booktabs} \usepackage{tikz} -\usepackage[skins,listings]{tcolorbox} -\newtcblisting{arabluacode}[1]{colback=white, boxrule=.15mm, - colframe=red!50!white, listing options={style=tcblatex, - numbers=left, numberstyle=\tiny}, #1} +\usepackage[breakable, skins,listings,xparse]{tcolorbox} +\DeclareTCBListing{arabluacode}{s}{colback=white, boxrule=.15mm, + colframe=red!50!white, listing options={style=tcblatex, + numbers=left, numberstyle=\tiny}, IfBooleanTF={#1}{listing side + text}{}} +\DeclareTotalTCBox{\arabluaverb}{v}{verbatim, colback=white, + boxrule=.15mm, colframe=red!50!white}{#1} +\DeclareTotalTCBox{\arabluabox}{m}{left=0mm, right=0mm, top=0mm, + bottom=0mm, colback=white, boxrule=.15mm, + colframe=red!50!white}{#1} +\newcommand{\package}[1]{\textsf{#1}\index{#1=#1 (package)}} \usepackage{csquotes} -\usepackage[style=authoryear, natbib]{biblatex} +\usepackage[style=authoryear, indexing=cite]{biblatex} +\DeclareIndexFieldFormat{indextitle}{\index{#1=\emph{#1}}} \addbibresource{arabluatex.bib} \EnableCrossrefs \CodelineIndex @@ -253,16 +260,47 @@ % % \section{Usage} % \subsection{Activating \package{arabluatex}} -% As usual put in your preamble: -% |\usepackage{arabluatex}| +% As usual put in your preamble:\\ +% \arabluaverb{\usepackage{arabluatex}}\\ % The only requirement of \package{arabluatex} is \LuaLaTeX; it will % complain if you try to compile your document with another % engine. That aside, \package{arabluatex} does not load packages such % as \package{polyglossia} or \package{luabidi}. It can work with -% \package{polyglossia} but does not require it. +% \package{polyglossia} though, but does not require it. +% +% \paragraph{Font setup} +% If you wish to use your own Arabic font, you can define it before +% loading \package{arabluatex}. Assuming that \package{fontspec} is +% loaded, put this in your preamble just above the line that loads +% \package{arabluatex}: +% \arabluabox{\cs{newfontfamily}\cs{arabicfont}[Script=Arabic]\marg{fontname}} +% \noindent where \meta{fontname} is the standard name of the Arabic +% font you wish to use. +% +% By default, if no Arabic font is selected, \package{arabluatex} will +% issue a warning message and attempt to load the Amiri +% font\footnote{\textcite{pkg:amiri}.} like so:\\ +% \arabluaverb{\newfontfamily\arabicfont[Script=Arabic]{Amiri}} +% \begin{quote}\footnotesize +% \textbf{Rem.} By default Amiri places the \arb[trans]{kasra} in +% combination with the \arb[trans]{ta^sdId} below the consonant, +% like so: \arb{BBi}\,. This is correct, as at least in the oldest +% manuscripts {\newfontfamily\arabicfont[Script=Arabic, +% RawFeature={+ss05}]{Amiri}\arb{BBi}} may stand for \arb{BBa} as +% well as \arb{BBi}\,. See \textcite[i.14.C--D]{Wright}. The placement +% of the \arb[trans]{kasra} above the consonant may be obtained by +% selecting the |ss05| feature of the Amiri font, like +% so:\footnote{See the documentation of \package{amiri}, +% \textcite[5]{pkg:amiri}.}\\ +% \arabluaverb{\newfontfamily\arabicfont[Script=Arabic,RawFeature={+ss05}]{Amiri}} +% +% Other Arabic fonts may behave differently. +% \end{quote} +% +% \subsection{Options} +% % -% \DescribeOption{voc} -% good for me +% \DescribeOption{voc}\hfill\arabluaverb{default}\\ good for me % \begin{itemize} % \item voc Vocalized Arabic % \item novoc Full vocalized Arabic @@ -332,6 +370,7 @@ \def\al@mode@novoc{novoc} \def\al@mode@trans{trans} % \newif\ifal@mode@defined +\RequirePackage{fontspec} \RequirePackage{amsmath} \RequirePackage{etoolbox} \RequirePackage{luacode} diff --git a/arabluatex_fullvoc.lua b/arabluatex_fullvoc.lua index 0b591e7..8fb564e 100644 --- a/arabluatex_fullvoc.lua +++ b/arabluatex_fullvoc.lua @@ -173,6 +173,8 @@ digraphsfv = { {a="ww", b="وّ"}, {a="yy", b="يّ"}, -- sukūn begin + {a="\"", b=""}, + {a="([%_%^%.]?[btjghxdrzs%`fqklmnwy])$", b="%1ْ"}, {a="([%_%^%.]?[btjghxdrzs%`fqklmnwy])([%s])", b="%1ْ%2"}, {a="([%_%^%.]?[btjghxdrzs%`fqklmnwy])([^%_uaiUAIًٌٍ])", b="%1ْ%2"}, -- sukūn end @@ -197,5 +199,5 @@ digraphsfv = { {a="%.b", b="ٮ"}, {a="%.f", b="ڡ"}, {a="%.k", b="ک"}, - {a="%.n", b="ں"} + {a="%.n", b="ں"}, } diff --git a/arabluatex_novoc.lua b/arabluatex_novoc.lua index 199059b..b6d59d2 100644 --- a/arabluatex_novoc.lua +++ b/arabluatex_novoc.lua @@ -43,6 +43,9 @@ longvnv = { } shortvnv = { + {a="\"u", b="ُ"}, + {a="\"a", b="َ"}, + {a="\"i", b="ِ"}, {a="u", b=""}, {a="a", b=""}, {a="i", b=""} diff --git a/arabluatex_voc.lua b/arabluatex_voc.lua index 9451074..25d46bb 100644 --- a/arabluatex_voc.lua +++ b/arabluatex_voc.lua @@ -269,7 +269,9 @@ single = { {a="w", b="و"}, {a="y", b="ي"}, {a="T", b="ة"}, - {a="\"", b="ْ"}, + {a="\"$", b="ْ"}, + {a="\"(%W)", b="ْ%1"}, + {a="\"([^uaiUAI])", b="ْ%1"}, {a="([^0-9])%-([^0-9])", b="%1%2"}, {a="B", b="ـ"} } @@ -282,6 +284,9 @@ longv = { } shortv = { + {a="\"u", b="ُ"}, + {a="\"a", b="َ"}, + {a="\"i", b="ِ"}, {a="u", b="ُ"}, {a="a", b="َ"}, {a="i", b="ِ"} -- cgit v1.2.3