Re: [NTG-context] learning LuaTeX (was: Hans' presentation: using plain TEX (from TUG 2009) [apologies if OT])

2010-04-04 Thread Graham Douglas

Hello Patrick

who said...

>>Besides the gdb part, this is pretty much how I "learned" LuaTeX 
>>(still on my path). I suggest you stay with plain, then add features 
>>as you go along:


> * write your own font handler (see the bluewiki page) - LuaTeX 
>supports many different kinds of fonts

>* write your own kpathsea module (and thus replace kpathsea)
>* do a nodelist traversal and find out about the different node types
>* create a nodelist and write it out to TeX (node.write(...))
>* use tex.linebreak() for creating a paragraph.
...

Good to know that I'm not the only one going down the "simple"
path. My plans are indeed along the lines you indicate. I have the
utmost admiration and respect for the work that has gone into ConTeXt, a 
great piece of work. For now, I just need to get back to the "very 
basics" and a minimal installation of LuaTeX with plain seems to do that

nicely, for now.

>> If you understand german or use google translate, have a look at

>> http://www.luatex.de

Sadly, I do not read German, a real pity as there are some interesting
bits of code on there. Google Translate, here I come :-)

Warm regards and thanks again for your time to reply.

Cheers!

Graham

___
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] Hans' presentation: using plain TEX (from TUG 2009) [apologies if OT]

2010-04-03 Thread Graham Douglas

<>

Hi Hans

Thank you for your commnts. Oh, for sure, tinkering with
plain is just an interim step along the (long...) road. A very minimal 
"harness setup" to write minimal code --- to play with the various 
LuaTeX API functions via GNU's gdb debugger. By building a small test 
environment/playground from scratch, including compiling LuaTeX, and
hacking together a basic TDS, gives me a way to learn about stuff like 
kpathsea etc. Whether or not it's a good way to learn, the right stuff 
to learn, I'm not sure, but I have learnt a lot through trial + error 
and not a little frustration, at times... And it keeps me pleasantly

occupied with an absorbing and very low-cost hobby :-)

If there would be any interest, I'd be happy to write it up at some 
point if anyone would benefit --- but it'd need scrutiny from resident 
experts prior to publication: peer review :-)


Warm wishes

Graham


___
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] Hans' presentation: using plain TEX (from TUG 2009) [apologies if OT]

2010-04-03 Thread Graham Douglas

Dear Hans, Taco et al

I hope this is the appropriate place to ask my question
--- if not, my apologies.

I've compiled LuaTeX on Windows and have been using Hans'
presentation "using plain TEX" (from TUG 2009) to construct
a minimal working runtime environment based on plain tex.
Basically, a hand-coded texmf.cnf and a minimal (non-ConTeXt)
environment/TDS constructed around the "build" directory created by 
build.sh.


The reason for doing this is to start with a setup
which is the minimum possible, as a way to learn.
ConTeXt is very powerful and orders of magnitude more complex
than plain (obviously...) so I needed to strip that away, for now.

It seems to work well, so far.

My question relates to fonts. In the luatex-plain example:

\input plain
\directlua {tex.enableprimitives('', tex.extraprimitives())}
\pdfoutput=1
\everyjob \expandafter {%
\the\everyjob
\input luatex-basics\relax
\input luatex-fonts\relax
\input luatex-mplib\relax
}
\edef\fmtversion{\fmtversion+luatex}

===> luatex --ini luatex-plain.tex

You include some ConTeXt font machinery which I'd like
to experiment with using fonts I have in .afm/.pfb format only.

I ran

mtxrun --script font --names

