aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arabluatex.dtx36
-rw-r--r--arabluatex.lua6
2 files changed, 40 insertions, 2 deletions
diff --git a/arabluatex.dtx b/arabluatex.dtx
index bdb5a99..94e13b5 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -216,7 +216,6 @@
216\DeclareTotalTCBox{\arabluabox}{m}{left=0mm, right=0mm, top=0mm, 216\DeclareTotalTCBox{\arabluabox}{m}{left=0mm, right=0mm, top=0mm,
217 bottom=0mm, colback=white, boxrule=.15mm, 217 bottom=0mm, colback=white, boxrule=.15mm,
218 colframe=red!50!white}{#1} 218 colframe=red!50!white}{#1}
219\usepackage{xcolor}
220\newcommand{\package}[1]{\textsf{#1}\index{#1=#1 (package)}} 219\newcommand{\package}[1]{\textsf{#1}\index{#1=#1 (package)}}
221\usepackage{csquotes} 220\usepackage{csquotes}
222\DeclareQuoteStyle{arabic} 221\DeclareQuoteStyle{arabic}
@@ -4156,6 +4155,41 @@ wa-ya.sIru ta.hta 'l-jild-i
4156% and \meta{suffix} the suffix appended to the file that is to be 4155% and \meta{suffix} the suffix appended to the file that is to be
4157% opened and compiled again. 4156% opened and compiled again.
4158% 4157%
4158% \subsection{Further processing of Unicode converted files}
4159% \label{sec:further-processing-utf-files}
4160% Unicode files can be further processed by document converters such
4161% as John McFarlane's |pandoc|\footnote{\url{http://pandoc.org/}}. To
4162% take here one example, here is how |file_out.tex| can be converted
4163% from \hologo{LuaLaTeX} into Open Document format (|.odt|):---%
4164% \iffalse
4165%<*example>
4166% \fi
4167\begin{arabluaverbatim}
4168 pandoc -s file_out.tex -o file_out.odt
4169\end{arabluaverbatim}
4170% \iffalse
4171%</example>
4172% \fi
4173%
4174% However, specific commands such as \cs{txarb} or \cs{txtrans}, which
4175% are not known to |pandoc|, must be redefined explicitly in the
4176% preamble to prevent the converter from gobbling their arguments,
4177% like so:---%
4178% \iffalse
4179%<*example>
4180% \fi
4181\begin{arabluaverbatim}
4182 % preamble (below the line that loads arabluatex)
4183 \usepackage{suffix}
4184 \renewcommand{\txarb}[1]{#1}
4185 \renewcommand{\txtrans}[1]{\emph{#1}}
4186 \WithSuffix\renewcommand*{\prname}[1]{#1}
4187 % &c
4188\end{arabluaverbatim}
4189% \iffalse
4190%</example>
4191% \fi
4192%
4159% \section{Future work} 4193% \section{Future work}
4160% \label{sec:future-work} 4194% \label{sec:future-work}
4161% A short, uncommented, list of what is planned in the versions of 4195% A short, uncommented, list of what is planned in the versions of
diff --git a/arabluatex.lua b/arabluatex.lua
index 8fc04d6..5b2d2e3 100644
--- a/arabluatex.lua
+++ b/arabluatex.lua
@@ -817,7 +817,11 @@ function al_closestream()
817 t = string.gsub(t, "(\\end%s?)(%b{})", "%1%2\n") 817 t = string.gsub(t, "(\\end%s?)(%b{})", "%1%2\n")
818 t = string.gsub(t, "([^\n]%s-)(\\end)%s?(%b{})", "%1\n%2%3") 818 t = string.gsub(t, "([^\n]%s-)(\\end)%s?(%b{})", "%1\n%2%3")
819 t = string.gsub(t, "\n\n\n", "\n\n") 819 t = string.gsub(t, "\n\n\n", "\n\n")
820 t = string.gsub(t, "(\\txarb%s?%{)(\\txarb%s?%b{})(%})", "%2") 820 t = string.gsub(t, "(\\txarb%s?%{)(\\txarb%s?)(%b{})(%})", "%1%3%4")
821 t = string.gsub(t, "(\\prname%s?%*%{)(\\txtrans%s?)(%b{})(%})", function(tagio, tagii, body, tagic)
822 body = string.sub(body, 2, -2)
823 return string.format("%s%s%s", tagio, body, tagic)
824 end)
821 if string.find(t, "\\begin%s?{document}.-\\arb%s?[%[%{]") or 825 if string.find(t, "\\begin%s?{document}.-\\arb%s?[%[%{]") or
822 string.find(t, "\\begin%s?{document}.-\\[Uu]c%s?%b{}") 826 string.find(t, "\\begin%s?{document}.-\\[Uu]c%s?%b{}")
823 then 827 then