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