to generate a font name database (luatex-fonts-names.lua)

 ["mappings"]={
  ["aharonibold"]={ "Aharoni Bold", "C:/Windows/fonts/ahronbd.ttf" },
  ["andalus"]={ "Andalus", "C:/Windows/fonts/andlso.ttf" },
  ["angsananew"]={ "Angsana New", "C:/Windows/fonts/angsa.ttf" },
  ["angsananewbold"]={ "Angsana New Bold", "C:/Windows/fonts/angsab.ttf"
<>

and copied it across to my plain tex texmf tree.

Works fine, PDF outputs perfectly, so it enables lots more fonts in the 
plain format. However, the database is clearly restricted to TrueType 
and OpenType fonts so my question is:


Does the font machinery included by:

\input luatex-basics\relax
\input luatex-fonts\relax
\input luatex-mplib\relax

provide support for afm/pfb fonts?

TrueType etc are OK like this:

\font\testf=[arialbolditalicmt] at 12pt

(name taken from database)

However, as soon as I try to use this with afm/pfb files
it fails, unable to find the metrics.

For example:

\font\testa=file:MinionRegularItalic_wt350_wd450_op10 at 34pt

It may be potentially bad names that I'm using with underscores
(they are all named like this Minion_wtX_wdY_opZ)

(X,Y,Z are values for weight, width and optical size)

But it also failed with simple font names.

I checked that the fonts can be found:

\directlua {
local found = 
kpse.find_file("MinionRegularItalic_wt350_wd450_op10","afm")

  tex.print("$$"..found.."$$")
local ifound = 
kpse.find_file("MinionRegularItalic_wt350_wd450_op10","type1 fonts")

tex.print("$$"..ifound.."$$")
}

($$ is a silly hack due to the _)

So, is it possible to find and load .afm/.pfb with your luatex-plain 
example. Is that font machinery included in luatex-plain?


If so, can you suggest why the luatex-plain example
might be failing with the .afm/.pfb files?

I would be very grateful for any insights you can provide.

Many, many thanks in advance.

And another busy day on the list!!!

Warm wishes

Graham












___
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] Typographical Engineering in Context

2010-04-03 Thread Graham Douglas

Idris Hamid wrote:

==
FYI: I am presently working on a book:

Typographical Ontology and Engineering:
Structured and Automated Authoring in Context

The basic outline is


I. Ontology and Theory
II. Typographical Engineering in Context [including special topics,
advanced techniques of luatex, opentype etc]
III. A Typographical Engineer's Reference [organization of options and
commands, glossary]
IV. Appendix: Authoring in Notepad++ [or some other tool]
V. Indices



I look forward to your feedback and suggestions!

Best wishes
Idris
===

Hello Idris

A chapter or appendix on the fundamentals of Unicode
A (big...) chapter on typesetting Arabic :-) would be great
--- I've been self-teaching/studying Arabic for a couple
of years, time permitting. I hope one day to use ConTeXt to
write-up my study notes --- especially the formal grammar
which is (need I say) vast!

It would be great to be able to document tools whereby you could
mark-up any Arabic word (noun, adjective verb etc) to show certain
parts in colour or add overbraces/underbraces etc. Colouring the glyphs 
or other ways of annotating the Arabic text to help your own documenting 
and understanding of the rules. I'm sure you know what I mean!!


Of course, it would be impractical to cover all possibilities
but the core task of accessing the node lists (and (maybe) by
attributes) to introduce special effects onto the Arabic glyphs.
Tools to access the vowelling --- e.g., colour the vowels
or add boxes around them etc --- purely for the purposes
of aiding understanding/memory etc.

Anything that could help students/learners of Arabic to write really 
well typeset notes, with the Arabic text "annotated" to highlight things 
that you want to really stress.


Especially if it is some tricky point of grammar and you want to really 
make sure you write a careful account of your hard-earned understanding 
so you don't forget next time!!!


Lots of node-list processing :-)

Warm regards

Graham

















___
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] The ConTeXt book

2010-04-03 Thread Graham Douglas

Taco wrote:
==
Over the past four years, it has been next to impossible to get people
interested in the reference manual project, not even for something as
simple as reading the rewritten chapters and telling me what they think
about it. Still, at the same time, complaints about the quality of the
documentation have been a constant recurrence on the mailing list.

I know the argument that beginners do not understand the source
well enough to write a manual themselves is valid. But it is equally
true that a person that *does* know the source enough to write the
manual is not the correct person to proofread it.

The near total lack of feedback had led me to believe that most
complainers are in it just for the complaining. This is extremely
demotivating, and so I have almost given up on doing documentation
at all. I mean, what's the point if nobody really cares? There are
many more interesting things to do in life than work for weeks on
end on revising chapters nobody appears willing to read anyway.

