From 8b10020879e9fe881d91aeff2c66b2670dfe25c7 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Sun, 26 Aug 2018 11:48:58 +0200 Subject: still documenting. remove \txtrans nested inside \prname* --- arabluatex.dtx | 36 +++++++++++++++++++++++++++++++++++- arabluatex.lua | 6 +++++- 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 @@ \DeclareTotalTCBox{\arabluabox}{m}{left=0mm, right=0mm, top=0mm, bottom=0mm, colback=white, boxrule=.15mm, colframe=red!50!white}{#1} -\usepackage{xcolor} \newcommand{\package}[1]{\textsf{#1}\index{#1=#1 (package)}} \usepackage{csquotes} \DeclareQuoteStyle{arabic} @@ -4156,6 +4155,41 @@ wa-ya.sIru ta.hta 'l-jild-i % and \meta{suffix} the suffix appended to the file that is to be % opened and compiled again. % +% \subsection{Further processing of Unicode converted files} +% \label{sec:further-processing-utf-files} +% Unicode files can be further processed by document converters such +% as John McFarlane's |pandoc|\footnote{\url{http://pandoc.org/}}. To +% take here one example, here is how |file_out.tex| can be converted +% from \hologo{LuaLaTeX} into Open Document format (|.odt|):---% +% \iffalse +%<*example> +% \fi +\begin{arabluaverbatim} + pandoc -s file_out.tex -o file_out.odt +\end{arabluaverbatim} +% \iffalse +% +% \fi +% +% However, specific commands such as \cs{txarb} or \cs{txtrans}, which +% are not known to |pandoc|, must be redefined explicitly in the +% preamble to prevent the converter from gobbling their arguments, +% like so:---% +% \iffalse +%<*example> +% \fi +\begin{arabluaverbatim} + % preamble (below the line that loads arabluatex) + \usepackage{suffix} + \renewcommand{\txarb}[1]{#1} + \renewcommand{\txtrans}[1]{\emph{#1}} + \WithSuffix\renewcommand*{\prname}[1]{#1} + % &c +\end{arabluaverbatim} +% \iffalse +% +% \fi +% % \section{Future work} % \label{sec:future-work} % 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() t = string.gsub(t, "(\\end%s?)(%b{})", "%1%2\n") t = string.gsub(t, "([^\n]%s-)(\\end)%s?(%b{})", "%1\n%2%3") t = string.gsub(t, "\n\n\n", "\n\n") - t = string.gsub(t, "(\\txarb%s?%{)(\\txarb%s?%b{})(%})", "%2") + t = string.gsub(t, "(\\txarb%s?%{)(\\txarb%s?)(%b{})(%})", "%1%3%4") + t = string.gsub(t, "(\\prname%s?%*%{)(\\txtrans%s?)(%b{})(%})", function(tagio, tagii, body, tagic) + body = string.sub(body, 2, -2) + return string.format("%s%s%s", tagio, body, tagic) + end) if string.find(t, "\\begin%s?{document}.-\\arb%s?[%[%{]") or string.find(t, "\\begin%s?{document}.-\\[Uu]c%s?%b{}") then -- cgit v1.2.3