Hi,
Please look at the attached file. Why numbering starts from zero?
%%%%%%%%%%%%%
%-----------------------------lang-far.tex------------------------------------
\writestatus{loading}{Farsi Languages}
\unprotect
\setupheadtext [content=فهرست مطالب]
\setupheadtext [tables=ليست جداول]
\setupheadtext [figures=ليست تصاوير]
\setupheadtext [graphics=ليست اشکال]
\setupheadtext [index=نمايه]
\setupheadtext [abbreviations=اختصارات]
\setupheadtext [units=واحدها]
\setuplabeltext [table=جدول ]
\setuplabeltext [figure=شكل ]
\setuplabeltext [graphic=طرح ]
%D We don't set these here. One can do that in a style.
\setuplabeltext [chapter=فصل ] % Chapter
\setuplabeltext [section=بخش ]
\setuplabeltext [subsection=زيربخش ]
\setuplabeltext [subsubsection=زيرزيربخش ]
\setuplabeltext [subsubsubsection=زيرزيرزيربخش ]
\setuplabeltext [appendix=پيوست ] % Appendix
\setuplabeltext [part=قسمت ]
\setuplabeltext [line=خط ]
\setuplabeltext [lines=خطهاي ]
\setuplabeltext [january=ژانويه]
\setuplabeltext [february=فوريه]
\setuplabeltext [march=مارس]
\setuplabeltext [april=آوريل]
\setuplabeltext [may=مي]
\setuplabeltext [june=ژوئن]
\setuplabeltext [july=ژوييه]
\setuplabeltext [august=آگوست]
\setuplabeltext [september=سپتامبر]
\setuplabeltext [october=اکتبر]
\setuplabeltext [november=نوامبر]
\setuplabeltext [december=دسامبر]
\setuplabeltext [sunday=يکشنبه]
\setuplabeltext [monday=دوشنبه]
\setuplabeltext [tuesday=سهشنبه]
\setuplabeltext [wednesday=چهارشنبه]
\setuplabeltext [thursday=پنجشنبه]
\setuplabeltext [friday=جمعه]
\setuplabeltext [saturday=شنبه]
%D Rather new ...
\setuplabeltext [page=صفحه]
\setuplabeltext [atpage=در صفحهٔ ]
%\setuplabeltext [hencefore=كما وضحنا سابقا]
%\setuplabeltext [hereafter=كما نوضح لاحقا]
\setuplabeltext [see=نگاه کنيد به]
%D ... and to be completed!
\protect
\endinput
%-----------------------------end----------------------------
%-------------------------far-env.tex-----------------------------------
%This file is designed by Mehdi Omidali for easy typesetting farsi in Context
%File Versin:2008-7-20
\startenvironment far-env
\usemodule[lang-far]
\mainlanguage[arabic]
% Font setup
\definefontfeature
[arabic]
[mode=node,language=dflt,script=arab,
init=yes,medi=yes,fina=yes,isol=yes,
liga=yes,dlig=yes,rlig=yes,clig=yes,
mark=yes,mkmk=yes,kern=yes,curs=yes,futerfile=verbose.fea]
\starttypescript [serif] [arabic]
\definefontsynonym [Farsi-Light] [name:ScheherazadeRegOT.ttf]
[features=arabic]
\definefontsynonym [Farsi-Bold] [name:ScheherazadeRegOT.ttf]
[features=arabic]
\definefontsynonym [Farsi-Italic] [name:ScheherazadeRegOT.ttf]
[features=arabic]
\definefontsynonym [Farsi-Bold-Italic] [name:ScheherazadeRegOT.ttf]
[features=arabic]
\stoptypescript
\starttypescript [serif] [arabic] [name]
\usetypescript[serif][fallback]
\definefontsynonym [Serif] [Farsi-Light] [features=arabic]
\definefontsynonym [SerifItalic] [Farsi-Italic] [features=arabic]
\definefontsynonym [SerifBold] [Farsi-Bold] [features=arabic]
\definefontsynonym [SerifBoldItalic] [Farsi-Bold-Italic] [features=arabic]
\stoptypescript
\starttypescript [Farsi]
\definetypeface [Farsi] [rm] [serif] [arabic] [default]
\stoptypescript
\def\FarsiGlobalDir {\pagedir TRT\bodydir TRT\pardir TRT\textdir TRT}
\def\FarsiParDir {\textdir TRT\pardir TRT}
\def\FarsiTextDir {\textdir TRT}
\def\LatinParDir {\textdir TLT\pardir TLT}
\def\LatinTextDir {\textdir TLT}
\def\LatinGlobalDir {\pagedir TLT\bodydir TLT\pardir TLT\textdir TLT}
\define\setfarsi
{\FarsiGlobalDir%
\usetypescript[Farsi]%
\setupbodyfont[Farsi,18pt]}
\definestartstop
[farsipar]
[commands=\Farsi\FarsiParDir]
\define[1]\RT
{{\Farsi\FarsiTextDir#1}}
\define\setlatin
{\LatinGlobalDir%
\usetypescript[lm]%
\setupbodyfont[lm,18pt]}
\definestartstop
[latinpar]
[commands=\Farsi\LatinParDir]
\define[1]\LT
{{\LatinTextDir#1}}
\setuphead
[chapter]
[ page=yes,
before=\hairline\blank,
after=\nowhitespace\hairline,
header=nomarking,
textstyle=bold,
numberstyle=bold,
]
\setupheads[separator=\LT{--}]
\setuppagenumbering[conversion=persiannumerals]
\setupheadertexts[]%We put here because we want to define headertexts next.
%\setupheadertexts[][pagenumber]
\setupsection [chapter]
[conversion=persiannumerals]
\setupsection [section]
[conversion=persiannumerals]
\setupsection [subsection]
[conversion=persiannumerals]
\setupsection [subsubsection]
[conversion=persiannumerals]
\setupfootnotes
[conversion=persiannumerals]
\stopenvironment
---------------------------------------------end--------------------
% engine=luatex
\setupinteraction
[state=start,
title={راهنمای نگارش فارسی با کانتکست},
author={مهدی امیدعلی},
subtitle={حروفچینی بهوسیلهٔ لواتک},
keyword={فارسی لواتک كانتكست}]
\starttext
\environment far-env
\setfarsi
\startfrontmatter
\startstandardmakeup
\midaligned{راهنمای فارسی کانتکست}
\midaligned{نويسنده}
\midaligned{مهدی امیدعلی}
\stopstandardmakeup
\completecontent
\stopfrontmatter
\startbodymatter
\chapter{پیشگفتار}
\section[firstsection]{کانتکست چیست؟}\index{کانتکست}
این یک پانوشت است
\footnote{\LT{Numbers starts from zero}}
\subsection{روش نصب}
\in{ بخش}[firstsection]
\footnote{\LT{The reference number is not correct}}
\stopbodymatter
\completeindex
\stoptext
------------------------------------end--------------------------------
On 7/22/08, Aditya Mahajan
On Tue, 22 Jul 2008, Mehdi Omidali wrote:
Dear Idris, سلام you are right. I found that \setupheads[separator=something] works, but I found a mysterious bug. Whatever one declares as a separator, when you make a reference to the chapter, section, etc, lua writes the number with periods.compile the attached file and look at the reference.
Unfortunately, this is an old bug. Hans is planning to revamp the handling of sections and references in mkiv. So, hopefully this will be corrected soon.
If you really need this functionality now, there are ugly workarounds. I can post them when I get back to home computer.
Aditya