aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2016-05-19 19:56:12 +0200
committerRobert Alessi <alessi@robertalessi.net>2016-05-19 19:56:42 +0200
commit6d65061031b9ee35de8166131b249f8238141d2b (patch)
tree620e50f371e1cccbdc5428f3c3bc8766f65de995
parentf84ee7e82d37dac9180f352f29c68bac5c0c742a (diff)
downloadarabluatex-6d65061031b9ee35de8166131b249f8238141d2b.tar.gz
done implementing and documenting \arbup
-rw-r--r--arabluatex.dtx83
-rw-r--r--arabluatex_trans.lua2
2 files changed, 76 insertions, 9 deletions
diff --git a/arabluatex.dtx b/arabluatex.dtx
index 2e3dc7e..4396804 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -27,7 +27,7 @@
27%<package-info>\NeedsTeXFormat{LaTeX2e}[1999/12/01] 27%<package-info>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
28%<package-info>\ProvidesPackage{arabluatex} 28%<package-info>\ProvidesPackage{arabluatex}
29%<*package-info> 29%<*package-info>
30 [2016/05/09 v1.2 This is ArabTeX for LuaLaTeX] 30 [2016/05/19 v1.3 This is ArabTeX for LuaLaTeX]
31%</package-info> 31%</package-info>
32% 32%
33%<*driver> 33%<*driver>
@@ -136,7 +136,7 @@
136\setmainfont{Libertinus Serif} 136\setmainfont{Libertinus Serif}
137\setsansfont{Libertinus Sans} 137\setsansfont{Libertinus Sans}
138\setmonofont[Scale=.9]{Libertinus Mono} 138\setmonofont[Scale=.9]{Libertinus Mono}
139\usepackage{arabluatex}[2016/05/09] 139\usepackage{arabluatex}[2016/05/19]
140\usepackage{varioref} 140\usepackage{varioref}
141\usepackage{hypdoc} 141\usepackage{hypdoc}
142\hypersetup{unicode=true, colorlinks, allcolors=blue, 142\hypersetup{unicode=true, colorlinks, allcolors=blue,
@@ -189,7 +189,7 @@
189%</driver> 189%</driver>
190% \fi 190% \fi
191% 191%
192% \CheckSum{316} 192% \CheckSum{0}
193% 193%
194% \CharacterTable 194% \CharacterTable
195% {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 195% {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
@@ -903,6 +903,17 @@ consonants, though three of them are also used as vowels
903% \arb[voc]{^say'iN} \arb[trans]{^say'iN}. 903% \arb[voc]{^say'iN} \arb[trans]{^say'iN}.
904% \end{quote} 904% \end{quote}
905% 905%
906% In some cases, it may be useful to mark the root form of defective
907% words so as to produce a more accurate transliteration of ending
908% \arb[trans]{tanwIn}. As seen above, \arb[trans]{tanwIn} preceding
909% \arb[novoc]{_A} is written \meta{aN\_A} or \meta{aNY}. Such forms as
910% \arb[voc]{qA.diNI} may likewise be written \meta{iNI}:---
911% \begin{quote}
912% |al-qA.dI| \arb[voc]{al-qA.dI} \arb[trans]{al-qA.dI}, |qA.diyaN|
913% \arb[voc]{qA.diyaN} \arb[trans]{qA.diyaN}, |qA.diNI|
914% \arb[voc]{qA.diNI} \arb[trans]{qA.diNI}.
915% \end{quote}
916%
906% \subsection{Other orthographic signs} 917% \subsection{Other orthographic signs}
907% \paragraph{\arb[trans]{tA' marbU.taT}} 918% \paragraph{\arb[trans]{tA' marbU.taT}}
908% It is written \meta{T}: 919% It is written \meta{T}:
@@ -1759,6 +1770,50 @@ consonants, though three of them are also used as vowels
1759% argument of \cs{cap} vz. up to the first letter that is to be 1770% argument of \cs{cap} vz. up to the first letter that is to be
1760% uppercased, like so: |\cap{m}u.hammaduN|. 1771% uppercased, like so: |\cap{m}u.hammaduN|.
1761% 1772%
1773% \subsection{Additional note on \texttt{dmg} convention}
1774% \label{sec:additional-note-dmg}
1775% \NEWfeature{v1.3} According to \textcite[6]{dmg}, Arabic
1776% \arb[trans]{'i`rAb} may be rendered into |dmg| in three different
1777% ways:
1778% \begin{compactenum}[(a)]
1779% \item \label{ref:dmg-full-rend}In full:
1780% \NoArbUp\arb[trans]{\cap{`amruNU}}\ArbUpDflt\,;
1781% \item \label{ref:dmg-up-rend}As superscript text:
1782% \arb[trans]{\cap{`amruNU}}\,;
1783% \item Discarded: \arb[trans]{\cap{`amr}}.
1784% \end{compactenum}
1785% \DescribeMacro{\arbup} By default, \package{arabluatex} applies rule
1786% \ref{ref:dmg-up-rend}. Once delimited by a set of Lua functions,
1787% every \arb[trans]{tanwIn} is passed as an argument on to a
1788% \cs{arbup} command which is set to \cs{textsuperscript}.
1789%
1790% \DescribeMacro{\NoArbUp} \DescribeMacro{\ArbUpDflt} \cs{NoArbUp} may
1791% be used either in the preamble or at any point of the document in
1792% case one wishes to apply rule \ref{ref:dmg-full-rend}. The default
1793% rule \ref{ref:dmg-up-rend} can be set back with \cs{ArbUpDflt} at
1794% any point of the document.
1795%
1796% \DescribeMacro{\SetArbUp} Finally, \cs{SetArbUp}\marg{formatting
1797% directives} may be used to customize the way \arb[trans]{tanwIn} is
1798% displayed. To take one example, here is how Arabic
1799% \arb[trans]{'i`rAb} may be rendered as subscript text:---
1800% \iffalse
1801%<*example>
1802% \fi
1803\begin{arabluacode}
1804\SetArbUp{\textsubscript{#1}}
1805Arabic |dmg| transliteration for \arb{ra'aytu ^gAmi`aN
1806muhaddamaTaN mi'_danatu-hu}: \arb[trans]{ra'aytu
1807^gAmi`aN muhaddamaTaN mi'_danatu-hu.}
1808\end{arabluacode}
1809% \iffalse
1810%</example>
1811% \fi
1812%
1813% As shown in the above example, |#1| is the token that is replaced
1814% with the actual \arb[trans]{tanwIn} in the formatting directives of
1815% the \cs{SetArbUp} command.
1816%
1762% \subsection{Examples} 1817% \subsection{Examples}
1763% \label{sec:examples-translit} 1818% \label{sec:examples-translit}
1764% Here follows in transliteration the story of 1819% Here follows in transliteration the story of
@@ -2029,7 +2084,7 @@ wa-ya.sIru ta.hta 'l-jildi
2029% \begin{macrocode} 2084% \begin{macrocode}
2030\NeedsTeXFormat{LaTeX2e} 2085\NeedsTeXFormat{LaTeX2e}
2031\ProvidesPackage{arabluatex}% 2086\ProvidesPackage{arabluatex}%
2032[2016/05/09 v1.2 ArabTeX-like interface for LuaLaTeX] 2087[2016/05/19 v1.3 ArabTeX-like interface for LuaLaTeX]
2033\RequirePackage{ifluatex} 2088\RequirePackage{ifluatex}
2034% \end{macrocode} 2089% \end{macrocode}
2035% \package{arabluatex} requires \LuaLaTeX\ of course. Issue a warning 2090% \package{arabluatex} requires \LuaLaTeX\ of course. Issue a warning
@@ -2160,21 +2215,33 @@ wa-ya.sIru ta.hta 'l-jildi
2160% \end{macrocode} 2215% \end{macrocode}
2161% \end{macro} 2216% \end{macro}
2162% \begin{macro}{\arbup} 2217% \begin{macro}{\arbup}
2218% \changes{v1.3}{2016/05/19}{\arb[trans]{tanwIn} is now written as
2219% superscript text in \texttt{dmg} mode by default.}
2220% \begin{macro}{\NoArbUp}
2221% \begin{macro}{\ArbUpDflt}
2163% \begin{macro}{\SetArbUp} 2222% \begin{macro}{\SetArbUp}
2164% By default, \cs{arbup} is set to \cs{textsuperscript}. This is how 2223% By default, \cs{arbup} is set to \cs{textsuperscript}. This is how
2165% the \arb[trans]{tanwIn} that takes place at the end of a word 2224% the \arb[trans]{tanwIn} that takes place at the end of a word
2166% should be displayed in |dmg| mode. \cs{SetArbUp} may be used 2225% should be displayed in |dmg| mode. \cs{NoArbUp} may be used
2167% either in the preamble or at any point of the document to change 2226% either in the preamble or at any point of the document in case one
2168% the default definition. 2227% wishes to have the \arb[trans]{tanwIn} on the line. The default
2228% rule can be set back with \cs{ArbUpDflt} at any point of the
2229% document. Finally \cs{SetArbUp} may be used to customize the way
2230% \arb[trans]{tanwIn} is displayed: this command takes the
2231% formatting directives as argument, like so:
2232% \cs{SetArbUp}\marg{code}.
2169% \begin{macrocode} 2233% \begin{macrocode}
2170\NewDocumentCommand{\al@arbup@dflt}{m}{\textsuperscript{\thinspace#1}}% 2234\NewDocumentCommand{\al@arbup@dflt}{m}{\textsuperscript{#1}}%
2171\NewDocumentCommand{\al@arbup}{m}{\al@arbup@dflt{#1}} 2235\NewDocumentCommand{\al@arbup}{m}{\al@arbup@dflt{#1}}
2172\NewDocumentCommand{\arbup}{m}{\al@arbup{#1}} 2236\NewDocumentCommand{\arbup}{m}{\al@arbup{#1}}
2173\NewDocumentCommand{\ArbUpDflt}{}{\let\al@arbup=\al@arbup@dflt} 2237\NewDocumentCommand{\ArbUpDflt}{}{\let\al@arbup=\al@arbup@dflt}
2174\NewDocumentCommand{\NoArbUp}{}{\RenewDocumentCommand{\al@arbup}{m}{##1}} 2238\NewDocumentCommand{\NoArbUp}{}{\RenewDocumentCommand{\al@arbup}{m}{##1}}
2239\NewDocumentCommand{\SetArbUp}{m}{\RenewDocumentCommand{\al@arbup}{m}{#1}}
2175% \end{macrocode} 2240% \end{macrocode}
2176% \end{macro} 2241% \end{macro}
2177% \end{macro} 2242% \end{macro}
2243% \end{macro}
2244% \end{macro}
2178% \begin{macro}{\cap} Proper Arabic names or book titles should be 2245% \begin{macro}{\cap} Proper Arabic names or book titles should be
2179% passed to the command \cs{cap} so that they have their first letters 2246% passed to the command \cs{cap} so that they have their first letters
2180% uppercased. \cs{cap} is actually coded in Lua. 2247% uppercased. \cs{cap} is actually coded in Lua.
diff --git a/arabluatex_trans.lua b/arabluatex_trans.lua
index fbea94b..838bccc 100644
--- a/arabluatex_trans.lua
+++ b/arabluatex_trans.lua
@@ -199,7 +199,7 @@ trigraphstrdmg = { -- trigraphs or more
199 {a="(_a)U", b="A"}, 199 {a="(_a)U", b="A"},
200 {a="(_a)I", b="A"}, 200 {a="(_a)I", b="A"},
201 -- assimilations 201 -- assimilations
202 {a="(n)(})(%s)([rlmnwy])", b="%4%2%3%4"} 202 {a="(n)(}?)(%s)([rlmnwy])", b="%4%2%3%4"}
203} 203}
204 204
205trigraphstrdmgeasy = { -- see the differences below under 'easy' tag 205trigraphstrdmgeasy = { -- see the differences below under 'easy' tag