Best wishes,
Taco


Hi Taco

Just a few words of encouragement :-)

You can be assured that the reference manual is definitely not going
unused. In my current quest to learn LuaTeX I refer to it almost
daily. Just for the record, I work in scientific publishing but my 
interest in LuaTeX is purely and completely personal and not at all

related to my "day job".

I too would be willing to help "improve" the manual, especially to
help clarify issues which may be difficult for a beginner (like me!) to
understand. I have some ideas for additional material which could help 
to link or bridge a number of key topics/concepts in order to better 
understand the "architecture" of LuaTeX. Sort of "glue material".


You are absolutely right to say that, as the person writing the code, it 
is extremely difficult to be the one solely responsible for preparing 
the manual. Apart from anything, with such a pround and in-depth 
knowledge of the innards of TeX it must be extremely difficult for you 
to step back and take the perspective of someone who is just stating 
out. And, frankly, writing documentation of any sort can be pretty dull.
Furthermore, I think that we'd all benefit from you spending most of 
your time doing what you do best: cutting the code!


As someone very new to LuaTeX, I also want to thank you again for the
tremendous work you are doing.

Do please contact me by personal e-mail to discuss the above in more
detail, should you wish to do so.

Warm wishes

Graham









___
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] The ConTeXt book

2010-04-01 Thread Graham Douglas

>This is to inform you that's I've been commissioned by Hans and Taco
>to work on a manual for ConTeXt, under their supervision, during the
>next 12 months.  After the recent discussions about documentation on
>this list, they have agreed that the lack of a complete manual was
>getting more and more serious, and they have decided to fix this by
>delegating this task.

This is brilliant news! Perhaps additional funds to support this could
be raised by a Paypal donations account? Or, should the manual be 
"sufficiently stable" at some point to sell hard copies via digital

printing. Sure, we can all print the PDFs but I, for one, am buried
in piles of unwieldy printouts and prefer a proper bound copy, any day.
Printing large ConTeXt docs would be heavy duty work for most
home printers and use lots of ink, so bound hard copies would be quite 
an economic alternative, in my opinion.


Maybe it's my age but I really don't like reading copious amounts of 
documentation on screen, no matter how carefully the PDFs are designed.


A great piece of news indeed.

Warm regards

Graham

___
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] Compiling under Windows (Visual Studio 2008)

2010-03-25 Thread Graham Douglas

Hi

I hope this message is not too off topic but I thought I would
ask here first. I would very much like to (try...) to compile LuaTeX
using Microsoft Visual Studio 2008. But I'm not sure if this is likely 
to be enormously complex and maybe too difficult (for me, anyway).


Does the list know it is possible to build LuaTeX
under Microsoft Visual Studio 2008 --- if so, is this
possible from Taco's source distribution without having
to make substantial changes to anything.

One small thing I can confirm is that Lunatic Python can be quite easily
compiled to a Windows DLL to enable Python calls from Lua and hence
LuaTeX on Windows. LuaTeX's support for exteral modules now makes
it quite easy to do this.

I can confirm this seems to work, although I've
not really pushed it hard. The following very simple example does
work. Inspiration for doing this is due to the intersting article
by Luigi Scarso in the latest TUGBOAT.

Here's a simple example (far away from the complexities of Luigi's
work, but it shows the basic principle). This code is just quick hack
to get it up and running.

\directlua 0{
lib=package.loadlib('python.dll','luaopen_python')

lib()

pmw = python.globals()
p=python.import('Image')
im = p.open("c:\\logo.gif")
r,s,t=im.format, im.size, im.mode
tex.print(r,tostring(s),tostring(t))
sys = python.import("sys");
tex.print(tostring(sys.version_info))
}
\stoptext

Many thanks in advance to anyone who has time to share their
expertise and insight on a Windows build. Why build it? Just as a way to 
learn more about how it works, that's it really.


Warm wishes to all

Graham




___
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] More on Adobe Multiple Master fonts (not quite dead yet:-)

2010-03-21 Thread Graham Douglas

