# Customize right to left list in context

How can I use margin and column options with right to left list (arabic language).

I have defined new enumeration ..., أ , ب for my right to left list, but if I add mergin or any other option for itemize environment I get a bullet instead of my defined label.

MWE

\setuppapersize[A4]
\mainlanguage[arabic]
\setupdirections[bidi=global]
\setupalign[r2l]

\definefontfeature
[arabic]
[mode=node,language=dflt,script=arab,
init=yes,medi=yes,fina=yes,isol=yes,
liga=yes,dlig=yes,rlig=yes,tlig=yes,
calt=yes,trep=yes,clig=yes,
mark=yes,mkmk=yes,kern=yes,curs=yes]

\starttypescript [serif] [arabic]
\definefontsynonym [Arabic] [name:Amiri] [features=arabic]
\stoptypescript

\starttypescript [serif] [arabic] [name]
\usetypescript[serif][fallback]
\definefontsynonym [Serif][Arabic][features=arabic]
\stoptypescript

\starttypescript [Arabic]
\definetypeface [Arabic] [rm] [serif] [arabic] [default]
\definetypeface [Arabic] [mm] [math]  [palatino] [default]
\stoptypescript

\setuplayout[
grid=min,
backspace=20mm, width=170mm,
topspace=10mm, height=275mm,
footerdistance=0.5mm
]

\setuppagenumbering[
state=none,
]

\setupbodyfont[Arabic,18pt]
\setupinterlinespace[line=30pt]

\def\arabiclabel#1%
{\ifcase#1 \or أ\or ب\or ج\or د\or ه\or
و\or ي\else
\expandafter\arabiclabel\expandafter{\the\numexpr#1-7\relax}\fi}

\defineconversion[s][\arabiclabel]

\starttext

\startitemize[s]
\item
كلمة
\item
كلمة
\item
كلمة
\stopitemize

\startitemize[s,margin=1em,columnn,three]
\item
كلمة
\item
كلمة
\item
كلمة
\stopitemize

\stoptext


Output

Note columns in right to left should be starting from right edge to the left edge

There are two ways one can set up the column versions of itemization in right-to-left environments. (This works in the beta, and I do not know about the stable version from TeXlive 2015. In any case, the beta will soon find its way in TeXlive 2016.)

The first approach is to change the behavior for all itemizations in your document, which is convenient in primarily right-to-left documents. Just put the following in your preamble.

\setupmixedcolumns[itemgroupcolumns][direction=reverse]


The second approach is to change the direction for individual itemizations. Here you had better be careful, as the other answer pointed out, that keywords and assignments should be separated. Look at the example below, using the second approach.

\setupalign[r2l]
\starttext
\startitemize[n,columns,three][direction=reverse]
\item One
\item Two
\item Three
\item Four
\item Five
\item Six
\item Seven
\stopitemize
\stoptext


In fact, there are two column itemizations in CONTEXT. One is the one you used, and the other is horizontal. Assuming two columns and more than two items, the first one places the second item on the second line, while the second method puts the second item on the first line after the first item. (This is useful, for instance, in certain multiple-choice questions.)

To use the horizontal method in right-to-left setting, try the following.

\startitemize[n,horizontal,two][direction=reverse]
\startitem One \stopitem
\startitem Two \stopitem
\startitem Three \stopitem
\startitem Four \stopitem
\stopitemize


One more point: In the current beta, you can use \abjadnumerals and \arabicnumerals (which produce the numbering you seem to like), in addition to the \arabicdecimals (and \persiandecimals) macros or corresponding keys that produce Indic numerals. A bunch of similar numbering methods are defined in core-con.mkiv.

There are two mistakes in your code:

1. The keyword is columns, not column;
2. you have to separate keywords and assignments (this one is a classic on the mailing list).

So, your second item group should start like this:

\startitemize [s,columns,three] [margin=1em]

• Thanks @Thomas , but how about direction of columns. in your answer, I obtain left to right columns but I would like right to left columns, first item should be on the right side of the page. – Salim Bou Feb 18 '16 at 13:32
• I'm sorry, but I have no idea; I don't know enough about right to left typesetting. – Thomas Feb 18 '16 at 14:02
• @salimbou The new columns mechanism (which is used by itemize) doesn’t support right to left columns (you should request this feature on the context mailing list) but you can use the old columns environment: \startcolumns[direction=left]\startitemize \item First \item Second \item Third \stopitemize \stopcolumns – Wolfgang Schuster Feb 21 '16 at 10:00