Re: [NTG-context] \mainlanguage[pe]

2016-07-07 Thread Hans Hagen

On 7/7/2016 2:40 PM, Mohammad Hossein Bateni wrote:

While you're at it, could you also add something like jday, jmonth, jmm,
jyear, etc. to use the Jalali calendar instead of the Gregorian?  I see
that the—commented—conversion code exists in core-con.lua.  I am willing
to provide test cases for the conversion.


sure.

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] ppchTeX

2016-07-07 Thread Alan BRASLAU
On Wed, 6 Jul 2016 18:23:57 +0200
Henri Menke  wrote:

> Dear list,
> 
> I just wanted to check whether chemical structures typeset in ConTeXt
> can be exported as XML.  Therefore I wanted to setup a simple example
> with ppchTeX.  I copied example 3.1 from the manual [1]
> 
> > \usemodule[chemic]
> > \starttext
> > 
> > \startchemical[height=4500,bottom=2500]
> >   \bottext{$\beta$-D-Fructopyranose}
> >   \chemical[SIX,FRONT,BB1236,+SB4,-SB5,Z5][O]
> >   \chemical[SIX,FRONT,+R12346,+RZ12346][\SR{HO},H,H,H,OH]
> >   \chemical[SIX,FRONT,-R12346,-RZ12346][H,OH,\SR{HO},H,CH_2OH]
> > \stopchemical
> > 
> > \stoptext  
> 
> Unfortunately, typesetting with MkIV distributed with TL 2016 produces
> something really weird (see attached).
> 
> Is the module `chemic` compatible with MkIV or am I doing something
> wrong?
> 
> Cheers,
> Henri
> 
> [1] http://www.pragma-ade.nl/general/manuals/mp-ch-en.pdf


\usemodule[chemic] is MKII. It has been replace with core MKIV commands.

The syntax has been somewhat rationalized and many bugs corrected.

The example can be reproduced as follows:


\starttext

\startchemical [height=4500,bottom=2500]
  \bottext{$\beta$-D-Fructopyranose}
  \chemical[SIXFRONT,BB123,B4,+SB5,-SB6,Z6] [O]
  \chemical[+LR12345,LRZ12345] [OH,\SR{HO},H,H,H]
  \chemical[+RR12345,RRZ12345] [CH_2OH,H,\SL{OH},\SR{HO},H]
\stopchemical

\stoptext 



Unfortunately, the revised manual still has some errors that I need to
fix...

Alan
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] \mainlanguage[pe]

2016-07-07 Thread Wolfgang Schuster

Mohammad Hossein Bateni 
7. Juli 2016 um 16:31
Thanks, Wolfgang!

BTW why doesn't the following work?  it gives the 'missing number' error.

% \mainlanguage[en]
\romannumerals{\currentdate[day]}

1. The \currentdate command isn’t expandable and is therefore not 
expanded when you use it as argument for another command.


2. The \romannumerals commands expects a number as argument but 
\currentdate returns more than a simple number.


Wolfgang
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] \mainlanguage[pe]

2016-07-07 Thread Mohammad Hossein Bateni
Thanks, Wolfgang!

BTW why doesn't the following work?  it gives the 'missing number' error.

% \mainlanguage[en]
\romannumerals{\currentdate[day]}

On Thu, Jul 7, 2016 at 10:02 AM, Wolfgang Schuster <
schuster.wolfg...@gmail.com> wrote:

> Mohammad Hossein Bateni 
> 7. Juli 2016 um 10:53
> Wolfgang & Hans,
>
> In customizing the date, is there a way to use a number converter on day
> and year?  In particular, I'd like to apply persiandecimals conversion on
> them.
>
> You can only change the numbers for the day (see below, I used greek to
> demonstrate it) but it could be done better (e.g.
> \currentdate[persian->day,space,month,persian->month] with "->" as
> separator for the conversion and keyword).
>
> %% begin example
> \installlanguage[fa][state=start]
>
> \defineconversion[fa][day][α,β,γ,δ,ε,ζ,η,θ,ι,κ,λ,μ]
>
> \setupbodyfont[pagella]
>
> \starttext
>
> \currentdate[day]
>
> \language[fa]
>
> \currentdate[day]
>
> \stoptext
> %% end example
>
> (I have a similar question regarding \currentime.)
>
> Not possible at the moment.
>
> Wolfgang
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] \mainlanguage[pe]