Hi, yes I read Idris' comment about that in his paper about
installing Minion Pro. For now I'd like to use this as an opportunity
to learn more about the font machinery in Context/LuaTeX... as part of
my journey towards minimal understanding and writing typescripts for 
this collection. Many years ago I paid quite a lot of money for these MM 
fonts so it would be great to get them all fully installed with Context. 
My idea is that with a very large range of weights, widths and optical 
sizes you could create some nice combinations plus be able to switch 
widths (say) for some glyphs, perhaps to fine-tune some parts of a 
typeset paragtaph.


Warm regards

Graham



___
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] More on Adobe Multiple Master fonts (not quite dead yet:-)

2010-03-21 Thread Graham Douglas

Dear Hans + Taco

I have a question about "Minion Expert" fonts. I do
have a copy of Idris's paper on this very topic but I'm not
sure if this is still the way to install fonts via MKIV/LuaTeX.
I'll give some background on what I'm doing, so my apologies to the
list for the long post.

[Note: happy to write this up in full for the Wiki at some point if of
more general interest]

I have been able to create hundreds of Minion instances and
(with the excption of "Expert") successfully install them in Context ---
works really very well. I have tested the PDF output with 500+ separate
instances embedded, all seem to work perfectly --- provided the mmpfb 
settings are right.


The resulting instances/fonts (.afm, .pfb) are output directly into the 
Context tree with names like


MinionRegularRoman_wt525_wd600_op20.[afm|pfb]

Generally the names are formed as follows:

Minion[Variety][Angle]_wt[num]_wd[num]_op[num]

Variety = one of Expert,Regular,Smallcaps
Angle = one of Roman,Italic

After refreshing the font lists/file name databases all instances
can all be accessed through commands like this

\definedfont[MinionRegularRoman_wt450_wd600_op10 at 12pt]

--- I intend to write a typescript to set them up
properly but these are early days for me with Context. I'm
hoping that the above font naming convention will allow me to
write a quite flexible set of typescripts... eventually.

The only one that does not work is the Expert font (no surprise I guess)

As mentioned, my scripts output the fonts directly
into the Context tree, for Regular,Smallcaps varieties
that's all I have to do. Wonderful!

So, to the "Expert" variety...

Clearly, this font has a "non standard" encoding vector which
is causing the problm (I guess). The AFM records

EncodingScheme FontSpecific

If I install instances like

MinionExpertRoman_wt350_wd450_op10.afm

then run the minimal example

\starttext
\definedfont[MinionExpertRoman_wt500_wd450_op10 at 12pt]
This is an interesting test. 1234567890. filling, fill. ABCDEF.
\stoptext

When I run this for the firt time I get

!load afm   : reading 
c:/Context/tex/texmf-context/fonts/afm/minion/MinionExpertRoman/MinionExpertRoman_wt500_wd450_op10.afm
!load afm   : unifying 
c:/Context/tex/texmf-context/fonts/afm/minion/MinionExpertRoman/MinionExpertRoman_wt500_wd450_op10.afm
!afm glyph  : assigning private slot U+F for unknown glyph name 
Acutesmall
!afm glyph  : assigning private slot U+F0001 for unknown glyph name 
nineoldstyle



The resulting PDF is blank, apart from the dot and commas
in the sample text "This is an interesting test. 1234567890. filling, 
fill. ABCDEF."


So, finally to my question: what additional work do I need to do
to fully integrate the Expert fonts to access some of the nice features
of these fonts?

Warm wishes

Graham
===

___
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] Adobe Multiple Master Fonts: support in LuaTeX?

2010-03-19 Thread Graham Douglas

Hi Taco

Totally understand that, many thanks for the clarification.

Back to mmafm, mmpfb :-)

Warm wishes

Graham

___
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] Using external libraries in LuaTeX

2010-03-19 Thread Graham Douglas

Hi Luigi

"Well if you are really interested then you should
join ntg + tug  now. My article --- as many others about luatex & mkiv 
--- is in the last number of TUGBOAT"


-- already made TUG membership application, plus made a donation to the 
LuaTeX fund.


Warm regards

Graham


