Re: [NTG-context] xml attribute conditional

2011-12-14 Thread Jon Crump
Hans,

Thanks for this. It's almost what I need. I truly appreciate the
effort, and it does give me some ideas about things to try.

However, if I change your example buffer slightly (for clarity) to this:


   
   arab  foo 
   arab  bar 
   
   
   english  eggs 
   english  ham 
   
   
note text ONE
note text TWO
   


your code runs and gives me this:

[div a]
arab [footnote1] arab [footnote2]
[div a]
[div b]
english [note1 eggs ] english [note2 ham ]
[div b]

1 foo
2 bar

but what I'm trying for is this:

[div a]
arab [ foo1 ] arab [ bar2 ]
[div a]
[div b]
english [ eggs1 ] english [ ham2 ]
[div b]

1 note text ONE
2 note text TWO
___
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] xml attribute conditional

2011-12-14 Thread Jon Crump
>> @xml:id==string.sub('#N020-18', 2) ->
>>     (ll.at and ll.at['xml:id'])==string.sub('#N020-18', 2) ! Missing
>> number, treated as zero.
>
>
> lua error with sub .. not sure what you want t o test here
>
> indeed an error will prevent the multipass file to be saved (feature)
>
>
> Hans

Thanks Hans, It's good to know the --result problem is not a bug, but
a feature. My problem then arises from my use of \note as opposed to
\footnote. In processing a  tag in the xml, I need to test if the
current ref node has an ancestor  with attribute:
@xml:id='apr_engl'. If it does, I need to create a \footnote whose
text comes from a  element with attribute xml:id='N020-18', if
it does not, I need to create a \note whose reference number
corresponds to the one created by \footnote and thus points to the
same footnote contents:


<...>
referenced text
<...>


<...>
referenced text
<...>

...
footnote contents

To result in:

arabic text (1)
english text (1)
(1) footnote content

Currently I'm getting:

arabic text ??
english text (1)
(1) footnote content

Document order problem maybe?

thanks,
Jon
___
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] xml attribute conditional

2011-12-13 Thread Jon Crump
Hans et alia,

Thanks for helping out with the right xpath expression. That was
indeed the problem: div elements in the ancestor axis that had no
xml:id attribute. Unfortunately, this doesn't solve my root problem.

I have a tei/xml marked up text with English and Arabic sections. For
each ref tag in the english section I want to place a \footnote. For
the corresponding ref in the Arabic section I want to place a \note
pointing to the same footnote as the corresponding English ref. The
minimal example appended below accomplishes this, but when I try to
apply this solution to my full text, this solution fails: I get ?? in
place of the references in the arabic, lua stats reports:

mkiv lua stats  > cross referencing - 56 identified, 56 unknown

and I get repeated errors of the following sort:

xml > lpath >  1 : ex :
@xml:id==string.sub('#N020-18', 2) ->
(ll.at and ll.at['xml:id'])==string.sub('#N020-18', 2) ! Missing
number, treated as zero.

which is where, I presume, the ?? references are coming from

minimal example follows (\environment ara-sty not included)

Any insights you may have would be gratefully received.

Jon

