aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2016-12-13 19:29:08 +0100
committerRobert Alessi <alessi@robertalessi.net>2016-12-13 19:29:08 +0100
commit42a1cf54a5537eedef0b33a6b8ee762fa10f7145 (patch)
tree08bddc588fa4ca30a78501b0c166294ba46c956b
parent6fd591423c4fb66a6d07dff777e0578b942f8fe3 (diff)
downloadarabluatex-42a1cf54a5537eedef0b33a6b8ee762fa10f7145.tar.gz
verse: done implementing 'arabverse' and \bayt
-rw-r--r--arabluatex.dtx23
1 files changed, 15 insertions, 8 deletions
diff --git a/arabluatex.dtx b/arabluatex.dtx
index f728dc4..e1a5d29 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -2968,9 +2968,10 @@ wa-ya.sIru ta.hta 'l-jild-i
2968% \end{environment} 2968% \end{environment}
2969% \begin{environment}{arabverse} 2969% \begin{environment}{arabverse}
2970% \changes{v1.6}{2016/11/30}{New environment \texttt{arabverse} for 2970% \changes{v1.6}{2016/11/30}{New environment \texttt{arabverse} for
2971% typesetting Arabic poetry} The environment |arabverse| may receive 2971% typesetting Arabic poetry} The |arabverse| environment may receive
2972% different options: |width|, |metre|, |utf| and |mode|; all of them 2972% different options: |width|, |tadwirwidth|, |metre|, |utf| and
2973% are defined here just before the environment |arabverse|: 2973% |mode|; all of them are defined here just before the |arabverse|
2974% environment:
2974% \begin{macrocode} 2975% \begin{macrocode}
2975\newlength{\al@bayt@width} 2976\newlength{\al@bayt@width}
2976\newlength{\al@tadwir@width} 2977\newlength{\al@tadwir@width}
@@ -2980,10 +2981,11 @@ wa-ya.sIru ta.hta 'l-jild-i
2980\define@key[al]{verse}{tadwirwidth}{\setlength{\al@tadwir@width}{#1}} 2981\define@key[al]{verse}{tadwirwidth}{\setlength{\al@tadwir@width}{#1}}
2981\define@key[al]{verse}{metre}{\arb{#1}} 2982\define@key[al]{verse}{metre}{\arb{#1}}
2982\define@boolkey[al]{verse}{utf}[true]{} 2983\define@boolkey[al]{verse}{utf}[true]{}
2984\define@boolkey[al]{verse}{delim}[true]{}
2983\define@choicekey[al]{verse}{mode}{fullvoc, voc, novoc, 2985\define@choicekey[al]{verse}{mode}{fullvoc, voc, novoc,
2984 trans}{\def\al@mode{#1}} 2986 trans}{\def\al@mode{#1}}
2985\presetkeys[al]{verse}{metre=\LR{\vskip -\baselineskip}}{} 2987\presetkeys[al]{verse}{metre=\LR{\vskip -\baselineskip}, utf=false,
2986\presetkeys[al]{verse}{utf=false}{} 2988 delim=false}{}
2987% \end{macrocode} 2989% \end{macrocode}
2988% Then follows the environment itself: 2990% Then follows the environment itself:
2989% \begin{macrocode} 2991% \begin{macrocode}
@@ -3014,15 +3016,20 @@ wa-ya.sIru ta.hta 'l-jild-i
3014% the document to change this default setting. 3016% the document to change this default setting.
3015% \end{macro} 3017% \end{macro}
3016% \begin{macrocode} 3018% \begin{macrocode}
3019\NewDocumentCommand{\arb@utf}{m}{%
3020 \ifal@verse@utf\txarb{#1}\else\arb{#1}\fi}
3017\def\al@hemistich@delim{*} 3021\def\al@hemistich@delim{*}
3018\NewDocumentCommand{\SetHemistichDelim}{m}{\def\al@hemistich@delim{#1}} 3022\NewDocumentCommand{\SetHemistichDelim}{m}{\def\al@hemistich@delim{#1}}
3019\def\al@verse@stroke{\leavevmode\xleaders\hbox{\arb{--}}\hfill\kern0pt} 3023\def\al@verse@stroke{\leavevmode\xleaders\hbox{\arb{--}}\hfill\kern0pt}
3020\NewDocumentCommand{\bayt}{m o m}{% 3024\NewDocumentCommand{\bayt}{m o m}{%
3021 \ifdefined\savenotes\savenotes\else\fi% 3025 \ifdefined\savenotes\savenotes\else\fi%
3022 \edef\al@tatweel{--}% 3026 \edef\al@tatweel{--}%
3023 \adjustbox{width=\al@bayt@width, height=\Height}{\arb{#1}}% 3027 \adjustbox{width=\al@bayt@width, height=\Height}{\arb@utf{#1}}%
3024 \IfNoValueTF{#2}{% 3028 \IfNoValueTF{#2}{%
3029 \ifal@verse@delim\makebox[\al@tadwir@width][c]{\al@hemistich@delim}%
3030 \else%
3025 \hspace{\al@tadwir@width}% 3031 \hspace{\al@tadwir@width}%
3032 \fi
3026 }{% 3033 }{%
3027 \edef\@tempa{#2}% 3034 \edef\@tempa{#2}%
3028 \ifx\@tempa\al@tatweel% 3035 \ifx\@tempa\al@tatweel%
@@ -3032,9 +3039,9 @@ wa-ya.sIru ta.hta 'l-jild-i
3032 \makebox[\al@tadwir@width][s]{\al@verse@stroke}% 3039 \makebox[\al@tadwir@width][s]{\al@verse@stroke}%
3033 \fi% 3040 \fi%
3034 \else% 3041 \else%
3035 \adjustbox{center=\al@tadwir@width, height=\Height}{\arb{#2}} 3042 \adjustbox{center=\al@tadwir@width, height=\Height}{\arb@utf{#2}}%
3036 \fi}% 3043 \fi}%
3037 \adjustbox{width=\al@bayt@width, height=\Height}{\arb{#3}}% 3044 \adjustbox{width=\al@bayt@width, height=\Height}{\arb@utf{#3}}%
3038 \ifdefined\spewnotes\spewnotes\else\fi% 3045 \ifdefined\spewnotes\spewnotes\else\fi%
3039} 3046}
3040% \end{macrocode} 3047% \end{macrocode}