aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2018-05-31 17:12:28 +0200
committerRobert Alessi <alessi@robertalessi.net>2018-05-31 17:12:28 +0200
commit41ab3e046f0a73c1eb9e75cfe7999a3fc24724e1 (patch)
tree7d131c6d88212a4a0eefcc324fc72c5a22141130
parentb6de514c212fc0cbf828f599702d91022de421ad (diff)
downloadarabluatex-41ab3e046f0a73c1eb9e75cfe7999a3fc24724e1.tar.gz
\item needs a special processing. moved it back into brkcmd() function
-rw-r--r--arabluatex.dtx36
-rw-r--r--arabluatex.lua8
2 files changed, 37 insertions, 7 deletions
diff --git a/arabluatex.dtx b/arabluatex.dtx
index c9db780..471ff5a 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -2009,6 +2009,24 @@ word that \cs{arbnull} is applied to.
2009% \end{quote} 2009% \end{quote}
2010% \end{quoting} 2010% \end{quoting}
2011% 2011%
2012% \NEWfeature{v1.12}\cs{abjad} may also be used to convert values of
2013% counters into \arb[trans]{'ab^gad} numbers, like so:--- %
2014% \changes{v1.12}{2018/05/29}{\cs{abjad} can now process \LaTeX\
2015% counters}%
2016% \iffalse
2017%<*example>
2018% \fi
2019\begin{arabluacode}
2020 The \arb[trans]{'ab^gad} number for the current page (\thepage) is
2021 \abjad{\thepage}.
2022\end{arabluacode}
2023% \iffalse
2024%</example>
2025% \fi%
2026%
2027% This technique can be used to produce abjad-numbered lists as will
2028% be demonstrated \vpageref{ref:abjad-list}.
2029%
2012% \subsection{Additional characters} 2030% \subsection{Additional characters}
2013% \label{sec:additional-characters} 2031% \label{sec:additional-characters}
2014% In the manuscripts, the unpointed letters, \arb[trans]{al-.hurUfu 2032% In the manuscripts, the unpointed letters, \arb[trans]{al-.hurUfu
@@ -2255,9 +2273,11 @@ word that \cs{arbnull} is applied to.
2255% there are two easy ways to have them printed. 2273% there are two easy ways to have them printed.
2256% 2274%
2257% If they are little in number, each footnote may be split into pairs 2275% If they are little in number, each footnote may be split into pairs
2258% of \cs{footnote\allowbreak{}mark}|{}| (please mind the braces) in 2276% of \cs{footnote\allowbreak{}mark}|{}| (please mind the braces or
2259% the argument of the \cs{bayt} command and \cs{footnotetext} outside 2277% \enquote{declare} |footnotemark| using \cs{MkArbBreak} to take it
2260% the \cs{bayt} command. 2278% out of the Arabic environment\footnote{See
2279% \vref{sec:declare-new-commands}.}) in the argument of the \cs{bayt}
2280% command and \cs{footnotetext} outside the \cs{bayt} command.
2261% 2281%
2262% If the footnotes are abundant in number, it is advised to load the 2282% If the footnotes are abundant in number, it is advised to load the
2263% \package{footnotehyper} package which \package{arabluatex} will then 2283% \package{footnotehyper} package which \package{arabluatex} will then
@@ -3270,9 +3290,9 @@ qAla barzawayhi bn-u 'azhar-a, ra's-u 'a.tibbA'-i fAris-a...
3270% \label{sec:lists} 3290% \label{sec:lists}
3271% Lists environments are also accepted inside the |arab| 3291% Lists environments are also accepted inside the |arab|
3272% environment. One may either use any of the three standard list 3292% environment. One may either use any of the three standard list
3273% environments, viz. |itemize|, |enumerate| and |description| or use a 3293% environments, viz. |itemize|, |enumerate| and |description| or use
3274% package that provides additional refinements such as 3294% packages that provide additional refinements such as
3275% \package{paralist}. 3295% \package{paralist} or \package{enumitem}.
3276% 3296%
3277% To take a first example, should one wish to typeset a list of 3297% To take a first example, should one wish to typeset a list of
3278% manuscripts, the |description| environment can be used like so:--- 3298% manuscripts, the |description| environment can be used like so:---
@@ -3320,6 +3340,10 @@ qAla barzawayhi bn-u 'azhar-a, ra's-u 'a.tibbA'-i fAris-a...
3320%</example> 3340%</example>
3321% \fi 3341% \fi
3322% 3342%
3343% \label{ref:abjad-list}
3344% As a third example, abjad-numbered lists can be typeset in
3345% conjunction with the \package{enumitem} package, like so:---
3346%
3323% \paragraph{Caveat} 3347% \paragraph{Caveat}
3324% The various French definition files of the \package{babel} package 3348% The various French definition files of the \package{babel} package
3325% viz. |acadian|, |canadien|, |francais|, |frenchb| or |french| all 3349% viz. |acadian|, |canadien|, |francais|, |frenchb| or |french| all
diff --git a/arabluatex.lua b/arabluatex.lua
index acb7b06..a395929 100644
--- a/arabluatex.lua
+++ b/arabluatex.lua
@@ -62,7 +62,6 @@ local albrkcmds = {
62 "RLfootnote", 62 "RLfootnote",
63 "LRfootnote", 63 "LRfootnote",
64 "LRmarginpar", 64 "LRmarginpar",
65 "item",
66 "Footnote", 65 "Footnote",
67 "Marginpar", 66 "Marginpar",
68 "edtext", 67 "edtext",
@@ -105,6 +104,13 @@ local function breakcmd(str)
105 str = gsub(str, dblbkslash * lpeg.Cs(brkcmds[i]) * cmdargs, "}%1%2%3\\arb{") 104 str = gsub(str, dblbkslash * lpeg.Cs(brkcmds[i]) * cmdargs, "}%1%2%3\\arb{")
106 end 105 end
107 end 106 end
107 -- process \item[], then \item[]
108 str = string.gsub(str, "\\(item.?)(%b[])",
109 function(tag, body)
110 body = string.sub(body, 2, -2)
111 return string.format("}\\item[\\arb{%s}] \\arb{", body)
112 end)
113 str = string.gsub(str, "(\\item)(%s+)", "%1{}%2")
108 -- \textcolor 114 -- \textcolor
109 str = string.gsub(str, "\\(textcolor.?)(%b{})(%b{})", 115 str = string.gsub(str, "\\(textcolor.?)(%b{})(%b{})",
110 function(tag, bodycolor, bodytext) 116 function(tag, bodycolor, bodytext)