From 4576aa220e2ea1934c068c1031666fb4bf887de3 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Mon, 16 Nov 2020 09:56:46 +0100 Subject: appended {} to \altrfont and neutralized it in arabluatex.uc() --- arabluatex.dtx | 23 +++++++++++++---------- arabluatex.lua | 9 +++++---- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/arabluatex.dtx b/arabluatex.dtx index 2972c0d..08f9be2 100644 --- a/arabluatex.dtx +++ b/arabluatex.dtx @@ -240,7 +240,6 @@ \usepackage{bookmark} \usepackage{authblk} \usepackage[scale=1.5]{ccicons} -\usepackage[lot]{multitoc} \usepackage{enumitem} \setlist{nosep} \setlist[itemize]{label=\textendash} @@ -287,6 +286,11 @@ {\marginpar{\hfill\emph{New feature} #1}}% \ignorespaces } +\usepackage{multicol} +\usepackage{tocloft} +\renewcommand\cftlotprehook{\begin{multicols}{2}} +\renewcommand\cftlotposthook{\end{multicols}} +\renewcommand\cftlottitlefont{\Large\bfseries} \usepackage{etoc} \etocsettocdepth{paragraph} \newcommand{\altableofcontents}{% @@ -307,18 +311,17 @@ \pdfbookmark[1]{Contents}{toc} \tableofcontents \endgroup} +\setlength\IndexMin{100pt} \EnableCrossrefs \RecordChanges \CodelineIndex \begin{document} \DocInput{arabluatex.dtx} - \printbibliography[heading=bibintoc] + \printbibliography[heading=bibnumbered] \phantomsection - \addcontentsline{toc}{section}{Change History} \PrintChanges \phantomsection - \addcontentsline{toc}{section}{Index} - \PrintIndex + \PrintIndex \end{document} % % \fi @@ -5095,16 +5098,16 @@ % it to suit our purpose: % \begin{macrocode} \AtBeginDocument{\ifdef{\LR}% - {\RenewDocumentCommand{\LR}{m}{\bgroup\textdir TLT\normalfont#1\egroup}} - {\NewDocumentCommand{\LR}{m}{\bgroup\textdir TLT\normalfont#1\egroup}}} + {\RenewDocumentCommand{\LR}{m}{\bgroup\textdir TLT\rmfamily#1\egroup}} + {\NewDocumentCommand{\LR}{m}{\bgroup\textdir TLT\rmfamily#1\egroup}}} % \end{macrocode} % \end{macro} % \begin{macro}{\RL} This one typesets its argument from right to % left. Same remark as above regarding the need of redefinition. % \begin{macrocode} \AtBeginDocument{\ifdef{\RL}% - {\RenewDocumentCommand{\RL}{m}{\bgroup\textdir TRT\normalfont#1\egroup}} - {\NewDocumentCommand{\RL}{m}{\bgroup\textdir TRT#1\normalfont\egroup}}} + {\RenewDocumentCommand{\RL}{m}{\bgroup\textdir TRT\rmfamily#1\egroup}} + {\NewDocumentCommand{\RL}{m}{\bgroup\textdir TRT#1\rmfamily\egroup}}} % \end{macrocode} % \end{macro} % \begin{macro}{\MkArbBreak} @@ -5242,7 +5245,7 @@ % font may also be selected with the font-selecting commands of the % \package{fontspec} package. % \begin{macrocode} -\def\al@trans@font{\normalfont}% +\def\al@trans@font{\rmfamily}% \NewDocumentCommand{\SetTranslitFont}{m}{\def\al@trans@font{#1}} % \end{macrocode} % \end{macro} diff --git a/arabluatex.lua b/arabluatex.lua index 8e97fa1..dec3649 100644 --- a/arabluatex.lua +++ b/arabluatex.lua @@ -625,7 +625,7 @@ local function transdmg(str, rules) for i = 1,#nulltr do inside = string.gsub(inside, nulltr[i].a, nulltr[i].b) end - return string.format("\\altrfont %s", inside) + return string.format("\\altrfont{}%s", inside) end) return str end @@ -663,7 +663,7 @@ local function transloc(str) for i = 1,#nulltr do inside = string.gsub(inside, nulltr[i].a, nulltr[i].b) end - return string.format("\\altrfont %s", inside) + return string.format("\\altrfont{}%s", inside) end) return str end @@ -698,7 +698,7 @@ local function transarabica(str) for i = 1,#nulltr do inside = string.gsub(inside, nulltr[i].a, nulltr[i].b) end - return string.format("\\altrfont %s", inside) + return string.format("\\altrfont{}%s", inside) end) return str end @@ -899,7 +899,7 @@ function arabluatex.closestream() local o = io.open(tex.jobname..utffilesuffix..".tex", "w") local t = f:read("*a") t = string.gsub(t, "\\arabicfont{}", "") - t = string.gsub(t, "\\altrfont%s+", "") + t = string.gsub(t, "\\altrfont{}", "") t = string.gsub(t, "\\par ", "\n\n") t = string.gsub(t, "(\\@al@ob)", "{") t = string.gsub(t, "(\\@al@cb@sp)", "} ") @@ -1139,6 +1139,7 @@ function arabluatex.uc(str) body = string.sub(body, 2, -2) return string.format("%s", body) end) + str = string.gsub(str, "\\altrfont%s?{}", "") str = string.gsub(str, "{", "\\@al@ob") str = string.gsub(str, "} ", "\\@al@cb@sp ") str = string.gsub(str, "}", "\\@al@cb") -- cgit v1.2.3