Changes

Jump to navigation Jump to search
3,167 bytes added ,  13:46, 28 April 2016
no edit summary
This can be used either as {{code|\LTR{some English text}}} for short pieces (for example, inside an RTL paragraph) or as a start/stop construct to produce LTR paragraphs.
 
=== Indic numerals ===
Arabic, Persian and Urdu documents typically use a different set of digits, called Indic; it's kind of ironic that the normal digits used in Latin languages are called Arabic! The ConTeXt beta has several number conversion methods to achieve this: {{code|persiandecimals}}, {{code|arabicdecimals}}. Note that these are different from {{code|persiannumerals}} and {{code|arabicnumerals}}. The naming of the latter is inspired from Roman numerals and the like, which use letters for displaying numbers.
 
To use these conversion methods, you should look for a {{code|conversion}} or {{code|numberconversion}} in the command of interest. Setting that to the above values would achieve the desired behavior. However, a few elements lack proper BiDi support; so it is best to place the above conversions inside a left-to-right block to guarantee correct number display.
 
For instance to get the page numbers using Indic digits, we can use the following.
 
<texcode>
\setuppagenumber[numberconversion=persiandecimals]
</texcode>
 
== Structural elements ==
=== Footnotes ===
One may has complex requirements for footnotes in a bidirectional documents, but there are two basic elements that most RTL documents ask for.
* The footnote text had better go through the BiDi algorithm because it may contain numbers or otherwise LTR material.
* Footnote rule should either default to the right-hand side or agree with the direction of the first footnote paragraph.
 
<texcode>
\setupfootnotes[rule=paragraph] % available in beta only; set it to right to have it always on the right.
\startsetups[bidi:footnotes]
\setupdirections[bidi=on]
\stopsetups
\setupnotes[footnote][setups=bidi:footnotes]
</texcode>
 
To change the numbers to Indic numerals (used in Arabic, Persian and Urdu documents), you can use the following.
 
<texcode>
\setupnotation[footnote][numberconversion=persiandecimals] % available in beta only
</texcode>
 
In general, footnotes originating in RTL paragraphs are typeset on the right and those within LTR text produce LTR footnotes. With the above change, both types end up with Indic digits. Some more work is to be done if these are not what you want.
 
=== Sectioning ===
To get the section numbers right as well as their directions both in the head and in the table of contents, I use the following setup.
 
<texcode>
\setuphead[part,chapter,section][conversion=LTRpersiandecimals,numberstyle=\righttoleft]
</texcode>
 
=== Itemize ===
 
Use {{code|persiandecimals}} or the other values to number itemizations.
 
<texcode>
\startitemize[persiandecimals]
\item First
\item Second
\stopitemize
</texcode>
 
The multi-column versions (using keys {{code|columns}} or {{code|horizontal}}) have a default left-to-right direction. To fix that, use either of the two solutions below. One sets is per {{cmd|startitemize}} while the other sets it globally.
 
<texcode>
\startitemize[columns,two][direction=reverse]
\item First
\item Second
\item Third
\item Fourth
\stopitemize
</texcode>
 
<texcode>
% The global solution
\setupmixedcolumns[itemgroupcolumns][direction=reverse]
</texcode>
 
=== Multi-column document ===
Similar to the above, we can pick right-to-left ordering for the columns.
 
<texcode>
\startcolumns[n=2,direction=left]
\input knuth
\stopcolumns
</texcode>
 
== TODO ==
Here are some of the things to be added:
* LTR paragraphs inside (mostly) RTL document.* Change numbers to Hindi numerals** Handling the LTR/RTL issues** Math mode Hindi digits* Footnotes: rule, bidi
* RTL tables
* RTL columns* Section/float numbersFloat numbering
* Enumerations
* Descriptions
* Margin notes
* Dates and time
* Indices and sorting
25

edits

Navigation menu