2016-07-07 Thread Wolfgang Schuster

Mohammad Hossein Bateni 
7. Juli 2016 um 10:53
Wolfgang & Hans,

In customizing the date, is there a way to use a number converter on 
day and year?  In particular, I'd like to apply persiandecimals 
conversion on them.
You can only change the numbers for the day (see below, I used greek to 
demonstrate it) but it could be done better (e.g. 
\currentdate[persian->day,space,month,persian->month] with "->" as 
separator for the conversion and keyword).


%% begin example
\installlanguage[fa][state=start]

\defineconversion[fa][day][α,β,γ,δ,ε,ζ,η,θ,ι,κ,λ,μ]

\setupbodyfont[pagella]

\starttext

\currentdate[day]

\language[fa]

\currentdate[day]

\stoptext
%% end example

(I have a similar question regarding \currentime.)

Not possible at the moment.

Wolfgang
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] \mainlanguage[pe]

2016-07-07 Thread Mohammad Hossein Bateni
While you're at it, could you also add something like jday, jmonth, jmm,
jyear, etc. to use the Jalali calendar instead of the Gregorian?  I see
that the—commented—conversion code exists in core-con.lua.  I am willing to
provide test cases for the conversion.

Thanks!
—MHB

On Thu, Jul 7, 2016 at 4:53 AM, Mohammad Hossein Bateni 
wrote:

> Wolfgang & Hans,
>
> In customizing the date, is there a way to use a number converter on day
> and year?  In particular, I'd like to apply persiandecimals conversion on
> them.  (I have a similar question regarding \currentime.)
>
> Thanks!
> —Hossein
>
> On Wed, Jul 6, 2016 at 2:30 PM, Wolfgang Schuster <
> schuster.wolfg...@gmail.com> wrote:
>
>> Mohammad Hossein Bateni 
>> 6. Juli 2016 um 20:02
>> Hello,
>>
>> This was lost in the other thread, so I'm starting a fresh one dedicated
>> to the question.
>>
>> 1) \showinstalledlanguages does not show pe/persian/fa or anything like
>> that but it has several arabic variants.  was this dropped in MkIV or was
>> there never a persian language environment even in MkII?  I thought there
>> were translated labels for Farsi somewhere.
>> 2) In the following MWE, ad-hoc hyphenation using \- works and leads to
>> hyphenation.  However, specifying the pattern at the beginning does not
>> have any effect.  Am I missing something?
>>
>>
>> \usemodule[simplefonts]
>> \setmainfont[dejavusans][features=arabic,range=arabic]
>> \setupalign[r2l]
>> \showframe
>> \hyphenation{سازمان‌-دهی}
>>
>> \starttext
>>
>> %% The above pattern is not used here and the long word moves into the
>> margin.
>> \dorecurse{14}{سلام }
>> سازمان‌دهی
>> مناسب.
>>
>> %% It does work here, though.
>> \dorecurse{14}{سلام }
>> سازمان\-دهی
>> مناسب.
>>
>> \stoptext
>>
>>
>> How can one create a new language?  The languages manual
>>  suggests
>> that this is possible.  Does that mean I need to send the request to
>> Hans/Wolfgang to create the new entry or can one do so dynamically?  Beside
>> the issue of sorting in indices, etc.—which I will get to in due
>> time—having an entry for language pe/persian seems to be necessary to
>> *properly* use \setuplabeltext, etc.  Is that correct?
>>
>> You can create a new language (and synonyms for it) with the
>> \installlanguage command, below is a slightly modified version of the
>> arabic entry. You can change the values for leftquotation etc. and send the
>> result to Hans.
>>
>> % this goes into mult-sys.mkiv
>>
>> \definesystemconstant {persian} \definesystemconstant {fa}
>>
>> % this goes into lang-def.mkiv
>>
>> \installlanguage
>>   [\s!fa]
>>   [\c!spacing=\v!broad,
>>\c!leftsentence=\emdash,
>>\c!rightsentence=\emdash,
>>\c!leftsubsentence=\emdash,
>>\c!rightsubsentence=\emdash,
>>\c!leftquote=\upperleftsinglesixquote,
>>\c!rightquote=\upperrightsingleninequote,
>>\c!leftquotation=\upperleftdoublesixquote,
>>\c!rightquotation=\upperrightdoubleninequote,
>>\c!date={\v!day,\space,\v!month,\space,\v!year}]
>>
>> \installlanguage [\s!persian] [\s!fa]
>>
>> \installlanguage[\s!fa-ir][\c!default=\s!fa]
>>
>>
>> The default labels for the languages are stored in lang-txt.lua, you can
>> add entries for persian and send the modified file to Hans.
>>
>> Wolfgang
>>
>>
>> ___
>> If your question is of interest to others as well, please add an entry to
>> the Wiki!
>>
>> maillist : ntg-context@ntg.nl /
>> http://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
>> archive  : http://foundry.supelec.fr/projects/contextrev/
>> wiki : http://contextgarden.net
>>
>> ___
>>
>
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] \mainlanguage[pe]

