summaryrefslogtreecommitdiff
path: root/macros/latex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-08-30 03:01:16 +0000
committerNorbert Preining <norbert@preining.info>2020-08-30 03:01:16 +0000
commitc6a1b1f6422e10f363a9de80c4f103f0c155d8bb (patch)
tree1389e67a96950e5a44d635efc31a6bb4f7528511 /macros/latex
parent84ead792ae29b5dcefb36517d42178c278b8cb9b (diff)
CTAN sync 202008300301
Diffstat (limited to 'macros/latex')
-rw-r--r--macros/latex/contrib/animate/ChangeLog3
-rw-r--r--macros/latex/contrib/animate/README.md1
-rw-r--r--macros/latex/contrib/animate/animate.pdfbin3898615 -> 3883925 bytes
-rw-r--r--macros/latex/contrib/animate/animate.sty3
-rw-r--r--macros/latex/contrib/animate/animate.tex7
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/american-apa.lbx8
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.bbx15
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx4
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.dbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/austrian-apa.lbx8
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test-references.bib22
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.pdfbin224598 -> 224605 bytes
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.pdfbin66621 -> 66878 bytes
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.tex8
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/brazilian-apa.lbx8
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/british-apa.lbx8
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/danish-apa.lbx8
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/dutch-apa.lbx8
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/english-apa.lbx8
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/french-apa.lbx8
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/galician-apa.lbx8
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/german-apa.lbx8
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/greek-apa.lbx8
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/italian-apa.lbx8
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/naustrian-apa.lbx8
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/ngerman-apa.lbx8
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/norsk-apa.lbx8
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/norwegian-apa.lbx8
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/nswissgerman-apa.lbx8
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/nynorsk-apa.lbx8
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/portuguese-apa.lbx8
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/russian-apa.lbx8
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/slovene-apa.lbx8
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/spanish-apa.lbx8
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/swedish-apa.lbx8
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/swissgerman-apa.lbx8
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/american-apa6.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/apa6.bbx41
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/apa6.cbx13
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/apa6.dbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/austrian-apa6.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/biblatex-apa6-test-references.bib2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/biblatex-apa6-test.pdfbin110080 -> 110082 bytes
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/biblatex-apa6.pdfbin92893 -> 92735 bytes
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/biblatex-apa6.tex6
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/brazilian-apa6.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/british-apa6.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/danish-apa6.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/dutch-apa6.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/english-apa6.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/french-apa6.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/galician-apa6.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/german-apa6.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/greek-apa6.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/italian-apa6.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/naustrian-apa6.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/ngerman-apa6.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/norsk-apa6.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/norwegian-apa6.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/nswissgerman-apa6.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/nynorsk-apa6.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/portuguese-apa6.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/russian-apa6.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/slovene-apa6.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/spanish-apa6.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/swedish-apa6.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa6/swissgerman-apa6.lbx2
-rw-r--r--macros/latex/contrib/texnegar/INSTALL.txt49
-rw-r--r--macros/latex/contrib/texnegar/README.txt27
-rw-r--r--macros/latex/contrib/texnegar/doc-ligature-texnegar.pdfbin0 -> 13140 bytes
-rw-r--r--macros/latex/contrib/texnegar/doc-ligature-xep.pdfbin0 -> 10112 bytes
-rw-r--r--macros/latex/contrib/texnegar/doc-samples-glyph.pdfbin0 -> 63437 bytes
-rw-r--r--macros/latex/contrib/texnegar/doc-samples-hrule.pdfbin0 -> 62969 bytes
-rw-r--r--macros/latex/contrib/texnegar/doc-samples-xep.pdfbin0 -> 65544 bytes
-rw-r--r--macros/latex/contrib/texnegar/texnegar-doc.ltx599
-rw-r--r--macros/latex/contrib/texnegar/texnegar-doc.pdfbin0 -> 3145159 bytes
-rw-r--r--macros/latex/contrib/texnegar/texnegar-luatex-glyph.pdfbin0 -> 1105890 bytes
-rw-r--r--macros/latex/contrib/texnegar/texnegar-luatex-glyph.tex87
-rw-r--r--macros/latex/contrib/texnegar/texnegar-luatex-leaders-glyph.pdfbin0 -> 325838 bytes
-rw-r--r--macros/latex/contrib/texnegar/texnegar-luatex-leaders-glyph.tex87
-rw-r--r--macros/latex/contrib/texnegar/texnegar-luatex-leaders-hrule.pdfbin0 -> 174805 bytes
-rw-r--r--macros/latex/contrib/texnegar/texnegar-luatex-leaders-hrule.tex87
-rw-r--r--macros/latex/contrib/texnegar/texnegar-xetex-bidi-glyph.pdfbin0 -> 157984 bytes
-rw-r--r--macros/latex/contrib/texnegar/texnegar-xetex-bidi-glyph.tex91
-rw-r--r--macros/latex/contrib/texnegar/texnegar-xetex-bidi-leaders-glyph.pdfbin0 -> 212554 bytes
-rw-r--r--macros/latex/contrib/texnegar/texnegar-xetex-bidi-leaders-glyph.tex91
-rw-r--r--macros/latex/contrib/texnegar/texnegar-xetex-bidi-leaders-hrule.pdfbin0 -> 156632 bytes
-rw-r--r--macros/latex/contrib/texnegar/texnegar-xetex-bidi-leaders-hrule.tex91
-rw-r--r--macros/latex/contrib/texnegar/texnegar-xetex-xepersian-glyph.pdfbin0 -> 156629 bytes
-rw-r--r--macros/latex/contrib/texnegar/texnegar-xetex-xepersian-glyph.tex89
-rw-r--r--macros/latex/contrib/texnegar/texnegar-xetex-xepersian-leaders-glyph.pdfbin0 -> 194658 bytes
-rw-r--r--macros/latex/contrib/texnegar/texnegar-xetex-xepersian-leaders-glyph.tex89
-rw-r--r--macros/latex/contrib/texnegar/texnegar-xetex-xepersian-leaders-hrule.pdfbin0 -> 155930 bytes
-rw-r--r--macros/latex/contrib/texnegar/texnegar-xetex-xepersian-leaders-hrule.tex89
-rw-r--r--macros/latex/contrib/texnegar/texnegar.dtx1808
-rw-r--r--macros/latex/contrib/texnegar/texnegar.ins79
-rw-r--r--macros/latex/contrib/texnegar/texnegar.pdfbin0 -> 535371 bytes
-rw-r--r--macros/latex/contrib/texnegar/xepersian-XB.pdfbin0 -> 106731 bytes
-rw-r--r--macros/latex/contrib/texnegar/xepersian-XB.tex81
99 files changed, 3642 insertions, 171 deletions
diff --git a/macros/latex/contrib/animate/ChangeLog b/macros/latex/contrib/animate/ChangeLog
index 6638dbfa3f..2c474b2b60 100644
--- a/macros/latex/contrib/animate/ChangeLog
+++ b/macros/latex/contrib/animate/ChangeLog
@@ -1,3 +1,6 @@
+2020-08-29
+ * new: \multiframebreak for terminating \multiframe loop
+
2020-08-04
* fix: typesetting failure with `latex-dev'
diff --git a/macros/latex/contrib/animate/README.md b/macros/latex/contrib/animate/README.md
index 3d76e4ab20..3252779d44 100644
--- a/macros/latex/contrib/animate/README.md
+++ b/macros/latex/contrib/animate/README.md
@@ -60,6 +60,7 @@ export
\newframe
\multiframe{<number of frames>}{[<variables>]}{
... repeated (parameterized) material ...
+ \multiframebreak % optional !
}
\end{animateinline}
````
diff --git a/macros/latex/contrib/animate/animate.pdf b/macros/latex/contrib/animate/animate.pdf
index de2203afcf..6e7de8842d 100644
--- a/macros/latex/contrib/animate/animate.pdf
+++ b/macros/latex/contrib/animate/animate.pdf
Binary files differ
diff --git a/macros/latex/contrib/animate/animate.sty b/macros/latex/contrib/animate/animate.sty
index ae65243dba..dd4fe8959c 100644
--- a/macros/latex/contrib/animate/animate.sty
+++ b/macros/latex/contrib/animate/animate.sty
@@ -13,7 +13,7 @@
\NeedsTeXFormat{LaTeX2e}
-\def\@anim@version{2020/08/04}
+\def\@anim@version{2020/08/29}
\ProvidesPackage{animate}
[\@anim@version\space PDF & SVG animations from files and inline graphics]
@@ -2333,6 +2333,7 @@
\@anim@updatevars% update variables
\fi%
\global\advance\@anim@mulframecnt by \@ne%
+ \def\multiframebreak{\global\@anim@mulframecnt=#1}%
\ignorespaces%
#3% execute loop body
\unskip%
diff --git a/macros/latex/contrib/animate/animate.tex b/macros/latex/contrib/animate/animate.tex
index 14316a68dd..1cabe9c9fe 100644
--- a/macros/latex/contrib/animate/animate.tex
+++ b/macros/latex/contrib/animate/animate.tex
@@ -235,6 +235,11 @@ and the environment
\newframe
\multiframe{<number of frames>}{[<variables>]}{
... repeated (parameterized) material ...
+ \multiframebreak % optional!
+}
+\newframe*[...] % some \newframe variant required
+\multiframe{...}{...}{ % between two \multiframes
+ ...
}
\end{animateinline}
\end{verbatim}
@@ -249,6 +254,8 @@ The \verb+\multiframe+ command allows the construction of loops around pictures.
\end{verbatim}
\verb+<variable name>+ is a sequence of one or more letters \emph{without} a leading backslash\footnote{This is different from {\tt\string\multido} (package `multido') where variable names have a leading `{\tt\textbackslash}' in the declaration.}. The first (and possibly only) letter of the variable name determines the type of the variable. There are three different types: integers (`\verb+i+', `\verb+I+'), reals (`\verb+n+', `\verb+N+', `\verb+r+', `\verb+R+') and dimensions or \LaTeX{} lengths (`\verb+d+', `\verb+D+'). Upon first execution of the loop body, the variable takes the value \verb+<initial value>+. Each further iteration increments the variable by \verb+<increment>+. Negative increments must be preceded by `\verb+-+'. Here are some examples: `\verb:i=1+2:', `\verb:Rx=10.0+-2.25:', `\verb:dim=20pt+1ex:'. Within the loop body, variables are expanded to their current value by prepending a backslash to the variable name, that is \verb+\i+, \verb+\Rx+ and \verb+\dim+ according to the previous examples. \verb+\multiframe+ must be surrounded by \verb+\begin{animateinline}+ and \verb+\end{animateinline}+ or by any of the \verb+\newframe+ variants. Two consecutive \verb+\multiframe+ commands must be separated by one of the \verb+\newframe+ variants.
+\verb+\multiframebreak+ can be called to terminate a \verb+\multiframe+ loop prematurely, usually as part of a conditional statement. This command should preferably be placed near the end of the loop body in order not to produce an empty animation frame.
+
By default, the animation is built frame by frame in the order of inclusion of the embedded material. However, extended control of the order of appearance, superposition and repetition of the material is available through the `\verb+timeline+' option (see Section~\ref{sect:timeline}).
\myparagraph*{Sets of graphics files}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/american-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/american-apa.lbx
index 7c4cf8f8d5..7cc81ebb73 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/american-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/american-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{american-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
+\ProvidesFile{american-apa.lbx}[2020/08/28\space v9.14\space APA biblatex localisation]
\InheritBibliographyExtras{american}
\NewBibliographyString{jourarticle}
@@ -279,7 +279,7 @@
\protected\def\mkbibdateapalong#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -301,7 +301,7 @@
\protected\def\mkbibdateapalongextra#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -323,7 +323,7 @@
\protected\def\mkbibdateapalongmdy#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.bbx
index 7071b6e422..1b81bd5e17 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.bbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.bbx
@@ -12,7 +12,7 @@
%%
%% The Current Maintainer of this work is Philip Kime.
-\ProvidesFile{apa.bbx}[2020/05/30\space v9.13\space APA biblatex references style]
+\ProvidesFile{apa.bbx}[2020/08/28\space v9.14\space APA biblatex references style]
\RequireBiber[3]
\RequireBibliographyStyle{standard}
\urlstyle{same} % APA examples all have URLs in same font as text
@@ -761,12 +761,15 @@
\setunit*{\addcomma\addspace}%
\ifentrytype{book}{\printfield{volume}}{}}}
-% Additional post title information in brackets
+% Additional post title information in brackets unless it's the meta subtype "nonacademic"
+% which is used to conditionalise date formats in the .lbx files
\newbibmacro*{addinfo2}{%
\printtexte[brackets]{%
- \iffieldbibstring{entrysubtype}
- {\bibcplstring{\thefield{entrysubtype}}}
- {\printfield{entrysubtype}}%
+ \iffieldequalstr{entrysubtype}{nonacademic}
+ {}
+ {\iffieldbibstring{entrysubtype}
+ {\bibcplstring{\thefield{entrysubtype}}}
+ {\printfield{entrysubtype}}}%
\setunit*{\addsemicolon\addspace}%
\printfield{note}}}
@@ -1773,6 +1776,8 @@
\usebibmacro{apa:related}%
\newunit\newblock
\usebibmacro{eprint}%
+ \newunit\newblock
+ \printlist{organization}%
\addperiod\addspace
\newunit\newblock
\usebibmacro{doi+url}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx
index f5ac0bb007..2dcff1742e 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx
@@ -12,7 +12,7 @@
%%
%% The Current Maintainer of this work is Philip Kime.
-\ProvidesFile{apa.cbx}[2020/05/30\space v9.13\space APA biblatex citation style]
+\ProvidesFile{apa.cbx}[2020/08/28\space v9.14\space APA biblatex citation style]
\RequireBiber[3]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -519,7 +519,7 @@
% (APA 8.11) No parens round year for cites when the cite is in
% parentheses. Use new command \nptextcite for such cites.
-\DeclareDelimAlias*[nptextcite]{finalnamedelim}[parencite]{finalnamedelim}
+\DeclareDelimAlias[nptextcite]{finalnamedelim}[parencite]{finalnamedelim}
\DeclareCiteCommand{\nptextcite}
{\usebibmacro{cite:init}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.dbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.dbx
index aa5ccb7134..dce4fd802a 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.dbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.dbx
@@ -12,7 +12,7 @@
%%
%% The Current Maintainer of this work is Philip Kime.
-\ProvidesFile{apa.dbx}[2020/05/30\space v9.13\space APA biblatex style data model]
+\ProvidesFile{apa.dbx}[2020/08/28\space v9.14\space APA biblatex style data model]
\RequireBiber[3]
\DeclareDatamodelEntrytypes{
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/austrian-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/austrian-apa.lbx
index fa509e76d5..dae9ffb810 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/austrian-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/austrian-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{austrian-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
+\ProvidesFile{austrian-apa.lbx}[2020/08/28\space v9.14\space APA biblatex localisation]
\InheritBibliographyExtras{austrian}
% Following DGPs guidlines for German/Austrian
@@ -154,7 +154,7 @@
\protected\def\mkbibdateapalong#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -176,7 +176,7 @@
\protected\def\mkbibdateapalongextra#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -199,7 +199,7 @@
\protected\def\mkbibdateapalongmdy#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test-references.bib b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test-references.bib
index 446a1b009d..4755c81625 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test-references.bib
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test-references.bib
@@ -542,10 +542,10 @@
}
@ARTICLE{10.1:3b,
+ ENTRYSUBTYPE = {nonacademic},
AUTHOR = {C. Goldman},
TITLE = {The Complicated Calibration of Love, Especially in Adoption},
JOURNALTITLE = {Chicago Tribune},
- KEYWORDS = {nonacademic},
DATE = {2018-11-28}
}
@@ -718,57 +718,57 @@
}
% (APA 10.1 Example 15)
-% Note use of KEYWORDS to indicate non-academic magazine so that dates
+% Note use of ENTRYSUBTYPE to indicate non-academic magazine so that dates
% are formatted correctly
@ARTICLE{10.1:15a,
+ ENTRYSUBTYPE = {nonacademic},
AUTHOR = {S. Bergeson},
TITLE = {Really Cool Neutral Plasmas},
JOURNALTITLE = {Science},
VOLUME = {363},
NUMBER = {6422},
PAGES = {33--34},
- KEYWORDS = {nonacademic},
DATE = {2019-01-04},
DOI = {10.1126/science.aau7988}
}
@ARTICLE{10.1:15b,
+ ENTRYSUBTYPE = {nonacademic},
AUTHOR = {M. Bustillos},
TITLE = {On Video Games and Storytelling},
SUBTITLE = {An Interview with {Tom} {Bissell}},
JOURNALTITLE = {The New Yorker},
- KEYWORDS = {nonacademic},
DATE = {2013-03-19},
URL = {https://www.newyorker.com/books/page-turner/on-video-games-and-storytelling-an-interview-with-tom-bissell}
}
@ARTICLE{10.1:15c,
+ ENTRYSUBTYPE = {nonacademic},
AUTHOR = {K. Wier},
TITLE = {Forgiveness Can Improve Mental and Physical Health},
JOURNALTITLE = {Monitor on Psychology},
VOLUME = {48},
NUMBER = {1},
- KEYWORDS = {nonacademic},
PAGES = {30},
DATE = {2017-01}
}
% (APA 10.1 Example 16)
@ARTICLE{10.1:16a,
+ ENTRYSUBTYPE = {nonacademic},
AUTHOR = {B. Guarino},
TITLE = {How Will Humanity React to Alien Life?
{Psychologists} Have Some Predictions},
JOURNALTITLE = {The Washington Post},
- KEYWORDS = {nonacademic},
DATE = {2017-12-04},
URL = {https://www.washingtonpost.com/news/speaking-of-science/wp/2017/12/04/how-will-humanity-react-to-alien-life-psychologists-have-some-predictions}
}
@ARTICLE{10.1:16b,
+ ENTRYSUBTYPE = {nonacademic},
AUTHOR = {A. Hess},
TITLE = {Cats Who Take Direction},
JOURNALTITLE = {The New York Times},
- KEYWORDS = {nonacademic},
DATE = {2019-01-03},
PAGES = {C1}
}
@@ -788,17 +788,18 @@
% "Comment on the article" string. A simpler but less general way of getting the same
% results would be:
%@ARTICLE{10.1:18,
+% ENTRYSUBTYPE = {nonacademic},
% AUTHOR = {{KS in NJ}},
% TITLE = {From this article, it sounds like men are figuring
% something out that women have known forever. {I} know of many},
% TITLEADDON = {Comment on the article ``How workout buddies can help stave off loneliness''},
% JOURNALTITLE = {The Washington Post},
-% KEYWORDS = {nonacademic},
% DATE = {2019-01-15},
% URL = {https://wapo.st/2HDToGJ}
%}
@ARTICLE{10.1:18,
+ ENTRYSUBTYPE = {nonacademic},
AUTHOR = {{KS in NJ}},
TITLE = {From this article, it sounds like men are figuring
something out that women have known forever. {I} know of many},
@@ -806,7 +807,6 @@
RELATEDTYPE = {commenton},
RELATEDSTRING = {Comment on the article},
JOURNALTITLE = {The Washington Post},
- KEYWORDS = {nonacademic},
DATE = {2019-01-15},
URL = {https://wapo.st/2HDToGJ}
}
@@ -1619,13 +1619,13 @@
% (APA 10.7 Example 68)
@ARTICLE{10.7:68,
+ ENTRYSUBTYPE = {nonacademic},
AUTHOR = {F. Santos},
TITLE = {Reframing Refugee Children's Stories},
RELATED = {10.7:68r},
RELATEDTYPE = {reviewof},
RELATEDSTRING = {Review of the book},
JOURNALTITLE = {The New York Times},
- KEYWORDS = {nonacademic},
DATE = {2019-01-11},
URL = {https://nyt.ms/2Hlgjk3}
}
@@ -2464,7 +2464,7 @@
@ONLINE{10.16:114,
GROUPAUTHOR = {{U.S. Census Bureau}},
TITLE = {{U.S.} and World Population Clock},
- EPRINT = {U.S. Department of Commerce},
+ ORGANIZATION = {U.S. Department of Commerce},
URL = {https://www.census.gov/popclock/},
URLDATE = {2019-07-03}
}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.pdf b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.pdf
index 51fe552e24..da9eea03db 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.pdf
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.pdf
Binary files differ
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.pdf b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.pdf
index 591c07058a..971c8be80e 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.pdf
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.pdf
Binary files differ
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.tex b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.tex
index 20605c0738..fb47beb8d2 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.tex
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.tex
@@ -24,7 +24,7 @@
url={http://mirror.ctan.org/macros/latex/exptl/biblatex-contrib/biblatex-apa/},
author={Philip Kime},
email={Philip@kime.org.uk},
- revision={9.13},
+ revision={9.14},
date={\today}}
\hypersetup{%
@@ -365,7 +365,7 @@ associated |EDITORTYPE| fields \apa{10.5:63}.
\subsubsection{Article types}
Since |ARTICLE| entry types are used extensively for academic journals and
-also newspaper articles, the |KEYWORD| ``nonacademic'' should be specified
+also newspaper articles, the |ENTRYSUBTYPE| ``nonacademic'' should be specified
for articles that are not academic articles in an academic journal. This is
because date formatting differs in the style between academic and
non-academic articles. This is a more general solution than introducing new
@@ -397,6 +397,10 @@ the examples.
\begin{changelog}
+\begin{release}{9.14}{2020-08-28}
+\item Bugfixes, compat with biblatex 3.15
+\end{release}
+
\begin{release}{9.13}{2020-05-30}
\item Fixed Spanish long date format
\end{release}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/brazilian-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/brazilian-apa.lbx
index c769ed240d..a0184d562d 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/brazilian-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/brazilian-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{brazilian-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
+\ProvidesFile{brazilian-apa.lbx}[2020/08/28\space v9.14\space APA biblatex localisation]
\InheritBibliographyExtras{brazilian}
\NewBibliographyString{jourarticle}
@@ -149,7 +149,7 @@
\protected\def\mkbibdateapalong#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -171,7 +171,7 @@
\protected\def\mkbibdateapalongextra#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -193,7 +193,7 @@
\protected\def\mkbibdateapalongmdy#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/british-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/british-apa.lbx
index a8587b0ecc..32fe71feae 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/british-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/british-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{british-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
+\ProvidesFile{british-apa.lbx}[2020/08/28\space v9.14\space APA biblatex localisation]
\InheritBibliographyExtras{british}
\NewBibliographyString{jourarticle}
@@ -153,7 +153,7 @@
\protected\def\mkbibdateapalong#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -175,7 +175,7 @@
\protected\def\mkbibdateapalongextra#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -197,7 +197,7 @@
\protected\def\mkbibdateapalongmdy#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/danish-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/danish-apa.lbx
index 8cbc8bc31d..06394e17a7 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/danish-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/danish-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{danish-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
+\ProvidesFile{danish-apa.lbx}[2020/08/28\space v9.14\space APA biblatex localisation]
\InheritBibliographyExtras{danish}
\NewBibliographyString{jourarticle}
@@ -165,7 +165,7 @@
\protected\def\mkbibdateapalong#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -189,7 +189,7 @@
\protected\def\mkbibdateapalongextra#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -213,7 +213,7 @@
\protected\def\mkbibdateapalongmdy#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/dutch-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/dutch-apa.lbx
index a628eb3da9..e9a4a11ac4 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/dutch-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/dutch-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{dutch-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
+\ProvidesFile{dutch-apa.lbx}[2020/08/28\space v9.14\space APA biblatex localisation]
\InheritBibliographyExtras{dutch}
\NewBibliographyString{jourarticle}
@@ -153,7 +153,7 @@
\protected\def\mkbibdateapalong#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -175,7 +175,7 @@
\protected\def\mkbibdateapalongextra#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -197,7 +197,7 @@
\protected\def\mkbibdateapalongmdy#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/english-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/english-apa.lbx
index 53dd289fcf..2bb647af19 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/english-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/english-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{english-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
+\ProvidesFile{english-apa.lbx}[2020/08/28\space v9.14\space APA biblatex localisation]
\InheritBibliographyExtras{english}
\NewBibliographyString{jourarticle}
@@ -155,7 +155,7 @@
\protected\def\mkbibdateapalong#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -177,7 +177,7 @@
\protected\def\mkbibdateapalongextra#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -199,7 +199,7 @@
\protected\def\mkbibdateapalongmdy#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/french-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/french-apa.lbx
index e8dc9eb374..4fcc6b1392 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/french-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/french-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{french-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
+\ProvidesFile{french-apa.lbx}[2020/08/28\space v9.14\space APA biblatex localisation]
\InheritBibliographyExtras{french}
\NewBibliographyString{jourarticle}
@@ -148,7 +148,7 @@
\protected\def\mkbibdateapalong#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -170,7 +170,7 @@
\protected\def\mkbibdateapalongextra#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -192,7 +192,7 @@
\protected\def\mkbibdateapalongmdy#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/galician-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/galician-apa.lbx
index 607d7686f7..97384b64ad 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/galician-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/galician-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{galician-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
+\ProvidesFile{galician-apa.lbx}[2020/08/28\space v9.14\space APA biblatex localisation]
\InheritBibliographyExtras{galician}
\setcounter{smartand}{0} % Turn off "smart and" or ampersands will all be replaced
@@ -166,7 +166,7 @@
\protected\def\mkbibdateapalong#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -188,7 +188,7 @@
\protected\def\mkbibdateapalongextra#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -210,7 +210,7 @@
\protected\def\mkbibdateapalongmdy#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/german-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/german-apa.lbx
index 68e235370a..f05de16a89 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/german-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/german-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{german-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
+\ProvidesFile{german-apa.lbx}[2020/08/28\space v9.14\space APA biblatex localisation]
\InheritBibliographyExtras{german}
% Following DGPs guidlines for German/Austrian
@@ -154,7 +154,7 @@
\protected\def\mkbibdateapalong#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -176,7 +176,7 @@
\protected\def\mkbibdateapalongextra#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -199,7 +199,7 @@
\protected\def\mkbibdateapalongmdy#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/greek-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/greek-apa.lbx
index 7cf6cc7cdf..0381d222fa 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/greek-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/greek-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{greek-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
+\ProvidesFile{greek-apa.lbx}[2020/08/28\space v9.14\space APA biblatex localisation]
\InheritBibliographyExtras{greek}
\NewBibliographyString{jourarticle}
@@ -171,7 +171,7 @@
\protected\def\mkbibdateapalong#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -193,7 +193,7 @@
\protected\def\mkbibdateapalongextra#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -215,7 +215,7 @@
\protected\def\mkbibdateapalongmdy#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/italian-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/italian-apa.lbx
index 8b1730ceaf..8486f557e3 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/italian-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/italian-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{italian-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
+\ProvidesFile{italian-apa.lbx}[2020/08/28\space v9.14\space APA biblatex localisation]
\InheritBibliographyExtras{italian}
\NewBibliographyString{jourarticle}
@@ -153,7 +153,7 @@
\protected\def\mkbibdateapalong#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -175,7 +175,7 @@
\protected\def\mkbibdateapalongextra#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -197,7 +197,7 @@
\protected\def\mkbibdateapalongmdy#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/naustrian-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/naustrian-apa.lbx
index 375d04724e..4e652cdc16 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/naustrian-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/naustrian-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{naustrian-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
+\ProvidesFile{naustrian-apa.lbx}[2020/08/28\space v9.14\space APA biblatex localisation]
\InheritBibliographyExtras{naustrian}
% Following DGPs guidlines for German/Austrian
@@ -154,7 +154,7 @@
\protected\def\mkbibdateapalong#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -176,7 +176,7 @@
\protected\def\mkbibdateapalongextra#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -199,7 +199,7 @@
\protected\def\mkbibdateapalongmdy#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/ngerman-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/ngerman-apa.lbx
index 09ed5836c8..892ab82d35 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/ngerman-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/ngerman-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{ngerman-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
+\ProvidesFile{ngerman-apa.lbx}[2020/08/28\space v9.14\space APA biblatex localisation]
\InheritBibliographyExtras{ngerman}
% Following DGPs guidlines for German/Austrian
@@ -156,7 +156,7 @@
\protected\def\mkbibdateapalong#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -178,7 +178,7 @@
\protected\def\mkbibdateapalongextra#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -201,7 +201,7 @@
\protected\def\mkbibdateapalongmdy#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/norsk-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/norsk-apa.lbx
index ce0e551221..35200f9d06 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/norsk-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/norsk-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{norsk-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
+\ProvidesFile{norsk-apa.lbx}[2020/08/28\space v9.14\space APA biblatex localisation]
\InheritBibliographyExtras{norsk}
\NewBibliographyString{revisededition}
@@ -113,7 +113,7 @@
\protected\def\mkbibdateapalong#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -137,7 +137,7 @@
\protected\def\mkbibdateapalongextra#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -161,7 +161,7 @@
\protected\def\mkbibdateapalongmdy#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/norwegian-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/norwegian-apa.lbx
index 334d6c55a8..c6c5746136 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/norwegian-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/norwegian-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{norwegian-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
+\ProvidesFile{norwegian-apa.lbx}[2020/08/28\space v9.14\space APA biblatex localisation]
\InheritBibliographyExtras{norwegian}
\NewBibliographyString{revisededition}
@@ -152,7 +152,7 @@
\protected\def\mkbibdateapalong#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -176,7 +176,7 @@
\protected\def\mkbibdateapalongextra#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -200,7 +200,7 @@
\protected\def\mkbibdateapalongmdy#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/nswissgerman-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/nswissgerman-apa.lbx
index 2cd715be0a..f51849a7dd 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/nswissgerman-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/nswissgerman-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{nswissgerman-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
+\ProvidesFile{nswissgerman-apa.lbx}[2020/08/28\space v9.14\space APA biblatex localisation]
\InheritBibliographyExtras{nswissgerman}
% Following DGPs guidlines for German/Austrian/Swiss German
@@ -153,7 +153,7 @@
\protected\def\mkbibdateapalong#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -175,7 +175,7 @@
\protected\def\mkbibdateapalongextra#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -198,7 +198,7 @@
\protected\def\mkbibdateapalongmdy#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/nynorsk-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/nynorsk-apa.lbx
index 1061781117..ed51557726 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/nynorsk-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/nynorsk-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{nynorsk-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
+\ProvidesFile{nynorsk-apa.lbx}[2020/08/28\space v9.14\space APA biblatex localisation]
\InheritBibliographyExtras{nynorsk}
\NewBibliographyString{jourarticle}
@@ -153,7 +153,7 @@
\protected\def\mkbibdateapalong#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -177,7 +177,7 @@
\protected\def\mkbibdateapalongextra#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -201,7 +201,7 @@
\protected\def\mkbibdateapalongmdy#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/portuguese-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/portuguese-apa.lbx
index d8d7f60c99..6cfa4e8424 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/portuguese-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/portuguese-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{portuguese-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
+\ProvidesFile{portuguese-apa.lbx}[2020/08/28\space v9.14\space APA biblatex localisation]
\InheritBibliographyExtras{portuguese}
\NewBibliographyString{jourarticle}
@@ -149,7 +149,7 @@
\protected\def\mkbibdateapalong#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -171,7 +171,7 @@
\protected\def\mkbibdateapalongextra#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -193,7 +193,7 @@
\protected\def\mkbibdateapalongmdy#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/russian-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/russian-apa.lbx
index f82ec500e0..de2920aa47 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/russian-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/russian-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{russian-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
+\ProvidesFile{russian-apa.lbx}[2020/08/28\space v9.14\space APA biblatex localisation]
\InheritBibliographyExtras{russian}
\NewBibliographyString{jourarticle}
@@ -160,7 +160,7 @@
\protected\def\mkbibdateapalong#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -184,7 +184,7 @@
\protected\def\mkbibdateapalongextra#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -208,7 +208,7 @@
\protected\def\mkbibdateapalongmdy#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/slovene-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/slovene-apa.lbx
index e2c5c29a0c..ca59111347 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/slovene-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/slovene-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{slovene-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
+\ProvidesFile{slovene-apa.lbx}[2020/08/28\space v9.14\space APA biblatex localisation]
\InheritBibliographyExtras{slovene}
\NewBibliographyString{jourarticle}
@@ -188,7 +188,7 @@
\protected\def\mkbibdateapalong#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -212,7 +212,7 @@
\protected\def\mkbibdateapalongextra#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -236,7 +236,7 @@
\protected\def\mkbibdateapalongmdy#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/spanish-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/spanish-apa.lbx
index 7c975a11f4..6d9627f2cc 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/spanish-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/spanish-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{spanish-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
+\ProvidesFile{spanish-apa.lbx}[2020/08/28\space v9.14\space APA biblatex localisation]
\InheritBibliographyExtras{spanish}
\setcounter{smartand}{0} % Turn off "smart and" or ampersands will all be replaced
@@ -165,7 +165,7 @@
\protected\def\mkbibdateapalong#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -187,7 +187,7 @@
\protected\def\mkbibdateapalongextra#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -210,7 +210,7 @@
\protected\def\mkbibdateapalongmdy#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/swedish-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/swedish-apa.lbx
index db122c2273..a7c425d867 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/swedish-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/swedish-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{swedish-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
+\ProvidesFile{swedish-apa.lbx}[2020/08/28\space v9.14\space APA biblatex localisation]
\InheritBibliographyExtras{swedish}
\NewBibliographyString{jourarticle}
@@ -151,7 +151,7 @@
\protected\def\mkbibdateapalong#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -175,7 +175,7 @@
\protected\def\mkbibdateapalongextra#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -199,7 +199,7 @@
\protected\def\mkbibdateapalongmdy#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/swissgerman-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/swissgerman-apa.lbx
index fde62e3aba..5a165011c7 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/swissgerman-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/swissgerman-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{swissgerman-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
+\ProvidesFile{swissgerman-apa.lbx}[2020/08/28\space v9.14\space APA biblatex localisation]
\InheritBibliographyExtras{swissgerman}
% Following DGPs guidlines for German/Austrian/Swiss German
@@ -155,7 +155,7 @@
\protected\def\mkbibdateapalong#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -177,7 +177,7 @@
\protected\def\mkbibdateapalongextra#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
@@ -200,7 +200,7 @@
\protected\def\mkbibdateapalongmdy#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
+ and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
{\clearfield{labelmonth}%
\clearfield{labelday}}
{}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/american-apa6.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/american-apa6.lbx
index 3ce35769a6..356ea5c1bf 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/american-apa6.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/american-apa6.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{american-apa6.lbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex localisation]
+\ProvidesFile{american-apa6.lbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex localisation]
\InheritBibliographyExtras{american}
% (APA 6.22) The example abbreviations
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/apa6.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/apa6.bbx
index 56248f2870..7c207ed44f 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/apa6.bbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/apa6.bbx
@@ -12,7 +12,7 @@
%%
%% The Current Maintainer of this work is Philip Kime.
-\ProvidesFile{apa6.bbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex references style]
+\ProvidesFile{apa6.bbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex references style]
\RequireBiber[3]
\RequireBibliographyStyle{standard}
\urlstyle{same} % APA examples all have URLs in same font as text
@@ -409,9 +409,13 @@
\ifthenelse{\value{listcount}=\value{listtotal}}%
{\ifmorenames{\printdelim{andothersdelim}\bibstring{andothers}}{}}{}}
+\DeclareDelimFormat[bib,biblist]{nameyeardelim}{\newunitpunct}
+\DeclareDelimAlias*[bib,biblist]{nonameyeardelim}{nameyeardelim}
+
\renewbibmacro*{author}{%
\ifnameundef{author}
- {\usebibmacro{labeltitle}}
+ {\usebibmacro{labeltitle}%
+ \setunit{\printdelim{nonameyeardelim}}}
{\printnames[apaauthor][-\value{listtotal}]{author}%
\setunit*{\addspace}%
\printfield{nameaddon}%
@@ -422,8 +426,9 @@
\bibstring{with}%
\setunit{\addspace}%
\printnames[apaauthor][-\value{listtotal}]{with}}%
- \setunit{\addspace}}}%
- \newunit\newblock%
+ \setunit{\addspace}}%
+ \setunit{\printdelim{nameyeardelim}}}%
+ \newblock
\usebibmacro{labelyear+extradate}}
%
@@ -566,7 +571,7 @@
\ifnameundef{producer}\AND%
\ifnameundef{director}\AND%
\ifnameundef{writer}}
- {\newunit\newblock
+ {\setunit{\printdelim{nonameyeardelim}}\newblock
\usebibmacro{labelyear+extradate}}
{}}}
@@ -702,9 +707,9 @@
% don't lose sight of the fact we once had an editor for
% various year placement tests
\clearname{editor}%
- \setunit{\adddot\addspace}%
+ \setunit{\printdelim{nameyeardelim}}%
\usebibmacro{labelyear+extradate}%
- \setunit{\adddot\addspace}}}
+ \newunit}}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -871,7 +876,7 @@
\setunit{\addspace}%
\printfield{issuetitle}%
\notbool{bbx:editorinauthpos}
- {\newunit
+ {\setunit{\printdelim{nonameyeardelim}}%
\usebibmacro{labelyear+extradate}}
{}}
@@ -1040,14 +1045,8 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (APA 7.06) Reviews
-% The title of the review depends on the entrytype of the thing reviewed
\newcommand*{\begrelateddelimreviewof}{\addspace}
-\DeclareFieldFormat[review]{title}{%
- \entrydata*{\thefield{related}}{%
- \printtext[title]{%
- \printtext[apacase]{%
- \thefield{savedtitle}}}}}
-
+\DeclareFieldFormat[review]{title}{#1}
\DeclareFieldFormat[review]{pages}{#1}
\DeclareFieldFormat[review]{volume}{\mkbibemph{\apanum{#1}}}
\DeclareFieldFormat[review]{number}{\mkbibparens{\apanum{#1}}}
@@ -1754,7 +1753,7 @@
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
- \newunit\newblock
+ \setunit{\printdelim{nonameyeardelim}}\newblock
\ifbool{bbx:noreviewauthor}{\usebibmacro{labelyear+extradate}}{}%
\newunit\newblock
\usebibmacro{journal+issuetitle}%
@@ -1894,7 +1893,7 @@
\usebibmacro{writer}%
\usebibmacro{director}%
\usebibmacro{producer}%
- \newunit\newblock
+ \setunit{\printdelim{nameyeardelim}}\newblock
\usebibmacro{labelyear+extradate}%
\setunit{\printdelim{nametitledelim}}\newblock
\usebibmacro{title}%
@@ -1923,7 +1922,7 @@
\usebibmacro{writer}%
\usebibmacro{director}%
\usebibmacro{producer}%
- \newunit\newblock
+ \setunit{\printdelim{nameyeardelim}}\newblock
\usebibmacro{labelyear+extradate}%
\setunit{\printdelim{nametitledelim}}\newblock
\usebibmacro{title}%
@@ -1952,7 +1951,7 @@
\usebibmacro{writer}%
\usebibmacro{director}%
\usebibmacro{producer}%
- \newunit\newblock
+ \setunit{\printdelim{nameyeardelim}}\newblock
\usebibmacro{labelyear+extradate}%
\setunit{\printdelim{nametitledelim}}\newblock
\usebibmacro{title}%
@@ -2125,8 +2124,8 @@
{}}
%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
\newbibmacro*{type+institution}{%
\setunit{\addspace}%
\ifboolexpr{ test {\iffieldundef{type}} and test {\iflistundef{institution}} }
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/apa6.cbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/apa6.cbx
index 50815fdc3f..2c0b0f360e 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/apa6.cbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/apa6.cbx
@@ -12,7 +12,7 @@
%%
%% The Current Maintainer of this work is Philip Kime.
-\ProvidesFile{apa6.cbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex citation style]
+\ProvidesFile{apa6.cbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex citation style]
\RequireBiber[3]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -28,7 +28,6 @@
% (APA 6.11) requires comma separator between authors and years
\DeclareDelimFormat{nameyeardelim}{\addcomma\space}
-\DeclareDelimFormat[textcite]{nameyeardelim}{\addcomma\space}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -260,7 +259,9 @@
{\iffieldundef{shorthand}%
% Cite using title
{\usebibmacro{cite:noname}%
- \setunit{\global\booltrue{cbx:parens}\addspace\bibopenparen}%
+ \setunit{\global\booltrue{cbx:parens}%
+ \printdelim{nameyeardelim}%
+ \bibopenparen}%
\usebibmacro{cite:plabelyear+extradate}}
% Cite using shorthand
{\usebibmacro{cite:shorthand}}}
@@ -274,7 +275,9 @@
{\printnames{shortauthor}}
{\printnames[labelname][-\value{listtotal}]{author}}}%
% Year
- \setunit{\global\booltrue{cbx:parens}\addspace\bibopenparen}%
+ \setunit{\global\booltrue{cbx:parens}%
+ \printdelim{nonameyeardelim}%
+ \bibopenparen}%
% Put the shortauthor inside the year brackets if necessary
\ifnameundef{shortauthor}
{}
@@ -506,7 +509,7 @@
% (APA 6.21) No parens round year for cites when the cite is in
% parentheses. Use new command \nptextcite for such cites.
-\DeclareDelimAlias*[nptextcite]{finalnamedelim}[parencite]{finalnamedelim}
+\DeclareDelimAlias[nptextcite]{finalnamedelim}[parencite]{finalnamedelim}
\DeclareCiteCommand{\nptextcite}
{\usebibmacro{cite:init}%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/apa6.dbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/apa6.dbx
index 1e31e40fa8..b1dd1b416a 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/apa6.dbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/apa6.dbx
@@ -12,7 +12,7 @@
%%
%% The Current Maintainer of this work is Philip Kime.
-\ProvidesFile{apa6.dbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex style data model]
+\ProvidesFile{apa6.dbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex style data model]
\RequireBiber[3]
\DeclareDatamodelEntrytypes{
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/austrian-apa6.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/austrian-apa6.lbx
index 0ce89fce42..bc0f3fa72a 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/austrian-apa6.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/austrian-apa6.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{austrian-apa6.lbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex localisation]
+\ProvidesFile{austrian-apa6.lbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex localisation]
\InheritBibliographyExtras{austrian}
% Following DGPs guidlines for German/Austrian
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/biblatex-apa6-test-references.bib b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/biblatex-apa6-test-references.bib
index c6d6892f39..9fb7ca3523 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/biblatex-apa6-test-references.bib
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/biblatex-apa6-test-references.bib
@@ -388,7 +388,7 @@
RELATEDTYPE = {reprintfrom}
}
-@INCOLLECTION{mcppiaget,
+@BOOK{mcppiaget,
EDITOR = {P. H. Mussen},
TITLE = {Manual of Child Psychology},
DATE = {1970},
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/biblatex-apa6-test.pdf b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/biblatex-apa6-test.pdf
index c056b75b0f..906a0d4f47 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/biblatex-apa6-test.pdf
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/biblatex-apa6-test.pdf
Binary files differ
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/biblatex-apa6.pdf b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/biblatex-apa6.pdf
index 0a57a7be90..d9911d0040 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/biblatex-apa6.pdf
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/biblatex-apa6.pdf
Binary files differ
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/biblatex-apa6.tex b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/biblatex-apa6.tex
index a1b236afe6..a197a6cfd4 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/biblatex-apa6.tex
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/biblatex-apa6.tex
@@ -24,7 +24,7 @@
url={http://mirror.ctan.org/macros/latex/exptl/biblatex-contrib/biblatex-apa/},
author={Philip Kime},
email={Philip@kime.org.uk},
- revision={8.4},
+ revision={8.5},
date={\today}}
\hypersetup{%
@@ -457,6 +457,10 @@ applied to the data stream by |biber| and does not change your \file{.bib}.
\section{Revision history}\label{rev}
\begin{changelog}
+\begin{release}{8.5}{2020-08-28}
+\item Misc bug fixes, compat with biblatex 3.15
+\end{release}
+
\begin{release}{8.4}{2020-05-03}
\item Misc bug fixes
\end{release}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/brazilian-apa6.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/brazilian-apa6.lbx
index 4ec7f9158c..8a7d554131 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/brazilian-apa6.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/brazilian-apa6.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{brazilian-apa6.lbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex localisation]
+\ProvidesFile{brazilian-apa6.lbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex localisation]
\InheritBibliographyExtras{brazilian}
% (APA 6.22) The example abbreviations
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/british-apa6.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/british-apa6.lbx
index 31642b76bb..9fcc440b00 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/british-apa6.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/british-apa6.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{british-apa6.lbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex localisation]
+\ProvidesFile{british-apa6.lbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex localisation]
\InheritBibliographyExtras{british}
% (APA 6.22) The example abbreviations
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/danish-apa6.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/danish-apa6.lbx
index dc237de87c..4b465b5df0 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/danish-apa6.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/danish-apa6.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{danish-apa6.lbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex localisation]
+\ProvidesFile{danish-apa6.lbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex localisation]
\InheritBibliographyExtras{danish}
% (APA 6.22) The example abbreviations
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/dutch-apa6.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/dutch-apa6.lbx
index 903a7b77ae..03c1850e7b 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/dutch-apa6.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/dutch-apa6.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{dutch-apa6.lbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex localisation]
+\ProvidesFile{dutch-apa6.lbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex localisation]
\InheritBibliographyExtras{dutch}
% (APA 6.22) The example abbreviations
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/english-apa6.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/english-apa6.lbx
index 79336ea83e..f8d790b8ac 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/english-apa6.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/english-apa6.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{english-apa6.lbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex localisation]
+\ProvidesFile{english-apa6.lbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex localisation]
\InheritBibliographyExtras{english}
% (APA 6.22) The example abbreviations
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/french-apa6.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/french-apa6.lbx
index 4aed01e37a..23a6f819c7 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/french-apa6.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/french-apa6.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{french-apa6.lbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex localisation]
+\ProvidesFile{french-apa6.lbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex localisation]
\InheritBibliographyExtras{french}
% (APA 6.22) The example abbreviations
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/galician-apa6.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/galician-apa6.lbx
index 5c90b5fb0c..651b2f8ef9 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/galician-apa6.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/galician-apa6.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{galician-apa6.lbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex localisation]
+\ProvidesFile{galician-apa6.lbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex localisation]
\InheritBibliographyExtras{galician}
\setcounter{smartand}{0} % Turn off "smart and" or ampersands will all be replaced
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/german-apa6.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/german-apa6.lbx
index dd01497295..7347886b69 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/german-apa6.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/german-apa6.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{german-apa6.lbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex localisation]
+\ProvidesFile{german-apa6.lbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex localisation]
\InheritBibliographyExtras{german}
% (APA 6.22) The example abbreviations
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/greek-apa6.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/greek-apa6.lbx
index c65da12ebe..61077828aa 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/greek-apa6.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/greek-apa6.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{greek-apa6.lbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex localisation]
+\ProvidesFile{greek-apa6.lbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex localisation]
\InheritBibliographyExtras{greek}
% (APA 6.22) The example abbreviations
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/italian-apa6.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/italian-apa6.lbx
index f24dda01a3..4804c5ebed 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/italian-apa6.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/italian-apa6.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{italian-apa6.lbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex localisation]
+\ProvidesFile{italian-apa6.lbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex localisation]
\InheritBibliographyExtras{italian}
% (APA 6.22) The example abbreviations
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/naustrian-apa6.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/naustrian-apa6.lbx
index efc7dadade..407fa3a75e 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/naustrian-apa6.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/naustrian-apa6.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{naustrian-apa6.lbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex localisation]
+\ProvidesFile{naustrian-apa6.lbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex localisation]
\InheritBibliographyExtras{naustrian}
% (APA 6.22) The example abbreviations
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/ngerman-apa6.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/ngerman-apa6.lbx
index 3647ba8fc1..ce15270378 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/ngerman-apa6.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/ngerman-apa6.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{ngerman-apa6.lbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex localisation]
+\ProvidesFile{ngerman-apa6.lbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex localisation]
\InheritBibliographyExtras{ngerman}
% (APA 6.22) The example abbreviations
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/norsk-apa6.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/norsk-apa6.lbx
index 21cf3366ac..df71dc7273 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/norsk-apa6.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/norsk-apa6.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{norsk-apa6.lbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex localisation]
+\ProvidesFile{norsk-apa6.lbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex localisation]
\InheritBibliographyExtras{norsk}
% (APA 6.22) The example abbreviations
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/norwegian-apa6.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/norwegian-apa6.lbx
index 1e4bd4f649..08d984eb3a 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/norwegian-apa6.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/norwegian-apa6.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{norwegian-apa6.lbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex localisation]
+\ProvidesFile{norwegian-apa6.lbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex localisation]
\InheritBibliographyExtras{norwegian}
% (APA 6.22) The example abbreviations
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/nswissgerman-apa6.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/nswissgerman-apa6.lbx
index 793ea22062..098f4d7579 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/nswissgerman-apa6.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/nswissgerman-apa6.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{nswissgerman-apa6.lbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex localisation]
+\ProvidesFile{nswissgerman-apa6.lbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex localisation]
\InheritBibliographyExtras{nswissgerman}
% (APA 6.22) The example abbreviations
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/nynorsk-apa6.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/nynorsk-apa6.lbx
index d6660c762a..5176547db4 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/nynorsk-apa6.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/nynorsk-apa6.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{nynorsk-apa6.lbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex localisation]
+\ProvidesFile{nynorsk-apa6.lbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex localisation]
\InheritBibliographyExtras{nynorsk}
% (APA 6.22) The example abbreviations
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/portuguese-apa6.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/portuguese-apa6.lbx
index 9b272a9977..0551cb4189 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/portuguese-apa6.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/portuguese-apa6.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{portuguese-apa6.lbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex localisation]
+\ProvidesFile{portuguese-apa6.lbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex localisation]
\InheritBibliographyExtras{portuguese}
% (APA 6.22) The example abbreviations
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/russian-apa6.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/russian-apa6.lbx
index 42399aa9c9..ad60f585fc 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/russian-apa6.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/russian-apa6.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{russian-apa6.lbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex localisation]
+\ProvidesFile{russian-apa6.lbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex localisation]
\InheritBibliographyExtras{russian}
% (APA 6.22) The example abbreviations
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/slovene-apa6.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/slovene-apa6.lbx
index e04b8fcac9..61a69d468c 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/slovene-apa6.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/slovene-apa6.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{slovene-apa6.lbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex localisation]
+\ProvidesFile{slovene-apa6.lbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex localisation]
\InheritBibliographyExtras{slovene}
% (APA 6.22) The example abbreviations
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/spanish-apa6.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/spanish-apa6.lbx
index 79e7669705..3905d28204 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/spanish-apa6.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/spanish-apa6.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{spanish-apa6.lbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex localisation]
+\ProvidesFile{spanish-apa6.lbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex localisation]
\InheritBibliographyExtras{spanish}
\setcounter{smartand}{0} % Turn off "smart and" or ampersands will all be replaced
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/swedish-apa6.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/swedish-apa6.lbx
index 667af52f53..0a72a2a65b 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/swedish-apa6.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/swedish-apa6.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{swedish-apa6.lbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex localisation]
+\ProvidesFile{swedish-apa6.lbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex localisation]
\InheritBibliographyExtras{swedish}
% (APA 6.22) The example abbreviations
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/swissgerman-apa6.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/swissgerman-apa6.lbx
index 335cd7df89..9cce700b7e 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa6/swissgerman-apa6.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa6/swissgerman-apa6.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{swissgerman-apa6.lbx}[2020/05/03\space v8.4\space APA 6th ed. biblatex localisation]
+\ProvidesFile{swissgerman-apa6.lbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex localisation]
\InheritBibliographyExtras{swissgerman}
% Following DGPs guidlines for German/Austrian/Swiss German
diff --git a/macros/latex/contrib/texnegar/INSTALL.txt b/macros/latex/contrib/texnegar/INSTALL.txt
new file mode 100644
index 0000000000..bc9b2a85d3
--- /dev/null
+++ b/macros/latex/contrib/texnegar/INSTALL.txt
@@ -0,0 +1,49 @@
+ texnegar -- INSTALL
+======================
+
+ Source: texnegar.dtx (2020-08-29 v0.1a)
+ Author: Hossein Movahhedian
+ Info: filecontents + macro + verbatim
+ License: LPPL 1.3c
+ Copyright (C) 2020 Hossein Movahedian.
+ <dma8hm1334 AT gmail DOT com>
+
+- To extract the package and at the same time produce the
+ documentation, execute: xelatex thrice on texnegar.dtx.
+
+Files should then be moved to appropriate locations.
+
+-- *.dtx -> TEXMF/source/xelatex/texnegar/
+-- *.ins -> TEXMF/source/xelatex/texnegar/
+
+-- *.sty -> TEXMF/tex/xelatex/texnegar/
+-- *.lua -> TEXMF/tex/xelatex/texnegar/
+-- texnegar-ini.tex -> TEXMF/tex/xelatex/texnegar/
+-- texnegar-xetex-kashida.tex -> TEXMF/tex/xelatex/texnegar/
+-- texnegar-common-kashida.tex -> TEXMF/tex/xelatex/texnegar/
+
+-- *.pdf -> TEXMF/doc/xelatex/texnegar/
+-- *.tex -> TEXMF/doc/xelatex/texnegar/
+-- *.ltx -> TEXMF/doc/xelatex/texnegar/
+-- *.txt -> TEXMF/doc/xelatex/texnegar/
+
+Don't forget to run 'texconfig rehash' afterwards.
+
+The example files
+
+ texnegar-luatex-glyph.tex
+ texnegar-luatex-leaders-glyph.tex
+ texnegar-luatex-leaders-hrule.tex
+ texnegar-xetex-bidi-glyph.tex
+ texnegar-xetex-bidi-leaders-glyph.tex
+ texnegar-xetex-bidi-leaders-hrule.tex
+ texnegar-xetex-xepersian-glyph.tex
+ texnegar-xetex-xepersian-leaders-glyph.tex
+ texnegar-xetex-xepersian-leaders-hrule.tex
+ xepersian-XB.tex
+
+illustrate some features of the package and are an addendum to the
+user documentation texnegar-doc.pdf and the source documentation
+texnegar.pdf.
+
+That's it.
diff --git a/macros/latex/contrib/texnegar/README.txt b/macros/latex/contrib/texnegar/README.txt
new file mode 100644
index 0000000000..04d74db5a8
--- /dev/null
+++ b/macros/latex/contrib/texnegar/README.txt
@@ -0,0 +1,27 @@
+The TEXNEGAR package
+------------------------
+
+In some cursive scripts such as Persian or Arabic, kashida is used to create
+justification. In this type of justification characters are elongated rather
+than expanding spaces between words.
+
+The kashida justification in 'xepersian' has many bugs. Also it has problems
+with some fonts such as 'HM Series' available at
+'https://dma8hm1334.bitbucket.io' and 'X Series 2' available at
+'http://wiki.irmug.com/index.php/X_Series_2'. The 'xepersian-hm' package was
+the first attempt to fix these bugs in 'xepersian' which uses the xetex
+engine.
+
+This package extends the kashida justification to be used with the luatex
+engine too.
+
+The files 'texnegar-*.tex' in the directory 'texmf-dist/doc/xelatex/texnegar/'
+can be used as simple examples of the usage of the package.
+
+Please use the Bitbucket issue tracker:
+'https://bitbucket.org/dma8hm1334/texnegar/issues' to report a bug, request
+a feature or if you have a comment.
+
+I will do my best to fix all the bugs you report, but, unfortunately, time is a
+big hurdle to overcome; so, my apologies in advance for those which I cannot
+make time to fix.
diff --git a/macros/latex/contrib/texnegar/doc-ligature-texnegar.pdf b/macros/latex/contrib/texnegar/doc-ligature-texnegar.pdf
new file mode 100644
index 0000000000..055db30a9a
--- /dev/null
+++ b/macros/latex/contrib/texnegar/doc-ligature-texnegar.pdf
Binary files differ
diff --git a/macros/latex/contrib/texnegar/doc-ligature-xep.pdf b/macros/latex/contrib/texnegar/doc-ligature-xep.pdf
new file mode 100644
index 0000000000..ff1afa5c70
--- /dev/null
+++ b/macros/latex/contrib/texnegar/doc-ligature-xep.pdf
Binary files differ
diff --git a/macros/latex/contrib/texnegar/doc-samples-glyph.pdf b/macros/latex/contrib/texnegar/doc-samples-glyph.pdf
new file mode 100644
index 0000000000..2a242cc985
--- /dev/null
+++ b/macros/latex/contrib/texnegar/doc-samples-glyph.pdf
Binary files differ
diff --git a/macros/latex/contrib/texnegar/doc-samples-hrule.pdf b/macros/latex/contrib/texnegar/doc-samples-hrule.pdf
new file mode 100644
index 0000000000..303bebee91
--- /dev/null
+++ b/macros/latex/contrib/texnegar/doc-samples-hrule.pdf
Binary files differ
diff --git a/macros/latex/contrib/texnegar/doc-samples-xep.pdf b/macros/latex/contrib/texnegar/doc-samples-xep.pdf
new file mode 100644
index 0000000000..0e60c2020d
--- /dev/null
+++ b/macros/latex/contrib/texnegar/doc-samples-xep.pdf
Binary files differ
diff --git a/macros/latex/contrib/texnegar/texnegar-doc.ltx b/macros/latex/contrib/texnegar/texnegar-doc.ltx
new file mode 100644
index 0000000000..2bffbf9aa1
--- /dev/null
+++ b/macros/latex/contrib/texnegar/texnegar-doc.ltx
@@ -0,0 +1,599 @@
+%%
+%% This is file `texnegar-doc.tex'
+%%
+%% Copyright (c) Hossein Movahhedian 2020
+%%
+%% It may be distributed and/or modified under the LaTeX Project Public License,
+%% version 1.3c or higher (your choice). The latest version of
+%% this license is at: http://www.latex-project.org/lppl.txt
+%%
+
+\documentclass{ltxdoc}
+\usepackage{fontspec}
+\usepackage{graphicx}
+\usepackage{pdfpages}
+\usepackage{longtable}
+\usepackage[colorlinks]{hyperref}
+\usepackage{hologo}
+\usepackage{xcolor}
+\usepackage{iftex}
+
+\setfontfamily\PeFont[Script=Arabic,Language=Persian]{HM XKayhan}
+
+\def\TeXNegar{\TeX Negar}
+
+\usepackage{multicol,makeidx}
+\makeindex %%%
+
+% Partly adapted from the code provided by Maroš Beťko in:
+% https://tex.stackexchange.com/questions/404820/create-2-column-index-in-1-column-document-on-the-same-page
+% Redefine theindex enviroment so it won't place index on new page
+% This also makes the index 1 columns, which I don't want
+\makeatletter
+\renewenvironment{theindex}
+ {\section*{\indexname}\begin{multicols}{2}%
+ \@mkboth{\MakeUppercase\indexname}%
+ {\MakeUppercase\indexname}%
+ \thispagestyle{plain}\parindent\z@
+ \parskip\z@ \@plus .3\p@\relax
+ \columnseprule \z@
+ \columnsep 35\p@
+ \let\item\@idxitem}
+ {\end{multicols}}
+\makeatother
+
+\ifluatex
+ \def\RtoL#1{\PeFont\pagedir TRT \bodydir TRT \pardir TRT \textdir TRT #1}
+\fi
+\ifxetex
+ \def\RtoL#1{\PeFont\TeXXeTstate=1 \beginR #1 \endR}
+\fi
+
+\title{
+ The \TeXNegar{} package\\Kashida justification in LuaTeX and XeTeX\\User Documentation
+}
+
+\author{
+ Hossein Movahhedian\thanks
+ {
+ E-mail:
+ \href{mailto:dma8hm1334@gmail.com}
+ {\textsf{dma8hm1334@gmail.com}}
+ }
+}
+
+\date{Released \quad 2020-08-29 \quad v0.1a}
+
+\definecolor{HMhighlightBlueI}{rgb}{0,0,1}
+\definecolor{HMhighlightbgYellowII}{rgb}{1,1,1}
+\definecolor{HMhighlightbgPinkI}{rgb}{1,1,1}
+\definecolor{HMhighlightbgPinkII}{rgb}{1,1,1}
+\definecolor{HMhighlightbgPinkIII}{rgb}{1,1,1}
+
+\definecolor{HMcitecolor}{rgb}{1,0,1}
+
+\definecolor{HMnotecolor}{rgb}{0.6,0,0}
+
+\def\indexterm#1#2{{\color{HMhighlightBlueI} #2}\index{#1@#2}}
+\def\indextermsub#1#2#3{{\color{HMhighlightBlueI} #3}\index{#1@#2!#3}}
+\def\indextermsubsub#1#2#3#4{{\color{HMhighlightBlueI} #4}\index{#1@#2!#3!#4}}
+\def\ccsterm#1{{\color{HMhighlightBlueI}\tt \textbackslash #1}\index{#1@\tt \textbackslash #1}}
+\def\ccstermsub#1#2#3{{\color{HMhighlightBlueI}\tt \textbackslash #3}\index{#1@#2!\tt \textbackslash #3}}
+
+\begin{document}
+
+\maketitle
+
+\vskip 50mm
+\newbox\hnegar
+\setbox\hnegar\hbox{\texttt{Negar:}}
+\newbox\vnegar
+\setbox\vnegar\vbox{
+\hbox{\leaders\hrule\hskip \the\wd\hnegar}
+\hbox to -\the\wd\hnegar{\texttt{Negar:}}\vskip-0.6em
+\hbox{\leaders\hrule\hskip \the\wd\hnegar}}
+\unvbox\vnegar
+\vskip -\the\baselineskip
+\hskip 3em
+\begin{minipage}{0.65\linewidth}
+ \textit{\noindent
+ Negar, in Persian, is the present stem of negaashtan meaning to design; to paint;
+ to write; and as a noun it means ``sweetheart, idol, beloved, figuratively refering
+ to a beautiful woman, pattern, painting, and artistic design''
+ }
+\end{minipage}
+
+% \vskip 15mm
+% \begin{center}\begin{minipage}{0.65\linewidth}\parskip 15pt
+% \textit{
+% Negar, in Persian, is the present stem of negaashtan meaning to design; to paint;
+% to write; and as a noun it means ``sweetheart, idol, beloved, figuratively refering
+% to a beautiful woman, pattern, painting, and artistic design''
+% }
+% \end{minipage}\end{center}
+
+\newpage
+
+\tableofcontents
+
+\newpage
+
+\section{Introduction}
+
+\indexterm{Kashida}{Kashida} is used in Persian and Arabic typography to justify the text regardless
+of the number of the words on the line by elongating characters at certain
+points instead of expanding spaces between words or individual letters.
+
+One of the packages that implements kashida feature in Persian typesetting is
+\hyperref[HM:Brief-outline-of-the-issues]{\indexterm{xepersian}{\textsf{xepersian}} which
+ unfortunately has many bugs}. In addition kashida feature in
+\textsf{xepersian} has problems with some fonts such as \mbox{\textsf{HM Series}}
+available at\linebreak[4]
+\href{https://dma8hm1334.bitbucket.io}{\texttt{https://dma8hm1334.bitbucket.io}}
+and \mbox{\textsf{X Series 2}} available at\linebreak[4]
+\href{http://wiki.irmug.com/index.php/X_Series_2}{\texttt{http://wiki.irmug.com/index.php/X\_Series\_2}}.
+
+The \indexterm{texnegar}{\TeXNegar} package implements kashida justification in LuaTeX and XeTeX
+and fixes known bugs in \textsf{xepersian}.
+
+The following files in the directory \texttt{texmf-dist/doc/xelatex/texnegar/} can be used as simple
+examples of the usage of the package:
+\newcounter{beanx}
+\begin{list}{\arabic{beanx}.}{\usecounter{beanx}\setlength{\rightmargin}{\leftmargin}}
+ \item \texttt{texnegar-luatex-glyph.tex} \\
+ See pages 26 -- 35 for PDF output.
+ \item \texttt{texnegar-luatex-leaders-glyph.tex} \\
+ See pages 36 -- 45 for PDF output.
+ \item \texttt{texnegar-luatex-leaders-hrule.tex} \\
+ See pages 46 -- 55 for PDF output.
+ \item \texttt{texnegar-xetex-bidi-glyph.tex} \\
+ See pages 56 -- 65 for PDF output.
+ \item \texttt{texnegar-xetex-bidi-leaders-glyph.tex} \\
+ See pages 66 -- 75 for PDF output.
+ \item \texttt{texnegar-xetex-bidi-leaders-hrule.tex} \\
+ See pages 76 -- 85 for PDF output.
+ \item \texttt{texnegar-xetex-xepersian-glyph.tex} \\
+ See pages 86 -- 95 for PDF output.
+ \item \texttt{texnegar-xetex-xepersian-leaders-glyph.tex} \\
+ See pages 96 -- 105 for PDF output.
+ \item \texttt{texnegar-xetex-xepersian-leaders-hrule.tex} \\
+ See pages 106 -- 115 for PDF output.
+ % \item \texttt{xepersian-XB.tex} \\
+ % See pages 14 -- 23 for PDF output.
+\end{list}
+
+Please use the Bitbucket issue tracker:
+\href{https://bitbucket.org/dma8hm1334/texnegar/issues}{\textsf{https://bitbucket.org/dma8hm1334/\linebreak[4]texnegar/issues}}
+to report a bug, request a feature or if you have a comment.
+
+I will do my best to fix all the bugs you report, but, unfortunately,
+time is a big hurdle to overcome; so, my apologies in advance for those
+which I cannot make time to fix.
+
+\section{Brief outline of the issues}\label{HM:Brief-outline-of-the-issues}
+
+Kashida is one of the most important features that must be included in any
+Persian typesetter. In \textsf{xepersian} this feature is implemented but with some
+problems. See pages 14 -- 23 for pictorial illustrations for various font styles.
+These problems along with the fixes in \TeXNegar{} are briefly:
+
+\newcounter{bean}
+ \begin{list}{P-\Roman{bean}}{\usecounter{bean}\setlength{\rightmargin}{\leftmargin}}
+ \item In \textsf{xepersian} \indexterm{overlapping of glyphs}{overlapping of glyphs} occurs in letter
+ combinations such as "{\RtoL{ﺑ + ﻰ}}", "{\RtoL{ﺗ + ﻰ}}", and
+ "{\RtoL{ﭘ + ﻰ}}" because the character
+ \textsf{U+FEF0 (ARABIC LETTER FARSI YEH FINAL FORM)} is replaced with
+ another character. This is fixed by modifying the fixed part of the
+ glue inserted between the consecutive characters. Furthermore, both,
+ the fixed and the stretchable parts of the glue can be changed by the
+ user.
+ \item In \indexterm{letter combinations}{letter combinations} such as "{\RtoL{ﻫ + ﻰ}}", in \textsf{xepersian},
+ the character \textsf{U+FEEB (ARABIC LETTER HEH INITIAL FORM)} is
+ replaced with \textsf{U+06BE (ARABIC LETTER HEH DOACHASHEMEE)}. This
+ is fixed by inserting the character \textsf{U+200E} before the
+ combination "\textsf{U+200D + hrule + U+200D}" which is used as
+ stretching item.
+
+ {\color{gray}
+ Note: \indexterm{Vafa Khalighi}{Vafa Khalighi} has fixed this problem in
+ \href{https://tug.org/svn/texlive/trunk/Master/texmf-dist/tex/xelatex/xepersian/kashida-xepersian.def?revision=55165&view=co}%
+ {\texttt{xepersian-23.0}},
+ by copying the corresponding code from
+ \href{http://www.tug.org/svn/texlive/trunk/Master/texmf-dist/tex/xelatex/xepersian-hm/kashida-xepersian-hm.def?revision=55123&view=co}%
+ {\texttt{xepersian-hm-0.5e}}.
+ Consequently, the
+ option \texttt{KashidaXBFix} along with the commands \linebreak[4]
+ \texttt{\textbackslash KashidaXBFixOn} and
+ \texttt{\textbackslash KashidaXBFixOff} has been removed in \linebreak[4]
+ \texttt{xepersian-23.0} and the later versions.}
+
+ \item In \textsf{xepersian} when outline or shadow fonts are used, the gaps
+ filled by horizontal rule appears as a solid box. This is fixed by
+ using the \textsf{kashida} glyph instead of the horizontal rule in
+ \TeXNegar.
+ \item Activating kashida in \textsf{xepersian} disturbs \indexterm{ligatures}{ligatures}. This is
+ fixed in \TeXNegar{} by escaping the components of the
+ ligature which form the glyph, i.e. by inserting an escape character
+ before Persian letters joined to form the ligature without any empty
+ characters, blank characters, invisible characters and whitespace
+ characters which form the glyph. See
+ \mbox{Figures \ref{fig:ligatures-xep} and \ref{fig:ligatures-texnegar}}.
+ Currently only 3 ligature glyphs are available in
+ \TeXNegar, but you can add as many as you want or let
+ me know the ligature glyphs that you need, so that I can add them in
+ the next release of the package. Of course, this is not the best
+ solution, but it works.
+
+ \item If italic or oblique style of some fonts, such as \textsf{X Series 2},
+ is used in \textsf{xepersian}, an extra \indexterm{gap}{gap} is left between the
+ stretched characters. This is fixed in \textsf{HM Series} fonts.
+\end{list}
+
+For comparing the outputs of \textsf{xepersian} and \TeXNegar{} with
+a variety of options available to these packages, please see the
+\mbox{Figures \ref{fig:xepersian-XB}, \ref{fig:texnegar-hrule}}, and \ref{fig:texnegar-glyph}.
+
+\begin{figure}
+ \centerline{\fbox{\includegraphics[scale=1]{doc-ligature-xep.pdf}}}
+ \caption{Package: \textsf{xeprsian}, Font: \textsf{Noto Sans Arabic}, \textsf{Scale=1.1}, \textsf{Kashida=On}}
+ \label{fig:ligatures-xep}
+\end{figure}
+
+\begin{figure}
+ \centerline{\fbox{\includegraphics[scale=1]{doc-ligature-texnegar.pdf}}}
+ \caption{Package: \textsf{texnegar}, Font: \textsf{Noto Sans Arabic}, \textsf{Scale=1.1}, \textsf{Kashida=glyph}}
+ \label{fig:ligatures-texnegar}
+\end{figure}
+
+\begin{figure}
+ \centerline{\fbox{\includegraphics[scale=1]{doc-samples-xep.pdf}}}
+ \caption{Package: \textsf{xeprsian}, Font: \textsf{XB Kayhan}, \textsf{Scale=4.5}, \textsf{Kashida=On}}
+ \label{fig:xepersian-XB}
+\end{figure}
+
+\begin{figure}
+ \centerline{\fbox{\includegraphics[scale=1]{doc-samples-hrule.pdf}}}
+ \caption{Package: \textsf{texnegar}, Font: \textsf{HM XKayhan}, \textsf{Scale=4.5}, \textsf{Kashida=hrule}}
+ \label{fig:texnegar-hrule}
+\end{figure}
+
+\begin{figure}
+ \centerline{\fbox{\includegraphics[scale=1]{doc-samples-glyph.pdf}}}
+ \caption{Package: \textsf{texnegar}, Font: \textsf{HM XKayhan}, \textsf{Scale=4.5}, \textsf{Kashida=glyph}}
+ \label{fig:texnegar-glyph}
+\end{figure}
+
+\clearpage
+
+\section{Package loading and options}
+
+If you are going to use \TeXNegar{} with \textsf{bidi} or \textsf{xepersian} then
+please note that \TeXNegar{} should be loaded before \textsf{xepersian}.
+
+For example:
+\begin{verbatim}
+\documentclass{report}
+\usepackage[Kashida=leaders+glyph]{texnegar}
+\usepackage{xepersian}
+\end{verbatim}
+
+The options available in \TeXNegar{} are:
+
+\begin{itemize}
+ \item \indexterm{General Options}{\textbf{General Options}}: \\
+\begin{itemize}
+ \item \indextermsub{General Options}{\textbf{General Options}}{\texttt{Kashida}}: \\
+ which implements kashida feature with three possible values:
+ \begin{itemize}
+ \item \indextermsubsub{General Options}{\textbf{General Options}}{\texttt{Kashida}}{glyph}: \\
+ which uses the \texttt{kashida} character to stretch the text. \\
+
+ {\color{magenta}
+ Imortant notes for \hologo{XeLaTeX} users: \\
+
+ \begin{itemize}
+ \item
+ If you are going to use this option then you should run \texttt{xelatex} thrice. For example: \\
+
+ \texttt{rm -f kashida-example.aux \\
+ xelatex kashida-example.tex \\
+ xelatex kashida-example.tex \\
+ xelatex kashida-example.tex} \\
+
+ \item
+ This feature is still experimental in \hologo{XeLaTeX} and is not regarded as stable,
+ so, if you are going to use this option be ready for unpredictable results.
+
+ \item
+ With this option, for each gap which is to be filled with kashida,
+ some commands, current position on the page, and references are saved in the
+ \texttt{\bslash jobname.aux} file and if the text is long, the file size may get
+ too large.
+ \end{itemize}}
+
+ \item \indextermsubsub{General Options}{\textbf{General Options}}{\texttt{Kashida}}{leaders+glyph}: \\
+ which uses kashida glyph leaders to stretch the text.
+ Please note that the option `Kashida=leaders+glyph' is currently only
+ supported by \mbox{\textsf{HM Series}} fonts available at
+ \href{https://dma8hm1334.bitbucket.io}{\texttt{https://dma8hm1334.bitbucket.io}}.
+ If you know of any other font that supports this option, please
+ let me know to add it to the list of corresponding fonts.
+
+ Contrary to the option \texttt{Kashida=glyph}, in this case nothing is saved
+ in \texttt{.aux} files.
+
+ \item \indextermsubsub{General Options}{\textbf{General Options}}{\texttt{Kashida}}{leaders+hrule}: \\
+ which uses horizontal rule (\verb|\hrule|) leaders to stretch the text.
+
+ \item \texttt{Off}: \\
+ which disables kashida feature.
+
+ \item \texttt{On}: \\
+ which is the same as \texttt{leaders+glyph}.
+
+ \end{itemize}
+ Also, please note that the value of \texttt{Kashida} is mandatory.
+ For example \texttt{Kashida=glyph} inserts a stretched \texttt{kashida} glyph
+ and \linebreak[4] \texttt{Kashida=leaders+glyph} inserts \texttt{kashida} leaders wherever
+ it is needed.
+
+ \item \indextermsub{General Options}{\textbf{General Options}}{\texttt{linebreakpenalty}}: \\
+ which specifies the amount of penalty for preventing bad line-breaking.
+ You may strictly specify the value of this option. For example you may either set % \linebreak[4]
+ \texttt{'linebreakpenalty=8'} or
+ use the default values. The available default values of penalties which are put into the
+ horizontal list output are the negative of the followings:
+
+ \begin{longtable}{ll}
+ \texttt{min}: & \texttt{0} \\
+ \texttt{low}: & \texttt{8} \\
+ \texttt{medium}: & \texttt{15} \\
+ \texttt{high}: & \texttt{25} \\
+ \texttt{max}: & \texttt{10000}
+ \end{longtable}
+
+ \item \indextermsub{General Options}{\textbf{General Options}}{\texttt{ligatures}}: \\
+ which fixes the disturbance of ligatures caused by activating kashida
+ justification in \TeXNegar. You may strictly specify the value of this option.
+ For example \texttt{'ligatures=dlig'} or you may use the default value.
+ The available values are:
+
+ \begin{longtable}{ll}
+ \texttt{aalt}: & Access All Alternatives \\
+ \texttt{ccmp}: & Glyph Composition/Decomposition \\
+ \texttt{dlig}: & Discretionary Ligatures \\
+ \texttt{fina}: & Final (Terminal) Forms \\
+ \texttt{init}: & Initial Forms \\
+ \texttt{locl}: & Localized Forms \\
+ \texttt{medi}: & Medial Forms \\
+ \texttt{rlig}: & Required Ligatures \\
+ \texttt{default}: & All the above features
+ \end{longtable}
+ Please note that this feature is still experimental and is not regarded as stable.
+
+ \item \indextermsub{General Options}{\textbf{General Options}}{\texttt{color}}: \\
+ which colorize the stretched parts of the text for checking the quality of kashida
+ justification. Color must be one of a named color declared in \textsf{xcolor} package.
+ For example: \texttt{color=blue} or \texttt{color=Blue}.
+
+ Default color name is: \texttt{magenta}
+
+ Please note that activating this option increases system resource and disk usage.
+
+\end{itemize}
+\end{itemize}
+
+\begin{itemize}
+ \item \indexterm{LuaLaTeX-only Options}{\textbf{\hologo{LuaLaTeX}-only Options}}: \\
+\begin{itemize}
+ \item \indextermsub{LuaLaTeX-only Options}{\textbf{\hologo{LuaLaTeX}-only Options}}{\texttt{hboxrecursion}}: \\
+ which enables kashida justification inside horizontal boxes recursively.
+
+ \item \indextermsub{LuaLaTeX-only Options}{\textbf{\hologo{LuaLaTeX}-only Options}}{\texttt{vboxrecursion}}: \\
+ which enables kashida justification inside vertical boxes recursively.
+
+\end{itemize}
+\end{itemize}
+
+\begin{itemize}
+ \item \indexterm{XeLaTeX-only Options}{\textbf{\hologo{XeLaTeX}-only Options}}: \\
+\begin{itemize}
+ \item \indextermsub{XeLaTeX-only Options}{\textbf{\hologo{XeLaTeX}-only Options}}{\texttt{kashidastretch}}: \\
+ which specifies the amount of extra stretching
+ for some combinations of characters. You may strictly specify the value of
+ this option. For example \texttt{'kashidastretch=0.14 em plus 0.5 em'} or you
+ may use the default values. The available default values are:
+
+ \begin{longtable}{lll}
+ \texttt{kayhan} & \texttt{0.14 em plus 0.5 em} \\
+ \texttt{khorramshahr} & \texttt{0.131 em plus 0.5 em} \\
+ \texttt{kayhannavaar} & \texttt{0.129 em plus 0.5 em} \\
+ \texttt{kayhanpook} & \texttt{0.133 em plus 0.5 em} \\
+ \texttt{kayhansayeh} & \texttt{0.135 em plus 0.5 em} \\
+ \texttt{khoramshahr} & \texttt{0.128 em plus 0.5 em} \\
+ \texttt{khorramshahr} & \texttt{0.13 em plus 0.5 em} \\
+ \texttt{niloofar} & \texttt{0.132 em plus 0.5 em} \\
+ \texttt{paatch} & \texttt{0.127 em plus 0.5 em} \\
+ \texttt{riyaz} & \texttt{0.125 em plus 0.5 em} \\
+ \texttt{roya} & \texttt{0.142 em plus 0.5 em} \\
+ \texttt{shafigh} & \texttt{0.143 em plus 0.5 em} \\
+ \texttt{shafighKurd} & \texttt{0.126 em plus 0.5 em} \\
+ \texttt{shafighUzbek} & \texttt{0.123 em plus 0.5 em} \\
+ \texttt{shiraz} & \texttt{0.122 em plus 0.5 em} \\
+ \texttt{sols} & \texttt{0.124 em plus 0.5 em} \\
+ \texttt{tabriz} & \texttt{0.119 em plus 0.5 em} \\
+ \texttt{titr} & \texttt{0.12 em plus 0.5 em} \\
+ \texttt{titre} & \texttt{0.121 em plus 0.5 em} \\
+ \texttt{traffic} & \texttt{0.124 em plus 0.5 em} \\
+ \texttt{vahid} & \texttt{0.134 em plus 0.5 em} \\
+ \texttt{vosta} & \texttt{0.136 em plus 0.5 em} \\
+ \texttt{yaghut} & \texttt{0.138 em plus 0.5 em} \\
+ \texttt{yagut} & \texttt{0.137 em plus 0.5 em} \\
+ \texttt{yas} & \texttt{0.126 em plus 0.5 em} \\
+ \texttt{yekan} & \texttt{0.141 em plus 0.5 em} \\
+ \texttt{yermook} & \texttt{0.139 em plus 0.5 em} \\
+ \texttt{zar} & \texttt{0.116 em plus 0.5 em} \\
+ \texttt{ziba} & \texttt{0.119 em plus 0.5 em} \\
+ \texttt{default} & \texttt{0.14 em plus 0.5 em} \\
+ \texttt{noskip} & \texttt{0 em plus 0.5 em}
+ \end{longtable}
+
+ For example: \mbox{\texttt{'kashidastretch=titr'}} is equivalent to\linebreak
+ \mbox{\texttt{'kashidastretch=0.12 em plus 0.5 em'}}
+
+\end{itemize}
+\end{itemize}
+
+\section{Commands}
+
+\begin{itemize}
+ \item \indexterm{General Commands}{\textbf{General Commands}}: \\
+ \begin{description}
+ \item \ccstermsub{General Commands}{\textbf{General Commands}}{KashidaOff}: \\
+ disables kashida justification.
+
+ \item \ccstermsub{General Commands}{\textbf{General Commands}}{KashidaOn}: \\
+ enables kashida justification. If the option Kashida is activated
+ stretching the text is the default behavior.
+ \end{description}
+ \item \indexterm{XeLaTeX-only Commands}{\textbf{\hologo{XeLaTeX}-only Commands}}: \\
+ \begin{description}
+ \item \ccstermsub{XeLaTeX-only Commands}{\textbf{\hologo{XeLaTeX}-only Commands}}{discouragebadlinebreaks}{\color{HMhighlightBlueI}\verb|[linebreakpenalty][kashidastretch]{|{\it text}\verb|}|}: \\
+ {\it text} may not contain paragraph breaks.
+ This command puts a penalty after each Persian word.
+ The optional arguments \texttt{linebreakpenalty} and \texttt{kashidastretch} locally
+ specify the value of the penalty and the amount of extra stretching for some
+ combinations of characters respectively as discussed previously. For example
+ you may set this option as follows:
+
+ \texttt{\bslash discouragebadlinebreaks[9][0.12 em plus 0.5 em]\{$\dots\,$\}}
+ \end{description}
+\end{itemize}
+
+\section{Important notes}
+
+\begin{description}
+ \item Kashida and ligatures:
+
+ The method used to implement kashida feature breaks a ligature if it is applied to the letters which are joined to form
+ the ligature. This is fixed in \TeXNegar, but it is not well developed yet.
+\end{description}
+
+\section{Acknowledgments}
+In the first place I have to thank Donald Knuth for inventing TeX.
+During the development of this package I refered to Stack Exchange network of
+question-and-answer (Q\&A) websites to solve problems for which I am grateful.
+I also would like to thank the developer teams of TeX's friends especially LaTeX, LuaTeX and XeTeX teams.
+
+\def\HistoryItem#1#2{\subsection*{[#1]} \addcontentsline{toc}{subsection}{[#1]} \item #2}
+
+\section{Change History}
+
+\begin{itemize}
+ \let\tmpitemindent\itemindent
+ \addtolength{\itemindent}{\leftmargin}
+ \setlength{\parskip}{0pt}
+ \setlength{\itemsep}{0pt}
+
+ \HistoryItem{2020-08-29~v0.1a}{First standalone version.}
+
+\end{itemize}
+
+\section*{To Do's}
+
+To do
+
+\renewcommand{\refname}{References: \\ {\normalsize\it Actually, this is not a ``References'' nor a ``Literature'', but the most important
+ although not a complete list of ``Resources Used'' to develop this package.}}
+
+\begin{thebibliography}{9}
+
+ \bibitem{DEK-TTB} Donald E. Knuth,
+ \emph{The \hologo{TeX} book},
+ Addison-Wesley, 1986.
+
+ \bibitem{VE-TBT} Victor Eijkhout,
+ \emph{\hologo{TeX} BY TOPIC},
+ Addison-Wesley, 2013.
+
+ \bibitem{PWA-KAH-KB-TFI} Paul W. Abrahams, Kathryn A. Hargreaves, and Karl Berry,
+ \emph{\hologo{TeX} for the Impatient},
+ Addison-Wesley, 2013.
+
+ \bibitem{LL-LADPS} Leslie Lamport,
+ \emph{\hologo{LaTeX}, A document preparation System},
+ Addison-Wesley, 1986.
+
+ \bibitem{FM-MG-JB-DC-CR-TLC} Frank Mittelbach and Michel Goossens with Johannes Braams, David Carlisle, and Chris Rowley,
+ \emph{The \hologo{LaTeX} Companion},
+ Addison-Wesley, second edition, 2004.
+
+ \bibitem{PRO-IN-LUA} Roberto Ierusalimschy,
+ \emph{Programming in Lua},
+ Lua.org, fourth edition, 2016
+
+ \bibitem{LUA-REF-MAN} Lua.org,
+ \emph{Lua 5.3 Reference Manual},
+ Lua.org, 2016
+
+ \bibitem{TLT-TLS} Package \texttt{latex}: The LaTeX Team,
+ \emph{The \hologo{LaTeX2e} Sources},
+ \href{http://mirrors.ctan.org/macros/latex/base/source2e.pdf}{\texttt{CTAN:macros/latex/base/source2e.pdf}}, 2020-02-02
+
+ \bibitem{TL3T-TLS} Package \texttt{l3kernel}: The LaTeX3 Team,
+ \emph{The \hologo{LaTeX}3 Sources},
+ \href{http://mirrors.ctan.org/macros/latex/contrib/l3kernel/source3.pdf}{\texttt{CTAN:macros/latex/contrib/l3kernel/source3.pdf}}, 2020-07-17
+
+ \bibitem{TL3T-TLI} Package \texttt{l3kernel}: The LaTeX3 Team,
+ \emph{The \hologo{LaTeX}3 Interfaces},
+ \href{http://mirrors.ctan.org/macros/latex/contrib/l3kernel/interface3.pdf}{\texttt{CTAN:macros/latex/contrib/l3kernel/interface3.pdf}}, 2020-07-17
+
+ \bibitem{TLT-LRM} Package \texttt{luatex}: The LuaTeX Team,
+ \hologo{LuaTeX} Reference Manual,
+ \href{http://mirrors.ctan.org/systems/doc/luatex/luatex.pdf}{\texttt{CTAN:systems/doc/luatex/luatex.pdf}}, 2020
+
+ \bibitem{WR-KH-KB-XRG} Package \texttt{xetexref}: Will Robertson, Khaled Hosny, and Karl Berry,
+ \hologo{XeTeX} reference guide,
+ \href{http://mirrors.ctan.org/info/xetexref/xetex-reference.pdf}{\texttt{CTAN:info/xetexref/xetex-reference.pdf}}, 2019-12-09
+
+ \bibitem{JQ-AX} Package \texttt{xetex}: Jonathan Kew,
+ About \hologo{XeTeX},
+ \href{http://mirrors.ctan.org/systems/doc/xetex/XeTeX-notes.pdf}{\texttt{CTAN:systems/doc/xetex/XeTeX-notes.pdf}}, 2005-10-17
+
+ \bibitem{NG-TXC} Package \texttt{xetex}: Michel Goossens,
+ The \hologo{XeTeX} Companion,
+ \href{http://xml.web.cern.ch/XML/lgc2/xetexmain.pdf}{\texttt{http://xml.web.cern.ch/XML/lgc2/xetexmain.pdf}}, 2009-08-19
+
+ \bibitem{TEX-STACKEXCHANGE} Website: Stack Exchange: Hot Questions,
+ \hologo{TeX}-\hologo{LaTeX} Q\&A for users of TeX, LaTeX, ConTeXt, and related typesetting systems,
+ \href{https://tex.stackexchange.com}{\texttt{tex.stackexchange.com}}
+
+ \bibitem{LUATEX-WIKI} Website: LuaTeX Wiki,
+ \hologo{LuaTeX} Wiki,
+ \href{http://wiki.luatex.org/index.php/Main\_Page}{\texttt{wiki.luatex.org}}
+
+\end{thebibliography}
+
+\newpage
+
+\printindex
+\addcontentsline{toc}{section}{Index}
+
+\includepdf[pages={1-},scale=0.75]{xepersian-XB.pdf}
+
+\includepdf[pages={1-},scale=0.75]{texnegar-luatex-glyph.pdf}
+\includepdf[pages={1-},scale=0.75]{texnegar-luatex-leaders-glyph.pdf}
+\includepdf[pages={1-},scale=0.75]{texnegar-luatex-leaders-hrule.pdf}
+
+\includepdf[pages={1-},scale=0.75]{texnegar-xetex-bidi-glyph.pdf}
+\includepdf[pages={1-},scale=0.75]{texnegar-xetex-bidi-leaders-glyph.pdf}
+\includepdf[pages={1-},scale=0.75]{texnegar-xetex-bidi-leaders-hrule.pdf}
+
+\includepdf[pages={1-},scale=0.75]{texnegar-xetex-xepersian-glyph.pdf}
+\includepdf[pages={1-},scale=0.75]{texnegar-xetex-xepersian-leaders-glyph.pdf}
+\includepdf[pages={1-},scale=0.75]{texnegar-xetex-xepersian-leaders-hrule.pdf}
+
+\end{document}
+%%
+%%
+%% End of file `texnegar-doc.ltx'.
diff --git a/macros/latex/contrib/texnegar/texnegar-doc.pdf b/macros/latex/contrib/texnegar/texnegar-doc.pdf
new file mode 100644
index 0000000000..d23b3f96cd
--- /dev/null
+++ b/macros/latex/contrib/texnegar/texnegar-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/texnegar/texnegar-luatex-glyph.pdf b/macros/latex/contrib/texnegar/texnegar-luatex-glyph.pdf
new file mode 100644
index 0000000000..675efce316
--- /dev/null
+++ b/macros/latex/contrib/texnegar/texnegar-luatex-glyph.pdf
Binary files differ
diff --git a/macros/latex/contrib/texnegar/texnegar-luatex-glyph.tex b/macros/latex/contrib/texnegar/texnegar-luatex-glyph.tex
new file mode 100644
index 0000000000..0cc842cb32
--- /dev/null
+++ b/macros/latex/contrib/texnegar/texnegar-luatex-glyph.tex
@@ -0,0 +1,87 @@
+\documentclass{report}
+\usepackage{fontspec}
+\setmainfont[Script=Arabic,Language=Persian]{HM XKayhan}
+\setfontfamily\HMXKayhanEn[Scale=1.5,Colour=0000FF]{HM XKayhan}
+\setfontfamily\HMXKayhanRm[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan}
+\setfontfamily\HMXKayhanIt[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Italic}
+\setfontfamily\HMXKayhanOb[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhanOb Oblique}
+\setfontfamily\HMXKayhanOl[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Outline}
+\setfontfamily\HMXKayhanSd[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Shadow}
+\setfontfamily\HMXKayhanPo[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Pook}
+\setfontfamily\HMXKayhanSa[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Sayeh}
+\setfontfamily\HMXKayhanNa[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Navaar}
+
+\def\LtoR{\pagedir TLT \bodydir TLT \pardir TLT \textdir TLT}
+\def\RtoL{\pagedir TRT \bodydir TRT \pardir TRT \textdir TRT}
+
+\def\SampleText{\RtoL
+ راهی جایی تابی چاپی چاههی
+ شتابهایی تابی چاپی راهی تلاشهــایی
+ که کتابهایی که کلاههایی که کتابهایی }
+
+\def\SampleTitle#1#2#3{{\large\LtoR Engine: {\color{blue}\texttt{#1}}, \\
+ Style: {\color{blue}\texttt{#2}}, \\ Kashida: {\color{blue}\texttt{#3}}}\hbox{}\vskip 5mm}
+
+\pretolerance = 10000
+% \exhyphenpenalty=10000
+% \hyphenpenalty=10000
+% \penalty -10000
+% \tolerance=10000
+% \tolerance = -10000
+% \looseness = 10000
+
+\setlength\parindent{0pt}
+% \pagestyle{empty}
+\setcounter{page}{26}
+
+\usepackage[Kashida=glyph,kashidastretch=0.14 em plus 0.5 em,hboxrecursion=On,vboxrecursion=On,color=red]{texnegar}
+
+\begin{document}
+
+{\LtoR\HMXKayhanEn
+\begin{center}
+{\Huge\textsf{\TeXNegar} \\
+ \vspace{20pt}Example of Use \\
+ \vspace{20pt}\texttt{Engine: LuaTeX {\normalsize using texnegar}} \\
+ \vspace{20pt}\texttt{Kashida=glyph}} \\
+ \vspace{20pt}\makebox{\textsf{File:} \texttt{TEXMFDIST/doc/latex/texnegar/texnegar-luatex-glyph.tex}}
+ \vspace{20pt}
+
+{\Large
+\begin{tabular}{ll}
+ \textsf{Font:} & \textsf{HM XKayhan} \\
+ \textsf{Font Scale:} & \texttt{4.5} \\
+ \textsf{linebreakpenalty:} & \texttt{8} \\
+ \textsf{kashidastretch:} & \texttt{0.14em plus 5.5em} \\
+ \textsf{hboxrecursion:} & \texttt{On} \\
+ \textsf{vboxrecursion:} & \texttt{On} \\
+ \textsf{color:} & \texttt{red}
+\end{tabular}
+}
+\end{center}
+}
+
+\newpage \KashidaOff \SampleTitle{LuaTeX using texnegar}{Regular}{Off} \par {\HMXKayhanRm \SampleText}
+
+\newpage \KashidaOn \SampleTitle{LuaTeX using texnegar}{Regular}{glyph (On)} \par {\HMXKayhanRm \SampleText}
+
+\newpage \KashidaOn \SampleTitle{LuaTeX using texnegar}{Italic}{glyph (On)} \par {\HMXKayhanIt \SampleText}
+
+\newpage \KashidaOn \SampleTitle{LuaTeX using texnegar}{Oblique}{glyph (On)} \par {\HMXKayhanOb \SampleText}
+
+\newpage \KashidaOn \SampleTitle{LuaTeX using texnegar}{Outline}{glyph (On)} \par {\HMXKayhanOl \SampleText}
+
+\newpage \KashidaOn \SampleTitle{LuaTeX using texnegar}{Shadow}{glyph (On)} \par {\HMXKayhanSd \SampleText}
+
+\newpage \KashidaOn \SampleTitle{LuaTeX using texnegar}{Pook}{glyph (On)} \par {\HMXKayhanPo \SampleText}
+
+\newpage \KashidaOn \SampleTitle{LuaTeX using texnegar}{Sayeh}{glyph (On)} \par {\HMXKayhanSa \SampleText}
+
+\newpage \KashidaOn \SampleTitle{LuaTeX using texnegar}{Navaar}{glyph (On)} \par {\HMXKayhanNa \SampleText}
+
+\end{document}
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: t
+%%% End:
diff --git a/macros/latex/contrib/texnegar/texnegar-luatex-leaders-glyph.pdf b/macros/latex/contrib/texnegar/texnegar-luatex-leaders-glyph.pdf
new file mode 100644
index 0000000000..2f838c492d
--- /dev/null
+++ b/macros/latex/contrib/texnegar/texnegar-luatex-leaders-glyph.pdf
Binary files differ
diff --git a/macros/latex/contrib/texnegar/texnegar-luatex-leaders-glyph.tex b/macros/latex/contrib/texnegar/texnegar-luatex-leaders-glyph.tex
new file mode 100644
index 0000000000..31caf27ebd
--- /dev/null
+++ b/macros/latex/contrib/texnegar/texnegar-luatex-leaders-glyph.tex
@@ -0,0 +1,87 @@
+\documentclass{report}
+\usepackage{fontspec}
+\setmainfont[Script=Arabic,Language=Persian]{HM XKayhan}
+\setfontfamily\HMXKayhanEn[Scale=1.5,Colour=0000FF]{HM XKayhan}
+\setfontfamily\HMXKayhanRm[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan}
+\setfontfamily\HMXKayhanIt[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Italic}
+\setfontfamily\HMXKayhanOb[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhanOb Oblique}
+\setfontfamily\HMXKayhanOl[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Outline}
+\setfontfamily\HMXKayhanSd[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Shadow}
+\setfontfamily\HMXKayhanPo[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Pook}
+\setfontfamily\HMXKayhanSa[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Sayeh}
+\setfontfamily\HMXKayhanNa[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Navaar}
+
+\def\LtoR{\pagedir TLT \bodydir TLT \pardir TLT \textdir TLT}
+\def\RtoL{\pagedir TRT \bodydir TRT \pardir TRT \textdir TRT}
+
+\def\SampleText{\RtoL
+ راهی جایی تابی چاپی چاههی
+ شتابهایی تابی چاپی راهی تلاشهــایی
+ که کتابهایی که کلاههایی که کتابهایی }
+
+\def\SampleTitle#1#2#3{{\large\LtoR Engine: {\color{blue}\texttt{#1}}, \\
+ Style: {\color{blue}\texttt{#2}}, \\ Kashida: {\color{blue}\texttt{#3}}}\hbox{}\vskip 5mm}
+
+\pretolerance = 10000
+% \exhyphenpenalty=10000
+% \hyphenpenalty=10000
+% \penalty -10000
+% \tolerance=10000
+% \tolerance = -10000
+% \looseness = 10000
+
+\setlength\parindent{0pt}
+% \pagestyle{empty}
+\setcounter{page}{36}
+
+\usepackage[Kashida=leaders+glyph,kashidastretch=0.14 em plus 0.5 em,hboxrecursion=On,vboxrecursion=On,color=red]{texnegar}
+
+\begin{document}
+
+{\LtoR\HMXKayhanEn
+\begin{center}
+{\Huge\textsf{\TeXNegar} \\
+ \vspace{20pt}Example of Use \\
+ \vspace{20pt}\texttt{Engine: LuaTeX {\normalsize using texnegar}} \\
+ \vspace{20pt}\texttt{Kashida=leaders+glyph}} \\
+ \vspace{20pt}\makebox{\textsf{File:} \texttt{TEXMFDIST/doc/latex/texnegar/texnegar-luatex-leaders-glyph.tex}}
+ \vspace{20pt}
+
+{\Large
+\begin{tabular}{ll}
+ \textsf{Font:} & \textsf{HM XKayhan} \\
+ \textsf{Font Scale:} & \texttt{4.5} \\
+ \textsf{linebreakpenalty:} & \texttt{8} \\
+ \textsf{kashidastretch:} & \texttt{0.14em plus 5.5em} \\
+ \textsf{hboxrecursion:} & \texttt{On} \\
+ \textsf{vboxrecursion:} & \texttt{On} \\
+ \textsf{color:} & \texttt{red}
+\end{tabular}
+}
+\end{center}
+}
+
+\newpage \KashidaOff \SampleTitle{LuaTeX using texnegar}{Regular}{Off} \par {\HMXKayhanRm \SampleText}
+
+\newpage \KashidaOn \SampleTitle{LuaTeX using texnegar}{Regular}{leaders+glyph (On)} \par {\HMXKayhanRm \SampleText}
+
+\newpage \KashidaOn \SampleTitle{LuaTeX using texnegar}{Italic}{leaders+glyph (On)} \par {\HMXKayhanIt \SampleText}
+
+\newpage \KashidaOn \SampleTitle{LuaTeX using texnegar}{Oblique}{leaders+glyph (On)} \par {\HMXKayhanOb \SampleText}
+
+\newpage \KashidaOn \SampleTitle{LuaTeX using texnegar}{Outline}{leaders+glyph (On)} \par {\HMXKayhanOl \SampleText}
+
+\newpage \KashidaOn \SampleTitle{LuaTeX using texnegar}{Shadow}{leaders+glyph (On)} \par {\HMXKayhanSd \SampleText}
+
+\newpage \KashidaOn \SampleTitle{LuaTeX using texnegar}{Pook}{leaders+glyph (On)} \par {\HMXKayhanPo \SampleText}
+
+\newpage \KashidaOn \SampleTitle{LuaTeX using texnegar}{Sayeh}{leaders+glyph (On)} \par {\HMXKayhanSa \SampleText}
+
+\newpage \KashidaOn \SampleTitle{LuaTeX using texnegar}{Navaar}{leaders+glyph (On)} \par {\HMXKayhanNa \SampleText}
+
+\end{document}
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: t
+%%% End:
diff --git a/macros/latex/contrib/texnegar/texnegar-luatex-leaders-hrule.pdf b/macros/latex/contrib/texnegar/texnegar-luatex-leaders-hrule.pdf
new file mode 100644
index 0000000000..45a0990fbd
--- /dev/null
+++ b/macros/latex/contrib/texnegar/texnegar-luatex-leaders-hrule.pdf
Binary files differ
diff --git a/macros/latex/contrib/texnegar/texnegar-luatex-leaders-hrule.tex b/macros/latex/contrib/texnegar/texnegar-luatex-leaders-hrule.tex
new file mode 100644
index 0000000000..93938422da
--- /dev/null
+++ b/macros/latex/contrib/texnegar/texnegar-luatex-leaders-hrule.tex
@@ -0,0 +1,87 @@
+\documentclass{report}
+\usepackage{fontspec}
+\setmainfont[Script=Arabic,Language=Persian]{HM XKayhan}
+\setfontfamily\HMXKayhanEn[Scale=1.5,Colour=0000FF]{HM XKayhan}
+\setfontfamily\HMXKayhanRm[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan}
+\setfontfamily\HMXKayhanIt[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Italic}
+\setfontfamily\HMXKayhanOb[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhanOb Oblique}
+\setfontfamily\HMXKayhanOl[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Outline}
+\setfontfamily\HMXKayhanSd[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Shadow}
+\setfontfamily\HMXKayhanPo[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Pook}
+\setfontfamily\HMXKayhanSa[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Sayeh}
+\setfontfamily\HMXKayhanNa[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Navaar}
+
+\def\LtoR{\pagedir TLT \bodydir TLT \pardir TLT \textdir TLT}
+\def\RtoL{\pagedir TRT \bodydir TRT \pardir TRT \textdir TRT}
+
+\def\SampleText{\RtoL
+ راهی جایی تابی چاپی چاههی
+ شتابهایی تابی چاپی راهی تلاشهــایی
+ که کتابهایی که کلاههایی که کتابهایی }
+
+\def\SampleTitle#1#2#3{{\large\LtoR Engine: {\color{blue}\texttt{#1}}, \\
+ Style: {\color{blue}\texttt{#2}}, \\ Kashida: {\color{blue}\texttt{#3}}}\hbox{}\vskip 5mm}
+
+\pretolerance = 10000
+% \exhyphenpenalty=10000
+% \hyphenpenalty=10000
+% \penalty -10000
+% \tolerance=10000
+% \tolerance = -10000
+% \looseness = 10000
+
+\setlength\parindent{0pt}
+% \pagestyle{empty}
+\setcounter{page}{46}
+
+\usepackage[Kashida=leaders+hrule,kashidastretch=0.14 em plus 0.5 em,hboxrecursion=On,vboxrecursion=On,color=red]{texnegar}
+
+\begin{document}
+
+{\LtoR\HMXKayhanEn
+\begin{center}
+{\Huge\textsf{\TeXNegar} \\
+ \vspace{20pt}Example of Use \\
+ \vspace{20pt}\texttt{Engine: LuaTeX {\normalsize using texnegar}} \\
+ \vspace{20pt}\texttt{Kashida=leaders+hrule}} \\
+ \vspace{20pt}\makebox{\textsf{File:} \texttt{TEXMFDIST/doc/latex/texnegar/texnegar-luatex-leaders-hrule.tex}}
+ \vspace{20pt}
+
+{\Large
+\begin{tabular}{ll}
+ \textsf{Font:} & \textsf{HM XKayhan} \\
+ \textsf{Font Scale:} & \texttt{4.5} \\
+ \textsf{linebreakpenalty:} & \texttt{8} \\
+ \textsf{kashidastretch:} & \texttt{0.14em plus 5.5em} \\
+ \textsf{hboxrecursion:} & \texttt{On} \\
+ \textsf{vboxrecursion:} & \texttt{On} \\
+ \textsf{color:} & \texttt{red}
+\end{tabular}
+}
+\end{center}
+}
+
+\newpage \KashidaOff \SampleTitle{LuaTeX using texnegar}{Regular}{Off} \par {\HMXKayhanRm \SampleText}
+
+\newpage \KashidaOn \SampleTitle{LuaTeX using texnegar}{Regular}{leaders+hrule (On)} \par {\HMXKayhanRm \SampleText}
+
+\newpage \KashidaOn \SampleTitle{LuaTeX using texnegar}{Italic}{leaders+hrule (On)} \par {\HMXKayhanIt \SampleText}
+
+\newpage \KashidaOn \SampleTitle{LuaTeX using texnegar}{Oblique}{leaders+hrule (On)} \par {\HMXKayhanOb \SampleText}
+
+\newpage \KashidaOn \SampleTitle{LuaTeX using texnegar}{Outline}{leaders+hrule (On)} \par {\HMXKayhanOl \SampleText}
+
+\newpage \KashidaOn \SampleTitle{LuaTeX using texnegar}{Shadow}{leaders+hrule (On)} \par {\HMXKayhanSd \SampleText}
+
+\newpage \KashidaOn \SampleTitle{LuaTeX using texnegar}{Pook}{leaders+hrule (On)} \par {\HMXKayhanPo \SampleText}
+
+\newpage \KashidaOn \SampleTitle{LuaTeX using texnegar}{Sayeh}{leaders+hrule (On)} \par {\HMXKayhanSa \SampleText}
+
+\newpage \KashidaOn \SampleTitle{LuaTeX using texnegar}{Navaar}{leaders+hrule (On)} \par {\HMXKayhanNa \SampleText}
+
+\end{document}
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: t
+%%% End:
diff --git a/macros/latex/contrib/texnegar/texnegar-xetex-bidi-glyph.pdf b/macros/latex/contrib/texnegar/texnegar-xetex-bidi-glyph.pdf
new file mode 100644
index 0000000000..7f574e30ab
--- /dev/null
+++ b/macros/latex/contrib/texnegar/texnegar-xetex-bidi-glyph.pdf
Binary files differ
diff --git a/macros/latex/contrib/texnegar/texnegar-xetex-bidi-glyph.tex b/macros/latex/contrib/texnegar/texnegar-xetex-bidi-glyph.tex
new file mode 100644
index 0000000000..127d31bfa6
--- /dev/null
+++ b/macros/latex/contrib/texnegar/texnegar-xetex-bidi-glyph.tex
@@ -0,0 +1,91 @@
+\documentclass{report}
+
+\usepackage{fontspec}
+
+\setmainfont[Script=Arabic,Language=Persian]{HM XKayhan}
+
+\setfontfamily\HMXKayhanEn[Scale=1.5,Colour=0000FF]{HM XKayhan}
+\setfontfamily\HMXKayhanRm[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan}
+\setfontfamily\HMXKayhanIt[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Italic}
+\setfontfamily\HMXKayhanOb[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhanOb Oblique}
+\setfontfamily\HMXKayhanOl[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Outline}
+\setfontfamily\HMXKayhanSd[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Shadow}
+\setfontfamily\HMXKayhanPo[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Pook}
+\setfontfamily\HMXKayhanSa[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Sayeh}
+\setfontfamily\HMXKayhanNa[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Navaar}
+
+\usepackage[Kashida=glyph,linebreakpenalty=8,kashidastretch=0.14 em plus 0.5 em,color=red]{texnegar} % Succeeds
+
+\usepackage{bidi}
+
+\def\SampleText#1#2{{\setRTL\discouragebadlinebreaks[#1][#2]{
+ راهی جایی تابی چاپی چاههی تلاشهایی
+ شتابهایی تابی چاپی راهی تلاشهــایی
+ که کتابهایی که کلاههایی که کتابهایی }\unsetRTL}}
+
+\def\SampleTitle#1#2#3{{\large Engine: {\color{blue}\texttt{#1}}, \\
+ Style: {\color{blue}\texttt{#2}}, \\ Kashida: {\color{blue}\texttt{#3}}}\hbox{}\vskip 5mm}
+
+\pretolerance = 10000
+% \exhyphenpenalty=10000
+% \hyphenpenalty=10000
+% \penalty 10000
+% \tolerance=10000
+% \tolerance = -10000
+% \looseness = 10000
+
+\setlength\parindent{0pt}
+% \pagestyle{empty}
+\setcounter{page}{56}
+
+\begin{document}
+
+{
+\begin{center}
+{\HMXKayhanEn
+ \Huge{\textsf{\TeXNegar} \\
+ \vspace{20pt} Example of Use \\
+ \vspace{20pt}\texttt{Engine: XeTeX {\normalsize using texnegar and bidi}} \\
+ \vspace{20pt}\texttt{ Kashida=glyph}} \\
+ \vspace{20pt}\makebox{\normalsize\textsf{File:} \texttt{TEXMFDIST/doc/latex/texnegar/texnegar-xetex-bidi-glyph.tex}} \\
+ \vspace{20pt}
+}
+
+{\Large
+\begin{tabular}{ll}
+ \textsf{Font:} & \textsf{HM XKayhan} \\
+ \textsf{Font Scale:} & \texttt{4.5} \\
+ \textsf{linebreakpenalty:} & \texttt{8} \\
+ \textsf{kashidastretch:} & \texttt{0.14em plus 5.5em} \\
+ \textsf{hboxrecursion:} & \texttt{On} \\
+ \textsf{vboxrecursion:} & \texttt{On} \\
+ \textsf{color:} & \texttt{red}
+\end{tabular}
+}
+\end{center}
+}
+
+\newpage \KashidaOff \SampleTitle{XeTeX using texnegar and bidi}{Regular}{Off} \par {\HMXKayhanRm \SampleText{8}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and bidi}{Regular}{glyph (On)} \par {\HMXKayhanRm \SampleText{200}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and bidi}{Italic}{glyph (On)} \par {\HMXKayhanIt \SampleText{200}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and bidi}{Oblique}{glyph (On)} \par {\HMXKayhanOb \SampleText{200}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and bidi}{Outline}{glyph (On)} \par {\HMXKayhanOl \SampleText{200}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and bidi}{Shadow}{glyph (On)} \par {\HMXKayhanSd \SampleText{200}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and bidi}{Pook}{glyph (On)} \par {\HMXKayhanPo \SampleText{200}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and bidi}{Sayeh}{glyph (On)} \par {\HMXKayhanSa \SampleText{200}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and bidi}{Navaar}{glyph (On)} \par {\HMXKayhanNa \SampleText{200}{0.14 em plus 0.5 em}}
+
+\end{document}
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: t
+%%% End:
diff --git a/macros/latex/contrib/texnegar/texnegar-xetex-bidi-leaders-glyph.pdf b/macros/latex/contrib/texnegar/texnegar-xetex-bidi-leaders-glyph.pdf
new file mode 100644
index 0000000000..3b393c374b
--- /dev/null
+++ b/macros/latex/contrib/texnegar/texnegar-xetex-bidi-leaders-glyph.pdf
Binary files differ
diff --git a/macros/latex/contrib/texnegar/texnegar-xetex-bidi-leaders-glyph.tex b/macros/latex/contrib/texnegar/texnegar-xetex-bidi-leaders-glyph.tex
new file mode 100644
index 0000000000..6f46fa216a
--- /dev/null
+++ b/macros/latex/contrib/texnegar/texnegar-xetex-bidi-leaders-glyph.tex
@@ -0,0 +1,91 @@
+\documentclass{report}
+
+\usepackage{fontspec}
+
+\setmainfont[Script=Arabic,Language=Persian]{HM XKayhan}
+
+\setfontfamily\HMXKayhanEn[Scale=1.5,Colour=0000FF]{HM XKayhan}
+\setfontfamily\HMXKayhanRm[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan}
+\setfontfamily\HMXKayhanIt[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Italic}
+\setfontfamily\HMXKayhanOb[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhanOb Oblique}
+\setfontfamily\HMXKayhanOl[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Outline}
+\setfontfamily\HMXKayhanSd[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Shadow}
+\setfontfamily\HMXKayhanPo[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Pook}
+\setfontfamily\HMXKayhanSa[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Sayeh}
+\setfontfamily\HMXKayhanNa[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Navaar}
+
+\usepackage[Kashida=leaders+glyph,linebreakpenalty=8,kashidastretch=0.14 em plus 0.5 em,color=red]{texnegar} % Succeeds
+
+\usepackage{bidi}
+
+\def\SampleText#1#2{{\setRTL\discouragebadlinebreaks[#1][#2]{
+ راهی جایی تابی چاپی چاههی تلاشهایی
+ شتابهایی تابی چاپی راهی تلاشهــایی
+ که کتابهایی که کلاههایی که کتابهایی }\unsetRTL}}
+
+\def\SampleTitle#1#2#3{{\large Engine: {\color{blue}\texttt{#1}}, \\
+ Style: {\color{blue}\texttt{#2}}, \\ Kashida: {\color{blue}\texttt{#3}}}\hbox{}\vskip 5mm}
+
+\pretolerance = 10000
+% \exhyphenpenalty=10000
+% \hyphenpenalty=10000
+% \penalty 10000
+% \tolerance=10000
+% \tolerance = -10000
+% \looseness = 10000
+
+\setlength\parindent{0pt}
+% \pagestyle{empty}
+\setcounter{page}{66}
+
+\begin{document}
+
+{
+\begin{center}
+{\HMXKayhanEn
+ \Huge{\textsf{\TeXNegar} \\
+ \vspace{20pt} Example of Use \\
+ \vspace{20pt}\texttt{Engine: XeTeX {\normalsize using texnegar and bidi}} \\
+ \vspace{20pt} \texttt{Kashida=leaders+glyph}} \\
+ \vspace{20pt}\makebox{\normalsize\textsf{File:} \texttt{TEXMFDIST/doc/latex/texnegar/texnegar-xetex-bidi-leaders-glyph.tex}} \\
+ \vspace{20pt}
+}
+
+{\Large
+\begin{tabular}{ll}
+ \textsf{Font:} & \textsf{HM XKayhan} \\
+ \textsf{Font Scale:} & \texttt{4.5} \\
+ \textsf{linebreakpenalty:} & \texttt{8} \\
+ \textsf{kashidastretch:} & \texttt{0.14em plus 5.5em} \\
+ \textsf{hboxrecursion:} & \texttt{On} \\
+ \textsf{vboxrecursion:} & \texttt{On} \\
+ \textsf{color:} & \texttt{red}
+\end{tabular}
+}
+\end{center}
+}
+
+\newpage \KashidaOff \SampleTitle{XeTeX using texnegar and bidi}{Regular}{Off} \par {\HMXKayhanRm \SampleText{8}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and bidi}{Regular}{leaders+glyph (On)} \par {\HMXKayhanRm \SampleText{200}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and bidi}{Italic}{leaders+glyph (On)} \par {\HMXKayhanIt \SampleText{200}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and bidi}{Oblique}{leaders+glyph (On)} \par {\HMXKayhanOb \SampleText{200}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and bidi}{Outline}{leaders+glyph (On)} \par {\HMXKayhanOl \SampleText{200}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and bidi}{Shadow}{leaders+glyph (On)} \par {\HMXKayhanSd \SampleText{200}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and bidi}{Pook}{leaders+glyph (On)} \par {\HMXKayhanPo \SampleText{200}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and bidi}{Sayeh}{leaders+glyph (On)} \par {\HMXKayhanSa \SampleText{200}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and bidi}{Navaar}{leaders+glyph (On)} \par {\HMXKayhanNa \SampleText{200}{0.14 em plus 0.5 em}}
+
+\end{document}
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: t
+%%% End:
diff --git a/macros/latex/contrib/texnegar/texnegar-xetex-bidi-leaders-hrule.pdf b/macros/latex/contrib/texnegar/texnegar-xetex-bidi-leaders-hrule.pdf
new file mode 100644
index 0000000000..1d08e99a77
--- /dev/null
+++ b/macros/latex/contrib/texnegar/texnegar-xetex-bidi-leaders-hrule.pdf
Binary files differ
diff --git a/macros/latex/contrib/texnegar/texnegar-xetex-bidi-leaders-hrule.tex b/macros/latex/contrib/texnegar/texnegar-xetex-bidi-leaders-hrule.tex
new file mode 100644
index 0000000000..a585b6af22
--- /dev/null
+++ b/macros/latex/contrib/texnegar/texnegar-xetex-bidi-leaders-hrule.tex
@@ -0,0 +1,91 @@
+\documentclass{report}
+
+\usepackage{fontspec}
+
+\setmainfont[Script=Arabic,Language=Persian]{HM XKayhan}
+
+\setfontfamily\HMXKayhanEn[Scale=1.5,Colour=0000FF]{HM XKayhan}
+\setfontfamily\HMXKayhanRm[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan}
+\setfontfamily\HMXKayhanIt[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Italic}
+\setfontfamily\HMXKayhanOb[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhanOb Oblique}
+\setfontfamily\HMXKayhanOl[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Outline}
+\setfontfamily\HMXKayhanSd[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Shadow}
+\setfontfamily\HMXKayhanPo[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Pook}
+\setfontfamily\HMXKayhanSa[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Sayeh}
+\setfontfamily\HMXKayhanNa[Script=Arabic,Language=Persian,Scale=4.5]{HM XKayhan Navaar}
+
+\usepackage[Kashida=leaders+hrule,linebreakpenalty=8,kashidastretch=0.14 em plus 0.5 em,color=red]{texnegar} % Succeeds
+
+\usepackage{bidi}
+
+\def\SampleText#1#2{{\setRTL\discouragebadlinebreaks[#1][#2]{
+ راهی جایی تابی چاپی چاههی تلاشهایی
+ شتابهایی تابی چاپی راهی تلاشهــایی
+ که کتابهایی که کلاههایی که کتابهایی }\unsetRTL}}
+
+\def\SampleTitle#1#2#3{{\large Engine: {\color{blue}\texttt{#1}}, \\
+ Style: {\color{blue}\texttt{#2}}, \\ Kashida: {\color{blue}\texttt{#3}}}\hbox{}\vskip 5mm}
+
+\pretolerance = 10000
+% \exhyphenpenalty=10000
+% \hyphenpenalty=10000
+% \penalty 10000
+% \tolerance=10000
+% \tolerance = -10000
+% \looseness = 10000
+
+\setlength\parindent{0pt}
+% \pagestyle{empty}
+\setcounter{page}{76}
+
+\begin{document}
+
+{
+\begin{center}
+{\HMXKayhanEn
+ \Huge{\textsf{\TeXNegar} \\
+ \vspace{20pt} Example of Use \\
+ \vspace{20pt}\texttt{Engine: XeTeX {\normalsize using texnegar and bidi}} \\
+ \vspace{20pt} \texttt{Kashida=leaders+hrule}} \\
+ \vspace{20pt}\makebox{\normalsize\textsf{File:} \texttt{TEXMFDIST/doc/latex/texnegar/texnegar-xetex-bidi-leaders-hrule.tex}} \\
+ \vspace{20pt}
+}
+
+{\Large
+\begin{tabular}{ll}
+ \textsf{Font:} & \textsf{HM XKayhan} \\
+ \textsf{Font Scale:} & \texttt{4.5} \\
+ \textsf{linebreakpenalty:} & \texttt{8} \\
+ \textsf{kashidastretch:} & \texttt{0.14em plus 5.5em} \\
+ \textsf{hboxrecursion:} & \texttt{On} \\
+ \textsf{vboxrecursion:} & \texttt{On} \\
+ \textsf{color:} & \texttt{red}
+\end{tabular}
+}
+\end{center}
+}
+
+\newpage \KashidaOff \SampleTitle{XeTeX using texnegar and bidi}{Regular}{Off} \par {\HMXKayhanRm \SampleText{8}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and bidi}{Regular}{leaders+hrule (On)} \par {\HMXKayhanRm \SampleText{200}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and bidi}{Italic}{leaders+hrule (On)} \par {\HMXKayhanIt \SampleText{200}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and bidi}{Oblique}{leaders+hrule (On)} \par {\HMXKayhanOb \SampleText{200}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and bidi}{Outline}{leaders+hrule (On)} \par {\HMXKayhanOl \SampleText{200}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and bidi}{Shadow}{leaders+hrule (On)} \par {\HMXKayhanSd \SampleText{200}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and bidi}{Pook}{leaders+hrule (On)} \par {\HMXKayhanPo \SampleText{200}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and bidi}{Sayeh}{leaders+hrule (On)} \par {\HMXKayhanSa \SampleText{200}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and bidi}{Navaar}{leaders+hrule (On)} \par {\HMXKayhanNa \SampleText{200}{0.14 em plus 0.5 em}}
+
+\end{document}
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: t
+%%% End:
diff --git a/macros/latex/contrib/texnegar/texnegar-xetex-xepersian-glyph.pdf b/macros/latex/contrib/texnegar/texnegar-xetex-xepersian-glyph.pdf
new file mode 100644
index 0000000000..0a285b450f
--- /dev/null
+++ b/macros/latex/contrib/texnegar/texnegar-xetex-xepersian-glyph.pdf
Binary files differ
diff --git a/macros/latex/contrib/texnegar/texnegar-xetex-xepersian-glyph.tex b/macros/latex/contrib/texnegar/texnegar-xetex-xepersian-glyph.tex
new file mode 100644
index 0000000000..763b04d18a
--- /dev/null
+++ b/macros/latex/contrib/texnegar/texnegar-xetex-xepersian-glyph.tex
@@ -0,0 +1,89 @@
+\documentclass{report}
+
+\usepackage[Kashida=glyph,linebreakpenalty=8,kashidastretch=0.14 em plus 0.5 em,color=red]{texnegar} % Succeeds
+
+\usepackage[fontsloadable=true]{xepersian}
+% \settextfont[Scale=4.5,Colour=darkgray]{XB Kayhan}
+\settextfont{HM XKayhan}
+\setlatintextfont[Scale=1.5,Colour=0000FF]{HM XKayhan}
+
+\deflatinfont\HMXKayhanEn[Scale=1.2]{HM XKayhan}
+\defpersianfont\HMXKayhanRm[Scale=4.5]{HM XKayhan}
+\defpersianfont\HMXKayhanIt[Scale=4.5]{HM XKayhan Italic}
+\defpersianfont\HMXKayhanOb[Scale=4.5]{HM XKayhanOb Oblique}
+\defpersianfont\HMXKayhanOl[Scale=4.5]{HM XKayhan Outline}
+\defpersianfont\HMXKayhanSd[Scale=4.5]{HM XKayhan Shadow}
+\defpersianfont\HMXKayhanPo[Scale=4.5]{HM XKayhan Pook}
+\defpersianfont\HMXKayhanSa[Scale=4.5]{HM XKayhan Sayeh}
+\defpersianfont\HMXKayhanNa[Scale=4.5]{HM XKayhan Navaar}
+
+\def\SampleText#1#2{\discouragebadlinebreaks[#1][#2]{
+ راهی جایی تابی چاپی چاههی تلاشهایی
+ شتابهایی تابی چاپی راهی تلاشهــایی
+ که کتابهایی که کلاههایی که کتابهایی }}
+
+\def\SampleTitle#1#2#3{{{\HMXKayhanEn\LTR Engine: {\color{blue}\texttt{#1}}, \\
+ Style: {\color{blue}\texttt{#2}}, \\ Kashida: {\color{blue}\texttt{#3}}}}\hbox{}\vskip 5mm}
+
+\pretolerance = 10000
+% \exhyphenpenalty=10000
+% \hyphenpenalty=10000
+% \penalty -10000
+% \tolerance=10000
+% \tolerance = -10000
+% \looseness = 10000
+
+\setlength\parindent{0pt}
+% \pagestyle{empty}
+\setcounter{page}{86}
+\let\tmppage=\thepage
+\gdef\thepage{\scriptsize\lr\tmppage}
+
+\begin{document}
+
+\begin{latin}
+\begin{center}
+{\Huge\textsf{\TeXNegar} \\
+ \vspace{20pt} Example of Use \\
+ \vspace{20pt}\texttt{Engine: XeTeX {\normalsize using texnegar and xepersian}} \\
+ \vspace{20pt}\texttt{Kashida=glyph}} \\
+ \vspace{20pt}\makebox{\textsf{File:} \texttt{TEXMFDIST/doc/latex/texnegar/texnegar-xetex-xepersian-glyph.tex}} \\
+ \vspace{20pt}
+
+{\Large
+\begin{tabular}{ll}
+ \textsf{Font:} & \textsf{HM XKayhan} \\
+ \textsf{Font Scale:} & \texttt{4.5} \\
+ \textsf{linebreakpenalty:} & \texttt8 \\
+ \textsf{kashidastretch:} & \texttt{0.14em plus 5.5em} \\
+ \textsf{color:} & \texttt{red}
+\end{tabular}
+}
+\end{center}
+
+\end{latin}
+
+\newpage \KashidaOff \SampleTitle{XeTeX using texnegar and xepersian}{Regular}{Off} \par {\HMXKayhanRm \SampleText{8}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and xepersian}{Regular}{glyph (On)} \par {\HMXKayhanRm \SampleText{15}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and xepersian}{Italic}{glyph (On)} \par {\HMXKayhanIt \SampleText{20}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and xepersian}{Oblique}{glyph (On)} \par {\HMXKayhanOb \SampleText{20}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and xepersian}{Outline}{glyph (On)} \par {\HMXKayhanOl \SampleText{25}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and xepersian}{Shadow}{glyph (On)} \par {\HMXKayhanSd \SampleText{30}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and xepersian}{Pook}{glyph (On)} \par {\HMXKayhanPo \SampleText{200}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and xepersian}{Sayeh}{glyph (On)} \par {\HMXKayhanSa \SampleText{200}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and xepersian}{Navaar}{glyph (On)} \par {\HMXKayhanNa \SampleText{200}{0.14 em plus 0.5 em}}
+
+\end{document}
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: t
+%%% End:
diff --git a/macros/latex/contrib/texnegar/texnegar-xetex-xepersian-leaders-glyph.pdf b/macros/latex/contrib/texnegar/texnegar-xetex-xepersian-leaders-glyph.pdf
new file mode 100644
index 0000000000..12098ea3dc
--- /dev/null
+++ b/macros/latex/contrib/texnegar/texnegar-xetex-xepersian-leaders-glyph.pdf
Binary files differ
diff --git a/macros/latex/contrib/texnegar/texnegar-xetex-xepersian-leaders-glyph.tex b/macros/latex/contrib/texnegar/texnegar-xetex-xepersian-leaders-glyph.tex
new file mode 100644
index 0000000000..92870b4e44
--- /dev/null
+++ b/macros/latex/contrib/texnegar/texnegar-xetex-xepersian-leaders-glyph.tex
@@ -0,0 +1,89 @@
+\documentclass{report}
+
+\usepackage[Kashida=leaders+glyph,linebreakpenalty=8,kashidastretch=0.14 em plus 0.5 em,color=red]{texnegar} % Succeeds
+
+\usepackage[fontsloadable=true]{xepersian}
+% \settextfont[Scale=4.5,Colour=darkgray]{XB Kayhan}
+\settextfont{HM XKayhan}
+\setlatintextfont[Scale=1.5,Colour=0000FF]{HM XKayhan}
+
+\deflatinfont\HMXKayhanEn[Scale=1.2]{HM XKayhan}
+\defpersianfont\HMXKayhanRm[Scale=4.5]{HM XKayhan}
+\defpersianfont\HMXKayhanIt[Scale=4.5]{HM XKayhan Italic}
+\defpersianfont\HMXKayhanOb[Scale=4.5]{HM XKayhanOb Oblique}
+\defpersianfont\HMXKayhanOl[Scale=4.5]{HM XKayhan Outline}
+\defpersianfont\HMXKayhanSd[Scale=4.5]{HM XKayhan Shadow}
+\defpersianfont\HMXKayhanPo[Scale=4.5]{HM XKayhan Pook}
+\defpersianfont\HMXKayhanSa[Scale=4.5]{HM XKayhan Sayeh}
+\defpersianfont\HMXKayhanNa[Scale=4.5]{HM XKayhan Navaar}
+
+\def\SampleText#1#2{\discouragebadlinebreaks[#1][#2]{
+ راهی جایی تابی چاپی چاههی تلاشهایی
+ شتابهایی تابی چاپی راهی تلاشهــایی
+ که کتابهایی که کلاههایی که کتابهایی }}
+
+\def\SampleTitle#1#2#3{{{\HMXKayhanEn\LTR Engine: {\color{blue}\texttt{#1}}, \\
+ Style: {\color{blue}\texttt{#2}}, \\ Kashida: {\color{blue}\texttt{#3}}}}\hbox{}\vskip 5mm}
+
+\pretolerance = 10000
+% \exhyphenpenalty=10000
+% \hyphenpenalty=10000
+% \penalty -10000
+% \tolerance=10000
+% \tolerance = -10000
+% \looseness = 10000
+
+\setlength\parindent{0pt}
+% \pagestyle{empty}
+\setcounter{page}{96}
+\let\tmppage=\thepage
+\gdef\thepage{\scriptsize\lr\tmppage}
+
+\begin{document}
+
+\begin{latin}
+\begin{center}
+{\Huge\textsf{\TeXNegar} \\
+ \vspace{20pt} Example of Use \\
+ \vspace{20pt}\texttt{Engine: XeTeX {\normalsize using texnegar and xepersian}} \\
+ \vspace{20pt}\texttt{Kashida=leaders+glyph}} \\
+ \vspace{20pt}\makebox{\textsf{File:} \texttt{TEXMFDIST/doc/latex/texnegar/texnegar-xetex-xepersian-leaders-glyph.tex}} \\
+ \vspace{20pt}
+
+{\Large
+\begin{tabular}{ll}
+ \textsf{Font:} & \textsf{HM XKayhan} \\
+ \textsf{Font Scale:} & \texttt{4.5} \\
+ \textsf{linebreakpenalty:} & \texttt8 \\
+ \textsf{kashidastretch:} & \texttt{0.14em plus 5.5em} \\
+ \textsf{color:} & \texttt{red}
+\end{tabular}
+}
+\end{center}
+
+\end{latin}
+
+\newpage \KashidaOff \SampleTitle{XeTeX using texnegar and xepersian}{Regular}{Off} \par {\HMXKayhanRm \SampleText{8}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and xepersian}{Regular}{leaders+glyph (On)} \par {\HMXKayhanRm \SampleText{8}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and xepersian}{Italic}{leaders+glyph (On)} \par {\HMXKayhanIt \SampleText{8}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and xepersian}{Oblique}{leaders+glyph (On)} \par {\HMXKayhanOb \SampleText{8}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and xepersian}{Outline}{leaders+glyph (On)} \par {\HMXKayhanOl \SampleText{8}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and xepersian}{Shadow}{leaders+glyph (On)} \par {\HMXKayhanSd \SampleText{8}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and xepersian}{Pook}{leaders+glyph (On)} \par {\HMXKayhanPo \SampleText{8}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and xepersian}{Sayeh}{leaders+glyph (On)} \par {\HMXKayhanSa \SampleText{8}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and xepersian}{Navaar}{leaders+glyph (On)} \par {\HMXKayhanNa \SampleText{8}{0.14 em plus 0.5 em}}
+
+\end{document}
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: t
+%%% End:
diff --git a/macros/latex/contrib/texnegar/texnegar-xetex-xepersian-leaders-hrule.pdf b/macros/latex/contrib/texnegar/texnegar-xetex-xepersian-leaders-hrule.pdf
new file mode 100644
index 0000000000..b574694222
--- /dev/null
+++ b/macros/latex/contrib/texnegar/texnegar-xetex-xepersian-leaders-hrule.pdf
Binary files differ
diff --git a/macros/latex/contrib/texnegar/texnegar-xetex-xepersian-leaders-hrule.tex b/macros/latex/contrib/texnegar/texnegar-xetex-xepersian-leaders-hrule.tex
new file mode 100644
index 0000000000..a5df81db3f
--- /dev/null
+++ b/macros/latex/contrib/texnegar/texnegar-xetex-xepersian-leaders-hrule.tex
@@ -0,0 +1,89 @@
+\documentclass{report}
+
+\usepackage[Kashida=leaders+hrule,linebreakpenalty=8,kashidastretch=0.14 em plus 0.5 em,color=red]{texnegar} % Succeeds
+
+\usepackage[fontsloadable=true]{xepersian}
+% \settextfont[Scale=4.5,Colour=darkgray]{XB Kayhan}
+\settextfont{HM XKayhan}
+\setlatintextfont[Scale=1.5,Colour=0000FF]{HM XKayhan}
+
+\deflatinfont\HMXKayhanEn[Scale=1.2]{HM XKayhan}
+\defpersianfont\HMXKayhanRm[Scale=4.5]{HM XKayhan}
+\defpersianfont\HMXKayhanIt[Scale=4.5]{HM XKayhan Italic}
+\defpersianfont\HMXKayhanOb[Scale=4.5]{HM XKayhanOb Oblique}
+\defpersianfont\HMXKayhanOl[Scale=4.5]{HM XKayhan Outline}
+\defpersianfont\HMXKayhanSd[Scale=4.5]{HM XKayhan Shadow}
+\defpersianfont\HMXKayhanPo[Scale=4.5]{HM XKayhan Pook}
+\defpersianfont\HMXKayhanSa[Scale=4.5]{HM XKayhan Sayeh}
+\defpersianfont\HMXKayhanNa[Scale=4.5]{HM XKayhan Navaar}
+
+\def\SampleText#1#2{\discouragebadlinebreaks[#1][#2]{
+ راهی جایی تابی چاپی چاههی تلاشهایی
+ شتابهایی تابی چاپی راهی تلاشهــایی
+ که کتابهایی که کلاههایی که کتابهایی }}
+
+\def\SampleTitle#1#2#3{{{\HMXKayhanEn\LTR Engine: {\color{blue}\texttt{#1}}, \\
+ Style: {\color{blue}\texttt{#2}}, \\ Kashida: {\color{blue}\texttt{#3}}}}\hbox{}\vskip 5mm}
+
+\pretolerance = 10000
+% \exhyphenpenalty=10000
+% \hyphenpenalty=10000
+% \penalty -10000
+% \tolerance=10000
+% \tolerance = -10000
+% \looseness = 10000
+
+\setlength\parindent{0pt}
+% \pagestyle{empty}
+\setcounter{page}{106}
+\let\tmppage=\thepage
+\gdef\thepage{\scriptsize\lr\tmppage}
+
+\begin{document}
+
+\begin{latin}
+\begin{center}
+{\Huge\textsf{\TeXNegar} \\
+ \vspace{20pt} Example of Use \\
+ \vspace{20pt}\texttt{Engine: XeTeX {\normalsize using texnegar and xepersian}} \\
+ \vspace{20pt}\texttt{Kashida=leaders+hrule}} \\
+ \vspace{20pt}\makebox{\textsf{File:} \texttt{TEXMFDIST/doc/latex/texnegar/texnegar-xetex-xepersian-leaders-hrule.tex}} \\
+ \vspace{20pt}
+
+{\Large
+\begin{tabular}{ll}
+ \textsf{Font:} & \textsf{HM XKayhan} \\
+ \textsf{Font Scale:} & \texttt{4.5} \\
+ \textsf{linebreakpenalty:} & \texttt8 \\
+ \textsf{kashidastretch:} & \texttt{0.14em plus 5.5em} \\
+ \textsf{color:} & \texttt{red}
+\end{tabular}
+}
+\end{center}
+
+\end{latin}
+
+\newpage \KashidaOff \SampleTitle{XeTeX using texnegar and xepersian}{Regular}{Off} \par {\HMXKayhanRm \SampleText{8}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and xepersian}{Regular}{leaders+hrule (On)} \par {\HMXKayhanRm \SampleText{8}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and xepersian}{Italic}{leaders+hrule (On)} \par {\HMXKayhanIt \SampleText{8}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and xepersian}{Oblique}{leaders+hrule (On)} \par {\HMXKayhanOb \SampleText{8}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and xepersian}{Outline}{leaders+hrule (On)} \par {\HMXKayhanOl \SampleText{8}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and xepersian}{Shadow}{leaders+hrule (On)} \par {\HMXKayhanSd \SampleText{8}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and xepersian}{Pook}{leaders+hrule (On)} \par {\HMXKayhanPo \SampleText{8}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and xepersian}{Sayeh}{leaders+hrule (On)} \par {\HMXKayhanSa \SampleText{8}{0.14 em plus 0.5 em}}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using texnegar and xepersian}{Navaar}{leaders+hrule (On)} \par {\HMXKayhanNa \SampleText{8}{0.14 em plus 0.5 em}}
+
+\end{document}
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: t
+%%% End:
diff --git a/macros/latex/contrib/texnegar/texnegar.dtx b/macros/latex/contrib/texnegar/texnegar.dtx
new file mode 100644
index 0000000000..af171614c5
--- /dev/null
+++ b/macros/latex/contrib/texnegar/texnegar.dtx
@@ -0,0 +1,1808 @@
+% \iffalse meta-comment
+%
+% This is file `texnegar.dtx'
+%
+% Copyright (C) 2020 Hossein Movahhedian
+%
+% It may be distributed and/or modified under the LaTeX Project Public License,
+% version 1.3c or higher (your choice). The latest version of
+% this license is at: http://www.latex-project.org/lppl.txt
+%
+%<*internal>
+\iffalse
+%</internal>
+%<*README-txt>
+The TEXNEGAR package
+------------------------
+
+In some cursive scripts such as Persian or Arabic, kashida is used to create
+justification. In this type of justification characters are elongated rather
+than expanding spaces between words.
+
+The kashida justification in 'xepersian' has many bugs. Also it has problems
+with some fonts such as 'HM Series' available at
+'https://dma8hm1334.bitbucket.io' and 'X Series 2' available at
+'http://wiki.irmug.com/index.php/X_Series_2'. The 'xepersian-hm' package was
+the first attempt to fix these bugs in 'xepersian' which uses the xetex
+engine.
+
+This package extends the kashida justification to be used with the luatex
+engine too.
+
+The files 'texnegar-*.tex' in the directory 'texmf-dist/doc/xelatex/texnegar/'
+can be used as simple examples of the usage of the package.
+
+Please use the Bitbucket issue tracker:
+'https://bitbucket.org/dma8hm1334/texnegar/issues' to report a bug, request
+a feature or if you have a comment.
+
+I will do my best to fix all the bugs you report, but, unfortunately, time is a
+big hurdle to overcome; so, my apologies in advance for those which I cannot
+make time to fix.
+%</README-txt>
+%<*internal>
+\fi
+%</internal>
+%
+%<*driver|package>
+% The version of expl3 required is tested as early as possible, as
+% some really old versions do not define \ProvidesExplPackage.
+\RequirePackage{expl3}[2018/02/21]
+%<package>\@ifpackagelater{expl3}{2018/02/21}
+%<package> {}
+%<package> {%
+%<package> \PackageError{xtemplate}{Support package l3kernel too old}
+%<package> {%
+%<package> Please install an up to date version of l3kernel\MessageBreak
+%<package> using your TeX package manager or from CTAN.\MessageBreak
+%<package> \MessageBreak
+%<package> Loading xtemplate will abort!%
+%<package> }%
+%<package> \endinput
+%<package> }
+%</driver|package>
+%<*driver>
+\documentclass[full]{l3doc}
+\begin{document}
+ \DocInput{\jobname.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \ifluatex
+% \immediate\directlua{os.execute([[ lualatex texnegar-doc.ltx ]])}
+% \immediate\directlua{os.execute([[ lualatex texnegar-doc.ltx ]])}
+% \immediate\directlua{os.execute([[ makeindex -c texnegar-doc.idx ]])}
+% \immediate\directlua{os.execute([[ lualatex texnegar-doc.ltx ]])}
+% \fi
+%
+% \ifxetex
+% \immediate\write18{lualatex texnegar-doc.ltx}
+% \immediate\write18{lualatex texnegar-doc.ltx}
+% \immediate\write18{makeindex -c texnegar-doc.idx}
+% \immediate\write18{lualatex texnegar-doc.ltx}
+% \fi
+%
+% \begin{implementation}
+%
+% \def\TeXNegar{\TeX Negar}
+%
+% \title{^^A
+% The \TeXNegar{} package\\Kashida justification in LuaTeX and XeTeX\\Source code documentation^^A
+% }
+%
+% \author{^^A
+% Hossein Movahhedian\thanks
+% {^^A
+% E-mail:
+% \href{mailto:dma8hm1334@gmail.com}
+% {\textsf{dma8hm1334@gmail.com}}
+% }^^A
+% }
+%
+% \date{Released \quad 2020-08-29 \quad v0.1a}
+%
+% \maketitle
+%
+% \vskip 40mm
+% \begin{function}{Negar:}
+% \begin{minipage}{0.65\linewidth}
+% \textit{\noindent
+% Negar, in Persian, is the present stem of negaashtan meaning to design; to paint;
+% to write; and as a noun it means ``sweetheart, idol, beloved, figuratively refering
+% to a beautiful woman, pattern, painting, and artistic design''
+% }
+% \end{minipage}
+% \end{function}
+%
+% \newpage
+%
+% \tableofcontents
+%
+% \newpage
+%
+% \section{\TeXNegar{} Implementation}
+%
+% \subsection{File: \texttt{texnegar.sty}}
+%
+% \begin{macrocode}
+%<*texnegar-sty>
+\RequirePackage{xparse}
+\RequirePackage{l3keys2e}
+\RequirePackage{graphicx}[2019-11-30]
+\RequirePackage[dvipsnames,svgnames,x11names]{xcolor}[2016/05/11]
+\ProvidesExplPackage {texnegar} {2020-08-29} {0.1a} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
+
+\sys_if_engine_luatex:T
+ {
+ \RequirePackageWithOptions{texnegar-luatex}
+ \endinput
+ }
+\sys_if_engine_xetex:T
+ {
+ \RequirePackageWithOptions{texnegar-xetex}
+ \endinput
+ }
+\msg_new:nnn {texnegar} {cannot-use-pdftex}
+ {
+ The~ texnegar~ package~ requires~ either~ XeTeX~ or~ LuaTeX.\\\\
+ You~ must~ change~ your~ typesetting~ engine~ to,~ e.g.,~
+ "xelatex"~ or~ "lualatex" instead~ of~ "latex"~ or~ "pdflatex".
+ }
+\msg_fatal:nn {texnegar} {cannot-use-pdftex}
+
+ \endinput
+%</texnegar-sty>
+% \end{macrocode}
+%
+% \subsection{File: \texttt{texnegar-luatex.sty}}
+%
+% \begin{macrocode}
+%<*texnegar-luatex-sty>
+\ProvidesExplPackage {texnegar-luatex} {2020-08-29} {0.1a} { Full implementation of kashida feature in xetex and luatex }
+
+\tex_input:D { texnegar-ini.tex }
+
+\bool_if:NT \l_texnegar_kashida_fix_bool
+ {
+ \if_int_compare:w \luatexversion < \c_texnegar_luatexversionmajormin_int\c_texnegar_luatexversionminormin_int
+ \msg_error:nnxxx { texnegar } { luatex-version-is-too-old } { !!!! } { \c_texnegar_luatexversionmajormin_int } { \c_texnegar_luatexversionminormin_int }
+ \fi:
+
+ \hbox_set:Nn \l_texnegar_k_box { \resizebox{5000sp}{\height}{-} }
+
+ \hbox_set:Nn \l_texnegar_ksh_box { \char\lua_now:n { tex.sprint(0, font.getfont(font.current()).resources.unicodes[token.scan_string()]) } hyphen }
+
+ \directlua{dofile(kpse.find_file("texnegar.lua"))}
+ }
+
+\bool_if:NT \l_texnegar_kashida_fix_bool
+ {
+ \tex_input:D { texnegar-common-kashida.tex }
+
+ \AtBeginDocument
+ {
+ \KashidaOn
+ }
+ }
+
+ \endinput
+%</texnegar-luatex-sty>
+% \end{macrocode}
+%
+% \subsection{File: \texttt{texnegar-xetex.sty}}
+%
+% \begin{macrocode}
+%<*texnegar-xetex-sty>
+\RequirePackage{zref-savepos}[2020-03-03]
+\ProvidesExplPackage {texnegar-xetex} {2020-08-29} {0.1a} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
+
+\tex_input:D { texnegar-ini.tex }
+
+\bool_if:NT \l_texnegar_kashida_fix_bool
+ {
+ \tex_input:D { texnegar-xetex-kashida.tex }
+ }
+
+ \endinput
+%</texnegar-xetex-sty>
+% \end{macrocode}
+%
+% \subsection{File: \texttt{texnegar-ini.tex}}
+%
+% \begin{macrocode}
+%<*texnegar-ini-tex>
+\ProvidesExplFile {texnegar-ini.tex} {2020-08-29} {0.1a} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
+
+\def\TeXNegar{\TeX Negar}
+
+\box_new:N \l_texnegar_k_box
+\box_new:N \l_texnegar_ksh_box
+
+\tl_const:Nn \c_texnegar_luatexversionmajormin_int {1}
+\tl_const:Nn \c_texnegar_luatexversionminormin_int {12}
+
+\int_const:Nn \c_texnegar_ksh_int {"0640} % kashida
+\int_const:Nn \c_texnegar_lrm_int {"200E} % left-right-mark
+\int_const:Nn \c_texnegar_zwj_int {"200D} % zero-width joiner
+
+\int_const:Nn \c_texnegar_two_int {2}
+\int_const:Nn \c_texnegar_four_int {4}
+
+\tl_const:Nn \c_texnegar_skip_a_tl { 0 em plus 0.5 em }
+\tl_const:Nn \c_texnegar_skip_b_tl { 0.14 em plus 5.5 em }
+
+\int_new:N \l_texnegar_counter_int
+
+\int_new:N \l_texnegar_kashida_slot_int
+
+\int_new:N \l_texnegar_line_break_penalty_int
+
+\int_new:N \l_texnegar_min_penalty_int
+\int_new:N \l_texnegar_low_penalty_int
+\int_new:N \l_texnegar_med_penalty_int
+\int_new:N \l_texnegar_high_penalty_int
+\int_new:N \l_texnegar_max_penalty_int
+
+\int_new:N \l_fontnumber_int
+
+\tl_new:N \l_texnegar_line_break_tl
+
+\tl_new:N \l_texnegar_main_font_full_tl
+\tl_new:N \l_texnegar_main_font_name_tl
+
+\tl_new:N \l_texnegar_font_full_tl
+\tl_new:N \l_texnegar_font_name_tl
+
+\tl_new:N \l_texnegar_skip_default_tl
+
+\tl_new:N \l_texnegar_active_ligs_tl
+
+\tl_new:N \l_texnegar_gap_filler_tl
+
+\tl_new:N \l_texnegar_use_color_tl
+\tl_new:N \l_texnegar_color_tl
+\tl_new:N \l_texnegar_color_rgb_tl
+
+\dim_new:N \l_texnegar_diff_pos_dim
+
+\bool_set_false:N \l_texnegar_kashida_fix_bool
+
+\bool_set_false:N \l_texnegar_kashida_glyph_bool
+\bool_set_false:N \l_texnegar_kashida_leaders_glyph_bool
+\bool_set_false:N \l_texnegar_kashida_leaders_hrule_bool
+
+\bool_set_false:N \l_texnegar_ligature_bool
+\bool_set_false:N \l_texnegar_linebreakpenalty_bool
+\bool_set_false:N \l_texnegar_hboxrecursion_bool
+\bool_set_false:N \l_texnegar_vboxrecursion_bool
+\bool_set_false:N \l_texnegar_color_bool
+
+\int_set:Nn \l_texnegar_min_penalty_int { 0 }
+\int_set:Nn \l_texnegar_low_penalty_int { 8 }
+\int_set:Nn \l_texnegar_med_penalty_int { 15 }
+\int_set:Nn \l_texnegar_high_penalty_int { 25 }
+\int_set:Nn \l_texnegar_max_penalty_int { 10000 }
+
+\tl_set:Nn \l_texnegar_stretch_glyph_tl { glyph }
+\tl_set:Nn \l_texnegar_stretch_leaders_glyph_tl { leaders+glyph }
+\tl_set:Nn \l_texnegar_stretch_leaders_hrule_tl { leaders+hrule }
+\tl_set:Nn \l_texnegar_stretch_off_tl { Off }
+\tl_set:Nn \l_texnegar_stretch_on_tl { On }
+
+\tl_set:Nn \l_texnegar_hboxrecursion_off_tl { Off }
+\tl_set:Nn \l_texnegar_hboxrecursion_on_tl { On }
+
+\tl_set:Nn \l_texnegar_vboxrecursion_off_tl { Off }
+\tl_set:Nn \l_texnegar_vboxrecursion_on_tl { On }
+
+\tl_set:Nn \l_texnegar_fnt_kayhan_tl { kayhan }
+\tl_set:Nn \l_texnegar_fnt_kayhannavaar_tl { kayhannavaar }
+\tl_set:Nn \l_texnegar_fnt_kayhanpook_tl { kayhanpook }
+\tl_set:Nn \l_texnegar_fnt_kayhansayeh_tl { kayhansayeh }
+\tl_set:Nn \l_texnegar_fnt_khoramshahr_tl { khoramshahr }
+\tl_set:Nn \l_texnegar_fnt_khorramshahr_tl { khorramshahr }
+\tl_set:Nn \l_texnegar_fnt_niloofar_tl { niloofar }
+\tl_set:Nn \l_texnegar_fnt_paatch_tl { paatch }
+\tl_set:Nn \l_texnegar_fnt_riyaz_tl { riyaz }
+\tl_set:Nn \l_texnegar_fnt_roya_tl { roya }
+\tl_set:Nn \l_texnegar_fnt_shafigh_tl { shafigh }
+\tl_set:Nn \l_texnegar_fnt_shafighKurd_tl { shafighKurd }
+\tl_set:Nn \l_texnegar_fnt_shafighUzbek_tl { shafighUzbek }
+\tl_set:Nn \l_texnegar_fnt_shiraz_tl { shiraz }
+\tl_set:Nn \l_texnegar_fnt_sols_tl { sols }
+\tl_set:Nn \l_texnegar_fnt_tabriz_tl { tabriz }
+\tl_set:Nn \l_texnegar_fnt_titr_tl { titr }
+\tl_set:Nn \l_texnegar_fnt_titre_tl { titre }
+\tl_set:Nn \l_texnegar_fnt_traffic_tl { traffic }
+\tl_set:Nn \l_texnegar_fnt_vahid_tl { vahid }
+\tl_set:Nn \l_texnegar_fnt_vosta_tl { vosta }
+\tl_set:Nn \l_texnegar_fnt_yaghut_tl { yaghut }
+\tl_set:Nn \l_texnegar_fnt_yagut_tl { yagut }
+\tl_set:Nn \l_texnegar_fnt_yas_tl { yas }
+\tl_set:Nn \l_texnegar_fnt_yekan_tl { yekan }
+\tl_set:Nn \l_texnegar_fnt_yermook_tl { yermook }
+\tl_set:Nn \l_texnegar_fnt_zar_tl { zar }
+\tl_set:Nn \l_texnegar_fnt_ziba_tl { ziba }
+\tl_set:Nn \l_texnegar_fnt_default_tl { default }
+\tl_set:Nn \l_texnegar_fnt_noskip_tl { noskip }
+
+\tl_set:Nn \l_texnegar_lig_aalt_tl { aalt } % Access All Alternatives
+\tl_set:Nn \l_texnegar_lig_ccmp_tl { ccmp } % Glyph Composition/Decomposition
+\tl_set:Nn \l_texnegar_lig_dlig_tl { dlig } % Discretionary Ligatures
+\tl_set:Nn \l_texnegar_lig_fina_tl { fina } % Final (Terminal) Forms
+\tl_set:Nn \l_texnegar_lig_init_tl { init } % Initial Forms
+\tl_set:Nn \l_texnegar_lig_locl_tl { locl } % Localized Forms
+\tl_set:Nn \l_texnegar_lig_medi_tl { medi } % Medial Forms
+\tl_set:Nn \l_texnegar_lig_rlig_tl { rlig } % Required Ligatures
+\tl_set:Nn \l_texnegar_lig_default_tl { default }
+
+\tl_set:Nn \l_texnegar_col_default_tl { magenta }
+
+\clist_set:Nn \l_texnegar_lig_aalt_clist { } % Access All Alternatives
+\clist_set:Nn \l_texnegar_lig_ccmp_clist { } % Glyph Composition/Decomposition
+\clist_set:Nn \l_texnegar_lig_dlig_clist { FDF2 = الله , FDF3 = اکبر , FDFB = جلجلاله } % Discretionary Ligatures
+\clist_set:Nn \l_texnegar_lig_fina_clist { } % Final (Terminal) Forms
+\clist_set:Nn \l_texnegar_lig_init_clist { } % Initial Forms
+\clist_set:Nn \l_texnegar_lig_locl_clist { } % Localized Forms
+\clist_set:Nn \l_texnegar_lig_medi_clist { } % Medial Forms
+\clist_set:Nn \l_texnegar_lig_rlig_clist { } % Required Ligatures
+\clist_set:Nn \l_texnegar_lig_default_clist { }
+
+\clist_set:Nn \l_texnegar_lig_names_clist
+ {
+ \l_texnegar_lig_aalt_tl , { \l_texnegar_lig_aalt_clist } ,
+ \l_texnegar_lig_ccmp_tl , { \l_texnegar_lig_ccmp_clist } ,
+ \l_texnegar_lig_dlig_tl , { \l_texnegar_lig_dlig_clist } ,
+ \l_texnegar_lig_fina_tl , { \l_texnegar_lig_fina_clist } ,
+ \l_texnegar_lig_init_tl , { \l_texnegar_lig_init_clist } ,
+ \l_texnegar_lig_locl_tl , { \l_texnegar_lig_locl_clist } ,
+ \l_texnegar_lig_medi_tl , { \l_texnegar_lig_medi_clist } ,
+ \l_texnegar_lig_rlig_tl , { \l_texnegar_lig_rlig_clist } ,
+ }
+
+\msg_new:nnn { texnegar } { error-kashida-character-is-not-available-in-the-main-font }
+ {
+ Sorry,~ kashida~ character~ is~ not~ available~ in~ the~ main~ font~#1!
+ }
+
+\msg_new:nnn { texnegar } { error-value-not-available-for-kashida-option }
+ {
+ Sorry,~ value~ `#1'~ is~ not~ available~ for~ `Kashida'~ option~ yet~!
+ }
+
+\msg_new:nnn { texnegar } { error-specify-value-for-kashida-option }
+ {
+ Sorry,~ you~ must~ specify~ a~ value~ for~ `Kashida'~ option~ yet~!
+ }
+
+\msg_new:nnn { texnegar } { warning-experimental-feature }
+ {
+ Please~ note~ that~ the~ feature~ `#1'~ is~ still~ experimental~
+ and~ is~ not~ regarded~ as~ stable.
+ }
+
+\msg_new:nnn { texnegar } { hm-series-font-not-found }
+ {
+ Either~ the~ font~`#1'~ is~ not~ installed~ on~ your~ system~ or~ does~ not~
+ belong~ to~ HM~Series~fonts.~
+ Please~ note~ that~ the~ option~ `Kashida=leaders+glyph'~ is~ currently~ only~
+ supported~ by~ HM~Series~fonts.~
+ If~ you~ know~ of~ any~ other~ font~ that~ supports~ this~ option,~ please~
+ let~ me~ know~ to~ add~ it~ to~ the~ list~ of~ corresponding~ fonts.~
+ }
+
+\msg_new:nnn { texnegar } { luatex-version-is-too-old }
+ {
+ #1:~Your~luatex~is~too~old,~you~need~at~least~version~#2.#3~!
+ }
+
+\keys_define:nn { texnegar }
+ {
+ Kashida .code:n =
+ {
+ \tl_set:Nn \l_tmpa_tl { #1 }
+ \tl_case:NnTF \l_tmpa_tl
+ {
+ \l_texnegar_stretch_glyph_tl
+ {
+ \msg_warning:nnn { texnegar } { warning-experimental-feature } { Kashida=glyph }
+ \tl_set:Nx \l_texnegar_gap_filler_tl { \l_texnegar_stretch_glyph_tl }
+ \AtBeginDocument
+ {
+ \tl_set:Nx \l_texnegar_main_font_full_tl { \tex_fontname:D \tex_the:D \tex_font:D }
+ \tl_set:Nx \l_texnegar_main_font_name_tl { \l_texnegar_main_font_full_tl }
+ \regex_replace_once:nnN { ^"([^/]+)/.* } { \1 } \l_texnegar_main_font_name_tl
+ }
+ \bool_set_true:N \l_texnegar_kashida_fix_bool
+ \bool_set_true:N \l_texnegar_kashida_glyph_bool
+ }
+ \l_texnegar_stretch_leaders_glyph_tl
+ {
+ \tl_set:Nx \l_texnegar_gap_filler_tl { \l_texnegar_stretch_leaders_glyph_tl }
+ \bool_set_true:N \l_texnegar_kashida_fix_bool
+ \bool_set_true:N \l_texnegar_kashida_leaders_glyph_bool
+ }
+ \l_texnegar_stretch_leaders_hrule_tl
+ {
+ \tl_set:Nx \l_texnegar_gap_filler_tl { \l_texnegar_stretch_leaders_hrule_tl }
+ \bool_set_true:N \l_texnegar_kashida_fix_bool
+ \bool_set_true:N \l_texnegar_kashida_leaders_hrule_bool
+ }
+ \l_texnegar_stretch_off_tl
+ {
+ \tl_set:Nx \l_texnegar_gap_filler_tl { \l_texnegar_stretch_off_tl }
+ \bool_set_false:N \l_texnegar_kashida_fix_bool
+ }
+ \l_texnegar_stretch_on_tl
+ {
+ \tl_set:Nx \l_texnegar_gap_filler_tl { \l_texnegar_stretch_leaders_glyph_tl }
+ \bool_set_true:N \l_texnegar_kashida_fix_bool
+ \bool_set_true:N \l_texnegar_kashida_leaders_glyph_bool
+ }
+ } { } { \tl_set:Nx \l_texnegar_gap_filler_tl { #1 } }
+ \tl_if_empty:NT \l_texnegar_gap_filler_tl { \msg_error:nn { texnegar } { error-specify-value-for-kashida-option } }
+ } ,
+
+ linebreakpenalty .code:n =
+ {
+ \int_set:Nn \l_tmpa_int { #1 }
+ \int_case:nnTF \l_tmpa_int
+ {
+ \l_texnegar_min_penalty_int { \int_set:Nn \l_texnegar_line_break_penalty_int { \l_texnegar_min_penalty_int } }
+ \l_texnegar_low_penalty_int { \int_set:Nn \l_texnegar_line_break_penalty_int { \l_texnegar_low_penalty_int } }
+ \l_texnegar_med_penalty_int { \int_set:Nn \l_texnegar_line_break_penalty_int { \l_texnegar_med_penalty_int } }
+ \l_texnegar_high_penalty_int { \int_set:Nn \l_texnegar_line_break_penalty_int { \l_texnegar_high_penalty_int } }
+ \l_texnegar_max_penalty_int { \int_set:Nn \l_texnegar_line_break_penalty_int { \l_texnegar_max_penalty_int } }
+ } { } { \int_set:Nn \l_texnegar_line_break_penalty_int { #1 } }
+ \bool_set_true:N \l_texnegar_linebreakpenalty_bool
+ } ,
+
+ kashidastretch .code:n =
+ {
+ \tl_set:Nn \l_tmpa_tl { #1 }
+ \tl_case:NnTF \l_tmpa_tl
+ {
+ \l_texnegar_fnt_kayhan_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.14 em plus 0.5 em } }
+ \l_texnegar_fnt_kayhannavaar_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.129 em plus 0.5 em } }
+ \l_texnegar_fnt_kayhanpook_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.133 em plus 0.5 em } }
+ \l_texnegar_fnt_kayhansayeh_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.135 em plus 0.5 em } }
+ \l_texnegar_fnt_khoramshahr_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.128 em plus 0.5 em } }
+ \l_texnegar_fnt_khorramshahr_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.13 em plus 0.5 em } }
+ \l_texnegar_fnt_niloofar_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.132 em plus 0.5 em } }
+ \l_texnegar_fnt_paatch_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.127 em plus 0.5 em } }
+ \l_texnegar_fnt_riyaz_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.125 em plus 0.5 em } }
+ \l_texnegar_fnt_roya_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.142 em plus 0.5 em } }
+ \l_texnegar_fnt_shafigh_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.143 em plus 0.5 em } }
+ \l_texnegar_fnt_shafighKurd_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.126 em plus 0.5 em } }
+ \l_texnegar_fnt_shafighUzbek_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.123 em plus 0.5 em } }
+ \l_texnegar_fnt_shiraz_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.122 em plus 0.5 em } }
+ \l_texnegar_fnt_sols_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.124 em plus 0.5 em } }
+ \l_texnegar_fnt_tabriz_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.119 em plus 0.5 em } }
+ \l_texnegar_fnt_titr_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.12 em plus 0.5 em } }
+ \l_texnegar_fnt_titre_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.121 em plus 0.5 em } }
+ \l_texnegar_fnt_traffic_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.124 em plus 0.5 em } }
+ \l_texnegar_fnt_vahid_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.134 em plus 0.5 em } }
+ \l_texnegar_fnt_vosta_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.136 em plus 0.5 em } }
+ \l_texnegar_fnt_yaghut_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.138 em plus 0.5 em } }
+ \l_texnegar_fnt_yagut_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.137 em plus 0.5 em } }
+ \l_texnegar_fnt_yas_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.126 em plus 0.5 em } }
+ \l_texnegar_fnt_yekan_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.141 em plus 0.5 em } }
+ \l_texnegar_fnt_yermook_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.139 em plus 0.5 em } }
+ \l_texnegar_fnt_zar_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.116 em plus 0.5 em } }
+ \l_texnegar_fnt_ziba_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.119 em plus 0.5 em } }
+ \l_texnegar_fnt_default_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.14 em plus 0.5 em } }
+ \l_texnegar_fnt_noskip_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0 em plus 0.5 em } }
+ } { } { \tl_set:Nn \l_texnegar_skip_default_tl { #1 } }
+ } ,
+ kashidastretch .default:n = \tl_set:Nn \l_texnegar_skip_default_tl { 0 em plus 0.5 em } ,
+
+ ligatures .code:n =
+ {
+ \tl_set:Nn \l_tmpa_tl { #1 }
+ \tl_case:NnTF \l_tmpa_tl
+ {
+ \l_texnegar_lig_aalt_tl { \tl_set:Nx \l_texnegar_active_ligs_tl { \l_texnegar_lig_aalt_tl } }
+ \l_texnegar_lig_ccmp_tl { \tl_set:Nx \l_texnegar_active_ligs_tl { \l_texnegar_lig_ccmp_tl } }
+ \l_texnegar_lig_dlig_tl { \tl_set:Nx \l_texnegar_active_ligs_tl { \l_texnegar_lig_dlig_tl } }
+ \l_texnegar_lig_fina_tl { \tl_set:Nx \l_texnegar_active_ligs_tl { \l_texnegar_lig_fina_tl } }
+ \l_texnegar_lig_init_tl { \tl_set:Nx \l_texnegar_active_ligs_tl { \l_texnegar_lig_init_tl } }
+ \l_texnegar_lig_locl_tl { \tl_set:Nx \l_texnegar_active_ligs_tl { \l_texnegar_lig_locl_tl } }
+ \l_texnegar_lig_medi_tl { \tl_set:Nx \l_texnegar_active_ligs_tl { \l_texnegar_lig_medi_tl } }
+ \l_texnegar_lig_rlig_tl { \tl_set:Nx \l_texnegar_active_ligs_tl { \l_texnegar_lig_rlig_tl } }
+ \l_texnegar_lig_default_tl { \tl_set:Nx \l_texnegar_active_ligs_tl { \l_texnegar_lig_default_tl } }
+ } { } { \tl_set:Nn \l_texnegar_active_ligs_tl { #1 } }
+ \bool_set_true:N \l_texnegar_ligature_bool
+ } ,
+ ligatures .default:n = \tl_set:Nn \l_texnegar_active_ligs_tl { \l_texnegar_lig_default_tl } ,
+
+ color .code:n =
+ {
+ \tl_set:Nn \l_tmpa_tl { #1 }
+ \tl_if_empty:NTF \l_tmpa_tl
+ {
+ \tl_set:Nx \l_texnegar_color_tl { \l_texnegar_col_default_tl }
+ }
+ {
+ \tl_set:Nx \l_texnegar_color_tl { \l_tmpa_tl }
+ }
+ \bool_set_true:N \l_texnegar_color_bool
+ \sys_if_engine_luatex:T
+ {
+ \convertcolorspec{named}{\l_texnegar_color_tl}{rgb}\l_texnegar_color_rgb_tl
+ \directlua{l_texnegar_color_rgb_tl = "\l_texnegar_color_rgb_tl"}
+ }
+ } ,
+
+ hboxrecursion .code:n =
+ {
+ \tl_set:Nn \l_tmpa_tl { #1 }
+ \tl_case:NnTF \l_tmpa_tl
+ {
+ \l_texnegar_hboxrecursion_off_tl
+ {
+ \bool_set_false:N \l_texnegar_hboxrecursion_bool
+ }
+ \l_texnegar_hboxrecursion_on_tl
+ {
+ \bool_set_true:N \l_texnegar_hboxrecursion_bool
+ }
+ } { } { \bool_set_false:N \l_texnegar_hboxrecursion_bool }
+ } ,
+ hboxrecursion .default:n = \bool_set_true:N \l_texnegar_hboxrecursion_bool ,
+
+ vboxrecursion .code:n =
+ {
+ \tl_set:Nn \l_tmpa_tl { #1 }
+ \tl_case:NnTF \l_tmpa_tl
+ {
+ \l_texnegar_vboxrecursion_off_tl
+ {
+ \bool_set_false:N \l_texnegar_vboxrecursion_bool
+ }
+ \l_texnegar_vboxrecursion_on_tl
+ {
+ \bool_set_true:N \l_texnegar_vboxrecursion_bool
+ }
+ } { } { \bool_set_false:N \l_texnegar_vboxrecursion_bool }
+ } ,
+ vboxrecursion .default:n = \bool_set_true:N \l_texnegar_vboxrecursion_bool ,
+ }
+
+\ProcessKeysOptions { texnegar }
+
+\sys_if_engine_luatex:T
+ {
+ \NewDocumentCommand \KashidaHMFixOff {} { \directlua{StopStretching()} }
+ \NewDocumentCommand \KashidaHMFixOn {} { \directlua{StartStretching()} }
+ }
+
+\sys_if_engine_xetex:T
+ {
+ \NewDocumentCommand \KashidaHMFixOn {} { \bool_set_true:N \l_texnegar_kashida_fix_bool }
+ \NewDocumentCommand \KashidaHMFixOff {} { \bool_set_false:N \l_texnegar_kashida_fix_bool }
+ }
+
+\tex_let:D \KashidaOn \KashidaHMFixOn
+\tex_let:D \KashidaOff \KashidaHMFixOff
+
+\bool_if:NTF \l_texnegar_kashida_fix_bool
+ {
+ \tl_if_empty:NT \l_texnegar_skip_default_tl { \tl_set:Nn \l_texnegar_skip_default_tl { 0.14 em plus 0.5 em } }
+ }
+ {
+ \tl_set:NV \l_texnegar_skip_default_tl \c_texnegar_skip_a_tl
+ }
+
+%% % \makeatletter
+%% % \newif\if@Kashida@on
+%% Becuase Vafa Khalighi has copied the above code (injecting the character uni+200E) in xepersian-23.0
+%% (https://tug.org/svn/texlive/trunk/Master/texmf-dist/tex/xelatex/xepersian/kashida-xepersian.def?revision=55165&view=co),
+%% the following line of code is not needed in xepersian anymore.
+%% % \newif\if@Kashida@XB@fix
+%% % \makeatother
+
+ \endinput
+%</texnegar-ini-tex>
+% \end{macrocode}
+%
+% \subsection{File: \texttt{texnegar-common-kashida.tex}}
+% \begin{macrocode}
+%<*texnegar-common-kashida-tex>
+\ProvidesExplFile {texnegar-common-kashida.tex} {2020-08-29} {0.1a} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
+
+\bool_if:NT \l_texnegar_ligature_bool
+{
+ \clist_new:N \l_texnegar_ligatures_clist
+ \int_new:N \l_texnegar_lig_names_len_int
+ \int_set:Nn \l_texnegar_lig_names_len_int { \clist_count:N \l_texnegar_lig_names_clist }
+ \int_step_inline:nnnn { 1 } { 2 } { \l_texnegar_lig_names_len_int }
+ {
+ \int_set:Nn \l_tmpa_int { #1 }
+ \int_set:Nn \l_tmpb_int { \int_eval:n { \l_tmpa_int + 1 } }
+ \tl_set:Nf \l_tmpa_tl { \clist_item:Nn \l_texnegar_lig_names_clist { \l_tmpa_int } }
+ \clist_set:Nx \l_tmpa_clist { { \clist_item:Nn \l_texnegar_lig_names_clist { \l_tmpb_int } } }
+ \bool_if:nT { \tl_if_eq_p:NN \l_texnegar_active_ligs_tl \l_tmpa_tl || \tl_if_eq_p:NN \l_texnegar_active_ligs_tl \l_texnegar_lig_default_tl }
+ {
+ \clist_put_left:Nx \l_texnegar_ligatures_clist { \l_tmpa_clist }
+ }
+ }
+ \clist_map_inline:Nn \l_texnegar_ligatures_clist
+ {
+ \seq_set_split:Nnn \l_tmpa_seq { = } { #1 }
+ \seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl { } { }
+ \seq_pop_left:NN \l_tmpa_seq \l_tmpb_tl { } { }
+ \tl_const:cx { \tl_use:N \l_tmpb_tl } { \char"\l_tmpa_tl \ }
+ }
+}
+
+\bool_if:NT \l_texnegar_linebreakpenalty_bool
+{
+ %% Partly adapted from LaTeX2e source
+ \cs_new:Nn \texnegar_line_break: {
+ \if_mode_vertical:
+ \GenericError{
+ \space\space\space\space\space\space\space\space\space\space\space\space\space\space\space
+ }{
+ LaTeX Error: There’s no line here to end
+ }{
+ See the LaTeX manual or LaTeX Companion for explanation.
+ }{
+ Your command was ignored.\MessageBreak
+ Type \space I <command> <return> \space to replace it~
+ with another command,\MessageBreak
+ or \space <return> \space to continue without it.}
+ \else:
+ \l_tmpa_skip \tex_lastskip:D
+ \tex_unskip:D
+ \tex_penalty:D -\l_texnegar_line_break_penalty_int
+ \dim_compare:nT { \l_tmpa_skip > \c_zero_skip }
+ { \skip_horizontal:N \l_tmpa_skip \tex_ignorespaces:D }
+ \fi:
+ }
+
+ \NewDocumentCommand { \discouragebadlinebreaks } { O{\l_texnegar_line_break_penalty_int} O{\c_texnegar_skip_b_tl} m }
+ {
+ \IfNoValueF {#1}
+ { \int_set:Nn \l_texnegar_line_break_penalty_int {#1} }
+ \IfNoValueF {#2}
+ { \tl_set:Nn \l_texnegar_skip_default_tl {#2} }
+ \texnegar_put_line_breaks:n { #3 }
+ }
+
+ \cs_new_protected:Nn \texnegar_put_line_breaks:n
+ {
+ \tl_set:Nn \l_texnegar_line_break_tl { #1 }
+ \regex_replace_all:nnN { ([ابپتثجحخچدذرزژسشعغصضفقطظکگلمنوهیـ])+ } { \ \0 \ \c{texnegar_line_break:}\ } \l_texnegar_line_break_tl
+ \tl_use:N \l_texnegar_line_break_tl
+ }
+}
+%</texnegar-common-kashida-tex>
+% \end{macrocode}
+%
+% \subsection{File: \texttt{texnegar-xetex-kashida.tex}}
+%
+% \begin{macrocode}
+%<*texnegar-xetex-kashida-tex>
+\ProvidesExplFile {texnegar-xetex-kashida.tex} {2020-08-29} {0.1a} { Full implementation of kashida feature in XeLaTex and LuaLaTeX }
+
+\newXeTeXintercharclass \c_texnegar_d_charclass % dual-joiner class
+\newXeTeXintercharclass \c_texnegar_l_charclass % lam
+\newXeTeXintercharclass \c_texnegar_r_charclass % right-joiner
+\newXeTeXintercharclass \c_texnegar_a_charclass % alef
+\newXeTeXintercharclass \c_texnegar_y_charclass % yeh
+
+\tex_input:D { texnegar-common-kashida.tex }
+
+\tl_set:Nn \l_texnegar_use_color_tl
+ {
+ \bool_if:NTF \l_texnegar_color_bool
+ {
+ \colorlet{default}{\l_texnegar_color_tl}
+ }
+ {
+ \colorlet{default}{.}
+ }
+ \color{default}
+ }
+
+%% Partly adapted from the code provided by David Carlisle in:
+%% https://tex.stackexchange.com/questions/356709/how-to-know-the-width-and-fill-the-glue-space-between-two-characters-when-using/356721#356721
+\cs_new:Npn \texnegar_kashida_glyph #1
+{
+ \bool_if:NT \l_texnegar_kashida_fix_bool
+ {
+ \c_texnegar_lrm_int\tex_penalty:D 10000
+ \mode_leave_vertical:
+ \tex_global:D \tex_advance:D \l_texnegar_counter_int \c_one_int
+
+ \tl_set:Nx \l_texnegar_pos_tl { p\tex_romannumeral:D \l_texnegar_counter_int }
+ \tl_set:Nx \l_texnegar_zref_tl { z\tex_romannumeral:D \l_texnegar_counter_int }
+
+ \zsaveposx{x_i_\l_texnegar_zref_tl}
+ \tl_set:Nx \l_tmpa_tl
+ {
+ \iow_now:cx { @auxout }
+ {
+ \token_to_str:N \gdef \exp_after:wN \token_to_str:N \cs:w xi\l_texnegar_pos_tl \cs_end: { \zposx{ x_i_\l_texnegar_zref_tl } }
+ }
+ }
+ \l_tmpa_tl
+ \skip_horizontal:n { #1 }
+ \zsaveposx{x_f_\l_texnegar_zref_tl}
+ \tl_set:Nx \l_tmpa_tl
+ {
+ \iow_now:cx { @auxout }
+ {
+ \token_to_str:N \gdef \exp_after:wN \token_to_str:N \cs:w xf\l_texnegar_pos_tl \cs_end: { \zposx{ x_f_\l_texnegar_zref_tl } }
+ }
+ }
+ \l_tmpa_tl
+ \exp_after:wN
+ \if_meaning:w
+ \cs:w xi\l_texnegar_pos_tl \cs_end: \tex_relax:D
+ \else:
+ \dim_set:Nn \l_texnegar_diff_pos_dim
+ {
+ \dim_eval:n { \cs:w xi\l_texnegar_pos_tl \cs_end: sp - \cs:w xf\l_texnegar_pos_tl \cs_end: sp }
+ }
+ \dim_compare:nTF { \l_texnegar_diff_pos_dim == 0sp }
+ { }
+ { \llap { \resizebox { \l_texnegar_diff_pos_dim \tex_relax:D } { \height } { \l_texnegar_use_color_tl \c_texnegar_ksh_int } } }
+ \fi:
+ }
+}
+
+\cs_new:Npn \texnegar_kashida_leaders #1
+{
+ \bool_if:NT \l_texnegar_kashida_fix_bool
+ {
+ \tl_if_eq:NNTF \l_texnegar_gap_filler_tl \l_texnegar_stretch_leaders_glyph_tl
+ {
+ \tl_set:Nx \l_texnegar_font_full_tl { \tex_fontname:D \tex_the:D \tex_font:D }
+ \tl_set:Nx \l_texnegar_font_name_tl { \l_texnegar_font_full_tl }
+ \tl_set:Nx \l_texnegar_font_init_tl { \l_texnegar_font_name_tl }
+ \regex_replace_once:nnN { ^"\[?(HM)[\_\ ](X|F).* } { \1\2 } \l_texnegar_font_init_tl\relax
+ \tl_set:Nn \l_tmpa_tl { HMF }
+ \tl_set:Nn \l_tmpb_tl { HMX }
+ \bool_if:nTF { \str_if_eq_p:NN { \l_texnegar_font_init_tl } { \l_tmpa_tl } || \str_if_eq_p:NN { \l_texnegar_font_init_tl } { \l_tmpb_tl } }
+ {
+ \hbox_set:Nn \l_texnegar_ksh_box { \l_texnegar_use_color_tl \XeTeXglyph\XeTeXglyphindex"kashida" }
+ \c_texnegar_zwj_int \tex_penalty:D 10000
+ \tex_leaders:D \copy\l_texnegar_ksh_box \skip_horizontal:n { #1 }
+ \c_texnegar_zwj_int
+ }
+ {
+ \msg_error:nnx { texnegar } { hm-series-font-not-found } { \l_texnegar_font_name_tl }
+ }
+ }
+ {
+ %% Partly adapted from the code provided by Jonathan Kew in:
+ %% https://tug.org/pipermail/xetex/2009-February/012307.html.
+ %% Somebody notified me that the code in 'kashida-xepersian.def' from xepersian
+ %% package is an exact copy of Jonathan Kew's code. Being unaware of this, in
+ %% the earlier versions of this package I made a mistake and acknowledged
+ %% Vafa Khalighi instead of Jonathan Kew. A sincere thank you to Jonathan Kew
+ %% for his excellent code.
+ \c_texnegar_lrm_int\c_texnegar_zwj_int
+ {\l_texnegar_use_color_tl\tex_penalty:D 10000
+ \tex_leaders:D \tex_hrule:D height \XeTeXglyphbounds \c_texnegar_two_int
+ \int_use:N \XeTeXcharglyph \c_texnegar_ksh_int depth \XeTeXglyphbounds \c_texnegar_four_int
+ \int_use:N \XeTeXcharglyph \c_texnegar_ksh_int \skip_horizontal:n { #1 }
+ }
+ \c_texnegar_zwj_int
+ }
+ }
+}
+
+\XeTeXinterchartokenstate = 1
+
+\clist_set:Nn \l_texnegar_a_clist { 0622,0623,0625,0627 } % ‏ا، إ، أ، آ‏
+\clist_map_inline:Nn \l_texnegar_a_clist
+ {
+ \XeTeXcharclass "#1 \c_texnegar_a_charclass
+ }
+
+\clist_set:Nn \l_texnegar_d_clist { 0626,0628,062A,062B,062C,062D,062E,0633,0634,0635,0636,0637,0638,0639,063A,0640,0641,0642,0643,0645,0646,0647,067E,0686,06A9,06AF } % ‏ئ,ب,ت,ث,ج,ح,خ,س,ش,ص,ض,ط,ظ,ع,غ,ـ,ف,ق,ك,م,ن,ه,پ,چ,ک,گ‏
+\clist_map_inline:Nn \l_texnegar_d_clist
+ {
+ \XeTeXcharclass "#1 \c_texnegar_d_charclass
+ }
+
+\clist_set:Nn \l_texnegar_l_clist { 0644 } % ‏ل‏
+\clist_map_inline:Nn \l_texnegar_l_clist
+ {
+ \XeTeXcharclass "#1 \c_texnegar_l_charclass
+ }
+
+\clist_set:Nn \l_texnegar_r_clist { 0624,0629,062F,0630,0631,0632,0648,0698 } % ‏ؤ,ة,د,ذ,ر,ز,و,ژ‏
+\clist_map_inline:Nn \l_texnegar_r_clist
+ {
+ \XeTeXcharclass "#1 \c_texnegar_r_charclass
+ }
+
+\clist_set:Nn \l_texnegar_y_clist { 0649,064A,06CC } % ‏ی,ي,ى‏
+\clist_map_inline:Nn \l_texnegar_y_clist
+ {
+ \XeTeXcharclass "#1 \c_texnegar_y_charclass
+ }
+
+\tl_if_eq:NNTF \l_texnegar_gap_filler_tl \l_texnegar_stretch_glyph_tl {
+ \XeTeXinterchartoks \c_texnegar_y_charclass \c_texnegar_y_charclass = {
+ \bool_if:NTF \l_texnegar_kashida_fix_bool
+ { \c_texnegar_zwj_int \texnegar_kashida_glyph \l_texnegar_skip_default_tl \c_texnegar_zwj_int }
+ { \c_texnegar_zwj_int \texnegar_kashida_glyph \c_texnegar_skip_a_tl \c_texnegar_zwj_int }
+ }
+ \XeTeXinterchartoks \c_texnegar_d_charclass \c_texnegar_y_charclass = {
+ \bool_if:NTF \l_texnegar_kashida_fix_bool
+ { \c_texnegar_zwj_int \texnegar_kashida_glyph \l_texnegar_skip_default_tl \c_texnegar_zwj_int }
+ { \c_texnegar_zwj_int \texnegar_kashida_glyph \c_texnegar_skip_a_tl \c_texnegar_zwj_int }
+ }
+ \XeTeXinterchartoks \c_texnegar_y_charclass \c_texnegar_d_charclass = { \c_texnegar_zwj_int \texnegar_kashida_glyph \c_texnegar_skip_a_tl \c_texnegar_zwj_int }
+ \XeTeXinterchartoks \c_texnegar_d_charclass \c_texnegar_d_charclass = { \c_texnegar_zwj_int \texnegar_kashida_glyph \c_texnegar_skip_a_tl \c_texnegar_zwj_int }
+ \XeTeXinterchartoks \c_texnegar_l_charclass \c_texnegar_d_charclass = { \c_texnegar_zwj_int \texnegar_kashida_glyph \c_texnegar_skip_a_tl \c_texnegar_zwj_int }
+ \XeTeXinterchartoks \c_texnegar_d_charclass \c_texnegar_l_charclass = { \c_texnegar_zwj_int \texnegar_kashida_glyph \c_texnegar_skip_a_tl \c_texnegar_zwj_int }
+ \XeTeXinterchartoks \c_texnegar_l_charclass \c_texnegar_l_charclass = { \c_texnegar_zwj_int \texnegar_kashida_glyph \c_texnegar_skip_a_tl \c_texnegar_zwj_int }
+ \XeTeXinterchartoks \c_texnegar_d_charclass \c_texnegar_r_charclass = { \c_texnegar_zwj_int \texnegar_kashida_glyph \c_texnegar_skip_a_tl \c_texnegar_zwj_int }
+ \XeTeXinterchartoks \c_texnegar_d_charclass \c_texnegar_a_charclass = { \c_texnegar_zwj_int \texnegar_kashida_glyph \c_texnegar_skip_a_tl \c_texnegar_zwj_int }
+ \XeTeXinterchartoks \c_texnegar_l_charclass \c_texnegar_r_charclass = { \c_texnegar_zwj_int \texnegar_kashida_glyph \c_texnegar_skip_a_tl \c_texnegar_zwj_int }
+ \XeTeXinterchartoks \c_texnegar_l_charclass \c_texnegar_a_charclass = { }
+}
+{
+ \bool_if:nTF {
+ \tl_if_eq_p:NN \l_texnegar_gap_filler_tl \l_texnegar_stretch_leaders_glyph_tl ||
+ \tl_if_eq_p:NN \l_texnegar_gap_filler_tl \l_texnegar_stretch_leaders_hrule_tl
+ }
+ {
+ \XeTeXinterchartoks \c_texnegar_y_charclass \c_texnegar_y_charclass = {
+ \bool_if:NTF \l_texnegar_kashida_fix_bool
+ { \texnegar_kashida_leaders \l_texnegar_skip_default_tl }
+ { \texnegar_kashida_leaders \c_texnegar_skip_a_tl }
+ }
+ \XeTeXinterchartoks \c_texnegar_d_charclass \c_texnegar_y_charclass = {
+ \bool_if:NTF \l_texnegar_kashida_fix_bool
+ { \texnegar_kashida_leaders \l_texnegar_skip_default_tl }
+ { \texnegar_kashida_leaders \c_texnegar_skip_a_tl }
+ }
+ \XeTeXinterchartoks \c_texnegar_y_charclass \c_texnegar_d_charclass = { \texnegar_kashida_leaders \c_texnegar_skip_a_tl }
+ \XeTeXinterchartoks \c_texnegar_d_charclass \c_texnegar_d_charclass = { \texnegar_kashida_leaders \c_texnegar_skip_a_tl }
+ \XeTeXinterchartoks \c_texnegar_l_charclass \c_texnegar_d_charclass = { \texnegar_kashida_leaders \c_texnegar_skip_a_tl }
+ \XeTeXinterchartoks \c_texnegar_d_charclass \c_texnegar_l_charclass = { \texnegar_kashida_leaders \c_texnegar_skip_a_tl }
+ \XeTeXinterchartoks \c_texnegar_l_charclass \c_texnegar_l_charclass = { \texnegar_kashida_leaders \c_texnegar_skip_a_tl }
+ \XeTeXinterchartoks \c_texnegar_d_charclass \c_texnegar_r_charclass = { \texnegar_kashida_leaders \c_texnegar_skip_a_tl }
+ \XeTeXinterchartoks \c_texnegar_d_charclass \c_texnegar_a_charclass = { \texnegar_kashida_leaders \c_texnegar_skip_a_tl }
+ \XeTeXinterchartoks \c_texnegar_l_charclass \c_texnegar_r_charclass = { \texnegar_kashida_leaders \c_texnegar_skip_a_tl }
+ \XeTeXinterchartoks \c_texnegar_l_charclass \c_texnegar_a_charclass = { }
+ }
+ {
+ \msg_error:nnx { texnegar } { error-value-not-available-for-kashida-option } { \l_texnegar_gap_filler_tl }
+ }
+}
+
+ \endinput
+%</texnegar-xetex-kashida-tex>
+% \end{macrocode}
+%
+% \subsection{File: \texttt{pe-char-table.lua}}
+%
+% \begin{macrocode}
+%<*pe-char-table-lua>
+--
+-- This is file `pe-char-table.lua',
+-- generated with the docstrip utility.
+--
+-- The original source files were:
+--
+-- texnegar.dtx (with options: `pe-char-table-lua')
+--
+-- Copyright (C) 2020 Hossein Movahhedian
+--
+-- It may be distributed and/or modified under the LaTeX Project Public License,
+-- version 1.3c or higher (your choice). The latest version of
+-- this license is at: http://www.latex-project.org/lppl.txt
+--
+-- pe_char_table = pe_char_table or {}
+-- local pe_char_table = pe_char_table
+-- pe_char_table.module = {
+-- name = "pe_char_table",
+-- version = "0.1a",
+-- date = "2020-08-29",
+-- description = "Full implementation of kashida feature in XeLaTex and LuaLaTeX",
+-- author = "Hossein Movahhedian",
+-- copyright = "Hossein Movahhedian",
+-- license = "LPPL v1.3c"
+-- }
+--
+-- -- ^^A%% texnegar-lua.dtx -- part of TEXNEGAR <bitbucket.org/dma8hm1334/texnegar>
+-- local err, warn, info, log = luatexbase.provides_module(pe_char_table.module)
+-- pe_char_table.log = log or (function (s) luatexbase.module_info("pe_char_table", s) end)
+-- pe_char_table.warning = warn or (function (s) luatexbase.module_warning("pe_char_table", s) end)
+-- pe_char_table.error = err or (function (s) luatexbase.module_error("pe_char_table", s) end)
+
+local peCharTableInitial = {
+ [64344] = utf8.char(64344), -- "ﭘ", utf8.codepoint("ﭘ") == 64344, "\u{FB58}", INITIAL FORM PEH
+ [64380] = utf8.char(64380), -- "ﭼ", utf8.codepoint("ﭼ") == 64380, "\u{FB7C}", INITIAL FORM TCHEH
+ [64400] = utf8.char(64400), -- "ﮐ", utf8.codepoint("ﮐ") == 64400, "\u{FB90}", INITIAL FORM KEHEH
+ [64404] = utf8.char(64404), -- "ﮔ", utf8.codepoint("ﮔ") == 64404, "\u{FB94}", INITIAL FORM GAF
+ [64510] = utf8.char(64510), -- "ﯾ", utf8.codepoint("ﯾ") == 64510, "\u{FBFE}", INITIAL FORM YEH
+ [65169] = utf8.char(65169), -- "ﺑ", utf8.codepoint("ﺑ") == 65169, "\u{FE91}", INITIAL FORM BEH
+ [65175] = utf8.char(65175), -- "ﺗ", utf8.codepoint("ﺗ") == 65175, "\u{FE97}", INITIAL FORM TEH
+ [65179] = utf8.char(65179), -- "ﺛ", utf8.codepoint("ﺛ") == 65179, "\u{FE9B}", INITIAL FORM THEH
+ [65183] = utf8.char(65183), -- "ﺟ", utf8.codepoint("ﺟ") == 65183, "\u{FE9F}", INITIAL FORM JEEM
+ [65187] = utf8.char(65187), -- "ﺣ", utf8.codepoint("ﺣ") == 65187, "\u{FEA3}", INITIAL FORM HAH
+ [65191] = utf8.char(65191), -- "ﺧ", utf8.codepoint("ﺧ") == 65191, "\u{FEA7}", INITIAL FORM KHAH
+ [65203] = utf8.char(65203), -- "ﺳ", utf8.codepoint("ﺳ") == 65203, "\u{FEB3}", INITIAL FORM SEEN
+ [65207] = utf8.char(65207), -- "ﺷ", utf8.codepoint("ﺷ") == 65207, "\u{FEB7}", INITIAL FORM SHEEN
+ [65211] = utf8.char(65211), -- "ﺻ", utf8.codepoint("ﺻ") == 65211, "\u{FEBB}", INITIAL FORM SAD
+ [65215] = utf8.char(65215), -- "ﺿ", utf8.codepoint("ﺿ") == 65215, "\u{FEBF}", INITIAL FORM DAD
+ [65219] = utf8.char(65219), -- "ﻃ", utf8.codepoint("ﻃ") == 65219, "\u{FEC3}", INITIAL FORM TAH
+ [65223] = utf8.char(65223), -- "ﻇ", utf8.codepoint("ﻇ") == 65223, "\u{FEC7}", INITIAL FORM ZAH
+ [65227] = utf8.char(65227), -- "ﻋ", utf8.codepoint("ﻋ") == 65227, "\u{FECB}", INITIAL FORM AIN
+ [65231] = utf8.char(65231), -- "ﻏ", utf8.codepoint("ﻏ") == 65231, "\u{FECF}", INITIAL FORM GHAIN
+ [65235] = utf8.char(65235), -- "ﻓ", utf8.codepoint("ﻓ") == 65235, "\u{FED3}", INITIAL FORM FEH
+ [65239] = utf8.char(65239), -- "ﻗ", utf8.codepoint("ﻗ") == 65239, "\u{FED7}", INITIAL FORM QAF
+ [65243] = utf8.char(65243), -- "ﻛ", utf8.codepoint("ﻛ") == 65243, "\u{FEDB}", INITIAL FORM KAF
+ [65247] = utf8.char(65247), -- "ﻟ", utf8.codepoint("ﻟ") == 65247, "\u{FEDF}", INITIAL FORM LAM
+ [65251] = utf8.char(65251), -- "ﻣ", utf8.codepoint("ﻣ") == 65251, "\u{FEE3}", INITIAL FORM MEEM
+ [65255] = utf8.char(65255), -- "ﻧ", utf8.codepoint("ﻧ") == 65255, "\u{FEE7}", INITIAL FORM NOON
+ [65259] = utf8.char(65259), -- "ﻫ", utf8.codepoint("ﻫ") == 65259, "\u{FEEB}", INITIAL FORM HEH
+ [65267] = utf8.char(65267), -- "ﻳ", utf8.codepoint("ﻳ") == 65267, "\u{FEF3}", INITIAL FORM YEH
+}
+
+local peCharTableMedial = {
+ [1565] = utf8.char(1565), -- "؝ؘ؝؝", utf8.codepoint("؝؝") == 1565, "\u{061D}", KASHIDA
+ [1600] = utf8.char(1600), -- "ـ", utf8.codepoint("ـ") == 1600, "\u{0640}", ARABIC TATWEEL
+ [64345] = utf8.char(64345), -- "ﭙ", utf8.codepoint("ﭙ") == 64345, "\u{FB59}", MEDIAL FORM PEH
+ [64381] = utf8.char(64381), -- "ﭽ", utf8.codepoint("ﭽ") == 64381, "\u{FB7D}", MEDIAL FORM TCHEH
+ [64401] = utf8.char(64401), -- "ﮑ", utf8.codepoint("ﮑ") == 64401, "\u{FB91}", MEDIAL FORM KEHEH
+ [64405] = utf8.char(64405), -- "ﮕ", utf8.codepoint("ﮕ") == 64405, "\u{FB95}", MEDIAL FORM GAF
+ [64425] = utf8.char(64425), -- "ﮩ", utf8.codepoint("ﮩ") == 64425, "\u{FBA9}", MEDIAL FORM HEH GOAL
+ [64429] = utf8.char(64429), -- "ﮭ", utf8.codepoint("ﮭ") == 64429, "\u{FBAD}", MEDIAL FORM HEH DOACHESMEE
+ [64511] = utf8.char(64511), -- "ﯿ", utf8.codepoint("ﯿ") == 64511, "\u{FBFF}", MEDIAL FORM YEH
+ [65170] = utf8.char(65170), -- "ﺒ", utf8.codepoint("ﺒ") == 65170, "\u{FE92}", MEDIAL FORM BEH
+ [65176] = utf8.char(65176), -- "ﺘ", utf8.codepoint("ﺘ") == 65176, "\u{FE98}", MEDIAL FORM TEH
+ [65180] = utf8.char(65180), -- "ﺜ", utf8.codepoint("ﺜ") == 65180, "\u{FE9C}", MEDIAL FORM THEH
+ [65184] = utf8.char(65184), -- "ﺠ", utf8.codepoint("ﺠ") == 65184, "\u{FEA0}", MEDIAL FORM JEEM
+ [65188] = utf8.char(65188), -- "ﺤ", utf8.codepoint("ﺤ") == 65188, "\u{FEA4}", MEDIAL FORM HAH
+ [65192] = utf8.char(65192), -- "ﺨ", utf8.codepoint("ﺨ") == 65192, "\u{FEA8}", MEDIAL FORM KHAH
+ [65204] = utf8.char(65204), -- "ﺴ", utf8.codepoint("ﺴ") == 65204, "\u{FEB4}", MEDIAL FORM SEEN
+ [65208] = utf8.char(65208), -- "ﺸ", utf8.codepoint("ﺸ") == 65208, "\u{FEB8}", MEDIAL FORM SHEEN
+ [65212] = utf8.char(65212), -- "ﺼ", utf8.codepoint("ﺼ") == 65212, "\u{FEBC}", MEDIAL FORM SAD
+ [65216] = utf8.char(65216), -- "ﻀ", utf8.codepoint("ﻀ") == 65216, "\u{FEC0}", MEDIAL FORM DAD
+ [65220] = utf8.char(65220), -- "ﻄ", utf8.codepoint("ﻄ") == 65220, "\u{FEC4}", MEDIAL FORM TAH
+ [65224] = utf8.char(65224), -- "ﻈ", utf8.codepoint("ﻈ") == 65224, "\u{FEC8}", MEDIAL FORM ZAH
+ [65228] = utf8.char(65228), -- "ﻌ", utf8.codepoint("ﻌ") == 65228, "\u{FECC}", MEDIAL FORM AIN
+ [65232] = utf8.char(65232), -- "ﻐ", utf8.codepoint("ﻐ") == 65232, "\u{FED0}", MEDIAL FORM GHAIN
+ [65236] = utf8.char(65236), -- "ﻔ", utf8.codepoint("ﻔ") == 65236, "\u{FED4}", MEDIAL FORM FEH
+ [65240] = utf8.char(65240), -- "ﻘ", utf8.codepoint("ﻘ") == 65240, "\u{FED8}", MEDIAL FORM QAF
+ [65244] = utf8.char(65244), -- "ﻜ", utf8.codepoint("ﻜ") == 65244, "\u{FEDC}", MEDIAL FORM KAF
+ [65248] = utf8.char(65248), -- "ﻠ", utf8.codepoint("ﻠ") == 65248, "\u{FEE0}", MEDIAL FORM LAM
+ [65252] = utf8.char(65252), -- "ﻤ", utf8.codepoint("ﻤ") == 65252, "\u{FEE4}", MEDIAL FORM MEEM
+ [65256] = utf8.char(65256), -- "ﻨ", utf8.codepoint("ﻨ") == 65256, "\u{FEE8}", MEDIAL FORM NOON
+ [65260] = utf8.char(65260), -- "ﻬ", utf8.codepoint("ﻬ") == 65260, "\u{FEEC}", MEDIAL FORM HEH
+ [65268] = utf8.char(65268), -- "ﻴ", utf8.codepoint("ﻴ") == 65268, "\u{FEF4}", MEDIAL FORM YEH
+}
+
+local peCharTableFinal = {
+ [64343] = utf8.char(64343), -- "ﭗ", utf8.codepoint("ﭗ") == 64343, "\u{FB57}", FINAL FORM PEH
+ [64379] = utf8.char(64379), -- "ﭻ", utf8.codepoint("ﭻ") == 64379, "\u{FB7B}", FINAL FORM TCHEH
+ [64395] = utf8.char(64395), -- "ﮋ", utf8.codepoint("ﮋ") == 64395, "\u{FB8B}", FINAL FORM JEH
+ [64399] = utf8.char(64399), -- "ﮏ", utf8.codepoint("ﮏ") == 64399, "\u{FB8F}", FINAL FORM KEHEH
+ [64403] = utf8.char(64403), -- "ﮓ", utf8.codepoint("ﮓ") == 64403, "\u{FB93}", FINAL FORM GAF
+ [64421] = utf8.char(64421), -- "ﮥ", utf8.codepoint("ﮥ") == 64421, "\u{FBA5}", FINAL FORM HEH WITH YEH ABOVE
+ [64509] = utf8.char(64509), -- "ﯽ", utf8.codepoint("ﯽ") == 64509, "\u{FBFD}", FINAL FORM YEH
+ [65166] = utf8.char(65166), -- "ﺎ", utf8.codepoint("ﺎ") == 65166, "\u{FE8E}", FINAL FORM ALEF
+ [65168] = utf8.char(65168), -- "ﺐ", utf8.codepoint("ﺐ") == 65168, "\u{FE90}", FINAL FORM BEH
+ [65172] = utf8.char(65172), -- "ﺔ", utf8.codepoint("ﺔ") == 65172, "\u{FE94}", FINAL FORM TEH MARBUTAH
+ [65174] = utf8.char(65174), -- "ﺖ", utf8.codepoint("ﺖ") == 65174, "\u{FE96}", FINAL FORM TEH
+ [65178] = utf8.char(65178), -- "ﺚ", utf8.codepoint("ﺚ") == 65178, "\u{FE9A}", FINAL FORM THEH
+ [65182] = utf8.char(65182), -- "ﺞ", utf8.codepoint("ﺞ") == 65182, "\u{FE9E}", FINAL FORM JEEM
+ [65186] = utf8.char(65186), -- "ﺢ", utf8.codepoint("ﺢ") == 65186, "\u{FEA2}", FINAL FORM HAH
+ [65190] = utf8.char(65190), -- "ﺦ", utf8.codepoint("ﺦ") == 65190, "\u{FEA6}", FINAL FORM KHAH
+ [65194] = utf8.char(65194), -- "ﺪ", utf8.codepoint("ﺪ") == 65194, "\u{FEAA}", FINAL FORM DAL
+ [65196] = utf8.char(65196), -- "ﺬ", utf8.codepoint("ﺬ") == 65196, "\u{FEAC}", FINAL FORM THAL
+ [65198] = utf8.char(65198), -- "ﺮ", utf8.codepoint("ﺮ") == 65198, "\u{FEAE}", FINAL FORM REH
+ [65200] = utf8.char(65200), -- "ﺰ", utf8.codepoint("ﺰ") == 65200, "\u{FEB0}", FINAL FORM ZAIN
+ [65202] = utf8.char(65202), -- "ﺲ", utf8.codepoint("ﺲ") == 65202, "\u{FEB2}", FINAL FORM SEEN
+ [65206] = utf8.char(65206), -- "ﺶ", utf8.codepoint("ﺶ") == 65206, "\u{FEB6}", FINAL FORM SHEEN
+ [65210] = utf8.char(65210), -- "ﺺ", utf8.codepoint("ﺺ") == 65210, "\u{FEBA}", FINAL FORM SAD
+ [65214] = utf8.char(65214), -- "ﺾ", utf8.codepoint("ﺾ") == 65214, "\u{FEBE}", FINAL FORM DAD
+ [65218] = utf8.char(65218), -- "ﻂ", utf8.codepoint("ﻂ") == 65218, "\u{FEC2}", FINAL FORM TAH
+ [65222] = utf8.char(65222), -- "ﻆ", utf8.codepoint("ﻆ") == 65222, "\u{FEC6}", FINAL FORM ZAH
+ [65226] = utf8.char(65226), -- "ﻊ", utf8.codepoint("ﻊ") == 65226, "\u{FECA}", FINAL FORM AIN
+ [65230] = utf8.char(65230), -- "ﻎ", utf8.codepoint("ﻎ") == 65230, "\u{FECE}", FINAL FORM GHAIN
+ [65234] = utf8.char(65234), -- "ﻒ", utf8.codepoint("ﻒ") == 65234, "\u{FED2}", FINAL FORM FEH
+ [65238] = utf8.char(65238), -- "ﻖ", utf8.codepoint("ﻖ") == 65238, "\u{FED6}", FINAL FORM QAF
+ [65242] = utf8.char(65242), -- "ﻚ", utf8.codepoint("ﻚ") == 65242, "\u{FEDA}", FINAL FORM KAF
+ [65246] = utf8.char(65246), -- "ﻞ", utf8.codepoint("ﻞ") == 65246, "\u{FEDE}", FINAL FORM LAM
+ [65250] = utf8.char(65250), -- "ﻢ", utf8.codepoint("ﻢ") == 65250, "\u{FEE2}", FINAL FORM MEEM
+ [65254] = utf8.char(65254), -- "ﻦ", utf8.codepoint("ﻦ") == 65254, "\u{FEE6}", FINAL FORM NOON
+ [65258] = utf8.char(65258), -- "ﻪ", utf8.codepoint("ﻪ") == 65258, "\u{FEEA}", FINAL FORM HEH
+ [65262] = utf8.char(65262), -- "ﻮ", utf8.codepoint("ﻮ") == 65262, "\u{FEEE}", FINAL FORM WAW
+ [65264] = utf8.char(65264), -- "ﻰ", utf8.codepoint("ﻰ") == 65264, "\u{FEF0}", FINAL FORM ALEF MAKSURAH
+ [65266] = utf8.char(65266), -- "ﻲ", utf8.codepoint("ﻲ") == 65266, "\u{FEF2}", FINAL FORM YEH
+ [65276] = utf8.char(65276), -- "ﻼ", utf8.codepoint("ﻼ") == 65276, "\u{FEFC}", FINAL FORM LIGATURE LAM WITH ALEF
+}
+
+return peCharTableInitial, peCharTableMedial, peCharTableFinal
+--
+--
+-- End of file `pe-char-table.lua'.
+%</pe-char-table-lua>
+% \end{macrocode}
+%
+% \subsection{File: \texttt{texnegar.lua}}
+%
+% \begin{macrocode}
+%<*texnegar-lua>
+--
+-- This is file `texnegar.lua',
+-- generated with the docstrip utility.
+--
+-- The original source files were:
+--
+-- texnegar.dtx (with options: `texnegar-lua')
+--
+-- Copyright (C) 2020 Hossein Movahhedian
+--
+-- It may be distributed and/or modified under the LaTeX Project Public License,
+-- version 1.3c or higher (your choice). The latest version of
+-- this license is at: http://www.latex-project.org/lppl.txt
+--
+-- texnegar = texnegar or {}
+-- local texnegar = texnegar
+-- texnegar.module = {
+-- name = "texnegar",
+-- version = "0.1a",
+-- date = "2020-08-29",
+-- description = "Full implementation of kashida feature in XeLaTex and LuaLaTeX",
+-- author = "Hossein Movahhedian",
+-- copyright = "Hossein Movahhedian",
+-- license = "LPPL v1.3c"
+-- }
+--
+-- -- ^^A%% texnegar-lua.dtx -- part of TEXNEGAR <bitbucket.org/dma8hm1334/texnegar>
+-- local err, warn, info, log = luatexbase.provides_module(texnegar.module)
+-- texnegar.log = log or (function (s) luatexbase.module_info("texnegar", s) end)
+-- texnegar.warning = warn or (function (s) luatexbase.module_warning("texnegar", s) end)
+-- texnegar.error = err or (function (s) luatexbase.module_error("texnegar", s) end)
+
+tex.enableprimitives('',tex.extraprimitives ())
+dofile(kpse.find_file("texnegar-ini.lua"))
+--
+--
+-- End of file `texnegar.lua'.
+%</texnegar-lua>
+% \end{macrocode}
+%
+% \subsection{File: \texttt{texnegar-ini.lua}}
+%
+% \begin{macrocode}
+%<*texnegar-ini-lua>
+--
+-- This is file `texnegar-ini.lua',
+-- generated with the docstrip utility.
+--
+-- The original source files were:
+--
+-- texnegar.dtx (with options: `texnegar-ini-lua')
+--
+-- Copyright (C) 2020 Hossein Movahhedian
+--
+-- It may be distributed and/or modified under the LaTeX Project Public License,
+-- version 1.3c or higher (your choice). The latest version of
+-- this license is at: http://www.latex-project.org/lppl.txt
+--
+-- texnegar_ini = texnegar_ini or {}
+-- local texnegar_ini = texnegar_ini
+-- texnegar_ini.module = {
+-- name = "texnegar_ini",
+-- version = "0.1a",
+-- date = "2020-08-29",
+-- description = "Full implementation of kashida feature in XeLaTex and LuaLaTeX",
+-- author = "Hossein Movahhedian",
+-- copyright = "Hossein Movahhedian",
+-- license = "LPPL v1.3c"
+-- }
+--
+-- -- ^^A%% texnegar-lua.dtx -- part of TEXNEGAR <bitbucket.org/dma8hm1334/texnegar>
+-- local err, warn, info, log = luatexbase.provides_module(texnegar_ini.module)
+-- texnegar_ini.log = log or (function (s) luatexbase.module_info("texnegar_ini", s) end)
+-- texnegar_ini.warning = warn or (function (s) luatexbase.module_warning("texnegar_ini", s) end)
+-- texnegar_ini.error = err or (function (s) luatexbase.module_error("texnegar_ini", s) end)
+
+-- enCharTableInitial, enCharTableMedial, enCharTableFinal = dofile(kpse.find_file("en-char-table.lua"))
+-- peCharTableInitial, peCharTableMedial, peCharTableFinal = dofile(kpse.find_file("pe-char-table.lua"))
+
+-- kashida_unicode = 1600
+-- kashida_subtype = 256
+
+-- COLORSTACK = node.subtype("pdf_colorstack")
+-- GLUE = node.id("glue")
+-- GLYPH = node.id("glyph")
+-- HLIST = node.id("hlist")
+-- KERN = node.id("kern")
+-- RULE = node.id("rule")
+-- WHATSIT = node.id("whatsit")
+
+-- c_false_bool = token.create("c_false_bool")
+c_true_bool = token.create("c_true_bool")
+
+-- l_texnegar_kashida_fix_bool = token.create("l_texnegar_kashida_fix_bool")
+
+-- l_texnegar_kashida_glyph_bool = token.create("l_texnegar_kashida_glyph_bool")
+-- l_texnegar_kashida_leaders_glyph_bool = token.create("l_texnegar_kashida_leaders_glyph_bool")
+-- l_texnegar_kashida_leaders_hrule_bool = token.create("l_texnegar_kashida_leaders_hrule_bool")
+
+-- l_texnegar_ligature_bool = token.create("l_texnegar_ligature_bool")
+
+-- l_texnegar_linebreakpenalty_bool = token.create("l_texnegar_linebreakpenalty_bool")
+
+-- l_texnegar_hboxrecursion_bool = token.create("l_texnegar_hboxrecursion_bool")
+-- l_texnegar_vboxrecursion_bool = token.create("l_texnegar_vboxrecursion_bool")
+
+l_texnegar_color_bool = token.create("l_texnegar_color_bool")
+
+if l_texnegar_color_bool.mode == c_true_bool.mode then
+ color_tbl = color_tbl or {}
+ for item in l_texnegar_color_rgb_tl:gmatch("([^,%s]+)") do
+ table.insert(color_tbl, item)
+ end
+end
+
+-- selected_font = font.current()
+-- selected_font_old = selected_font
+dofile(kpse.find_file("texnegar-luatex-kashida.lua")) -- leaders + resized glyph U+0640
+--
+--
+-- End of file `texnegar-ini.lua'.
+%</texnegar-ini-lua>
+% \end{macrocode}
+%
+% \subsection{File: \texttt{texnegar-luatex-kashida.lua}}
+%
+% \begin{macrocode}
+%<*texnegar-luatex-kashida-lua>
+--
+-- This is file `texnegar-luatex-kashida.lua',
+-- generated with the docstrip utility.
+--
+-- The original source files were:
+--
+-- texnegar.dtx (with options: `texnegar-luatex-kashida-lua')
+--
+-- Copyright (C) 2020 Hossein Movahhedian
+--
+-- It may be distributed and/or modified under the LaTeX Project Public License,
+-- version 1.3c or higher (your choice). The latest version of
+-- this license is at: http://www.latex-project.org/lppl.txt
+--
+-- texnegar_luatex_kashida = texnegar_luatex_kashida or {}
+-- local texnegar_luatex_kashida = texnegar_luatex_kashida
+-- texnegar_luatex_kashida.module = {
+-- name = "texnegar_luatex_kashida",
+-- version = "0.1a",
+-- date = "2020-08-29",
+-- description = "Full implementation of kashida feature in XeLaTex and LuaLaTeX",
+-- author = "Hossein Movahhedian",
+-- copyright = "Hossein Movahhedian",
+-- license = "LPPL v1.3c"
+-- }
+--
+-- -- ^^A%% texnegar-lua.dtx -- part of TEXNEGAR <bitbucket.org/dma8hm1334/texnegar>
+-- local err, warn, info, log = luatexbase.provides_module(texnegar_luatex_kashida.module)
+-- texnegar_luatex_kashida.log = log or (function (s) luatexbase.module_info("texnegar_luatex_kashida", s) end)
+-- texnegar_luatex_kashida.warning = warn or (function (s) luatexbase.module_warning("texnegar_luatex_kashida", s) end)
+-- texnegar_luatex_kashida.error = err or (function (s) luatexbase.module_error("texnegar_luatex_kashida", s) end)
+
+local peCharTableInitial, peCharTableMedial, peCharTableFinal = dofile(kpse.find_file("pe-char-table.lua"))
+
+local kashida_unicode = 1600
+local kashida_subtype = 256
+
+local COLORSTACK = node.subtype("pdf_colorstack")
+local node_id = node.id
+local GLUE = node_id("glue")
+local GLYPH = node_id("glyph")
+local HLIST = node_id("hlist")
+local RULE = node_id("rule")
+local WHATSIT = node_id("whatsit")
+
+local l_texnegar_kashida_glyph_bool = token.create("l_texnegar_kashida_glyph_bool")
+local l_texnegar_kashida_leaders_glyph_bool = token.create("l_texnegar_kashida_leaders_glyph_bool")
+local l_texnegar_kashida_leaders_hrule_bool = token.create("l_texnegar_kashida_leaders_hrule_bool")
+
+local l_texnegar_hboxrecursion_bool = token.create("l_texnegar_hboxrecursion_bool")
+local l_texnegar_vboxrecursion_bool = token.create("l_texnegar_vboxrecursion_bool")
+
+local selected_font = font.current()
+local selected_font_old = selected_font
+
+local string_format = string.format
+local debug_getinfo = debug.getinfo
+
+function GetGlyphDimensions(font_file, glyph_index)
+ local funcName = debug_getinfo(1).name
+ local funcNparams = debug_getinfo(1).nparams
+
+ local fnt = fontloader.open(font_file)
+ local idx = 0
+ local fnt_glyphcnt = fnt.glyphcnt
+ local fnt_glyphmin = fnt.glyphmin
+ local fnt_glyphmax = fnt.glyphmax
+ if fnt_glyphcnt > 0 then
+ for idx = fnt_glyphmin, fnt_glyphmax do
+ local gl = fnt.glyphs[idx]
+ if gl then
+ local gl_unicode = gl.unicode
+ if gl_unicode == glyph_index then
+ local gl_name = gl.name
+ gl_width = gl.width
+ local gl_bbox = gl.boundingbox
+ gl_llx = gl_bbox[1]
+ gl_depth = gl_bbox[2]
+ gl_urx = gl_bbox[3]
+ gl_height = gl_bbox[4]
+ break
+ end
+ end
+ idx = idx + 1
+ end
+ end
+ fontloader.close(fnt)
+ return {width = gl_width, height = gl_height, depth = gl_depth, llx = gl_llx, urx = gl_urx}
+end
+
+function GetGlue(t_plb_line_glue_node, t_plb_node)
+ local funcName = debug_getinfo(1).name
+ local funcNparams = debug_getinfo(1).nparams
+
+ local glue_id = t_plb_line_glue_node.id
+ local glue_subtype = t_plb_line_glue_node.subtype
+ local glue_width = t_plb_line_glue_node.width
+ local glue_stretch = t_plb_line_glue_node.stretch
+ local glue_shrink = t_plb_line_glue_node.shrink
+ local eff_glue_width = node.effective_glue(t_plb_line_glue_node, t_plb_node)
+ local glue_stretch_order = t_plb_line_glue_node.stretch_order
+ local glue_shrink_order = t_plb_line_glue_node.shrink_order
+ local glue_delta = 0
+ glue_delta = eff_glue_width - glue_width
+ return { id = glue_id, subtype = glue_subtype, width = glue_width, stretch = glue_stretch,
+ shrink = glue_shrink, stretch_order = glue_stretch_order, shrink_order = glue_shrink_order,
+ effective_glue = eff_glue_width, delta = glue_delta }
+end
+
+function GetGlyph(t_plb_line_glyph_node, t_tbl_line_fields, t_CharTableInitial, t_CharTableMedial, t_CharTableFinal)
+ local funcName = debug_getinfo(1).name
+ local funcNparams = debug_getinfo(1).nparams
+
+ local glyph_id = t_plb_line_glyph_node.id
+ local glyph_subtype = t_plb_line_glyph_node.subtype
+ local glyph_char = t_plb_line_glyph_node.char
+ local glyph_font = t_plb_line_glyph_node.font
+ local glyph_lang = t_plb_line_glyph_node.lang
+ local glyph_width = t_plb_line_glyph_node.width
+ local glyph_data = t_plb_line_glyph_node.data
+ if not (t_CharTableInitial[glyph_char] == nil) then
+ t_tbl_line_fields.joinerCharInitial = t_tbl_line_fields.joinerCharInitial + 1
+ t_plb_line_glyph_node.data = 1
+ elseif not (t_CharTableMedial[glyph_char] == nil) then
+ t_tbl_line_fields.joinerCharMedial = t_tbl_line_fields.joinerCharMedial + 1
+ t_plb_line_glyph_node.data = 2
+ elseif not (t_CharTableFinal[glyph_char] == nil) then
+ t_tbl_line_fields.joinerCharFinal = t_tbl_line_fields.joinerCharFinal + 1
+ t_plb_line_glyph_node.data = 3
+ end
+ return { id = glyph_id, subtype = glyph_subtype, char = glyph_char, font = glyph_font, lang = glyph_lang, width = glyph_width, data = glyph_data }, t_tbl_line_fields
+end
+
+function ProcessTableKashidaHlist(ksh_hlistNode, hbox_num, in_font)
+ local funcName = debug_getinfo(1).name
+ local funcNparams = debug_getinfo(1).nparams
+
+ local ksh_hlistNode_id = ksh_hlistNode.id
+ local ksh_hlistNode_subtype = ksh_hlistNode.subtype
+
+ for tn in node.traverse(ksh_hlistNode.head) do
+ local tn_id = tn.id
+ local tn_subtype = tn.subtype
+
+ if tn_id == 0 then
+ for tp in node.traverse(tn.head) do
+ local tp_id = tp.id
+ local tp_subtype = tp.subtype
+ if tp_id == 29 then
+ if l_texnegar_color_bool.mode == c_true_bool.mode then
+ local col_str = color_tbl[1] .. " " .. color_tbl[2] .. " " .. color_tbl[3]
+ local col_str_rg = col_str .. " rg "
+ local col_str_RG = col_str .. " RG"
+
+ local color_push = node.new(WHATSIT, COLORSTACK)
+ local color_pop = node.new(WHATSIT, COLORSTACK)
+ color_push.stack = 0
+ color_pop.stack = 0
+ color_push.command = 1
+ color_pop.command = 2
+ glue_ratio = .2
+ color_push.data = col_str_rg .. col_str_RG
+ color_pop.data = col_str_rg .. col_str_RG
+ tn.head = node.insert_before(tn.list, tn.head, node.copy(color_push))
+ tn.head = node.insert_after(tn.list, node.tail(tn.head), node.copy(color_pop))
+ end
+
+ local tp_font = tp.font
+ local tp_char = tp.char
+ tp.font = in_font
+
+ local ksh_unicode
+ ksh_unicode = font.getfont(in_font).resources.unicodes['kashida']
+ if hbox_num == 'l_texnegar_k_box' then
+ tp.char = kashida_unicode
+ elseif hbox_num == 'l_texnegar_ksh_box' then
+ tp.char = ksh_unicode
+ tn_width = tn.width
+ ksh_hlistNode.width = tn_width
+ end
+ elseif tp_id == 0 then
+ if tp.subtype ~= 3 then
+ tbl_kashida_hlist_nodes[ #tbl_kashida_hlist_nodes + 1 ] = tp
+ end
+ end
+ end
+ elseif tn_id == 1 then
+ do end
+ elseif tn_id == 8 then
+ do end
+ elseif tn_id == 29 then
+ if l_texnegar_color_bool.mode == c_true_bool.mode then
+ local col_str = color_tbl[1] .. " " .. color_tbl[2] .. " " .. color_tbl[3]
+ local col_str_rg = col_str .. " rg "
+ local col_str_RG = col_str .. " RG"
+
+ local color_push = node.new(WHATSIT, COLORSTACK)
+ local color_pop = node.new(WHATSIT, COLORSTACK)
+ color_push.stack = 0
+ color_pop.stack = 0
+ color_push.command = 1
+ color_pop.command = 2
+ glue_ratio = .2
+ color_push.data = col_str_rg .. col_str_RG
+ color_pop.data = col_str_rg .. col_str_RG
+ ksh_hlistNode.head = node.insert_before(ksh_hlistNode.list, ksh_hlistNode.head, node.copy(color_push))
+ ksh_hlistNode.head = node.insert_after(ksh_hlistNode.list, node.tail(ksh_hlistNode.head), node.copy(color_pop))
+ end
+
+ local tn_font = tn.font
+ local tn_char = tn.char
+ tn.font = in_font
+
+ local ksh_unicode
+ ksh_unicode = font.getfont(in_font).resources.unicodes['kashida']
+ if hbox_num == 'l_texnegar_k_box' then
+ tn.char = kashida_unicode
+ elseif hbox_num == 'l_texnegar_ksh_box' then
+ tn.char = ksh_unicode
+ tn_width = tn.width
+ ksh_hlistNode.width = tn_width
+ end
+ else
+ print(string_format("\n tn. Not processed node id is: %d", tn_id))
+ end
+ end
+end
+
+function SetFontInHbox(hbox_num, font_num)
+ local funcName = debug_getinfo(1).name
+ local funcNparams = debug_getinfo(1).nparams
+
+ tbl_kashida_hlist_nodes = {}
+
+ local tmp_node
+ tmp_node = node.new("hlist")
+ tmp_node = tex.getbox(hbox_num)
+
+ ProcessTableKashidaHlist(tmp_node, hbox_num, font_num)
+
+ ::kashida_hlist_BEGIN::
+ if #tbl_kashida_hlist_nodes > 0 then
+ local kashida_hlistNodeAdded = table.remove(tbl_kashida_hlist_nodes,1)
+ ProcessTableKashidaHlist(kashida_hlistNodeAdded, hbox_num, font_num)
+ goto kashida_hlist_BEGIN
+ end
+end
+
+function StretchGlyph(t_plb_node, t_plb_glyph_node, t_gluePerJoiner, t_dir, t_filler)
+ local funcName = debug_getinfo(1).name
+ local funcNparams = debug_getinfo(1).nparams
+
+ if t_filler == "resized_kashida" then
+ SetFontInHbox('l_texnegar_k_box', selected_font)
+ elseif t_filler == "leaders+kashida" then
+ SetFontInHbox('l_texnegar_ksh_box', selected_font)
+ end
+
+ kashida_node = node.new(GLYPH)
+ node_glue = node.new(GLUE)
+ node_rule = node.new(RULE)
+ node_hlist = node.new(HLIST)
+
+ font_current = selected_font
+ font_name = font.fonts[font_current].fullname
+ font_file = font.fonts[font_current].filename
+ kashida_char = font.fonts[font_current].characters[1600]
+
+ kashida_node.subtype = kashida_subtype
+ kashida_node.font = font_current
+ kashida_node.char = kashida_unicode
+ kashida_node.lang = tex.language
+
+ kashida_width = kashida_node.width
+ kashida_height = kashida_node.height
+ kashida_depth = kashida_node.depth
+
+ tbl_gl_dimen = GetGlyphDimensions(font_file, kashida_unicode)
+ ksh_width, ksh_height, ksh_depth, ksh_llx, ksh_urx =
+ tbl_gl_dimen.width, tbl_gl_dimen.height, tbl_gl_dimen.depth, tbl_gl_dimen.llx, tbl_gl_dimen.urx
+
+ ratio_width = kashida_width / ksh_width
+ leaders_height = ratio_width * ksh_height
+ leaders_depth = - ratio_width * ksh_depth
+
+ node_glue.subtype = 100
+ node.setglue(node_glue, t_gluePerJoiner, 0, 0, 0, 0)
+
+ if t_filler == "resized_kashida" then
+ node_glue.leader = node.copy_list(tex.box['l_texnegar_k_box'])
+ elseif t_filler == "leaders+kashida" then
+ node_glue.leader = node.copy_list(tex.box['l_texnegar_ksh_box'])
+ elseif t_filler == "leaders+hrule" then
+ node_glue.leader = node_rule
+ end
+
+ node_glue.leader.subtype = 0
+ node_glue.leader.height = leaders_height
+ node_glue.leader.depth = leaders_depth
+
+ node_glue.leader.dir = t_dir
+
+ node.insert_after(t_plb_node.list, t_plb_glyph_node, node_glue)
+ if t_filler == "leaders+hrule" then
+ for tn in node.traverse(t_plb_node.head) do
+ local tn_id = tn.id
+ local tn_subtype = tn.subtype
+
+ if tn_id == 12 and tn_subtype == 100 then
+ local t_hbox = node.new(HLIST)
+ local t_hrule = node.copy(tn)
+ t_hbox.head = node.insert_after(t_hbox.list, t_hbox.head,t_hrule)
+ t_plb_node.head = node.insert_after(t_plb_node.list, tn, t_hbox)
+
+ if l_texnegar_color_bool.mode == c_true_bool.mode then
+ local col_str = color_tbl[1] .. " " .. color_tbl[2] .. " " .. color_tbl[3]
+ local col_str_rg = col_str .. " rg "
+ local col_str_RG = col_str .. " RG"
+
+ local color_push = node.new(WHATSIT, COLORSTACK)
+ local color_pop = node.new(WHATSIT, COLORSTACK)
+ color_push.stack = 0
+ color_pop.stack = 0
+ color_push.command = 1
+ color_pop.command = 2
+ glue_ratio = .2
+ color_push.data = col_str_rg .. col_str_RG
+ color_pop.data = col_str_rg .. col_str_RG
+ t_hbox.head = node.insert_before(t_hbox.list, t_hbox.head, node.copy(color_push))
+ t_hbox.head = node.insert_after(t_hbox.list, node.tail(t_hbox.head), node.copy(color_pop))
+ end
+ end
+ end
+ end
+end
+
+function GetFillerSpec(t_plb_node, t_plb_head_node, t_tbl_line_fields, t_CharTableInitial, t_CharTableMedial, t_CharTableFinal)
+ local funcName = debug_getinfo(1).name
+ local funcNparams = debug_getinfo(1).nparams
+
+ t_plb_node_id = t_plb_node.id
+ t_plb_node_subtype = t_plb_node.subtype
+
+ for p in node.traverse(t_plb_head_node) do
+ local p_id = p.id
+ local p_subtype = p.subtype
+ if p_id == 0 then
+ t_tbl_line_fields.lineWidthRemainder = t_tbl_line_fields.lineWidthRemainder - p.width
+ if p.subtype ~= 3 then
+ tbl_hlist_nodes[ #tbl_hlist_nodes + 1 ] = p
+ end
+ elseif p_id == 1 then
+ t_tbl_line_fields.lineWidthRemainder = t_tbl_line_fields.lineWidthRemainder - p.width
+ tbl_vlist_nodes[ #tbl_vlist_nodes + 1 ] = p
+ elseif p_id == 12 then
+ tbl_p_glue = GetGlue(p, t_plb_node)
+ t_tbl_line_fields.lineWidthRemainder = t_tbl_line_fields.lineWidthRemainder - tbl_p_glue["effective_glue"]
+ t_tbl_line_fields.total_glues = t_tbl_line_fields.total_glues + 1
+ t_tbl_line_fields.stretchedGlue = t_tbl_line_fields.stretchedGlue + tbl_p_glue["delta"]
+ elseif p_id == 29 then
+ tbl_p_glyph, t_tbl_line_fields = GetGlyph(p, t_tbl_line_fields, t_CharTableInitial, t_CharTableMedial, t_CharTableFinal)
+ selected_font_old = selected_font
+ selected_font = tbl_p_glyph["font"]
+ t_tbl_line_fields.lineWidthRemainder = t_tbl_line_fields.lineWidthRemainder - tbl_p_glyph["width"]
+ t_tbl_line_fields.total_glyphs = t_tbl_line_fields.total_glyphs + 1
+ end
+ end
+
+ t_tbl_line_fields.total_joiners = t_tbl_line_fields.joinerCharInitial + t_tbl_line_fields.joinerCharMedial
+ t_tbl_line_fields.gluePerJoiner = 0
+ if t_tbl_line_fields.total_glues == 0 then
+ t_tbl_line_fields.stretchedGlue = t_tbl_line_fields.lineWidthRemainder
+ end
+ if t_tbl_line_fields.total_joiners > 0 then
+ t_tbl_line_fields.gluePerJoiner = t_tbl_line_fields.stretchedGlue // t_tbl_line_fields.total_joiners
+ t_tbl_line_fields.stretchedGlueRemaineder = t_tbl_line_fields.stretchedGlue % t_tbl_line_fields.total_joiners
+ elseif t_tbl_line_fields.total_joiners == 1 then
+ t_tbl_line_fields.gluePerJoiner = t_tbl_line_fields.stretchedGlue
+ end
+
+ return t_tbl_line_fields
+end
+
+function ProcessTableHlist(tmphl_n)
+ local funcName = debug_getinfo(1).name
+ local funcNparams = debug_getinfo(1).nparams
+
+ local tmphl_n_id = tmphl_n.id
+ local tmphl_n_subtype = tmphl_n.subtype
+
+ local tbl_line_fields = { line_dir = "", line_width = 0, lineWidthRemainder = 0, total_glyphs = 0,
+ joinerCharInitial = 0, joinerCharMedial = 0, joinerCharFinal = 0, total_joiners = 0,
+ stretchedGlue = 0, total_glues = 0, gluePerJoiner = 0, stretchedGlueRemaineder = 0}
+
+ local tbl_p_glue, tbl_p_glyph
+
+ if (tmphl_n_id == 0) and (tmphl_n_subtype == 1 or tmphl_n_subtype == 2) then
+ tbl_line_fields.line_width = tmphl_n.width
+ tbl_line_fields.line_dir = tmphl_n.dir
+ tbl_line_fields.lineWidthRemainder = tbl_line_fields.line_width
+
+ if tbl_line_fields.line_dir == "TLT" then
+ tbl_line_fields = GetFillerSpec(tmphl_n, tmphl_n.head, tbl_line_fields, peCharTableInitial, peCharTableMedial, peCharTableFinal)
+
+ if tbl_line_fields.total_joiners == 0 or tbl_line_fields.gluePerJoiner == 0 or tbl_line_fields.stretchedGlue <= 0 then
+ goto continue
+ end
+
+ for q in node.traverse_id(GLUE, tmphl_n.head) do
+ local eff_glue_width = node.effective_glue(q, tmphl_n)
+ node.setglue(q, q.width, 0, 0, q.stretch_order, q.glue_shrink_order)
+ end
+
+ for r in node.traverse_id(GLYPH, tmphl_n.head) do
+ local r_data = r.data
+ if r_data == 1 or r.data == 2 then
+ StretchGlyph(tmphl_n, r, tbl_line_fields.gluePerJoiner, tbl_line_fields.line_dir, filler_pe)
+ elseif r.data == 3 then
+ goto for_loop_01
+ end
+ ::for_loop_01::
+ end
+ tbl_line_fields.line_width = tmphl_n.width
+ tbl_line_fields.lineWidthRemainder = line_width
+ elseif tbl_line_fields.line_dir == "TRT" then
+ tbl_line_fields = GetFillerSpec(tmphl_n, tmphl_n.head, tbl_line_fields, peCharTableInitial, peCharTableMedial, peCharTableFinal)
+ if tbl_line_fields.total_joiners == 0 or tbl_line_fields.gluePerJoiner == 0 or tbl_line_fields.stretchedGlue <= 0 then
+ goto continue
+ end
+
+ for q in node.traverse_id(GLUE, tmphl_n.head) do
+ local eff_glue_width = node.effective_glue(q, tmphl_n)
+ node.setglue(q, q.width, 0, 0, q.stretch_order, q.glue_shrink_order)
+ end
+
+ for r in node.traverse_id(GLYPH, tmphl_n.head) do
+ local r_data = r.data
+ if r_data == 1 or r.data == 2 then
+ StretchGlyph(tmphl_n, r, tbl_line_fields.gluePerJoiner, tbl_line_fields.line_dir, filler_pe)
+ elseif r.data == 3 then
+ goto for_loop_02
+ end
+ ::for_loop_02::
+ end
+ tbl_line_fields.line_width = tmphl_n.width
+ tbl_line_fields.lineWidthRemainder = line_width
+ else
+ print(string_format("\n Line direction '%s' is not supported yet!", tbl_line_fields.line_dir))
+ end
+ end
+ ::continue::
+end
+
+function ProcessTableVlist(tmpvl_n)
+ local funcName = debug_getinfo(1).name
+ local funcNparams = debug_getinfo(1).nparams
+
+ local tmpvl_n_id = tmpvl_n.id
+ local tmpvl_n_subtype = tmpvl_n.subtype
+
+ print(string_format(" %s: 00-0 tmpvl_n: id: %d, subtype: %d", funcName, tmpvl_n_id, tmpvl_n_subtype))
+ for vbNode in node.traverse(tmpvl_n) do
+ if vbNode.id == 1 and vbNode.subtype == 0 then
+ for tr_vbNode in node.traverse(vbNode.head) do
+ if (tr_vbNode.id == 0) and (tr_vbNode.subtype == 1 or tr_vbNode.subtype == 2) then
+ ProcessTableHlist(tr_vbNode)
+ end
+ end
+ end
+ end
+end
+
+function PostLineBreakFilter(hboxes_stack, groupcode)
+ local funcName = debug_getinfo(1).name
+ local funcNparams = debug_getinfo(1).nparams
+
+ tbl_hlist_nodes = {}
+ tbl_vlist_nodes = {}
+ for hlistNode in node.traverse(hboxes_stack) do
+ if node.next(hlistNode) == nil then
+ goto END
+ end
+
+ ProcessTableHlist(hlistNode)
+
+ if l_texnegar_hboxrecursion_bool.mode == c_true_bool.mode then
+ ::hboxBEGIN::
+ if #tbl_hlist_nodes > 0 then
+ local hlistNodeAdded = table.remove(tbl_hlist_nodes,1)
+ ProcessTableHlist(hlistNodeAdded)
+ goto hboxBEGIN
+ end
+ end
+
+ if l_texnegar_vboxrecursion_bool.mode == c_true_bool.mode then
+ ::vboxBEGIN::
+ if #tbl_vlist_nodes > 0 then
+ local vlistNodeAdded = table.remove(tbl_vlist_nodes,1)
+ ProcessTableVlist(vlistNodeAdded)
+ goto vboxBEGIN
+ end
+ end
+
+ ::END::
+ end
+ return hboxes_stack
+end
+
+if l_texnegar_kashida_glyph_bool.mode == c_true_bool.mode then
+ filler_pe = "resized_kashida"
+elseif l_texnegar_kashida_leaders_glyph_bool.mode == c_true_bool.mode then
+ filler_pe = "leaders+kashida"
+elseif l_texnegar_kashida_leaders_hrule_bool.mode == c_true_bool.mode then
+ filler_pe = "leaders+hrule"
+else
+ print(string_format" Unknown kashida value.")
+end
+
+function StartStretching()
+ if not luatexbase.in_callback('post_linebreak_filter', 'insertKashida') then
+ luatexbase.add_to_callback('post_linebreak_filter', PostLineBreakFilter, 'insertKashida')
+ end
+end
+
+function StopStretching()
+ if luatexbase.in_callback('post_linebreak_filter', 'insertKashida') then
+ luatexbase.remove_from_callback('post_linebreak_filter', 'insertKashida')
+ end
+end
+--
+--
+-- End of file `texnegar-luatex-kashida.lua'.
+%</texnegar-luatex-kashida-lua>
+% \end{macrocode}
+%
+% \section{Acknowledgments}
+% In the first place I have to thank Donald Knuth for inventing TeX.
+% During the development of this package I refered to Stack Exchange network of
+% question-and-answer (Q\&A) websites to solve problems for which I am grateful.
+% I also would like to thank the developer teams of TeX's friends especially LaTeX, LuaTeX and XeTeX teams.
+%
+% \def\HistoryItem#1#2{\subsection*{[#1]} \addcontentsline{toc}{subsection}{[#1]} \item #2}
+%
+% \section{Change History}
+%
+% \begin{itemize}
+% \let\tmpitemindent\itemindent
+% \addtolength{\itemindent}{\leftmargin}
+% \setlength{\parskip}{0pt}
+% \setlength{\itemsep}{0pt}
+%
+% \HistoryItem{2020-08-29~v0.1a}{First standalone version.}
+%
+% \end{itemize}
+%
+% \section*{To Do's}
+%
+% To do
+%
+% \renewcommand{\refname}{References: \\ {\normalsize\it(Actually, this is not a ``References'' nor a ``Literature'', but the most important
+% although not a complete list of ``Resources Used'' to develop this package.)}}
+%
+% \begin{thebibliography}{9}
+%
+% \bibitem{DEK-TTB} Donald E. Knuth,
+% \emph{The \hologo{TeX} book},
+% Addison-Wesley, 1986.
+%
+% \bibitem{VE-TBT} Victor Eijkhout,
+% \emph{\hologo{TeX} BY TOPIC},
+% Addison-Wesley, 2013.
+%
+% \bibitem{PWA-KAH-KB-TFI} Paul W. Abrahams, Kathryn A. Hargreaves, and Karl Berry,
+% \emph{\hologo{TeX} for the Impatient},
+% Addison-Wesley, 2013.
+%
+% \bibitem{LL-LADPS} Leslie Lamport,
+% \emph{\hologo{LaTeX}, A document preparation System},
+% Addison-Wesley, 1986.
+%
+% \bibitem{FM-MG-JB-DC-CR-TLC} Frank Mittelbach and Michel Goossens with Johannes Braams, David Carlisle, and Chris Rowley,
+% \emph{The \hologo{LaTeX} Companion},
+% Addison-Wesley, second edition, 2004.
+%
+% \bibitem{PRO-IN-LUA} Roberto Ierusalimschy,
+% \emph{Programming in Lua},
+% Lua.org, fourth edition, 2016
+%
+% \bibitem{LUA-REF-MAN} Lua.org,
+% \emph{Lua 5.3 Reference Manual},
+% Lua.org, 2016
+%
+% \bibitem{TLT-TLS} Package \texttt{latex}: The LaTeX Team,
+% \emph{The \hologo{LaTeX2e} Sources},
+% \href{http://mirrors.ctan.org/macros/latex/base/source2e.pdf}{\texttt{CTAN:macros/latex/base/source2e.pdf}}, 2020-02-02
+%
+% \bibitem{TL3T-TLS} Package \texttt{l3kernel}: The LaTeX3 Team,
+% \emph{The \hologo{LaTeX}3 Sources},
+% \href{http://mirrors.ctan.org/macros/latex/contrib/l3kernel/source3.pdf}{\texttt{CTAN:macros/latex/contrib/l3kernel/source3.pdf}}, 2020-07-17
+%
+% \bibitem{TL3T-TLI} Package \texttt{l3kernel}: The LaTeX3 Team,
+% \emph{The \hologo{LaTeX}3 Interfaces},
+% \href{http://mirrors.ctan.org/macros/latex/contrib/l3kernel/interface3.pdf}{\texttt{CTAN:macros/latex/contrib/l3kernel/interface3.pdf}}, 2020-07-17
+%
+% \bibitem{TLT-LRM} Package \texttt{luatex}: The LuaTeX Team,
+% \hologo{LuaTeX} Reference Manual,
+% \href{http://mirrors.ctan.org/systems/doc/luatex/luatex.pdf}{\texttt{CTAN:systems/doc/luatex/luatex.pdf}}, 2020
+%
+% \bibitem{WR-KH-KB-XRG} Package \texttt{xetexref}: Will Robertson, Khaled Hosny, and Karl Berry,
+% \hologo{XeTeX} reference guide,
+% \href{http://mirrors.ctan.org/info/xetexref/xetex-reference.pdf}{\texttt{CTAN:info/xetexref/xetex-reference.pdf}}, 2019-12-09
+%
+% \bibitem{JQ-AX} Package \texttt{xetex}: Jonathan Kew,
+% About \hologo{XeTeX},
+% \href{http://mirrors.ctan.org/systems/doc/xetex/XeTeX-notes.pdf}{\texttt{CTAN:systems/doc/xetex/XeTeX-notes.pdf}}, 2005-10-17
+%
+% \bibitem{NG-TXC} Package \texttt{xetex}: Michel Goossens,
+% The \hologo{XeTeX} Companion,
+% \href{http://xml.web.cern.ch/XML/lgc2/xetexmain.pdf}{\texttt{http://xml.web.cern.ch/XML/lgc2/xetexmain.pdf}}, 2009-08-19
+%
+% \bibitem{TEX-STACKEXCHANGE} Website: Stack Exchange: Hot Questions,
+% \hologo{TeX}-\hologo{LaTeX} Q\&A for users of TeX, LaTeX, ConTeXt, and related typesetting systems,
+% \href{https://tex.stackexchange.com}{\texttt{tex.stackexchange.com}}
+%
+% \bibitem{LUATEX-WIKI} Website: LuaTeX Wiki,
+% \hologo{LuaTeX} Wiki,
+% \href{http://wiki.luatex.org/index.php/Main\_Page}{\texttt{wiki.luatex.org}}
+%
+% \end{thebibliography}
+%
+%\end{implementation}
+%
+% \ifluatex
+% \immediate\directlua{os.execute([[ makeindex -s gind.ist -o \jobname.ind \jobname.idx ]])}
+% \immediate\directlua{os.execute([[ makeindex -s gglo.ist -o \jobname.gls \jobname.glo ]])}
+% \fi
+% \ifxetex
+% \immediate\write18{makeindex -s gind.ist -o \jobname.ind \jobname.idx}
+% \immediate\write18{makeindex -s gglo.ist -o \jobname.gls \jobname.glo}
+% \fi
+% \PrintIndex
+% %\PrintChanges
+% \Finale
diff --git a/macros/latex/contrib/texnegar/texnegar.ins b/macros/latex/contrib/texnegar/texnegar.ins
new file mode 100644
index 0000000000..cfdf9150a6
--- /dev/null
+++ b/macros/latex/contrib/texnegar/texnegar.ins
@@ -0,0 +1,79 @@
+\iffalse meta-comment
+
+File: texnegar.ins
+
+Copyright (C) 2020 Hossein Movahhedian
+
+It may be distributed and/or modified under the LaTeX Project Public License,
+version 1.3c or higher (your choice). The latest version of
+this license is at: http://www.latex-project.org/lppl.txt
+
+\fi
+
+\let\jobname\relax
+\input l3docstrip.tex
+\askforoverwritefalse
+
+\preamble
+
+Copyright (C) 2020 Hossein Movahhedian
+
+It may be distributed and/or modified under the LaTeX Project Public License,
+version 1.3c or higher (your choice). The latest version of
+this license is at: http://www.latex-project.org/lppl.txt
+
+\endpreamble
+% stop docstrip adding \endinput
+\postamble
+\endpostamble
+
+\keepsilent
+
+\generate{\file{texnegar.sty} {\from{texnegar.dtx} {texnegar-sty}}}
+
+\nopreamble
+\nopostamble
+
+\generate{\file{README.txt} {\from{texnegar.dtx} {README-txt}}}
+
+\generate{\file{en-char-table.lua} {\from{texnegar.dtx} {en-char-table-lua}}}
+
+\generate{\file{pe-char-table.lua} {\from{texnegar.dtx} {pe-char-table-lua}}}
+
+\generate{\file{texnegar.lua} {\from{texnegar.dtx} {texnegar-lua}}}
+
+\generate{\file{texnegar-ini.lua} {\from{texnegar.dtx} {texnegar-ini-lua}}}
+
+\generate{\file{texnegar-luatex-kashida.lua} {\from{texnegar.dtx} {texnegar-luatex-kashida-lua}}}
+
+\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble
+
+\generate{\file{texnegar-luatex.sty} {\from{texnegar.dtx} {texnegar-luatex-sty}}}
+
+\generate{\file{texnegar-xetex.sty} {\from{texnegar.dtx} {texnegar-xetex-sty}}}
+
+\generate{\file{texnegar-ini.tex} {\from{texnegar.dtx} {texnegar-ini-tex}}}
+
+\generate{\file{texnegar-common-kashida.tex} {\from{texnegar.dtx} {texnegar-common-kashida-tex}}}
+
+\generate{\file{texnegar-xetex-kashida.tex} {\from{texnegar.dtx} {texnegar-xetex-kashida-tex}}}
+
+\obeyspaces
+\Msg{******************************************************}
+\Msg{* *}
+\Msg{* To finish the installation you have to move the *}
+\Msg{* following files into a directory searched by TeX: *}
+\Msg{* *}
+\Msg{* \space\space *.def, *.sty *}
+\Msg{* *}
+\Msg{* To produce the documentation run the file *}
+\Msg{* texnegar.dtx through XeLaTeX. *}
+\Msg{* *}
+\Msg{* Happy TeXing! *}
+\Msg{* *}
+\Msg{* Documentation is in texnegar.pdf *}
+\Msg{* *}
+\Msg{******************************************************}
+
+\endbatchfile
diff --git a/macros/latex/contrib/texnegar/texnegar.pdf b/macros/latex/contrib/texnegar/texnegar.pdf
new file mode 100644
index 0000000000..f176290f43
--- /dev/null
+++ b/macros/latex/contrib/texnegar/texnegar.pdf
Binary files differ
diff --git a/macros/latex/contrib/texnegar/xepersian-XB.pdf b/macros/latex/contrib/texnegar/xepersian-XB.pdf
new file mode 100644
index 0000000000..8dd873ed13
--- /dev/null
+++ b/macros/latex/contrib/texnegar/xepersian-XB.pdf
Binary files differ
diff --git a/macros/latex/contrib/texnegar/xepersian-XB.tex b/macros/latex/contrib/texnegar/xepersian-XB.tex
new file mode 100644
index 0000000000..10103a51b0
--- /dev/null
+++ b/macros/latex/contrib/texnegar/xepersian-XB.tex
@@ -0,0 +1,81 @@
+\documentclass{report}
+\usepackage{xcolor}
+\usepackage[Kashida=on]{xepersian}
+\settextfont[Scale=4.5,Colour=000001]{XB Kayhan}
+\setlatintextfont[Scale=1.5,Colour=0000FF]{XB Kayhan}
+
+\defpersianfont\XBKayhanEn[Scale=1.2,Colour=000001]{XB Kayhan}
+\defpersianfont\XBKayhanIt[Scale=4.5,Colour=000001]{XB Kayhan Italic}
+\defpersianfont\XBKayhanOb[Scale=4.5,Colour=000001]{XB Zar Oblique}
+\defpersianfont\XBKayhanOl[Scale=4.5,Colour=000001]{XB Kayhan Pook}
+\defpersianfont\XBKayhanSd[Scale=4.5,Colour=000001]{XB Kayhan Sayeh}
+\defpersianfont\XBKayhanPo[Scale=4.5,Colour=000001]{XB Kayhan Pook}
+\defpersianfont\XBKayhanSa[Scale=4.5,Colour=000001]{XB Kayhan Sayeh}
+\defpersianfont\XBKayhanNa[Scale=4.5,Colour=000001]{XB Kayhan Navaar}
+
+\def\SampleText{
+ راهی جایی تابی چاپی چاههی تلاشهایی
+ شتابهایی تابی چاپی راهی تلاشهــایی
+ که کتابهایی که کلاههایی که کتابهایی }
+
+\def\SampleTitle#1#2#3{{{\begin{latin}\XBKayhanEn Engine: {\color{blue}\texttt{#1,}} \\
+ Style: {\color{blue}\texttt{#2,}} \\ Kashida: {\color{blue}\texttt{#3}}\end{latin}}}\hbox{}\vskip 5mm}
+
+\pretolerance = 10000
+% \exhyphenpenalty=10000
+% \hyphenpenalty=10000
+% \penalty -10000
+% \tolerance=10000
+% \tolerance = -10000
+% \looseness = 10000
+
+\setlength\parindent{0pt}
+% \pagestyle{empty}
+\setcounter{page}{16}
+\let\tmppage=\thepage
+\gdef\thepage{\scriptsize\lr\tmppage}
+
+\begin{document}
+
+\begin{latin}
+\begin{center}
+% \Huge\textsf{xepersian}\vspace{20pt}\\ Example of Use\vspace{20pt}\\ \texttt{Kashida=On} \vspace{40pt}
+{\Huge\textsf{\XePersian} \\
+ \vspace{20pt} Example of Use \\
+ \vspace{20pt}\texttt{Engine: XeTeX {\normalsize using xepersian}} \\
+ \vspace{20pt}\texttt{Kashida=leaders+hrule}} \\
+ \vspace{20pt}\makebox{\textsf{File:} \texttt{TEXMFDIST/doc/latex/texnegar/xepersian-XB.tex}} \\
+ \vspace{20pt}
+
+
+{\Large
+\begin{tabular}{ll}
+ \textsf{Font:} & \textsf{XB Kayhan} \\
+ \textsf{Font Scale:} & \texttt{4.5} \\
+ \textsf{color:} & \texttt{red}
+\end{tabular}
+}
+\end{center}
+
+\end{latin}
+
+\color{red}
+\newpage \KashidaOff \SampleTitle{XeTeX using xepersian}{Regular}{Off} \par \SampleText
+
+\newpage \KashidaOn \SampleTitle{XeTeX using xepersian}{Regular}{leaders+hrule On} \par \SampleText
+
+\newpage \KashidaOn \SampleTitle{XeTeX using xepersian}{Italic}{leaders+hrule On} \par {\XBKayhanIt \SampleText}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using xepersian}{Oblique}{leaders+hrule On} \par {\XBKayhanOb \SampleText}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using xepersian}{Outline}{leaders+hrule On} \par {\XBKayhanOl \SampleText}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using xepersian}{Sayeh}{leaders+hrule On} \par {\XBKayhanSd \SampleText}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using xepersian}{Pook}{leaders+hrule On} \par {\XBKayhanPo \SampleText}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using xepersian}{Sayeh}{leaders+hrule On} \par {\XBKayhanSa \SampleText}
+
+\newpage \KashidaOn \SampleTitle{XeTeX using xepersian}{Navaar}{leaders+hrule On} \par {\XBKayhanNa \SampleText}
+
+\end{document}