___
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] Adobe Multiple Master Fonts: support in LuaTeX?

2010-03-19 Thread Graham Douglas

Hi All

A few (ie > 10) years ago I purchased the MinionMM and MyriadMM
Multiple Master typefaces from the long-defunct Adobe Type on Call.
I have the full set including the expert fonts. They were really quite
expensive so I would really like to find out if they are (or will be)
supported by LuaTeX. Having installed FontForge (FF) on my PC I note 
that FF certainly supports them. So, I was wondering if MM technolgy, 
even though it is kinda obsolete, is or will be supported?


For sure, you can certainly create individual instances via Akira's
port (thank you Akira) of the LCDF Typetools (specifically mmafm, mmpfb)

http://www.lcdf.org/type/index.html

I've tried this and the resulting PFB/AFM files definitely work
with Context --- even got my first very simple typescript to
work :-)

I would be very interested to know the current support, or planned
support, for being able to create "multiple master instances" on the 
fly. For sure, I appreciate that MM support may just not be worth the 
effort because the technology is "old" and few people are interested in 
this? Or it may be that it's too much work to create and then install 
instances on the fly.


But the fonts are nice... and cost a lot :-(

Warm regards

Graham





___
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] Using external libraries in LuaTeX

2010-03-19 Thread Graham Douglas



Hi Luigi

Great stuff, thank you. If you ever had time to write an
article which really explained the underlying programming
concepts you demonstrated in your slides I am sure you would find a lot
of people interested to read it. I think the ability to extend LuaTeX
via Lua libraries really is a powerful feature. With LuaTeX there is so
much going on, so many fascinating possibilities to explore, that it 
needs people like you, and other experts on this list, to "open the 
doors" to the rest of us, by showing the "big picture" and how it all 
really fits together. Leaving Taco + Hans to keep writing the goodies :-)


But, of course, articles etc take much time to write and
we all have busy day jobs etc.

Once again, many thanks.

Graham

___
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] Using external libraries in LuaTeX

2010-03-19 Thread Graham Douglas

> Why is this --- is this a catcode issue?

I need to read more
before asking stupid questions

Thanks Taco, much appreciated as always.

Warm regards

Graham

___
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] Using external libraries in LuaTeX

2010-03-18 Thread Graham Douglas

Hi Luigi

That is very cool work. At present, it is a bit beyond
my fuzzy skills, but I will dfinitely keep a copy of your
slides for future reference as I slowly get a bit
more familiar with LuaTeX etc.

Thanks for sharing that.

Warm wishes

Graham

___
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] Using external libraries in LuaTeX

2010-03-18 Thread Graham Douglas

<>

Taco wrote:
=

Here is a trivial example using LuaExpat:

\starttext
\startluacode
require "lxp";
text = 'hello world'
callbacks = { EndElement = false,
  StartElement = false,
  Default = function (p, s) tex.sprint(s) end }
p = lxp.new(callbacks)
\stopluacode

Some xml output: \directlua{p:parse(text)}!.

\directlua{p:close()}
\stoptext

=

Wonderful! Thanks Taco. Just for the record, for other Windows users,
to get this working I downloaded

luaexpat-1.1.win32-lua51.zip

from http://luaforge.net/projects/luaexpat/files

and from that I copied the following DLLs
(from luaexpat-1.1.win32-lua51.zip)

libexpat.dll
lxp.dll

into the following directory on my PC

C:\Context\tex\texmf-mswin\bin\lib\lua
(adapt to your ConText install)

One question, in the minimal example below, the XML text:

text = 'text  more text '

parses fine *if* on a single line. If I break the text onto multiple 
lines, eg


text = 'text 
 more text '

it fails with

! LuaTeX error :3: unfinished string near '' 
  text '.

} = lxp.new(callbacks)d

\dodostartluacode ...d \directlua \zerocount {#1}}

l.21 \stopluacode


Why is this --- is this a catcode issue?

Can you suggest a fix?

Once again, thank you, as always, for sharing your expertise.

Warm wishes

Graham



===
Minimal Example

\startluacode
require "lxp";
text = 'text  more text '
callbacks = {
StartElement = function (p, s)
tex.sprint("Starting element: " ..s)  
end,
EndElement = function (p, s)
tex.sprint("Finishing element: " ..s)
end,
CharacterData = function (p, s)
tex.sprint(s)
end
}
p = lxp.new(callbacks)
\stopluacode











___
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] Using external libraries in LuaTeX

