diff options
-rw-r--r-- | arabluatex.dtx | 138 |
1 files changed, 123 insertions, 15 deletions
diff --git a/arabluatex.dtx b/arabluatex.dtx index 4d3fb48..735c95b 100644 --- a/arabluatex.dtx +++ b/arabluatex.dtx | |||
@@ -1,6 +1,6 @@ | |||
1 | % \iffalse meta-comment | 1 | % \iffalse meta-comment |
2 | % ArabLuaTeX -- Processing ArabTeX notation under LuaLaTeX | 2 | % ArabLuaTeX -- Processing ArabTeX notation under LuaLaTeX |
3 | % Copyright (C) 2016--2020 Robert Alesssi | 3 | % Copyright (C) 2016--2020 Robert Alessi |
4 | % | 4 | % |
5 | % Please send error reports and suggestions for improvements to Robert | 5 | % Please send error reports and suggestions for improvements to Robert |
6 | % Alessi <alessi@robertalessi.net> | 6 | % Alessi <alessi@robertalessi.net> |
@@ -27,7 +27,7 @@ | |||
27 | %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] | 27 | %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] |
28 | %<package>\ProvidesPackage{arabluatex} | 28 | %<package>\ProvidesPackage{arabluatex} |
29 | %<*package> | 29 | %<*package> |
30 | [2020/03/15 v1.19 ArabTeX for LuaLaTeX] | 30 | [2020/03/23 v1.20 ArabTeX for LuaLaTeX] |
31 | %</package> | 31 | %</package> |
32 | % | 32 | % |
33 | %<*driver> | 33 | %<*driver> |
@@ -166,7 +166,7 @@ | |||
166 | \babelfont{sf}{NewComputerModern Sans} | 166 | \babelfont{sf}{NewComputerModern Sans} |
167 | \babelfont{tt}{NewComputerModern Mono} | 167 | \babelfont{tt}{NewComputerModern Mono} |
168 | \usepackage{metalogox} | 168 | \usepackage{metalogox} |
169 | \usepackage{arabluatex}[2020/03/15] | 169 | \usepackage{arabluatex}[2020/03/23] |
170 | \SetArbUp{\textsuperscript{\thinspace#1}} % Old Standard needs this | 170 | \SetArbUp{\textsuperscript{\thinspace#1}} % Old Standard needs this |
171 | \usepackage[nopar]{quran} | 171 | \usepackage[nopar]{quran} |
172 | \usepackage[noindex]{nameauth} | 172 | \usepackage[noindex]{nameauth} |
@@ -269,7 +269,7 @@ | |||
269 | %</driver> | 269 | %</driver> |
270 | % \fi | 270 | % \fi |
271 | % | 271 | % |
272 | % \CheckSum{1014} | 272 | % \CheckSum{1059} |
273 | % | 273 | % |
274 | % \CharacterTable | 274 | % \CharacterTable |
275 | % {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 | 275 | % {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 |
@@ -2187,7 +2187,7 @@ | |||
2187 | % environment must end with |\\|. | 2187 | % environment must end with |\\|. |
2188 | % | 2188 | % |
2189 | % \DescribeEnv{arabverse} The |arabverse| environment may take up to | 2189 | % \DescribeEnv{arabverse} The |arabverse| environment may take up to |
2190 | % six optional \enquote*{named arguments} each of which is set using | 2190 | % eight optional \enquote*{named arguments} each of which is set using |
2191 | % the syntax \meta{key}$=$\meta{value}, like so:---% | 2191 | % the syntax \meta{key}$=$\meta{value}, like so:---% |
2192 | % \iffalse | 2192 | % \iffalse |
2193 | %<*example> | 2193 | %<*example> |
@@ -2369,6 +2369,20 @@ | |||
2369 | % warping may be even more perceptible in Roman than in Arabic | 2369 | % warping may be even more perceptible in Roman than in Arabic |
2370 | % characters. | 2370 | % characters. |
2371 | % | 2371 | % |
2372 | % \DescribeMacro{\StretchBayt} \cs{StretchBayt}\verb+[true|false]+ | ||
2373 | % \hfill\tcboxverb{Default: true}\\ | ||
2374 | % \NEWfeature{v1.20} \cs{StretchBayt} takes one optional argument, | ||
2375 | % either |true| or |false| and can be used to remove the stretching | ||
2376 | % form lines of Arabic poetry. As a side effect, there will be more | ||
2377 | % space between words, but this can be compensated by inserting double | ||
2378 | % hyphens between letters (on this technique, see | ||
2379 | % \vref{sec:tatwil}). Should it be desired to extend further the | ||
2380 | % strokes, four hyphens may be inserted (|----|), viz. a multiple of | ||
2381 | % two. \cs{StretchBayt} may be used at any point of the document, even | ||
2382 | % between two subsequent lines of poetry. Note that | ||
2383 | % \cs{StretchBayt}|[false]| may require to carefuly adjust the width | ||
2384 | % of the hemistichs to avoid overlapping. | ||
2385 | % | ||
2372 | % \paragraph{Footnotes} | 2386 | % \paragraph{Footnotes} |
2373 | % Footnotes are not set by default inside the \cs{bayt} command, but | 2387 | % Footnotes are not set by default inside the \cs{bayt} command, but |
2374 | % there are two easy ways to have them printed. | 2388 | % there are two easy ways to have them printed. |
@@ -2429,13 +2443,16 @@ | |||
2429 | \bayt{wuqUfaN bi-hA .sa.hbI `alayya ma.tiyya-hum}{yaqUlUna | 2443 | \bayt{wuqUfaN bi-hA .sa.hbI `alayya ma.tiyya-hum}{yaqUlUna |
2430 | lA tahlik 'asaN_A wa-ta^gammali}\\ | 2444 | lA tahlik 'asaN_A wa-ta^gammali}\\ |
2431 | \bayt{wa-'inna ^sifA'I `abraTuN muharAqaTuN}{fa-hal `inda | 2445 | \bayt{wa-'inna ^sifA'I `abraTuN muharAqaTuN}{fa-hal `inda |
2432 | rasmiN dAsiriN min mu`awwali}\\ | 2446 | rasmiN dArisiN min mu`awwali}\\ |
2433 | \end{linenumbers*} | 2447 | \end{linenumbers*} |
2434 | \end{arabverse} | 2448 | \end{arabverse} |
2435 | \end{code} | 2449 | \end{code} |
2436 | % \iffalse | 2450 | % \iffalse |
2437 | %</example> | 2451 | %</example> |
2438 | % \fi% | 2452 | % \fi% |
2453 | % | ||
2454 | % \medskip | ||
2455 | % \noindent\textbf{\cs{StretchBayt}|[true]| (Default)}:--- | ||
2439 | % \begin{arab}[fullvoc] | 2456 | % \begin{arab}[fullvoc] |
2440 | % qAla imru'u 'l-\uc{q}aysi fI mu`allaqati-hi: | 2457 | % qAla imru'u 'l-\uc{q}aysi fI mu`allaqati-hi: |
2441 | % \end{arab} | 2458 | % \end{arab} |
@@ -2451,12 +2468,11 @@ | |||
2451 | % \bayt{tar_A ba`ara 'l-'ar'Ami fI `ara.sAti-hA}{wa-qI`Ani-hA | 2468 | % \bayt{tar_A ba`ara 'l-'ar'Ami fI `ara.sAti-hA}{wa-qI`Ani-hA |
2452 | % ka-'anna-hu .habbu fulfuli}\\ | 2469 | % ka-'anna-hu .habbu fulfuli}\\ |
2453 | % \bayt{ka-'annI .gadATa 'l-bayni yawma ta.hammalUA}{lad_A | 2470 | % \bayt{ka-'annI .gadATa 'l-bayni yawma ta.hammalUA}{lad_A |
2454 | % samurAti | 2471 | % samurAti 'l-.hayyi nAqifu .han.zali}\\ |
2455 | % 'l-.hayyi nAqifu .han.zali}\\ | ||
2456 | % \bayt{wuqUfaN bi-hA .sa.hbI `alayya ma.tiyya-hum}{yaqUlUna lA | 2472 | % \bayt{wuqUfaN bi-hA .sa.hbI `alayya ma.tiyya-hum}{yaqUlUna lA |
2457 | % tahlik 'asaN_A wa-ta^gammali}\\ | 2473 | % tahlik 'asaN_A wa-ta^gammali}\\ |
2458 | % \bayt{wa-'inna ^sifA'I `abraTuN muharAqaTuN}{fa-hal `inda rasmiN | 2474 | % \bayt{wa-'inna ^sifA'I `abraTuN muharAqaTuN}{fa-hal `inda rasmiN |
2459 | % dAsiriN min mu`awwali}\\ | 2475 | % dArisiN min mu`awwali}\\ |
2460 | % \end{linenumbers*} | 2476 | % \end{linenumbers*} |
2461 | % \end{arabverse} | 2477 | % \end{arabverse} |
2462 | % | 2478 | % |
@@ -2477,14 +2493,71 @@ | |||
2477 | % \bayt{tar_A ba`ara 'l-'ar'Ami fI `ara.sAti-hA}{wa-qI`Ani-hA | 2493 | % \bayt{tar_A ba`ara 'l-'ar'Ami fI `ara.sAti-hA}{wa-qI`Ani-hA |
2478 | % ka-'anna-hu .habbu fulfuli}\\ | 2494 | % ka-'anna-hu .habbu fulfuli}\\ |
2479 | % \bayt{ka-'annI .gadATa 'l-bayni yawma ta.hammalUA}{lad_A | 2495 | % \bayt{ka-'annI .gadATa 'l-bayni yawma ta.hammalUA}{lad_A |
2480 | % samurAti | 2496 | % samurAti 'l-.hayyi nAqifu .han.zali}\\ |
2481 | % 'l-.hayyi nAqifu .han.zali}\\ | 2497 | % \bayt{wuqUfaN bi-hA .sa.hbI `alayya ma.tiyya-hum}{yaqUlUna lA |
2498 | % tahlik 'asaN_A wa-ta^gammali}\\ | ||
2499 | % \bayt{wa-'inna ^sifA'I `abraTuN muharAqaTuN}{fa-hal `inda rasmiN | ||
2500 | % dArisiN min mu`awwali}\\ | ||
2501 | % \end{linenumbers*} | ||
2502 | % \end{arabverse} | ||
2503 | % | ||
2504 | % \medskip | ||
2505 | % \noindent\textbf{\cs{StretchBayt}|[false]|}:--- | ||
2506 | % \StretchBayt[false]\\ | ||
2507 | % In what follows, |width| has been set to |0.3\linewidth| and double | ||
2508 | % hyphens have been inserted between some letters to prolong their | ||
2509 | % horizontal strokes. | ||
2510 | % \begin{arab}[fullvoc] | ||
2511 | % qAla imru'u 'l-\uc{q}aysi fI mu`allaqati-hi: | ||
2512 | % \end{arab} | ||
2513 | % | ||
2514 | % \begin{arabverse}[mode=fullvoc, metre={(al-.darbu 'l-_tAnI mina | ||
2515 | % 'l-`arU.di 'l-'_Ul_A mina 'l-.tawIli)}, width=.3\linewidth] | ||
2516 | % \SetArbDflt* | ||
2517 | % \begin{linenumbers*} | ||
2518 | % \bayt{qifA nabki min _dikr_A .habIbiN wa-manzili}{bi-saq.ti | ||
2519 | % 'l-liw_A bayna \uc{'l-d}a_hUli fa-\uc{.h}awmali}\\ | ||
2520 | % \bayt{fa-\uc{t}U.di.ha fa-'l-\uc{m}iqrATi lam ya`--fu | ||
2521 | % rasmu---hA}{limA nasa^gat-hA mi--n ^gan----UbiN wa-^sam'ali}\\ | ||
2522 | % \bayt{ta--r_A ba--`ara 'l-'ar'Ami fI `ara.sAti-hA}{wa-qI--`Ani-hA | ||
2523 | % ka-'anna---hu .ha----bbu fu--{l}--fu----li}\\ | ||
2524 | % \bayt{ka-'annI .ga--dATa 'l-bay--ni ya--wma ta.hammalUA}{lad_A | ||
2525 | % samurAti 'l-.hayyi nAqifu .han.zali}\\ | ||
2526 | % \bayt{wuq--UfaN bi-hA .sa.hbI `a--layya ma--.tiyya---hu--m} | ||
2527 | % {ya--q--Ul--Una lA tahli--k 'asaN_A wa-ta^gamma----li}\\ | ||
2528 | % \bayt{wa-'inna ^si----f----A'I `a--{b}----raTuN muharAqa----TuN} | ||
2529 | % {fa---ha--l `inda rasmiN dArisiN min mu`awwali}\\ | ||
2530 | % \end{linenumbers*} | ||
2531 | % \end{arabverse} | ||
2532 | % | ||
2533 | % \medskip | ||
2534 | % | ||
2535 | % In what follows, |width| has been set to |0.375\linewidth| and | ||
2536 | % |\scriptsize| has been used so as to avoid overlapping. | ||
2537 | % \begin{arab}[trans] | ||
2538 | % qAla imru'u 'l-\uc{q}aysi fI mu`allaqati-hi: | ||
2539 | % \end{arab} | ||
2540 | % | ||
2541 | % \begin{arabverse}[mode=trans, metre={(al-.darbu 'l-_tAnI mina | ||
2542 | % 'l-`arU.di 'l-'_Ul_A mina 'l-.tawIli)}, width=.375\linewidth] | ||
2543 | % \SetArbDflt* | ||
2544 | % \scriptsize | ||
2545 | % \begin{linenumbers*} | ||
2546 | % \bayt{qifA nabki min _dikr_A .habIbiN wa-manzili}{bi-saq.ti | ||
2547 | % 'l-liw_A bayna \uc{'l-d}a_hUli fa-\uc{.h}awmali}\\ | ||
2548 | % \bayt{fa-\uc{t}U.di.ha fa-'l-\uc{m}iqrATi lam ya`fu | ||
2549 | % rasmu-hA}{limA nasa^gat-hA min ^ganUbiN wa-^sam'ali}\\ | ||
2550 | % \bayt{tar_A ba`ara 'l-'ar'Ami fI `ara.sAti-hA}{wa-qI`Ani-hA | ||
2551 | % ka-'anna-hu .habbu fulfuli}\\ | ||
2552 | % \bayt{ka-'annI .gadATa 'l-bayni yawma ta.hammalUA}{lad_A | ||
2553 | % samurAti 'l-.hayyi nAqifu .han.zali}\\ | ||
2482 | % \bayt{wuqUfaN bi-hA .sa.hbI `alayya ma.tiyya-hum}{yaqUlUna lA | 2554 | % \bayt{wuqUfaN bi-hA .sa.hbI `alayya ma.tiyya-hum}{yaqUlUna lA |
2483 | % tahlik 'asaN_A wa-ta^gammali}\\ | 2555 | % tahlik 'asaN_A wa-ta^gammali}\\ |
2484 | % \bayt{wa-'inna ^sifA'I `abraTuN muharAqaTuN}{fa-hal `inda rasmiN | 2556 | % \bayt{wa-'inna ^sifA'I `abraTuN muharAqaTuN}{fa-hal `inda rasmiN |
2485 | % dAsiriN min mu`awwali}\\ | 2557 | % dArisiN min mu`awwali}\\ |
2486 | % \end{linenumbers*} | 2558 | % \end{linenumbers*} |
2487 | % \end{arabverse} | 2559 | % \end{arabverse} |
2560 | % \StretchBayt[true] | ||
2488 | % | 2561 | % |
2489 | % \section{Special applications} | 2562 | % \section{Special applications} |
2490 | % \label{sec:special-applications} | 2563 | % \label{sec:special-applications} |
@@ -4883,6 +4956,14 @@ | |||
4883 | % \arb[trans]{tadwIr}. In some of these cases, the hemistichs may be | 4956 | % \arb[trans]{tadwIr}. In some of these cases, the hemistichs may be |
4884 | % connected by a prominent horizontal flexible stroke which is drawn | 4957 | % connected by a prominent horizontal flexible stroke which is drawn |
4885 | % by the \cs{al@verse@stroke} command. | 4958 | % by the \cs{al@verse@stroke} command. |
4959 | % \begin{macro}{\StretchBayt} | ||
4960 | % \changes{v1.20}{2020/03/23}{Optionally removes stretching from lines | ||
4961 | % of poetry} \cs{StretchBayt}\oarg{true\textbar false} Allows to | ||
4962 | % remove stretching and undesirable warping effect from Arabic lines of | ||
4963 | % poetry. This command accepts one fixed optional argument, either | ||
4964 | % |true| or |false|, and may be used either in the preamble or at any | ||
4965 | % point of the document. By default, it is set to |true|. | ||
4966 | % \end{macro} | ||
4886 | % \begin{macro}{\SetHemistichDelim} | 4967 | % \begin{macro}{\SetHemistichDelim} |
4887 | % \changes{v1.6}{2016/12/17}{New \cs{SetHemistichDelim} command for | 4968 | % \changes{v1.6}{2016/12/17}{New \cs{SetHemistichDelim} command for |
4888 | % changing the default delimiter between hemistichs} A hemistich | 4969 | % changing the default delimiter between hemistichs} A hemistich |
@@ -4892,6 +4973,21 @@ | |||
4892 | % point of the document to change this default setting. | 4973 | % point of the document to change this default setting. |
4893 | % \end{macro} | 4974 | % \end{macro} |
4894 | % \begin{macrocode} | 4975 | % \begin{macrocode} |
4976 | \newif\ifal@warp@bayt | ||
4977 | \al@warp@bayttrue | ||
4978 | \NewDocumentCommand{\StretchBayt}{O{true}}{ | ||
4979 | \edef\oarg@true{true} | ||
4980 | \edef\oarg@false{false} | ||
4981 | \edef\@tempa{#1} | ||
4982 | \ifx\@tempa\oarg@true\al@warp@bayttrue | ||
4983 | \else | ||
4984 | \ifx\@tempa\oarg@false\al@warp@baytfalse | ||
4985 | \else | ||
4986 | \PackageError{arabluatex}{\string\StretchBayt\space must be | ||
4987 | either 'true' or 'false'}{} | ||
4988 | \fi | ||
4989 | \fi | ||
4990 | } | ||
4895 | \NewDocumentCommand{\arb@utf}{m}{% | 4991 | \NewDocumentCommand{\arb@utf}{m}{% |
4896 | \ifal@verse@utf\txarb{#1}\else\arb{#1}\fi} | 4992 | \ifal@verse@utf\txarb{#1}\else\arb{#1}\fi} |
4897 | \def\al@hemistich@delim{*} | 4993 | \def\al@hemistich@delim{*} |
@@ -4901,7 +4997,11 @@ | |||
4901 | \IfBooleanTF{#1}{\relax}{\relax}% | 4997 | \IfBooleanTF{#1}{\relax}{\relax}% |
4902 | \ifdefined\savenotes\savenotes\else\fi% | 4998 | \ifdefined\savenotes\savenotes\else\fi% |
4903 | \edef\al@tatweel{--}% | 4999 | \edef\al@tatweel{--}% |
4904 | \adjustbox{width=\al@bayt@width, height=\Height}{\arb@utf{#2}}% | 5000 | \ifal@warp@bayt% |
5001 | \adjustbox{width=\al@bayt@width, height=\Height}{\arb@utf{#2}}% | ||
5002 | \else% | ||
5003 | \makebox[\al@bayt@width][s]{\arb@utf{#2}}% | ||
5004 | \fi% | ||
4905 | \IfNoValueTF{#3}{% | 5005 | \IfNoValueTF{#3}{% |
4906 | \ifal@verse@delim\makebox[\al@gutter@width][c]{\al@hemistich@delim}% | 5006 | \ifal@verse@delim\makebox[\al@gutter@width][c]{\al@hemistich@delim}% |
4907 | \else% | 5007 | \else% |
@@ -4917,11 +5017,19 @@ | |||
4917 | \fi% | 5017 | \fi% |
4918 | \else% | 5018 | \else% |
4919 | \ifx\al@mode\al@mode@trans% | 5019 | \ifx\al@mode\al@mode@trans% |
4920 | \adjustbox{width=\al@gutter@width, height=\Height}{\arb@utf{#3}}% | 5020 | \ifal@warp@bayt% |
5021 | \adjustbox{width=\al@gutter@width, height=\Height}{\arb@utf{#3}}% | ||
5022 | \else% | ||
5023 | \makebox[\al@gutter@width][s]{\arb@utf{#3}}% | ||
5024 | \fi% | ||
4921 | \else% | 5025 | \else% |
4922 | \makebox[\al@gutter@width][s]{\arb@utf{#3}}% | 5026 | \makebox[\al@gutter@width][s]{\arb@utf{#3}}% |
4923 | \fi\fi}% | 5027 | \fi\fi}% |
4924 | \adjustbox{width=\al@bayt@width, height=\Height}{\arb@utf{#4}}% | 5028 | \ifal@warp@bayt% |
5029 | \adjustbox{width=\al@bayt@width, height=\Height}{\arb@utf{#4}}% | ||
5030 | \else% | ||
5031 | \makebox[\al@bayt@width][s]{\arb@utf{#4}}% | ||
5032 | \fi% | ||
4925 | \ifdefined\spewnotes\spewnotes\else\fi% | 5033 | \ifdefined\spewnotes\spewnotes\else\fi% |
4926 | } | 5034 | } |
4927 | % \end{macrocode} | 5035 | % \end{macrocode} |