Changes

Jump to navigation Jump to search
465 bytes added ,  03:02, 18 August 2016
m
Persian \digits
\setupbodyfont[dejavu]
\starttext
$3+2=5 \quad \bf 3+2=5$\endgraf
\stoptext
</context>
<em>This works in the beta but not on the stable here.</em>
 
By (re)defining certain macros, we can use commands like {{cmd|digits}} to properly translate decimal points, thousand separators, etc. to their Arabic/Persian equivalents.
 
<texcode>
\def\digitsperiodsymbol{٫}
\digits{1.5}
</texcode>
== Structural elements ==
<em>The alignment of the second line is not right here but it works fine on my machine. Maybe the garden's CONTEXT version is old.</em>
Using {{code|1=alternative=left}} or {{code|1=alternative=right}} produces almost fine results in RTL but the placement of head text on the right-hand side adds some extra space. To avoid this, one can set {{code|1=width=fit}}. Using {{code|1=alternative=top}} places the head on the left-hand side even in RTL mode. This can be fixed via setting {{code|headalign}} (if the text is itself RTL).
In any case, the worst result comes from setting {{code|hang}} which places the hanging on the incorrect side (left for RTL) and pushes the head text into the margin on the correct side (right in RTL)!
\stopcolumns
</texcode>
 
<em>There is currently a bug that leads to incorrect section numbering inside RTL columns.</em>
=== Tables ===
CONTEXT has several mechanisms for typesetting tables: see [[Tables_Overview]]. Natural tables are the recommended construct, but they are somewhat verbose. It's easier for quick small tables to use the older macros adapted (and enhanced) from the TaBlE package. This is not actively developed, so we do not hope for new RTL features in particular.
Using them on their own leads ignores the paragraph direction and sets an LTR table. However, when wrapped in {{cmd|leftaligned}} or its friends, we get RTL/LTR tables depending on the paragraph direction.
<context source=yes mode=mkiv text="This produces:">
25

edits

Navigation menu