(PS I suspect that the multiple errors associated with this problem
are what's causing --result renaming to fail)

xml input:




 ين لنأخده  للغاية تعيس 
 ين لنأخده  شايلون شجوات 




 some english referenced 
text
 more english referenced 
text



text for note ONE
text for note TWO




context environment:
\startxmlsetups xml:lbsetups
\xmlsetsetup{#1}{*}{-}
\xmlsetsetup{#1}{body|text|div|p|lb|ref|note}{xml:*}
\xmlsetsetup{#1}{div[@type='enText']}{xml:div:entext}
\xmlsetsetup{#1}{div[@type='arText']}{xml:div:artext}
\xmlsetsetup{#1}{div[@type='fnotes']}{xml:div:fnotes}
\xmlsetsetup{#1}{ref}{xml:ref}
\xmlsetsetup{#1}{note}{xml:note}
\stopxmlsetups
\setupfootnotes[location=text]
\xmlregistersetup{xml:lbsetups}
\environment ara-sty
\def\Size{12pt}
\enabletrackers[xml.parse,xml.path]

\startxmlsetups xml:body
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:text
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:div:entext
\setlatin{\switchtobodyfont[palatino,\Size] \xmlflush{#1}}
\stopxmlsetups

\startxmlsetups xml:div:artext
\setarabic{\switchtobodyfont[Arabic] \xmlflush{#1}}
\stopxmlsetups

\startxmlsetups xml:div:fnotes
\placefootnotes
\stopxmlsetups

\startxmlsetups xml:ref
\xmlflush{#1}
\xmldoifelse{#1}{ancestor::div[@type='enText']}
{\footnote[\xmlatt{#1}{target}]
{\xmlfirst{#1}

{root::/body/text/div[@type='fnotes']/note[@xml:id==string.sub('\xmlatt{#1}{target}',2)]}
}
}
{\note[\xmlatt{#1}{target}]{}}  
\stopxmlsetups

\startxmlsetups xml:note
\xmlflush{#1}\endgraf
\stopxmlsetups


the ref tag setup that fails for my larger text looks like this:

\startxmlsetups xml:ref
\xmlflush{#1}
\xmldoifelse{#1}{ancestor::div[@xml:id and contains(@xml:id,
'apr_engl')]} %% this expression works
{\footnote[\xmlatt{#1}{target}]
{\xmlfirst{#1}

{root::/TEI/text/back/div[@xml:id=='notes']/note[@xml:id==string.sub('\xmlatt{#1}{target}',
2)]}
}
}

{
{\note[\xmlatt{#1}{target}]}{} %% argument to \note 
results in ??
instead of corresponding ref. number
}
\stopxmlsetups
___
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
___

[NTG-context] xml attribute conditional

2011-12-12 Thread Jon Crump
All,

I have a conditional expression that checks to see if the current node
has any ancestor whose xml:id attribute matches a string

\xmldoifelse{#1}{ancestor::div[@xml:id='apr_engl']}

What I need is a test to see if the current node has any ancestor
whose xml:id attribute _contains_ a substring. Something like this:

\xmldoifelse{#1}{ancestor::div[ @xml:id contains('_engl')]}

trying this:
\xmldoifelse{#1}{ancestor::div[ contains(@xml:id, '_engl')]}

got me this error:
! LuaTeX error :3: bad argument
#1 to 'contains' (string expected, got nil)

any suggestions?

Jon
___
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
___


[NTG-context] Bug report: --result switch fails in larger documents

2011-11-23 Thread Jon Crump
All,

Now that I've recovered my latest beta: context.mkiv 2011.11.14 16:17
(thanks Mojca, Hans) I can confirm that the bug still exists as
described:

On a short test file:
context --environment=arabtestI.tex --result=tmp arab-testII.xml

success:
mtx-context | result renamed to: tmp
system  | total runtime: 2.839

On a larger file of 54 pages
context --environment=svo-tei.tex --result=tmp svoboda_diary.xml

failure:
mtx-context | fatal error: return code: 1

tmp.pdf not created, but svoboda_diary.pdf is updated instead.

Regression error? List correspondence from March with subject '620
pages limit?' seems related. Correspondence ends with "Taco found the
bug (thanks!): There is a fix luatex rev. 4093."

Thoughts?
Jon
___
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] current version?

2011-11-23 Thread Jon Crump
Mojca,

Thanks very much. Tried again this morning with success.

Jon

On Wed, Nov 23, 2011 at 7:46 AM, Mojca Miklavec
 wrote:
> On Wed, Nov 23, 2011 at 00:37, Jon Crump  wrote:
>> Can anyone tell me how to get back to 2011.11.14 or to the latest version?
>
> Just try to fetch again.
>
> I need to fix a few scripts to make them more bullet proof against
> failures (Hans switched off rsync server and my scripts thought that
> beta has been removed from server).
>
> Mojca
> ___
___
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] Use ConTeXt standalone (was: current version?)

2011-11-23 Thread Jon Crump
All,

Thanks for responding, and for the link to gitorious. Hans and Mojca
appear to have fixed the rsync repo and I'm back to what appears to be
the current beta: 2011.11.22 16:49

Jon

On Wed, Nov 23, 2011 at 1:41 AM, Florian Wobbe  wrote:

>>> Can anyone tell me how to get back to 2011.11.14 or to the latest version?
>
> You'll either have to wait until Mojca or Hans fix the rsync archive, or you 
> pull the minimals from gitorious [2].
>
> Florian
>
> [1] http://www.pragma-ade.nl/download-1.htm
> [2] http://www.gitorious.org/context
>
___
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
___


[NTG-context] current version?

2011-11-22 Thread Jon Crump
Dear all,

Can someone help? By some incantation that I cannot now seem to
reproduce, I was able to obtain and install:
mtx-context | current version: 2011.11.14 16:17

In an attempt to update this version, I ran first-setup.sh found at
http://minimals.contextgarden.net/setup/first-setup.sh and what got
installed was:
mtx-context | current version: 2011.05.18 18:04

Can anyone tell me how to get back to 2011.11.14 or to the latest version?

Jon
___
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] regression? 620 pages limit? (SOLVED)?

2011-11-16 Thread Jon Crump
Damn and blast, pasted the wrong copy. for the successful run on the
short file I mentioned, the log reads:

mtx-context | result renamed to: tmp
system  | total runtime: 2.839

apologies,
Jon
___
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
___


[NTG-context] regression? 620 pages limit? (SOLVED)?

2011-11-16 Thread Jon Crump
Dear all

I appear to have run up against a bug discussed last March. I'm newly running:

mtx-context | main context file:
/Users/jjc/context11-11/tex/texmf-context/tex/context/base/context.mkiv
mtx-context | current version: 2011.11.14 16:17

with a short test file I run:

context --environment=arabtestI.tex --result=tmp arab-testII.xml

and the log concludes thus:

mtx-context | main context file:
/Users/jjc/context11-11/tex/texmf-context/tex/context/base/context.mkiv
mtx-context | current version: 2011.11.14 16:17

but when I try to do the same thing on my full marked up text:

context --environment=svo-tei.tex --result=tmp svoboda_diary.xml

the log concludes like this:

mtx-context | fatal error: return code: 1

I didn't notice this until I tried to use the --result flag because,
in spite of the 'fatal error', a new pdf (that actually reflected
changes I had made in the environment file) was in fact created using
the name of the xml input: svoboda_diary.pdf. But when I used
--result, a new pdf was created for the short file but not for the
long one. Wondering why, I inspected the log and only then noticed:
"mtx-context | fatal error: return code: 1"

In the error case the lua stats in the log shows:

mkiv lua stats  > result saved in file  - tmp.pdf

but no tmp.pdf file is produced. Instead, svoboda_diary.pdf is
updated; weird huh?

In the discussion on the list Steffan said "Taco found the bug
(thanks!): There is a fix luatex rev. 4093." So am I seeing a
regression error here or, as is perfectly possible since I'm out there
beyond the limits of my understanding, am I just doing something wrong
or using the wrong tool?

baffled as usual,
Jon
___
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
___


[NTG-context] marginal material in Arabic, tei/xml context mkiv

2011-06-03 Thread Jon Crump
All,

Pardon for trying to boost the topic, but I still can't seem to gain
control over marginal material in an Arabic section using the new
typo-mar.mkiv. I confess, it's quite likely that I'm just not getting
something obvious.

I've rotated the page to landscape to show where the marginal material
winds up when margin is [right]. When it's [left], it overwrites the
beginning of the Arabic line

If anyone has thoughts on this, I'd be grateful.

context environment file:
~
\startxmlsetups xml:teisetups
\xmlsetsetup{#1}{*}{-}
\xmlsetsetup{#1}{body}{xml:*}
\xmlsetsetup{#1}{div[@xml:id='arab']}{xml:div:arab}
\xmlsetsetup{#1}{div[@xml:id='engl']}{xml:div:engl}
\xmlsetsetup{#1}{lb}{xml:lb}
\stopxmlsetups

\setuppapersize[][A3,landscape]
\setuplayout[width=middle,textwidth=5in]
\xmlregistersetup{xml:teisetups}
\environment ara-sty

\startxmlsetups xml:body
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:lb
\MarText{\tfxx{xml linebreak numbers}}
\xmlflush{#1}
\stopxmlsetups

\definemargindata [MarText][right][color=red]

\startxmlsetups xml:div:arab
\setarabic{\switchtobodyfont[Arabic] \xmlflush{#1}}
\endgraf
\stopxmlsetups

\startxmlsetups xml:div:engl
\setlatin{\xmlflush{#1}}
\stopxmlsetups
~~~

XML source:
~~


  
فقد صممنا على السفر الى اورباو ممشانا من هنا سيكون
  
  
And so, we decided to travel to Europe. Our departure
from here will be
  

~~

ara-sty.tex setting up ScheherazadeRegOT:

\startenvironment ara-sty

\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]

\starttypescript [serif] [arabic]
 \definefontsynonym [Arabic-Light]   [name:ScheherazadeRegOT]
[features=arabic]
 \definefontsynonym [Arabic-Bold][name:ScheherazadeRegOT]
[features=arabic]
 \definefontsynonym [Arabic-Italic]  [name:ScheherazadeRegOT]
[features=arabic]
 \definefontsynonym [Arabic-Bold-Italic] [name:ScheherazadeRegOT]
[features=arabic]
\stoptypescript

\starttypescript [serif] [arabic] [name]
 \usetypescript[serif][fallback]
 \definefontsynonym [Serif]   [Arabic-Light]   [features=arabic]
 \definefontsynonym [SerifItalic] [Arabic-Italic]  [features=arabic]
 \definefontsynonym [SerifBold]   [Arabic-Bold][features=arabic]
 \definefontsynonym [SerifBoldItalic] [Arabic-Bold-Italic] [features=arabic]
\stoptypescript

\starttypescript [Arabic]
  \definetypeface [Arabic] [rm] [serif] [arabic] [default]
\stoptypescript

\def\ArabicGlobalDir {\pagedir TRT\bodydir TRT\pardir TRT\textdir TRT}
\def\ArabicParDir{\textdir TRT\pardir TRT}
\def\ArabicTextDir   {\textdir TRT}
\def\LatinParDir {\textdir TLT\pardir TLT}
\def\LatinTextDir{\textdir TLT}
\def\LatinGlobalDir  {\pagedir TLT\bodydir TLT\pardir TLT\textdir TLT}

\define\setarabic
  {\ArabicGlobalDir%
   \usetypescript[Arabic]%
   \setupbodyfont[Arabic,20pt]}

\definestartstop
  [arabicpar]
  [commands=\Arabic\ArabicParDir]

\define[1]\RT
  {{\Arabic\ArabicTextDir#1}}

\define\setlatin
  {\LatinGlobalDir%
   \usetypescript[lm]%
   \setupbodyfont[lm,20pt]}

\definestartstop
  [latinpar]
  [commands=\Arabic\LatinParDir]

\define[1]\LT
  {{\LatinTextDir#1}}

\setupdirections[bidi=local]


\stopenvironment
___
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
___

[NTG-context] line numbers in margin from xml in context mkiv

2011-05-27 Thread Jon Crump
Hans, et alia,

Thanks for mentioning typo-mar.mkiv. Once I found it, and figured out
what to do with it (put it in my texmf-local directory), it appears
to, as you say, "offer more control over margindata". My (rather
belated) thanks for offering this extended functionality, though my
grasp of context is still too fragile to really understand how to use
it.

typo-mar.mkiv appears to introduce a bug in my Arabic typesetting. In
my bilingual text, my margin data (pg/lb numbers) are placed correctly
in the margin of the English text, but the margins of the Arabic text
appear to be miscalculated and the margindata overwrites the
beginnings of the lines (or disappears beyond the edge if I set margin
'left'). My tyronic fooling around may certainly be at fault, but if
you could offer any observations on the following, I'd be grateful.

ConTeXt  ver: 2011.04.24 15:15 MKIV
My environment file is included below, stripped down as far as I could
to its essentials. I've attached the ara-style.tex file setting up
ScheherazadeRegOT; a stripped down example of my tei/xml source; and
the pdf output I'm getting. I hope I violate no convention of the list
in attaching these files, but in my naivete I'm not sure how much
information is too much.

\startxmlsetups xml:teisetups
       \xmlsetsetup{#1}{*}{-}
       \xmlsetsetup{#1}{body|p|pb|lb|}{xml:*}
       \xmlsetsetup{#1}{div[@xml:id='apr_arab']}{xml:div:arab}
       \xmlsetsetup{#1}{div[@xml:id='apr_engl']}{xml:div:engl}
               \xmlsetsetup{#1}{pb}{xml:pb}
               \xmlsetsetup{#1}{lb}{xml:lb}
\stopxmlsetups

\xmlregistersetup{xml:teisetups}
\environment ara-sty
\usetypescript[palatino]
\setupbodyfont[palatino,10pt]

\startxmlsetups xml:body
   \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:p
       \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:pb
   \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:lb
       \MarText{\tfxx{xml pb/lb numbers}}
       \xmlflush{#1}
\stopxmlsetups

\definemargindata [MarText][right][color=red]

\startxmlsetups xml:div:arab
       \setarabic{\switchtobodyfont[Arabic] \xmlflush{#1}}
\stopxmlsetups

\startxmlsetups xml:div:engl
       \setlatin{\switchtobodyfont[palatino, 12pt] \xmlflush{#1}}
\stopxmlsetups


On Wed, Apr 27, 2011 at 4:28 AM, Hans Hagen  wrote:
> On 27-4-2011 1:26, Jon Crump wrote:
>>
>> All,
>>
>> After being away from my project for a while I returned to find that
>> something that worked now no longer does. I updated the minimals on my
>> Mac and context is running as I would expect:
>>
>> jjc% context --version
>> mtx-context     | main context file:
>> /Users/jjc/context/tex/texmf-context/tex/context/base/context.mkiv
>> mtx-context     | current version: 2011.04.24 15:15
>>
>> But now, while running my environment.tex file against my target
>> TEI/xml file context complains:
>>
>> ! Undefined control sequence.
>> l.77 \defineinmargin
>>                      [lineNumbers] [normal]
>> ?
>
> see typo-mar.mkiv ... more control over margindata and new commands
>
> Hans
>
> -
>                                          Hans Hagen | PRAGMA ADE
>              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                             | www.pragma-pod.nl
> -
>


ara-sty.tex
Description: TeX document


  



فقد صممنا على السفر الى اورباو ممشانا من هنا سيكون 
نهار الاربعاء صباحاًاعني في ١٣ من هدا الشهر۔ فقد كرينا الدواب 
و تختروانورتبنا كل شيء و ما بقي سوى ان نضع بغدادورائنا ۔ 
من الايام الثلاثة الفاتت الى الآن جملة خطار عماليجون يودعونا 
و بالاخص الاهل جملة امراريجون عندنا ۔ فنسافر صحبة كرنل 
مكلر باليوزالانكليزي الذي معتمديروح الى لندرةفنأخذ درب 
البر اعني الى الدير و الشامو بيروتو من هناك الى القاهرةاذا 
سهل المولى ۔

  
  



And so, we decided to travel to Europe. Our departure from here will be 
on Wednesday morning, that is, on the 13th of this month. We have already hired the riding animals 
and a mule-litter and have arranged everything, nothing is left but to put Baghdad behind us. 
For the past three days till now, many visitors have come and are still coming to bid us goodbye, 
especially our family who are coming often to visit us. We are traveling in the company of the English Consul-General 
Colonel Mockler who has decided to go to London. Therefore, we shall take 
the land road that is to ad-Dayr, Damascus and Beirut, and thence to Cairo, 
God willing.

  



eng-arab-test.pdf
Description: Adobe PDF document
___

[NTG-context] line numbers in margin from xml in context mkiv

2011-04-26 Thread Jon Crump
All,

After being away from my project for a while I returned to find that
something that worked now no longer does. I updated the minimals on my
Mac and context is running as I would expect:

jjc% context --version
mtx-context | main context file:
/Users/jjc/context/tex/texmf-context/tex/context/base/context.mkiv
mtx-context | current version: 2011.04.24 15:15

But now, while running my environment.tex file against my target
TEI/xml file context complains:

! Undefined control sequence.
l.77 \defineinmargin
 [lineNumbers] [normal]
?

My own fragile understanding of what I'm doing may well be at fault,
but perhaps something relevant has changed with the minimals?

I had an environment file that I'd arrived at by much trial and error
that renders page/line numbers encoded in the xml/TEI source in the
margins of my pdf output:

\startxmlsetups xml:pb
\def\svopage{\xmlatt{#1}{n}.}
\xmlflush{#1}
\stopxmlsetups

\startluacode
 function filter(lb)
   if math.mod(lb,5) == 0 then
 context.svopage()
 context(lb)
   end
 end
\stopluacode

\define[1]\MyNumber%
 {\ctxlua{filter(#1)}\endgraf}

\startxmlsetups xml:lb
\xmldoifelse{#1}{ancestor::head[@type='diarytitle']}
{\\}
{\lineNumbers{\tfxx\MyNumber{\xmlatt{#1}{n
\xmlflush{#1}
\stopxmlsetups

\defineinmargin [lineNumbers] [normal]


Any suggestions would be gratefully received.
Jon
___
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] \note and \footnote

2010-12-23 Thread Jon Crump
On Thu, Dec 23, 2010 at 1:47 PM, Jon Crump  wrote:
> On Thu, Dec 23, 2010 at 1:41 PM, Thomas A. Schmitz
>  wrote:
>>
>> On Dec 23, 2010, at 10:34 PM, Jon Crump wrote:
>>
>>> mysterious: I tried that and got the same output; both for your version and 
>>> mine
>>
>> Here's mine. Are you using the same version?
>>
>> ConTeXt  ver: 2010.12.22 20:18 MKIV  fmt: 2010.12.23  int: english/english
>>
>
> Rats. That's just what I was trying to get. My version reports:
> ConTeXt  ver: 2010.12.10 15:15 MKIV  fmt: 2010.12.11  int: english/english
>
> So I guess I'll re-figure out how to update, and try again. Thanks for
> your efforts.
>
> Jon

Well that was relatively painless. Context now reports:
ConTeXt  ver: 2010.12.22 20:18 MKIV  fmt: 2010.12.23  int: english/english

And the doublefoot example now produces the expected results, Huzzah!

Many thanks Yury and Thomas.

Jon
___
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] \note and \footnote

2010-12-23 Thread Jon Crump
On Thu, Dec 23, 2010 at 1:41 PM, Thomas A. Schmitz
 wrote:
>
> On Dec 23, 2010, at 10:34 PM, Jon Crump wrote:
>
>> mysterious: I tried that and got the same output; both for your version and 
>> mine
>
> Here's mine. Are you using the same version?
>
> ConTeXt  ver: 2010.12.22 20:18 MKIV  fmt: 2010.12.23  int: english/english
>

Rats. That's just what I was trying to get. My version reports:
ConTeXt  ver: 2010.12.10 15:15 MKIV  fmt: 2010.12.11  int: english/english

So I guess I'll re-figure out how to update, and try again. Thanks for
your efforts.

Jon
___
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] \note and \footnote

2010-12-23 Thread Jon Crump
even more minimal, I tried running context on this:

\starttext

some text with footnote\footnote[f]{footnote text} \\

some text with reference\note[f]

\stoptext

and got the same phenomenon:

some text with footnote 1
some text with reference ??

Something about the \note[] mechanism I'm not getting?

Jon

On Thu, Dec 23, 2010 at 1:34 PM, Jon Crump  wrote:
> On Thu, Dec 23, 2010 at 1:20 PM, Thomas A. Schmitz
>  wrote:
>>
>> On Dec 23, 2010, at 10:17 PM, Jon Crump wrote:
>>
>>> My thought, ill-informed perhaps, was simply for clarity: to make it
>>> clear that I'm using the same value in both \note[] and \footnote[].
>>> In any case, sadly, using what you suggest still gets me the same
>>> result.
>>
>> I get correct output here. Try deleting the doublefoot.tuc file and 
>> rerunning ConTeXt.
>
> mysterious: I tried that and got the same output; both for your version and 
> mine
>
> attached .tex and .pdf
>
___
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] \note and \footnote

2010-12-23 Thread Jon Crump
On Thu, Dec 23, 2010 at 1:20 PM, Thomas A. Schmitz
 wrote:
>
> On Dec 23, 2010, at 10:17 PM, Jon Crump wrote:
>
>> My thought, ill-informed perhaps, was simply for clarity: to make it
>> clear that I'm using the same value in both \note[] and \footnote[].
>> In any case, sadly, using what you suggest still gets me the same
>> result.
>
> I get correct output here. Try deleting the doublefoot.tuc file and rerunning 
> ConTeXt.

mysterious: I tried that and got the same output; both for your version and mine

attached .tex and .pdf


doublefoot.pdf
Description: Adobe PDF document


doublefoot.tex
Description: TeX document
___
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] \note and \footnote

2010-12-23 Thread Jon Crump
On Thu, Dec 23, 2010 at 12:58 PM, Thomas A. Schmitz
 wrote:
>
> On Dec 23, 2010, at 9:47 PM, Jon Crump wrote:
>
>> Attached is a minimal working example, along with the pdf output I got 
>> running:
>> context --environment=doublefoot.tex doublefoot.xml
>
> Why do you use the intermediate step of creating a macro? I think this does 
> what you want:
>
>
> \startxmlsetups xml:ref
>        \xmldoifelse{#1}{parent::d...@type='arText']}
>                {\footnote[\xmlatt{#1}{target}]
>                        {\xmlfirst{#1}
>                                
> {root::/body/text/d...@type='fnotes']/no...@xml:id==string.sub('\xmlatt{#1}{target}',2)]}
>                        }
>                }
>                {\note[\xmlatt{#1}{target}]}
>        \xmlflush{#1}
> \stopxmlsetups
>
> Thomas

Thanks Thomas,

My thought, ill-informed perhaps, was simply for clarity: to make it
clear that I'm using the same value in both \note[] and \footnote[].
In any case, sadly, using what you suggest still gets me the same
result.

Jon
___
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] \note and \footnote

2010-12-23 Thread Jon Crump
On Thu, Dec 23, 2010 at 12:36 PM, Yury G. Kudryashov  wrote:

> I'm not sure about expansion order. Probably \thisRefName is not expanded in
> one of the commands above. Could you please attach either a minimal working
> example (test.xml and test.tex that one can save and run context test), or
> log file?
>

Thanks Yury,

Attached is a minimal working example, along with the pdf output I got running:
context --environment=doublefoot.tex doublefoot.xml

context --version reports:
MTXrun | current version: 2010.12.10 15:15


	
		
			 some arab text
			 more arab text
		
		
			 some english text
			 more english text
		
		
			text for note ONE
			text for note TWO
		
	




doublefoot.tex
Description: TeX document


doublefoot.pdf
Description: Adobe PDF document
___
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
___


[NTG-context] \note and \footnote

2010-12-23 Thread Jon Crump
All,

Something elementary, I'm sure, that I'm not understanding. I'm trying
to achieve parallel footnotes in arab/english texts, ie. each footnote
in the Arabic text has a corresponding footnote in the English text.
Both should point to the same footnote text. Like this:




 some arab text
 more arab text


 some english text
 more english text


text for note ONE
text for note TWO




I thought to use TeX's \note[ref], but the following doesn't seem to work.

\startxmlsetups xml:ref
\define\thisRefName{\xmlatt{#1}{target}}
\xmldoifelse{#1}{parent::d...@type='arText']}

{\footnote[\thisRefName]{\xmlfirst{#1}{root::/body/text/d...@type='fnotes']/no...@xml:id==string.sub('\xmlatt{#1}{target}',2)]}}}
{\note[\thisRefName]}
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:div:fnotes
\placefootnotes
\stopxmlsetups

I just get ?? for the reference markers in the English text. Any clues
as to what I'm doing wrong; or, is there a better way altogether to
approach this?

Jon
___
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] Marginal line numbers

2010-12-17 Thread Jon Crump
On Thu, Dec 16, 2010 at 1:34 PM, Wolfgang Schuster
 wrote:
>
> Am 16.12.2010 um 22:28 schrieb Jon Crump:
>
> In python-speak I'd interpret context.color() as a method call on a
> module 'context'. Could you, or anyone, direct me to any documentation
> for this module and a list of the properties and methods that it
> supports?
>
> http://pragma-ade.com/show-man-44.htm
> Wolfgang

Wolfgang, many thanks.
Jon
___
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] Marginal line numbers

2010-12-16 Thread Jon Crump
Thomas, et alia.

Thanks so very much! I now have this:

\startluacode
 function filter(s)
   if math.mod(s,5) == 0 then
 context.color( { "darkred" }, s )
   end
 end
\stopluacode

\define[1]\MyNumber%
 {\ctxlua{filter(#1)}\endgraf}

\startxmlsetups xml:lb
\lineNumbers{\MyNumber{\xmlatt{#1}{n}}}
\xmlflush{#1}
\stopxmlsetups

\defineinmargin [lineNumbers] [outer] [normal]

This gets me what I wanted.  Still fumbling greatly with the macro
syntax. I'm not sure what the recursion is for, for example. On the
other hand the lua seems rather straightforward to me by comparison. I
tried returning an empty string like this: context.color( {"blue"}, ''
) to remove the other numbers, but that seemed silly, so I just
removed the 'else' clause instead, and that seemed to work as well.

In python-speak I'd interpret context.color() as a method call on a
module 'context'. Could you, or anyone, direct me to any documentation
for this module and a list of the properties and methods that it
supports?

On Wed, Dec 15, 2010 at 11:34 PM, Thomas A. Schmitz
 wrote:

> This is easy with a lua function. Since you know python, I guess the 
> following example will be easy for you:
>
> \startluacode
>  function filter(s)
>    if math.mod(s,5) == 0 then
>      context.color( { "darkred" }, s )
>    else
>      context.color( { "darkblue" }, s )
>    end
>  end
> \stopluacode
>
> \define[1]\MyNumber%
>  {\ctxlua{filter(#1)}\endgraf}
>
> \starttext
>
> \dorecurse{25}{\MyNumber{\recurselevel}}
>
> \stoptext
>
> This should get you going, I hope
>
> Good luck
>
> Thomas
___
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
___


[NTG-context] Marginal line numbers

2010-12-14 Thread Jon Crump
All,

Thanks to Thomas's help, I've been making my way up the learning curve.

My TEI xml has empty lb elements indicating lines in the original and
corresponding lb elements in the translation. I'd like to be able to
set these numbers in the margin so that readers may coordinate the
lineation. So far I have this:

\startxmlsetups xml:lb
\lineNumbers{\xmlatt{#1}{n}}
\xmlflush{#1}
\stopxmlsetups

\defineinmargin [lineNumbers] [outer] [normal]

which works, but I'd like to be able to set only every fifth or tenth
line number. Is there a way to perform some arithmetic on the value of
the n attribute and then execute \lineNumbers accordingly?

for example:

if n%5 == 0 then \lineNumbers else ignore 

Thanks,
Jon
___
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] TEI - conTeXt

2010-12-11 Thread Jon Crump
On Fri, Dec 10, 2010 at 12:40 PM, Thomas Schmitz  wrote:

> processing an attribute with the 'xml:' namespace has been fixed by Hans
> very recently (last weekend), so if you haven't updated to the latest beta
> version, please do and try again; your syntax
> \xmlsetsetup{#1}{d...@xml:id='a']} is basically right.

I've done as you suggest and downloaded the minimals beta leaving the
TeX-live distribution behind, so I can be on the same page with you
all. Hans's fix has worked. I'm gratified that my intuition about how
@xml:id should work was not wrong. The example in my last message now
works as expected.

> Addressing content that has been set in xml anchors is possible, but not
> quite easy. I wouldn't have been able to figure it out without Hans. Just to
> show you an example: here's code that in my TEI document will fetch the
> content of a witness list:
>
> \xmlfirst{#1}{root::/TEI/text/front/d...@type=='sigla']/listWit/witne...@xml:id==string.sub('\xmlatt{#1}{wit}',2)]}
>

This looks sensible to me. I'll see if I can't make it work with my
document next week. Thanks ever so much. Is that string substitution
function a bit of Lua?

> Last point: I don't want to sound negative, but what you're attempting is
> not straightforward and certainly not easy stuff. I am currently planning on
> doing a long-term project on editing texts in this manner, and I'm quite
> optimistic that all problems can eventually be solved. But if you need
> short-term solutions, a perfectly typeset edition within a matter of weeks,
> this may not be possible right away. E.g., I don't think we really have a
> solid framework yet for a bilingual edition as you envisage it. It is
> possible, but not easy, Hans needs the time and many test cases to make the
> code work. There is a research group here in Germany (with public funding)
> who are currently working on xml printing of material of exactly this type.
> I can assure you that for the time being, there's nothing out there which
> comes even close to ConTeXt in this area, but we're still at the beginning.
> So: if you want to help and test and be part of this, you are more than
> welcome, but none of us has a magic bullet; this is work in progress, not
> drop-in solutions.

Thomas, I do not take it in a negative way; simply practical. I take
seriously both the principle and practice of open-source endeavors
like ConTeXt, and the scholarly work it can support. I hope and intend
that as I get up to speed, I'll be able to make some small
contribution, even if it's only posting the commented example of our
project on the wiki. I've done some programming in Python, and am
rather keen to learn something about Lua, as they have quite a bit in
common. It's unlikely I'll be able to make substantive contributions
to the code, but not impossible in the fullness of time. I'm mindful
of the generosity of all involved, and all on this list, and offer
great thanks and kudos.

Your cautionary note on the bilingual edition is taken to heart, and I
have recommended that for the time being our project will not try to
implement a facing page translation. This remains an important
desideratum for us however, and I will attend with great interest your
progress, and the insights of any engaged in similar efforts. The
specific use-case we have in mind, and the problems associated with it
may be of interest to others and I'll post it on the wiki.
___
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] TEI - conTeXt

2010-12-10 Thread Jon Crump
Thomas,

Thanks for responding. Yes, thanks to some help from Idris, Khaled, et
alia, I've got an ara-sty.tex environment file that sets up the
Scheherezade font and am getting very nice looking arabic text. I'm
now trying to get my arms around some basic elements of the conTeXt
system for dealing with xml.

Thanks to your TEI tutorial, I've got some good results for flushing
elements identified by tag name and by named attribute like this:

\xmlsetsetup{#1}{he...@type='chapter']}{xml:head:chapter}
\xmlsetsetup{#1}{p}{xml:p}

and the like. I'm now trying to figure out how to address elements in
the tei more precisely, like how to address the content nodes in the
, like ,  in order to use
their contents while setting elements like 
with a \footnote command (though we may, in fact, need to put these
elsewhere in an 'endnotes' section.).

I've sought in vain for the answers to simple questions like how to
address nodes identified by xml:id. In setting up a minimal example,
I've tried to do this:

with the xml:





foo


bar




set foo and not bar. This, for example, does not work:

\startxmlsetups xml:minimalsetups
\xmlsetsetup{#1}{*}{-}
\xmlsetsetup{#1}{body|text|div}{xml:*}
\xmlsetsetup{#1}{d...@xml:id='a']}{xml:div}
\stopxmlsetups

context complaining that xml:id='a' is not a valid lpath expression.
As you can see, I'm not getting some basic things about how to specify
and traverse the xml, much less applying the correct context commands
to get the content and formatting I need.

Another thing I'm going to need to do is to parse the text of certain
element attributes. For example, divs to be set in arabic are
distinguished from divs to be set in latin only by their xml:lang
attributes. I will need to be able to distinguish between ar-Arab,
en-Latn, and possibly also ar-Latn and more complex subtags like
"az-Arab-IR" as specified in
<http://www.rfc-editor.org/rfc/bcp/bcp47.txt>

Any clues you might care to offer, or examples that you know of, would
be gratefully received. I hesitate to attach the xml and tex files I'm
working with here, being unfamiliar with the protocols of the list,
but if it would help to see what I'm trying to work with, I could
certainly do that. More than this, I will certainly post on the wiki
some documentation and examples from this current project once I have
something to contribute that works. I'd like to extend your tutorial
for others who have TEI texts that they would like to typeset; indeed,
making public such documentation in their appropriate fora is part of
the remit of our project.

All at sea in Seattle,
Jon

On Fri, Dec 10, 2010 at 9:57 AM, Thomas Schmitz  wrote:
> On Thu, 9 Dec 2010 15:20:06 -0800
>  Jon Crump  wrote:
>>
>> All,
>>
>> More naive questions about xml and context. I'm finding this slow
>> going and documentation opaque or just thin on the ground.
>
> Before I try and help you with your question: you posted another problem on
> Nov 24 and got replies. Has this issue been solved?
>
>> More practical examples of TEI (or other xml texts)-> ConTeXt -> PDF
>> would sure come in handy.
>>
> You're more than welcome to contribute such examples. Remember, this is a
> volunteer effort.
>
> Thomas
___
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
___


[NTG-context] facing-page translation

2010-12-10 Thread Jon Crump
All,

More naive questions about xml and context. I'm finding this slow
going and documentation opaque, or just thin on the ground.

Posting as a separate question:

I've trawled through the documentation for help in typesetting TEI
marked-up documents as facing-page translations. What little I've
found there that I can understand is not encouraging. Does anyone know
of examples of XML -> ConTeXt -> PDF that could give me a clue as to
how this might be done?

thanks,
jon
___
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
___


[NTG-context] TEI - conTeXt

2010-12-10 Thread Jon Crump
All,

More naive questions about xml and context. I'm finding this slow
going and documentation opaque or just thin on the ground. I have XML
markup like this:

 reference term

where the reference text is in


reference text

I need to set this as an endnote reference. Can anyone give me a hint
as to how a context environment file should look to achieve this?

Thomas's excellent tutorial at http://wiki.contextgarden.net/TEI_xml
is a great help, but my grasp of the underlying protocols is fragile.
More practical examples of TEI (or other xml texts)-> ConTeXt -> PDF
would sure come in handy.

thanks,
jon
___
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] seeking 'hello world' example for Arabic typesetting with conTeXt

2010-11-29 Thread Jon Crump
Idris, Khaled, et alia,

Many, many thanks! Failing to find SimpleNaskhi.ttf anywhere, I
downloaded ScheherazadeRegOT.ttf from SIL. I have the font in the same
directory as my tei file apr.xml; along with my ara-sty.tex file
suitably edited with the font name for the \definefontsynonym
commands; and the environment file svo-tei.tex, in which I assert at
the top: \environment ara-sty, and call in a \startxmlsetups command
thus:

\startxmlsetups xml:div:month
\blank[line]\midaligned{\xmlatt{#1}{n}}\blank[medium]
\setarabic
\stopxmlsetups

Now, when I invoke context at the command-line:

context --environment=svo-tei.tex apr.xml

I'm finally seeing some Arabic text, and it's beautiful! It's a great
pity I don't actually read Arabic ;-(

It remains now to define my xmlsetups in such a way as to be able to
distinguish between the Arabic and Roman sections; my tei file is a
bit idiosyncratic, and I've much to do still in grasping the necessary
lpath expressions, but at last I'm making some progress! My heartfelt
thanks and profound admiration for all that you and your colleagues
have accomplished. I hope you'll not mind further simple-minded
questions down the road as I progress with this project.

Best,
Jon


2010/11/28 Idris Samawi Hamid ادريس   سماوي حامد :
> Hi Jon,
> Thankfully, with MkIV one [thankfully] no longer needs to concern oneself
> with metric files

Amen!

> NP, and that page needs updating anyway. For example, forget about
>
> \setcharactermirroring[1]
>
> and use
>
> \setupdirections[bidi=global] or
> \setupdirections[bidi=local]

not sure how to use these yet, but it's working.

> There is a simpler way to approach this, I'll try to post an example in the 
> coming days.

I'll look forward to any guidance for tyros that you may care to share

J
___
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
___


[NTG-context] seeking 'hello world' example for Arabic typesetting with conTeXt

2010-11-28 Thread Jon Crump
Dear all,

I'm gradually getting my head around using ConTeXt to typeset texts
marked up in TEI/XML. I'm trying to typeset an English/Arabic text and
I keep breaking my teeth on the Arabic. I'm trying to do what I can
with the macTeX 2010 distribution, but the documentation on the
conTeXt wiki has me confused. The amount I don't know about TeX is
truly daunting, but clearly there are some basic things about font
management that I don't understand.

I thought I had found a minimal example in
http://wiki.contextgarden.net/Arabic_and_Hebrew that I could use as a
starting point. After saving it locally as ara-sty.tex I tried to
typeset:

% engine=luatex
\environment ara-sty
\starttext
\setarabic

أهلا بالعالم!
\stoptext

a PDF was produced but it contained no text save for !. Among the
things that conTeXt told me was:

!define font: font with name arabtype is not found
!define font: unknown font arabtype, loading aborted
!define font: unable to define arabtype as \*Arabic20ptrmtf*

Where should I look for this font? Where is conTeXt looking for it? If
I were to find it, where should I put it? I gather that fonts on my
system can be used, but font metric files for them have to be
generated. How to do that?

Apologies for the unfocused tyro questions, but the TeX world has
become so much larger than it was when I last used it that I feel
quite at sea with all the available documentation.

thanks,
Jon
___
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
___


[NTG-context] TEI - conTeXt - pdf

2010-11-24 Thread Jon Crump
All,

Having abandoned apache's FOP, I've now been trying to get my arms
around XML typesetting with conTeXt with the help of Thomas's
excellent tutorial at http://wiki.contextgarden.net/TEI_xml. With some
difficulty I got the philostratus.xml/lorem ipsum example to work,
save for errors like this from the \definemargins command:

! You can't use `\dimexpr' in restricted horizontal mode.

(The marginal notations are typeset, but so are the distance arguments)

What I really need help with, however, is Arabic. Can anyone point me
to a 'hello world' example of how to typeset TEIxml in Arabic using
conTeXt? My TeX skills are very out of date and were never much to
begin with, and I'm having a devil of a time getting my head around
the welter of available documentation. I haven't even yet worked out
how to point context at suitable fonts, or how to invoke them in the
--environment .tex file.

[I'm using the MacTeX-2010 Distribution on OSX 10.5.8. It took me some
time do discover that I had to do:
$ luatools --generate
before I could run context at the command line thus:
$ context --environment=tei-style philostratus.xml]

Any hints, examples, or pointers to the relevant documentation would
be gratefully received.

Thanks,
Jon
___
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
___