2010-03-17 Thread Graham Douglas

Dear All

In a the recent Luatex 0.46.0 announcement

http://tug.org/pipermail/luatex/2009-November/001118.html

experimental support for loading external libraries was reported.

I am running Windows Vista with

ConTeXt  ver: 2010.03.12 19:49 MKIV  fmt: 2010.3.16  int: 
english/english with LuaTeX, Version beta-0.51.0-2010031309 (rev 3479)


I have also downloaded Lua 5.1 from http://luaforwindows.luaforge.net/
and so have Lua5.1.dll installed.

This distribution has a number of interesting extenal libraries
(ie DLLs) that I would like to try out with LuaTeX. If I can make 
progress I would be happy to document and write-up my experiments for 
posting on the Wiki in case they may be of interest to others. I should 
say that my coding skills are somewhat rusty as I've been away from 
programming/TeX for a few years... so do please excuse my "simplistic"

questions :-)

So, I was wondering if anyone has a minimal example they would be
kind enough to share, or can give me a few pointers/guidelines so that I 
can start experimenting. In particular, I'm interested to call external
libraries and inject the output from an external library into TeX for 
typesetting. For example, is it possible to load a library once, keep
it loaded and access the library functions from different commands 
during the TeX run?


In outline...

--- run some code to load the library (initialisation)
--- keeping the library available
--- some commands\definitions to accss library functions
eg \calltolibrary{)

--- make callsto library and pass the output into TeX for
typesetting

I would be very grateful for any guidance/help that can be offered.

Warm wishes to all

Graham



___
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] Working with Arabic

2010-03-08 Thread Graham Douglas

Just a short note to thank everyone for their various comments. I will
read some more and see how far I can get... and come back when I can 
formulate some more precise (better) questions. Am reading through the 
reference manual --- LuaTeX's versatility is quite incredible.


Warm regards to all.

Graham

___
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] Working with Arabic

2010-03-07 Thread Graham Douglas
Firstly, hello to all listmembers from a new member and first-time 
poster --- please excuse any accidental breach of list etiquette in my 
initial postings :-)


I would just like to start by saying a huge thank-you to Hans, Taco and
the LuaTeX team for producing this wonderful, facinating, piece of 
software. Thanks also to whoever wrote the rsynch-based installation of 
the ConTeXt minimals, it worked **beautifully** on my Windows Vista laptop.


I've come back to using TeX after a gap of a few years and I have to say 
that I am quite addicted to LuaTeX already. I have, in the recent past, 
programmed (mostly as a hobby) in C, Perl, PostScript etc --- so I am 
very keen to learn more about LuaTeX, and get to grips with it. There is 
much to learn, I am sure!


My personsal interest is to use LuaTeX as a tool in my (self-teaching)
studies of learning Arabic. Incidentally, that is how I discovered 
LuaTeX, through the videos of Idris' talks at the River-Valley site.


Specifically, I want to keep notes of my Arabic studies in a nice way, 
so LuaTeX looks perfect for that.


And so to my question. I would very much like to explore using (or 
writing (eventually...)???) commands that let me "format" Arabic words 
etc as part of my notes. I have not explored this yet, so I apologise if
this is already possible 'out of the box'. I just wanted to ask the 
experts here, before spending too much time exploring the wrong things!


For example, I would like to be able to use colour with certain glyphys 
in (any location) within Arabic words. For example \somecommand{Arabic 
text} where \somecommand{...} would (for example) put certain glyphs in 
colour --- particularly for grammar, where you are writing out verb 
tables, or dual/plural endings for adjectives/nouns etc.


In essence,  where do I need to start exploring to be able to write such 
things --- LuaTeX node processing, colour attributes etc??


Any pointers or guidance to help me start looking in the right place 
would be very welcome.


Warm wishes to all

Graham Douglas










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