diff options
-rw-r--r-- | arabluatex.dtx | 321 |
1 files changed, 297 insertions, 24 deletions
diff --git a/arabluatex.dtx b/arabluatex.dtx index e1a5d29..041620c 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/11/14 v1.5 An ArabTeX-like interface for LuaLaTeX] | 30 | [2016/12/15 v1.6 An ArabTeX-like interface for LuaLaTeX] |
31 | %</package-info> | 31 | %</package-info> |
32 | % | 32 | % |
33 | %<*driver> | 33 | %<*driver> |
@@ -145,7 +145,7 @@ | |||
145 | \defaultfontfeatures{RawFeature={+liga}} | 145 | \defaultfontfeatures{RawFeature={+liga}} |
146 | \setmainfont{Old Standard}[SmallCapsFont={Latin Modern Roman Caps}, | 146 | \setmainfont{Old Standard}[SmallCapsFont={Latin Modern Roman Caps}, |
147 | RawFeature={+mark;+ccmp;+ss05;+ss06}] | 147 | RawFeature={+mark;+ccmp;+ss05;+ss06}] |
148 | \usepackage{arabluatex}[2016/11/14] | 148 | \usepackage{arabluatex}[2016/12/15] |
149 | \usepackage[nopar]{quran} | 149 | \usepackage[nopar]{quran} |
150 | \usepackage{varioref} | 150 | \usepackage{varioref} |
151 | \usepackage{hypdoc} | 151 | \usepackage{hypdoc} |
@@ -160,6 +160,7 @@ | |||
160 | \quotingsetup{noorphans, rightmargin=0pt} | 160 | \quotingsetup{noorphans, rightmargin=0pt} |
161 | \renewcommand*{\quotingfont}{\footnotesize} | 161 | \renewcommand*{\quotingfont}{\footnotesize} |
162 | \usepackage[position=below]{caption} | 162 | \usepackage[position=below]{caption} |
163 | \usepackage{lineno} | ||
163 | \usepackage{longtable} | 164 | \usepackage{longtable} |
164 | \usepackage{booktabs} | 165 | \usepackage{booktabs} |
165 | \usepackage[defaultlines=3,all]{nowidow} | 166 | \usepackage[defaultlines=3,all]{nowidow} |
@@ -1203,6 +1204,7 @@ vowels (see §~3). | |||
1203 | % \end{compactenum} | 1204 | % \end{compactenum} |
1204 | % | 1205 | % |
1205 | % \paragraph{The definite article and the \arb[trans]{'alif-u 'l-wa.sl-i}} | 1206 | % \paragraph{The definite article and the \arb[trans]{'alif-u 'l-wa.sl-i}} |
1207 | % \label{ref:definite-article} | ||
1206 | % At the beginning of a sentence, \arb[fullvoc]{"a} is never written, | 1208 | % At the beginning of a sentence, \arb[fullvoc]{"a} is never written, |
1207 | % as \arb[fullvoc]{'l-.hamd-u li-ll_ah-i}; instead, to indicate that | 1209 | % as \arb[fullvoc]{'l-.hamd-u li-ll_ah-i}; instead, to indicate that |
1208 | % the \arb[trans]{'alif} is a connective \arb[trans]{'alif} | 1210 | % the \arb[trans]{'alif} is a connective \arb[trans]{'alif} |
@@ -1778,6 +1780,275 @@ vowels (see §~3). | |||
1778 | % \arb[trans]{\abjad{45}: kitAbu-hu fI 'l-\cap{`AdAt-i}}. | 1780 | % \arb[trans]{\abjad{45}: kitAbu-hu fI 'l-\cap{`AdAt-i}}. |
1779 | % \end{quote} | 1781 | % \end{quote} |
1780 | % | 1782 | % |
1783 | % \section{Arabic poetry} | ||
1784 | % \label{sec:poetry} | ||
1785 | % \NEWfeature{v1.6} \package{arabluatex} provides a special | ||
1786 | % environment for typesetting Arabic poetry. Every line in this | ||
1787 | % environment must end with |\\|. | ||
1788 | % | ||
1789 | % \DescribeEnv{arabverse} The |arabverse| environment may take up to | ||
1790 | % six optional \enquote*{named arguments} each of which is set using | ||
1791 | % the syntax \meta{key}$=$\meta{value}, like so:---% | ||
1792 | % \iffalse | ||
1793 | %<*example> | ||
1794 | % \fi | ||
1795 | \begin{arabluaverbatim} | ||
1796 | \begin{arabverse}[key1=value1, key2=value2, ...] | ||
1797 | <verses> | ||
1798 | \end{arabverse} | ||
1799 | \end{arabluaverbatim} | ||
1800 | % \iffalse | ||
1801 | %</example> | ||
1802 | % \fi | ||
1803 | % | ||
1804 | % The description of the optional arguments follows:--- | ||
1805 | % | ||
1806 | % \DescribeOption{mode} |mode|$=$\meta{mode}, either |voc|, |fullvoc|, | ||
1807 | % |novoc| or |trans|. The default mode is the one which is set at load | ||
1808 | % time as already seen \vref{sec:options}. | ||
1809 | % | ||
1810 | % \DescribeOption{width} |width|$=$\meta{length} | ||
1811 | % \hfill\arabluaverb{Default: 0.3\linewidth}\\ The default width of | ||
1812 | % each hemistich that the verse consists of. It may be expressed in | ||
1813 | % any accepted unit of measurement, such as |4cm| or |2in|. However, | ||
1814 | % one must keep in mind that the total length of the two hemistichs | ||
1815 | % added to the one of the gutter that separates them must not exceed | ||
1816 | % the length of the base line, unless one wishes to have the | ||
1817 | % hemistichs distributed on subsequent lines. | ||
1818 | % | ||
1819 | % \DescribeOption{gutter} |gutter|$=$\meta{width} | ||
1820 | % \hfill\arabluaverb{Default: 0.15 x (hemistich width)}\\ The gutter | ||
1821 | % consists of the blank space that is between the two hemistichs. By | ||
1822 | % default, it is commensurate with the width of the hemistich, but it | ||
1823 | % may be expressed in any accepted unit of measurement as well. | ||
1824 | % | ||
1825 | % \DescribeOption{metre} |metre|$=$\meta{name} | ||
1826 | % \hfill\arabluaverb{Default: none}\\ If the name of the metre is | ||
1827 | % expressed, it is printed after the lines and set flush left in | ||
1828 | % |voc|, |fullvoc| and |novoc| modes or flush right in |trans| mode. | ||
1829 | % | ||
1830 | % \DescribeOption{delim} |delim|$=$|true|\verb+|+|false| | ||
1831 | % \hfill\arabluaverb{Default: false}\\ This named argument does not | ||
1832 | % need a value as it defaults to |true| if it is used. If so, a | ||
1833 | % delimiter is printed between each of the hemistichs. By default, it | ||
1834 | % is set to the \enquote*{star} character \enquote*{*}. The command | ||
1835 | % \DescribeMacro{\SetHemistichDelim}\cs{SetHemistichDelim}\marg{delimiter} | ||
1836 | % may be used at any point of the document to change this default | ||
1837 | % setting. | ||
1838 | % | ||
1839 | % \DescribeOption{utf} |utf|$=$|true|\verb+|+|false| | ||
1840 | % \hfill\arabluaverb{Default: false}\\ As the preceding one, this | ||
1841 | % named argument does not need a value as it defaults to |true| if it | ||
1842 | % is used. If so, unicode Arabic input is expected in the |arabverse| | ||
1843 | % environment instead of \textsc{ascii} Arab\TeX\ or Buckwalter input | ||
1844 | % schemes. See \vref{sec:unicode-input} for more details. | ||
1845 | % | ||
1846 | % \DescribeMacro{\bayt} Inside the |arabverse| environment, each line | ||
1847 | % is typeset by the command \cs{bayt} which takes two mandatory | ||
1848 | % arguments and may accept one optional argument. Additionally, every | ||
1849 | % \cs{bayt} command \emph{must} be followed with |\\| like so:---% | ||
1850 | % \iffalse | ||
1851 | %<*example> | ||
1852 | % \fi | ||
1853 | \begin{arabluacode}[text only] | ||
1854 | \cs{bayt}\marg{\arb[trans]{.sadr}}\oarg{\arb[trans]{tadwIr}}% | ||
1855 | \marg{\arb[trans]{`ajuz}}|\\| | ||
1856 | \end{arabluacode} | ||
1857 | % \iffalse | ||
1858 | %</example> | ||
1859 | % \fi | ||
1860 | % | ||
1861 | % That two subsequent hemistichs should be connected with one another | ||
1862 | % is technically named \arb[trans]{tadwIr}. Should that happen, either | ||
1863 | % the \arb[trans]{.sadr} or the \arb[trans]{`ajuz} or both of them, | ||
1864 | % may be connected to one another by letters that are naturally bound | ||
1865 | % to the following or the preceding ones over the | ||
1866 | % \arb[trans]{tadwIr}. The optional argument of the \cs{bayt} command | ||
1867 | % is designed to deal with the various situations that may arise:--- | ||
1868 | % \begin{compactenum}[(a)] | ||
1869 | % \item If the two hemistichs be connected with one another by a | ||
1870 | % prominent horizontal flexible stroke, the \arb[trans]{tatwIl} should | ||
1871 | % be used, like so: |[--]| (see \vref{sec:tatwil}). Of course, the | ||
1872 | % ending word of the \arb[trans]{.sadr} and the word at the | ||
1873 | % commencement of the \arb[trans]{`a^guz} must have the | ||
1874 | % \arb[trans]{ta.twIl} too so that the proper shapes of the letters be | ||
1875 | % selected. Consider for example the following:--- | ||
1876 | % \iffalse | ||
1877 | %<*example> | ||
1878 | % \fi | ||
1879 | \begin{arabluacode} | ||
1880 | \begin{arabverse}[mode=fullvoc, width=.3\linewidth] | ||
1881 | \bayt{lA 'ar_A man `ahidtu fI-hA fa-'abkI 'l---}[--]{---yawma | ||
1882 | dalhaN wa-mA yu.hIru 'l-bukA'u}\\ | ||
1883 | \end{arabverse} | ||
1884 | \end{arabluacode} | ||
1885 | % \iffalse | ||
1886 | %</example> | ||
1887 | % \fi% | ||
1888 | % As one can see, \emph{triple hyphens} have been used. In the | ||
1889 | % \arb[trans]{.sadr}, the first hyphen triggers the rules that are | ||
1890 | % related to the definite article and the \arb[trans]{'alif-u | ||
1891 | % 'l-wa.sl-i},\footnote{See \vref{ref:definite-article}} while the | ||
1892 | % following two select the figure of the letter \arb[trans]{lAm} | ||
1893 | % connected with a following letter. In the \arb[trans]{`a^guz}, the | ||
1894 | % first two hyphens select the letter \arb[trans]{yA'} connected with | ||
1895 | % a preceding letter, while the last one is simply discarded in this | ||
1896 | % mode, but may appear as it should, if the |trans| mode be | ||
1897 | % selected:--- | ||
1898 | % \iffalse | ||
1899 | %<*example> | ||
1900 | % \fi | ||
1901 | \begin{arabluacode} | ||
1902 | \begin{arabverse}[mode=trans, width=.4\linewidth] | ||
1903 | \bayt{lA 'ar_A man `ahidtu fI-hA fa-'abkI 'l---}[--]{---yawma | ||
1904 | dalhaN wa-mA yu.hIru 'l-bukA'u}\\ | ||
1905 | \end{arabverse} | ||
1906 | \end{arabluacode} | ||
1907 | % \iffalse | ||
1908 | %</example> | ||
1909 | % \fi% | ||
1910 | % \item In some other cases, it may seem difficult, if not fairly | ||
1911 | % impossible, to split a given word into two parts. This happens | ||
1912 | % mostly because of the \arb[trans]{^saddaT}. Consider for example | ||
1913 | % the following:--- | ||
1914 | % \iffalse | ||
1915 | %<*example> | ||
1916 | % \fi | ||
1917 | \begin{arabluacode} | ||
1918 | \begin{arabverse}[mode=fullvoc, width=.25\linewidth, gutter=1cm] | ||
1919 | \bayt{.gayra 'annI qad 'asta`Inu `al_A 'l-ha--}[--mmi ]{'i_dA | ||
1920 | _haffa bi-'l-_tawiyyi 'l-na^gA'u}\\ | ||
1921 | \bayt{bi-zaf--UfiN ka-'anna-hA hiq--laTuN}[ 'ummu ]{ri'AliN | ||
1922 | dawwiyyaTuN saqfA'u}\\ | ||
1923 | \end{arabverse} | ||
1924 | \end{arabluacode} | ||
1925 | % \iffalse | ||
1926 | %</example> | ||
1927 | % \fi% | ||
1928 | % In the first line, the word \arb{al-hammi} should be split into | ||
1929 | % \arb{al-ham"-- --mi} as the first part of it belongs to the | ||
1930 | % \arb[trans]{.sadr} and the second to the \arb[trans]{`a^guz}. One | ||
1931 | % solution to avoid splitting this word in such a way is to write | ||
1932 | % inside the \arb[trans]{tadwIr} the part of it that belongs to either | ||
1933 | % hemistichs, without omitting to add a space after it. In the second | ||
1934 | % line, the word \arb{'ummu} should be split into \arb{'um"-- --mu}, | ||
1935 | % so that the only way to avoid splitting it into two parts is to | ||
1936 | % write it all inside the \arb[trans]{tadwIr}. In that case, as the | ||
1937 | % word is to be placed in the middle, it has been surrounded by | ||
1938 | % spaces. | ||
1939 | % \end{compactenum} | ||
1940 | % | ||
1941 | % \paragraph{Scaling and distortion of characters} | ||
1942 | % The |arabverse| environment and the \cs{bayt} command are designed | ||
1943 | % to typeset the verses in a two-column, fixed width layout. This may | ||
1944 | % result in somewhat distorted text. Should that happen, one may adapt | ||
1945 | % the layout by modifying the values of the above described |width| | ||
1946 | % and |gutter| named arguments until the visual aspect of the layout | ||
1947 | % be satisfactory. It has to be noted that distortion and warping may | ||
1948 | % be even more perceptible in Roman than in Arabic characters. | ||
1949 | % | ||
1950 | % \paragraph{Footnotes} | ||
1951 | % Footnotes are not set by default inside the \cs{bayt} command, but | ||
1952 | % there are two easy ways to have them printed. | ||
1953 | % | ||
1954 | % If they are little in number, each footnote may be split into pairs | ||
1955 | % of |\footnotemark{}| (please mind the braces) in either argument of | ||
1956 | % the \cs{bayt} command and |\footnotetext{}| outside the \cs{bayt} | ||
1957 | % command. | ||
1958 | % | ||
1959 | % If the footnotes are abundant in number, it is advised to load the | ||
1960 | % \package{footnote} package which \package{arabluatex} will then use | ||
1961 | % to typeset any kind of footnote that is called from the arguments of | ||
1962 | % the \cs{bayt} command. | ||
1963 | % | ||
1964 | % \paragraph{Line numbering} | ||
1965 | % Inside the |arabverse| environment, the |linenumbers| environment of | ||
1966 | % the \package{lineno} package may be used to have the lines of | ||
1967 | % succeeding verses numbered. Please refer to the documentation of | ||
1968 | % this package for more information or to the example below for a | ||
1969 | % basic implementation of this technique. | ||
1970 | % | ||
1971 | % \subsection{Example} | ||
1972 | % \label{sec:poetry-example} | ||
1973 | % Here follows the first lines of \arb[trans]{\upshape{}\cap{i}mru'u | ||
1974 | % 'l-\cap{q}aysi}'s \arb[trans]{\cap{m}u`allaqaT}:---% | ||
1975 | % \iffalse | ||
1976 | %<*example> | ||
1977 | % \fi | ||
1978 | \begin{arabluaverbatim} | ||
1979 | \begin{arab}[fullvoc] | ||
1980 | qAla \cap{i}mru'u 'l-\cap{q}aysi fI ^si`ri-hi 'l-\cap{m}u`allaqaTi: | ||
1981 | \end{arab} | ||
1982 | |||
1983 | \begin{arabverse}[mode=fullvoc, metre=(al-.tawIlu)] | ||
1984 | \SetArbDflt* | ||
1985 | \begin{linenumbers*} | ||
1986 | \bayt{qifA nabki min _dikr_A .habibiN wa-manzili}{bi-saq.ti | ||
1987 | 'l-liw_A bayna \cap{'l-da_hUl}i wa-\cap{.h}awmali}\\ | ||
1988 | \bayt{fa-\cap{t}Udi.ha fa-'l-\cap{m}iqrATi lam ya`fu | ||
1989 | rasmu-hA}{limA nasa^gat-hA min ^ganUbiN wa-^sam'ali}\\ | ||
1990 | \bayt{tar_A ba`ara 'l-'ar'Ami fI `ara.sAti-hA}{wa-qI`Ani-hA | ||
1991 | ka-'anna-hu .habbu fulfuli}\\ | ||
1992 | \bayt{ka-'annI .gadATa 'l-bayni yawma ta.hammalUA}{lad_A | ||
1993 | samurAti 'l-.hayyi nAqifu .han.zali}\\ | ||
1994 | \bayt{wuqUfaN bi-hA .sa.hbI `alayya ma.tiyya-hum}{yaqUlUna lA | ||
1995 | tahlik 'asaN_A wa-ta^gammali}\\ | ||
1996 | \bayt{wa-'inna ^sifA'I `abraTuN muhrAqaTuN}{fa-hal `inda rasmiN | ||
1997 | dAsiriN min mu`awwali}\\ | ||
1998 | \end{linenumbers*} | ||
1999 | \end{arabverse} | ||
2000 | \end{arabluaverbatim} | ||
2001 | % \iffalse | ||
2002 | %</example> | ||
2003 | % \fi% | ||
2004 | % \begin{arab}[fullvoc] | ||
2005 | % qAla \cap{i}mru'u 'l-\cap{q}aysi fI ^si`ri-hi | ||
2006 | % 'l-\cap{m}u`allaqaTi: | ||
2007 | % \end{arab} | ||
2008 | % | ||
2009 | % \begin{arabverse}[mode=fullvoc, metre=(al-.tawIlu), width=.25\linewidth] | ||
2010 | % \SetArbDflt* | ||
2011 | % \begin{linenumbers*} | ||
2012 | % \bayt{qifA nabki min _dikr_A .habibiN wa-manzili}{bi-saq.ti | ||
2013 | % 'l-liw_A bayna \cap{'l-da_hUl}i wa-\cap{.h}awmali}\\ | ||
2014 | % \bayt{fa-\cap{t}Udi.ha fa-'l-\cap{m}iqrATi lam ya`fu | ||
2015 | % rasmu-hA}{limA nasa^gat-hA min ^ganUbiN wa-^sam'ali}\\ | ||
2016 | % \bayt{tar_A ba`ara 'l-'ar'Ami fI `ara.sAti-hA}{wa-qI`Ani-hA | ||
2017 | % ka-'anna-hu .habbu fulfuli}\\ | ||
2018 | % \bayt{ka-'annI .gadATa 'l-bayni yawma ta.hammalUA}{lad_A | ||
2019 | % samurAti | ||
2020 | % 'l-.hayyi nAqifu .han.zali}\\ | ||
2021 | % \bayt{wuqUfaN bi-hA .sa.hbI `alayya ma.tiyya-hum}{yaqUlUna lA | ||
2022 | % tahlik 'asaN_A wa-ta^gammali}\\ | ||
2023 | % \bayt{wa-'inna ^sifA'I `abraTuN muhrAqaTuN}{fa-hal `inda rasmiN | ||
2024 | % dAsiriN min mu`awwali}\\ | ||
2025 | % \end{linenumbers*} | ||
2026 | % \end{arabverse} | ||
2027 | % | ||
2028 | % \begin{arab}[trans] | ||
2029 | % qAla \cap{i}mru'u 'l-\cap{q}aysi fI ^si`ri-hi | ||
2030 | % 'l-\cap{m}u`allaqaTi: | ||
2031 | % \end{arab} | ||
2032 | % | ||
2033 | % \begin{arabverse}[mode=trans, metre=(al-.tawIlu), width=.4\linewidth] | ||
2034 | % \SetArbDflt* | ||
2035 | % \begin{linenumbers*} | ||
2036 | % \bayt{qifA nabki min _dikr_A .habibiN wa-manzili}{bi-saq.ti | ||
2037 | % 'l-liw_A bayna \cap{'l-da_hUl}i wa-\cap{.h}awmali}\\ | ||
2038 | % \bayt{fa-\cap{t}Udi.ha fa-'l-\cap{m}iqrATi lam ya`fu | ||
2039 | % rasmu-hA}{limA nasa^gat-hA min ^ganUbiN wa-^sam'ali}\\ | ||
2040 | % \bayt{tar_A ba`ara 'l-'ar'Ami fI `ara.sAti-hA}{wa-qI`Ani-hA | ||
2041 | % ka-'anna-hu .habbu fulfuli}\\ | ||
2042 | % \bayt{ka-'annI .gadATa 'l-bayni yawma ta.hammalUA}{lad_A | ||
2043 | % samurAti | ||
2044 | % 'l-.hayyi nAqifu .han.zali}\\ | ||
2045 | % \bayt{wuqUfaN bi-hA .sa.hbI `alayya ma.tiyya-hum}{yaqUlUna lA | ||
2046 | % tahlik 'asaN_A wa-ta^gammali}\\ | ||
2047 | % \bayt{wa-'inna ^sifA'I `abraTuN muhrAqaTuN}{fa-hal `inda rasmiN | ||
2048 | % dAsiriN min mu`awwali}\\ | ||
2049 | % \end{linenumbers*} | ||
2050 | % \end{arabverse} | ||
2051 | % | ||
1781 | % \section{Special applications} | 2052 | % \section{Special applications} |
1782 | % \label{sec:special-applications} | 2053 | % \label{sec:special-applications} |
1783 | % \paragraph{Linguistics} | 2054 | % \paragraph{Linguistics} |
@@ -2662,7 +2933,7 @@ wa-ya.sIru ta.hta 'l-jild-i | |||
2662 | % \begin{macrocode} | 2933 | % \begin{macrocode} |
2663 | \NeedsTeXFormat{LaTeX2e} | 2934 | \NeedsTeXFormat{LaTeX2e} |
2664 | \ProvidesPackage{arabluatex}% | 2935 | \ProvidesPackage{arabluatex}% |
2665 | [2016/11/14 v1.5 An ArabTeX-like interface for LuaLaTeX] | 2936 | [2016/12/15 v1.6 An ArabTeX-like interface for LuaLaTeX] |
2666 | \RequirePackage{ifluatex} | 2937 | \RequirePackage{ifluatex} |
2667 | % \end{macrocode} | 2938 | % \end{macrocode} |
2668 | % \package{arabluatex} requires \LuaLaTeX\ of course. Issue a warning | 2939 | % \package{arabluatex} requires \LuaLaTeX\ of course. Issue a warning |
@@ -2790,7 +3061,7 @@ wa-ya.sIru ta.hta 'l-jild-i | |||
2790 | % \cs{SetArbEasy*} takes it away. Default complex rules can be set | 3061 | % \cs{SetArbEasy*} takes it away. Default complex rules can be set |
2791 | % back at any point of the document with \cs{SetArbDflt}. | 3062 | % back at any point of the document with \cs{SetArbDflt}. |
2792 | % \begin{macro}{\SetArbDflt*} | 3063 | % \begin{macro}{\SetArbDflt*} |
2793 | % \changes{v1.6}{2016/11/30}{This starred version applies the | 3064 | % \changes{v1.6}{2016/12/15}{This starred version applies the |
2794 | % assimilation rules in addition to what \cs{SetArbDflt} already | 3065 | % assimilation rules in addition to what \cs{SetArbDflt} already |
2795 | % does.} As of v1.6, \package{arabluatex} does not applies any more | 3066 | % does.} As of v1.6, \package{arabluatex} does not applies any more |
2796 | % the assimilation rules that are laid on \vref{ref:assimilation}; a | 3067 | % the assimilation rules that are laid on \vref{ref:assimilation}; a |
@@ -2967,18 +3238,18 @@ wa-ya.sIru ta.hta 'l-jild-i | |||
2967 | % \end{macrocode} | 3238 | % \end{macrocode} |
2968 | % \end{environment} | 3239 | % \end{environment} |
2969 | % \begin{environment}{arabverse} | 3240 | % \begin{environment}{arabverse} |
2970 | % \changes{v1.6}{2016/11/30}{New environment \texttt{arabverse} for | 3241 | % \changes{v1.6}{2016/12/15}{New environment \texttt{arabverse} for |
2971 | % typesetting Arabic poetry} The |arabverse| environment may receive | 3242 | % typesetting Arabic poetry} The |arabverse| environment may receive |
2972 | % different options: |width|, |tadwirwidth|, |metre|, |utf| and | 3243 | % different options: |mode|, |width|, |gutter|, |metre|, |utf| |
2973 | % |mode|; all of them are defined here just before the |arabverse| | 3244 | % and |delim|; all of them are defined here just before the |
2974 | % environment: | 3245 | % |arabverse| environment: |
2975 | % \begin{macrocode} | 3246 | % \begin{macrocode} |
2976 | \newlength{\al@bayt@width} | 3247 | \newlength{\al@bayt@width} |
2977 | \newlength{\al@tadwir@width} | 3248 | \newlength{\al@gutter@width} |
2978 | \setlength{\al@bayt@width}{.3\textwidth} | 3249 | \setlength{\al@bayt@width}{.3\textwidth} |
2979 | \setlength{\al@tadwir@width}{.15\al@bayt@width} | 3250 | \setlength{\al@gutter@width}{.15\al@bayt@width} |
2980 | \define@key[al]{verse}{width}{\setlength{\al@bayt@width}{#1}} | 3251 | \define@key[al]{verse}{width}{\setlength{\al@bayt@width}{#1}} |
2981 | \define@key[al]{verse}{tadwirwidth}{\setlength{\al@tadwir@width}{#1}} | 3252 | \define@key[al]{verse}{gutter}{\setlength{\al@gutter@width}{#1}} |
2982 | \define@key[al]{verse}{metre}{\arb{#1}} | 3253 | \define@key[al]{verse}{metre}{\arb{#1}} |
2983 | \define@boolkey[al]{verse}{utf}[true]{} | 3254 | \define@boolkey[al]{verse}{utf}[true]{} |
2984 | \define@boolkey[al]{verse}{delim}[true]{} | 3255 | \define@boolkey[al]{verse}{delim}[true]{} |
@@ -2994,23 +3265,22 @@ wa-ya.sIru ta.hta 'l-jild-i | |||
2994 | \ifx\al@mode\al@mode@trans% | 3265 | \ifx\al@mode\al@mode@trans% |
2995 | \ifal@verse@utf\setRL\else\setLR\fi% | 3266 | \ifal@verse@utf\setRL\else\setLR\fi% |
2996 | \else\setRL\fi}% | 3267 | \else\setRL\fi}% |
2997 | {\hfill\setkeys[al]{verse}[width,tadwirwidth,utf,mode]{#1}\egroup} | 3268 | {\hfill\setkeys[al]{verse}[width,gutter,utf,mode]{#1}\egroup} |
2998 | % \end{macrocode} | 3269 | % \end{macrocode} |
2999 | % \begin{macro}{\bayt} | 3270 | % \begin{macro}{\bayt} |
3000 | % \changes{v1.6}{2016/11/30}{New macro \cs{bayt} for typesetting | 3271 | % \changes{v1.6}{2016/12/15}{New macro \cs{bayt} for typesetting |
3001 | % each verse inside the \texttt{arabverse} environment} Each verse | 3272 | % each verse inside the \texttt{arabverse} environment} Each verse |
3002 | % consists of two hemistichs; therefore the command \cs{bayt} takes | 3273 | % consists of two hemistichs; therefore the command \cs{bayt} takes |
3003 | % two arguments, the first receives the \arb[trans]{.sadr} and the | 3274 | % two arguments, the first receives the \arb[trans]{.sadr} and the |
3004 | % second the \arb[trans]{`ajuz}. That two subsequent hemistishs | 3275 | % second the \arb[trans]{`ajuz}. That two subsequent hemistichs |
3005 | % should be connected with one another is technically named | 3276 | % should be connected with one another is technically named |
3006 | % \arb[trans]{tadwIr}. In some of these cases, the hemistishs may be | 3277 | % \arb[trans]{tadwIr}. In some of these cases, the hemistichs may be |
3007 | % connected by a prominent horizontal flexible stroke which is drawn | 3278 | % connected by a prominent horizontal flexible stroke which is drawn |
3008 | % by the command \cs{al@verse@stroke}. | 3279 | % by the command \cs{al@verse@stroke}. |
3009 | % \begin{macro}{\SetHemistichDelim} | 3280 | % \begin{macro}{\SetHemistichDelim} |
3010 | % \changes{v1.6}{2016/11/30}{New command \cs{SetHemistichDelim} for | 3281 | % \changes{v1.6}{2016/12/15}{New command \cs{SetHemistichDelim} for |
3011 | % changing the default delimiter between hemistichs} A hemistich | 3282 | % changing the default delimiter between hemistichs} A hemistich |
3012 | % delimiter also must be defined for there is no gutter between | 3283 | % delimiter also may be defined. By default, it is set to the |
3013 | % hemistichs in |trans| mode. By default, it is set to the | ||
3014 | % \enquote*{star} character: |*|. The command | 3284 | % \enquote*{star} character: |*|. The command |
3015 | % \cs{SetHemistichDelim}\marg{delimiter} may be used at any point of | 3285 | % \cs{SetHemistichDelim}\marg{delimiter} may be used at any point of |
3016 | % the document to change this default setting. | 3286 | % the document to change this default setting. |
@@ -3026,21 +3296,24 @@ wa-ya.sIru ta.hta 'l-jild-i | |||
3026 | \edef\al@tatweel{--}% | 3296 | \edef\al@tatweel{--}% |
3027 | \adjustbox{width=\al@bayt@width, height=\Height}{\arb@utf{#1}}% | 3297 | \adjustbox{width=\al@bayt@width, height=\Height}{\arb@utf{#1}}% |
3028 | \IfNoValueTF{#2}{% | 3298 | \IfNoValueTF{#2}{% |
3029 | \ifal@verse@delim\makebox[\al@tadwir@width][c]{\al@hemistich@delim}% | 3299 | \ifal@verse@delim\makebox[\al@gutter@width][c]{\al@hemistich@delim}% |
3030 | \else% | 3300 | \else% |
3031 | \hspace{\al@tadwir@width}% | 3301 | \hspace{\al@gutter@width}% |
3032 | \fi | 3302 | \fi |
3033 | }{% | 3303 | }{% |
3034 | \edef\@tempa{#2}% | 3304 | \edef\@tempa{#2}% |
3035 | \ifx\@tempa\al@tatweel% | 3305 | \ifx\@tempa\al@tatweel% |
3036 | \ifx\al@mode\al@mode@trans% | 3306 | \ifx\al@mode\al@mode@trans% |
3037 | \hspace{\al@tadwir@width}% | 3307 | \hspace{\al@gutter@width}% |
3038 | \else% | 3308 | \else% |
3039 | \makebox[\al@tadwir@width][s]{\al@verse@stroke}% | 3309 | \makebox[\al@gutter@width][s]{\al@verse@stroke}% |
3040 | \fi% | 3310 | \fi% |
3041 | \else% | 3311 | \else% |
3042 | \adjustbox{center=\al@tadwir@width, height=\Height}{\arb@utf{#2}}% | 3312 | \ifx\al@mode\al@mode@trans% |
3043 | \fi}% | 3313 | \adjustbox{width=\al@gutter@width, height=\Height}{\arb@utf{#2}}% |
3314 | \else% | ||
3315 | \makebox[\al@gutter@width][s]{\arb@utf{#2}}% | ||
3316 | \fi\fi}% | ||
3044 | \adjustbox{width=\al@bayt@width, height=\Height}{\arb@utf{#3}}% | 3317 | \adjustbox{width=\al@bayt@width, height=\Height}{\arb@utf{#3}}% |
3045 | \ifdefined\spewnotes\spewnotes\else\fi% | 3318 | \ifdefined\spewnotes\spewnotes\else\fi% |
3046 | } | 3319 | } |