2016-07-07 Thread Mohammad Hossein Bateni
Wolfgang & Hans,

In customizing the date, is there a way to use a number converter on day
and year?  In particular, I'd like to apply persiandecimals conversion on
them.  (I have a similar question regarding \currentime.)

Thanks!
—Hossein

On Wed, Jul 6, 2016 at 2:30 PM, Wolfgang Schuster <
schuster.wolfg...@gmail.com> wrote:

> Mohammad Hossein Bateni 
> 6. Juli 2016 um 20:02
> Hello,
>
> This was lost in the other thread, so I'm starting a fresh one dedicated
> to the question.
>
> 1) \showinstalledlanguages does not show pe/persian/fa or anything like
> that but it has several arabic variants.  was this dropped in MkIV or was
> there never a persian language environment even in MkII?  I thought there
> were translated labels for Farsi somewhere.
> 2) In the following MWE, ad-hoc hyphenation using \- works and leads to
> hyphenation.  However, specifying the pattern at the beginning does not
> have any effect.  Am I missing something?
>
>
> \usemodule[simplefonts]
> \setmainfont[dejavusans][features=arabic,range=arabic]
> \setupalign[r2l]
> \showframe
> \hyphenation{سازمان‌-دهی}
>
> \starttext
>
> %% The above pattern is not used here and the long word moves into the
> margin.
> \dorecurse{14}{سلام }
> سازمان‌دهی
> مناسب.
>
> %% It does work here, though.
> \dorecurse{14}{سلام }
> سازمان\-دهی
> مناسب.
>
> \stoptext
>
>
> How can one create a new language?  The languages manual
>  suggests
> that this is possible.  Does that mean I need to send the request to
> Hans/Wolfgang to create the new entry or can one do so dynamically?  Beside
> the issue of sorting in indices, etc.—which I will get to in due
> time—having an entry for language pe/persian seems to be necessary to
> *properly* use \setuplabeltext, etc.  Is that correct?
>
> You can create a new language (and synonyms for it) with the
> \installlanguage command, below is a slightly modified version of the
> arabic entry. You can change the values for leftquotation etc. and send the
> result to Hans.
>
> % this goes into mult-sys.mkiv
>
> \definesystemconstant {persian} \definesystemconstant {fa}
>
> % this goes into lang-def.mkiv
>
> \installlanguage
>   [\s!fa]
>   [\c!spacing=\v!broad,
>\c!leftsentence=\emdash,
>\c!rightsentence=\emdash,
>\c!leftsubsentence=\emdash,
>\c!rightsubsentence=\emdash,
>\c!leftquote=\upperleftsinglesixquote,
>\c!rightquote=\upperrightsingleninequote,
>\c!leftquotation=\upperleftdoublesixquote,
>\c!rightquotation=\upperrightdoubleninequote,
>\c!date={\v!day,\space,\v!month,\space,\v!year}]
>
> \installlanguage [\s!persian] [\s!fa]
>
> \installlanguage[\s!fa-ir][\c!default=\s!fa]
>
>
> The default labels for the languages are stored in lang-txt.lua, you can
> add entries for persian and send the modified file to Hans.
>
> Wolfgang
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___