1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
|
\RequirePackage{filecontents}
%
% This file is public domain
%
\begin{filecontents*}{exporting-preamble.tex}
\documentclass[12pt]{article}
\usepackage[fullvoc,export=false]{arabluatex}
\SetArbEasy
\usepackage{csquotes}
\DeclareQuoteStyle{arabic}
{\textquotedblright}{\textquotedblleft}
{\textquoteright}{\textquoteleft}
% \renewcommand{\txarb}[1]{#1}
% \renewcommand{\txtrans}[1]{\emph{#1}}
% \newcommand{\aemph}[1]{#1}
% \renewcommand{\arbup}[1]{\textsuperscript{#1}}
\end{filecontents*}
\begin{filecontents*}{exporting-dajaja.tex}
\begin{arabexport}
\section*{Unicode Arabic}
\setquotestyle{arabic}
\begin{arab}
kAna \uc{'a}bU 'l-\uc{h}u_dayli 'ahd_A 'il_A
\uc{m}uwaysiN dajAjaTaN. wa-kAnat dajAjatu-hu 'llatI
'ahdA-hA dUna mA kAna yuttaxa_du
li-\uc{m}uwaysiN. wa-l_akinna-hu bi-karami-hi
wa-bi-.husni _hu\-luqi-hi 'a.zhara 'l-ta`ajjuba min
simani-hA wa-.tIbi la.hmi-hA. wa-kAna <\uc{'a}bU
'l-\uc{h}u_dayli> yu`rafu bi-'l-'imsAki
'l-^sadIdi. fa-qAla: \enquote{wa-kayfa ra'ayta yA
\uc{'a}bA \uc{`i}mrAna tilka 'l-dajA\-jaTa?} qAla:
\enquote{kAnat `ajabaN mina 'l-`ajabi!} fa-yaqUlu:
\enquote{wa-tadrI mA jinsu-hA? wa-tadrI mA sinnu-hA?
fa-'inna 'l-dajAjaTa 'inna-mA ta.tIbu bi-'l-jinsi
wa-'l-sinni. wa-tadrI bi-'ayyi ^say'iN kunnA
nusamminu-hA? wa-fI 'ayyi makAniN kunnA na`lifu-hA?}
fa-lA yazAlu fI h_a_dA wa-'l-'A_haru ya.d.haku .da.hkaN
na`rifu-hu na.hnu wa-lA ya`rifu-hu \uc{'a}bU
'l-\uc{h}u_dayli.
\end{arab}
\begin{arab}
wa-kAna \uc{'a}bU 'l-\uc{h}u_dayli 'aslama 'l-nAsi
.sadraN wa-'awsa`a-hum _huluqaN wa-'ashala-hum
suhUlaTaN. fa-'in _dakarUA dajAjaTaN, qAla:
\enquote{'ayna kAnat yA \uc{'a}bA \uc{`i}mrAna min
tilka 'l-dajA\-jaTi?} fa-'in _dakarUA ba.t.taTaN 'aw
`anAqaN 'aw jazUraN 'aw baqaraTaN, qAla:
\enquote{fa-'ayna kAnat h_a_dihi 'l-jazUru fI 'l-juzuri
min tilka 'l-dajAjaTi fI 'l-dajAji!} wa-'ini
istasmana \uc{'a}bU 'l-\uc{h}u_dayli ^say'aN mina
'l-.tayri wa-'l-bahA'imi, qAla: \enquote{lA wa-'l-l_ahi
wa-lA tilka 'l-dajAjaTu!} wa-'in _dakarUA `u_dUbaTa
'l-^sa.hmi, qAla: \enquote{`u_dUbaTu 'l-^sa.hmi fI
'l-baqari wa-'l-ba.t.ti wa-bu.tUni 'l-samaki
wa-'l-dajAji, wa-lA siyyamA _d_alika 'l-jinsu mina
'l-dajAji.} wa-'in _dakarUA mIlAda ^say'iN 'aw
qudUma 'insAniN, qAla: \enquote{kAna _d_alika ba`da 'an
'ahdaytu-hA la-ka bi-sanaTiN, wa-mA kAna bayna qudUmi
fulAniN wa-bayna 'l-ba`_taTi bi-tilka 'l-dajAjaTi
'illA yawmuN.} wa-kAnat ma_ta\-laN fI kulli ^say'iN
wa-tArI_haN fI kulli ^say'iN.
\end{arab}
\bigskip
\begin{arab}
\uc{al-jA.hi.zu}, \aemph{\uc{k}itAbu 'l-\uc{b}u_halA'i}
\end{arab}
\section*{Romanized Arabic}
\setquotestyle{english}
\begin{arab}[trans]
kAna \uc{'a}bU 'l-\uc{h}u_dayli 'ahd_A 'il_A
\uc{m}uwaysiN dajAjaTaN. wa-kAnat dajAjatu-hu 'llatI
'ahdA-hA dUna mA kAna yuttaxa_du
li-\uc{m}uwaysiN. wa-l_akinna-hu bi-karami-hi
wa-bi-.husni _hu\-luqi-hi 'a.zhara 'l-ta`ajjuba min
simani-hA wa-.tIbi la.hmi-hA. wa-kAna <\uc{'a}bU
'l-\uc{h}u_dayli> yu`rafu bi-'l-'imsAki
'l-^sadIdi. fa-qAla: \enquote{wa-kayfa ra'ayta yA
\uc{'a}bA \uc{`i}mrAna tilka 'l-dajA\-jaTa?} qAla:
\enquote{kAnat `ajabaN mina 'l-`ajabi!} fa-yaqUlu:
\enquote{wa-tadrI mA jinsu-hA? wa-tadrI mA sinnu-hA?
fa-'inna 'l-dajAjaTa 'inna-mA ta.tIbu bi-'l-jinsi
wa-'l-sinni. wa-tadrI bi-'ayyi ^say'iN kunnA
nusamminu-hA? wa-fI 'ayyi makAniN kunnA na`lifu-hA?}
fa-lA yazAlu fI h_a_dA wa-'l-'A_haru ya.d.haku .da.hkaN
na`rifu-hu na.hnu wa-lA ya`rifu-hu \uc{'a}bU
'l-\uc{h}u_dayli.
\end{arab}
\begin{arab}[trans]
wa-kAna \uc{'a}bU 'l-\uc{h}u_dayli 'aslama 'l-nAsi
.sadraN wa-'awsa`a-hum _huluqaN wa-'ashala-hum
suhUlaTaN. fa-'in _dakarUA dajAjaTaN, qAla:
\enquote{'ayna kAnat yA \uc{'a}bA \uc{`i}mrAna min
tilka 'l-dajA\-jaTi?} fa-'in _dakarUA ba.t.taTaN 'aw
`anAqaN 'aw jazUraN 'aw baqaraTaN, qAla:
\enquote{fa-'ayna kAnat h_a_dihi 'l-jazUru fI 'l-juzuri
min tilka 'l-dajAjaTi fI 'l-dajAji!} wa-'ini
istasmana \uc{'a}bU 'l-\uc{h}u_dayli ^say'aN mina
'l-.tayri wa-'l-bahA'imi, qAla: \enquote{lA wa-'l-l_ahi
wa-lA tilka 'l-dajAjaTu!} wa-'in _dakarUA `u_dUbaTa
'l-^sa.hmi, qAla: \enquote{`u_dUbaTu 'l-^sa.hmi fI
'l-baqari wa-'l-ba.t.ti wa-bu.tUni 'l-samaki
wa-'l-dajAji, wa-lA siyyamA _d_alika 'l-jinsu mina
'l-dajAji.} wa-'in _dakarUA mIlAda ^say'iN 'aw qudUma
'insAniN, qAla: \enquote{kAna _d_alika ba`da 'an
'ahdaytu-hA la-ka bi-sanaTiN, wa-mA kAna bayna qudUmi
fulAniN wa-bayna 'l-ba`_taTi bi-tilka 'l-dajAjaTi
'illA yawmuN.} wa-kAnat ma_ta\-laN fI kulli ^say'iN
wa-tArI_haN fI kulli ^say'iN.
\end{arab}
\bigskip
\begin{arab}[trans]
\uc{al-jA.hi.zu}, \aemph{\uc{k}itAbu 'l-\uc{b}u_halA'i}
\end{arab}
\end{arabexport}
\end{filecontents*}
\documentclass[12pt]{article}
\usepackage[fullvoc,export=false]{arabluatex}
\SetArbEasy
\usepackage{csquotes}
\DeclareQuoteStyle{arabic}
{\textquotedblright}{\textquotedblleft}
{\textquoteright}{\textquoteleft}
\PassOptionsToPackage{pdfa}{hyperref}
\usepackage{hyperxmp}
\usepackage{hyperref}
\hypersetup{colorlinks, linkcolor=blue, pdfauthor={Robert
Alessi}}
\title{\large Exporting Unicode Arabic to an external
.tex source file}
\author{}
\date{}
\usepackage{xcolor}
\usepackage[outputdir=TMP]{minted}
\definecolor{bg}{rgb}{0.95,0.95,0.95}
\usepackage{ccicons}
\usepackage{paralist}
% \renewcommand{\txarb}[1]{#1}
% \renewcommand{\txtrans}[1]{\emph{#1}}
% \renewcommand{\aemph}[1]{#1}
% \renewcommand{\arbup}[1]{\textsuperscript{#1}}
\begin{document}
\vspace*{-.5in}
\noindent
\textbf{\textsf{arabluatex sample file}} --- \cczero\ This
file is public domain
\begin{compactenum}
\item Copy the source code below, paste it into your
favorite tex editor and save it as
\verb|exporting.tex|.
\item In the preamble, set \verb|export=true| in
\textsf{arabluatex} global options (line 3).
\item Compile this file with Lua\LaTeX.
\item Open \verb|exporting_out.tex| and compile it again
with Lua\LaTeX.
\item Open \verb|exporting_out_out.tex|, then:
\begin{compactenum}
\item In the preamble, set \verb|export=false| in
\textsf{arabluatex} global options (line 3).
\item Compile this file and see the resulting
\verb|exporting_out_out.pdf|.
\end{compactenum}
\item Finally, uncomment in the preamble the four lines
that are just above \verb|\begin{document}|.
\item Open a terminal, then do:
\begin{verbatim}
pandoc exporting_out_out.tex -s -o exporting.odt
\end{verbatim}
and open the resulting \verb|exporting.odt| file with LibreOffice.
\end{compactenum}
\phantomsection
\section*{Source code}
\label{ref:source-begin}
\inputminted[firstnumber=last, bgcolor=bg]{latex}%
{TMP/exporting-preamble.tex}
\begin{minted}[bgcolor=bg]{latex}
\begin{document}
\end{minted}
\inputminted[firstnumber=last, bgcolor=bg]{latex}%
{TMP/exporting-dajaja.tex}
\begin{minted}[bgcolor=bg]{latex}
\end{document}
\end{minted}
\label{ref:source-end}
\end{document}
|