Debian Codegraph @

texmf-dist/doc/latex/reledmac/examples/2-reledmac-right-to-left.tex

raw
1 \documentclass{article}
2 \usepackage[osf,p,nomath]{libertinus}
3 \usepackage{microtype}
4 \usepackage[pdfusetitle,hidelinks]{hyperref}
5 \usepackage[noend,nofamiliar,noeledsec,series={A}]{reledmac}
6
7 \usepackage[bidi=default,english]{babel}
8 \babelprovide[import=he]{hebrew}
9 \babelfont{rm}{Libertinus Serif}
10 \babelfont[hebrew]{rm}{Ezra SIL}
11 \newcommand{\texthebrew}[2][]{\foreignlanguage{hebrew}{#2}}
12 \newcommand{\textenglish}[2][]{\foreignlanguage{english}{#2}}
13 \usepackage{metalogo}
14 \Xparafootsep{$||$\ }
15 \Xarrangement{paragraph}
16 \Xafterlemmaseparator{0.5em}
17 \Xbeforelemmaseparator{0.25em}
18
19 \linenumincrement{1}
20 \firstlinenum{1}
21
22 % Here the reledmac settings for RTL
23 \Xwrapcontent{\textenglish}
24 \Xbhookgroup{\textdir TRT}
25 \Xlemmaseparator{[}%Will be reversed by Ezra SIL font
26
27 \title{Editing right-to-left text}
28 \date{}
29 \begin{document}
30 \maketitle
31 \begin{abstract}
32 In this example, we use Lua\LaTeX.
33 After this introduction page, all the document will be in Hebrew, except some notes in English.
34 So the apparatus will be typeset right-to-left, except the comment, which will be typeset left-to-right.
35 \end{abstract}
36
37
38 \newpage
39 \selectlanguage{hebrew}
40
41 \beginnumbering
42
43
44 \pstart
45 \edtext{בְּרֵאשִׁ֖ית בָּרָ֣א}{\Afootnote{Some comment (1)}}
46 אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃
47 \edtext{וְהָאָ֗רֶץ הָיְתָ֥ה}{\Afootnote{Some comment (2)}}
48 \edtext{%
49 תֹ֨הוּ֙ וָבֹ֔הוּ וְחֹ֖שֶׁךְ עַל־פְּנֵ֣י תְהֹ֑ום וְר֣וּחַ אֱלֹהִ֔ים מְרַחֶ֖פֶת עַל־פְּנֵ֥י הַמָּֽיִם׃
50 וַיֹּ֥אמֶר אֱלֹהִ֖ים יְהִ֣י אֹ֑ור וַֽיְהִי־אֹֽור׃%
51 }{\Afootnote{Some comment on a long lemma (3)}}
52 וַיַּ֧רְא אֱלֹהִ֛ים אֶת־הָאֹ֖ור כִּי־טֹ֑וב וַיַּבְדֵּ֣ל אֱלֹהִ֔ים בֵּ֥ין הָאֹ֖ור וּבֵ֥ין הַחֹֽשֶׁךְ׃
53 \edtext{וַיִּקְרָ֨א אֱלֹהִ֤ים׀}{\Afootnote{Some comment (4)}}
54 לָאֹור֙ יֹ֔ום וְלַחֹ֖שֶׁךְ קָ֣רָא לָ֑יְלָה וַֽיְהִי־עֶ֥רֶב וַֽיְהִי־בֹ֖קֶר יֹ֥ום אֶחָֽד׃ פ
55 \edtext{וַיַּ֤רְא אֱלֹהִים֙}{\Afootnote{Some comment (5)}}
56 אֶת־כָּל־אֲשֶׁ֣ר עָשָׂ֔ה וְהִנֵּה־טֹ֖וב מְאֹ֑ד וַֽיְהִי־עֶ֥רֶב וַֽיְהִי־בֹ֖קֶר יֹ֥ום הַשִּׁשִּֽׁי׃ פ
57
58 \pend
59 \endnumbering
60
61 \end{document}