Re: [NTG-context] overprinting

2009-09-13 Thread Peter Rolf
: http://contextgarden.net ___ \setupcolors[overprint=yes] \ifnum\contextmarkmode=4 \def\dostartoverprint% yes... one of the category 'asking for trouble' :D {\ctxlua{overprints.enabled=true}} \def\dostopoverprint

Re: [NTG-context] References in MKIV and bib module

2009-09-13 Thread Hans Hagen
: ok, revert ... (patch to criterum=here) \def\typesetpubslist {\dobeginoflist \the\initializebibdefinitions \edef\currentlist{pubs}% \doif{\listparameter\c!criterium}\v!cite{\setuplist[pubs][\c!criterium=\v!here]}% \ctxlua{bibtex.hacks.reset(\number\bibtexoncemode

Re: [NTG-context] References in MKIV and bib module

2009-09-13 Thread Thomas A. Schmitz
On Sep 13, 2009, at 9:34 PM, Hans Hagen wrote: ok, revert ... (patch to criterum=here) \def\typesetpubslist {\dobeginoflist \the\initializebibdefinitions \edef\currentlist{pubs}% \doif{\listparameter\c!criterium}\v!cite{\setuplist[pubs][\c! criterium=\v!here]}% \ctxlua

Re: [NTG-context] Errors on making lua documentation

2009-09-07 Thread luigi scarso
  {\setTABLEtail ##1\end } \expanded #1-\long \xdef \@@expanded   {\noexpand #1}\@@expanded l.1 \xmlsetup{26}{ldx:variable} \xmlflush #1-\ctxlua {lxml.flush(#1)} ... l.2 \xmlprocess{\xmldocument}{./x-mathml.lua}{} PS Wolfgang

Re: [NTG-context] Errors on making lua documentation

2009-09-04 Thread luigi scarso
{\noexpand #1}\@@expanded l.1 \xmlsetup{26}{ldx:variable} \xmlflush #1-\ctxlua {lxml.flush(#1)} ... l.2 \xmlprocess{\xmldocument}{./x-mathml.lua}{} PS Wolfgang, we may discuss about this in front a cup coffee .. -- luigi

Re: [NTG-context] metapost-pdf problem

2009-09-01 Thread Jean Magnan de Bornier
/rent.1} } \calculateexternalfigure ...xlua {figures.check()} \ctxlua {figures.include()... \dodoplaceexternalfigure ...[][#1][#2][#3][#4][#5] \popmacro

Re: [NTG-context] metapost-pdf problem

2009-09-01 Thread Peter Rolf
()} \ctxlua {figures.include()... \dodoplaceexternalfigure ...[][#1][#2][#3][#4][#5] \popmacro \textunderscore ... ... l.4 ? . Anyway the problem occurs also with mkii and pstopdf

[NTG-context] Document info an pdfboxes (mkiv)

2009-08-28 Thread Peter Rolf
858.8976] /TrimBox [ 0 0 612.28345061002 858.89763362975 ] /CropBox [ 0 0 612.28345061002 858.89763362975 ] 858.8976 858.89763362975 There is also a small bug in the document info code. \def\synchronizebackendidentity {\ctxlua{backends.codeinjections.setupidentity{ title= \!!bs\@@iatitle

Re: [NTG-context] Hyperlinks with MkIV

2009-08-18 Thread Hans Hagen
] is useful. \stoptext \def\dodospecialfrom[#1]% {\dontleavehmode\goto{\ctxlua{jobreferences.from(#1)}}[url(#1)]} - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt

Re: [NTG-context] Hyperlinks with MkIV

2009-08-18 Thread Khaled Hosny
://contextgarden.net][][Context garden] \starttext The \from[garden] is useful. \stoptext \def\dodospecialfrom[#1]% {\dontleavehmode\goto{\ctxlua{jobreferences.from(#1)}}[url(#1)]} This fixes it (needs luatex trunk though), thanks. -- Khaled Hosny Arabic localiser and member of Arabeyes.org

Re: [NTG-context] latest beta has trouble loading fonts on OS X

2009-08-14 Thread Taco Hoekwater
below to see that font name info it reports for that dfont file? \starttext \ctxlua { print( table.serialize( fontloader.info('/Library/Fonts/Baskerville.dfont')))} \stoptext Best wishes, Taco ___ If your

Re: [NTG-context] latest beta has trouble loading fonts on OS X

2009-08-14 Thread Wolfgang Schuster
Am 14.08.2009 um 17:28 schrieb Taco Hoekwater: That is a somewhat weird font name. Can you run the code below to see that font name info it reports for that dfont file? I get the same message with Optima, American Typewriter and Futura. \starttext \ctxlua { print( table.serialize

[NTG-context] lpeg substitution

2009-08-11 Thread Thomas A. Schmitz
do local replace = { A = X, B = X, } local dosub = (lpeg.Cs(1)) / replace local subs = (dosub)^0 function test (string) tex.sprint(lpeg.match(subs,string)) end end \stopluacode \def\Substitute#1{\ctxlua{test(#1)}} \starttext \Substitute

Re: [NTG-context] lpeg substitution

2009-08-11 Thread Hans Hagen
= (dosub)^0 function test (string) tex.sprint(lpeg.match(subs,string)) end \stopluacode \def\Substitute#1{\ctxlua{test(#1)}} \starttext \Substitute{thomas ABC whatever} \stoptext and yes, it's slow; the next variant is faster but takes a bit more memory (neglectable compared

Re: [NTG-context] writestatus not flushing

2009-08-05 Thread Taco Hoekwater
to be empty to. Is there a better solution? The likeliest cause of loops is still the tex macro expansion, so I would suggest \tracingall. If that doesn't help, try \ctxlua{print('') instead of \writestatus. Best wishes, Taco

Re: [NTG-context] pretty C with MKIV

2009-07-07 Thread Aditya Mahajan
no time for it right now. starting point : mtxrun --run vim full:2context.vim inside a context run you can use resolvers.resolve(full:2context.vim) or just resolvers.find_file(2context.vim,other text file) so using: \ctxlua{os.execute()} should be doable Thanks, this seems

Re: [NTG-context] pretty C with MKIV

2009-07-07 Thread Hans Hagen
point : mtxrun --run vim full:2context.vim inside a context run you can use resolvers.resolve(full:2context.vim) or just resolvers.find_file(2context.vim,other text file) so using: \ctxlua{os.execute()} should be doable

Re: [NTG-context] How to Determine the Current File Name and Line Number AND PAGE NUMBER in the ConTeXt Source?

2009-07-03 Thread Taco Hoekwater
Mojca Miklavec wrote: Line Number I don't know of any way, but TeX sometimes complains on errors and outputs the line number along. There is \inputlineno in TeX, so \the\inputlineno or the lua equivalent \ctxlua{tex.inputlineno} will work. Best wishes, Taco

Re: [NTG-context] How to Determine the Current File Name and Line Number AND PAGE NUMBER in the ConTeXt Source?

2009-07-03 Thread luigi scarso
On Fri, Jul 3, 2009 at 8:56 AM, Taco Hoekwater t...@elvenkind.com wrote: Mojca Miklavec wrote: Line Number I don't know of any way, but TeX sometimes complains on errors and outputs the line number along. There is \inputlineno in TeX, so \the\inputlineno or the lua equivalent \ctxlua

Re: [NTG-context] How to Determine the Current File Name and Line Number AND PAGE NUMBER in the ConTeXt Source?

2009-07-03 Thread Taco Hoekwater
along. There is \inputlineno in TeX, so \the\inputlineno or the lua equivalent \ctxlua{tex.inputlineno} will work. The problem is exactly locate the error in source . Sometimes the errorline of the log are in someway imprecise , ie. the errors is (are) around here . Yeah

Re: [NTG-context] How to Determine the Current File Name and Line Number AND PAGE NUMBER in the ConTeXt Source?

2009-07-03 Thread luigi scarso
way, but TeX sometimes complains on errors and outputs the line number along. There is \inputlineno in TeX, so \the\inputlineno or the lua equivalent \ctxlua{tex.inputlineno} will work. The problem is exactly locate the error in source . Sometimes the errorline

[NTG-context] How to Determine the Current File Name and Line Number in the ConTeXt Source?

2009-07-01 Thread Tad Ashlock
Is there a convenient way within a Lua block to determine the current file name and line number of the source file being processed by ConTeXt? For example: (test.tex) - \def\ShowLineNumber{% \ctxlua{print('current line number:', tex.current_line_number

Re: [NTG-context] How to Determine the Current File Name and Line Number in the ConTeXt Source?

2009-07-01 Thread Hans Hagen
Tad Ashlock wrote: Is there a convenient way within a Lua block to determine the current file name and line number of the source file being processed by ConTeXt? For example: (test.tex) - \def\ShowLineNumber{% \ctxlua{print('current line number

Re: [NTG-context] [PATCH] Add begin_of_buffer and end_of_buffer hooks for lua pretty printers

2009-06-15 Thread Matthijs Kooijman
+161,13 @@ \def\doprocessbufferverbatim {\doinitializeverbatim - \ctxlua{buffers.type(\currentbuffer)}} + \ctxlua{buffers.typebuffer(\currentbuffer)}} \def\doprocessbufferlinesverbatim#1#2#3% {#2% % todo, set up numbers \doinitializeverbatim - \ctxlua{buffers.type(\currentbuffer

Re: [NTG-context] Multiple letters

2009-05-10 Thread Wolfgang Schuster
][stopfilecontents]} \def\stopfilecontents {\doifmode{mkiv}{\savebuffer[\filename]\ctxlua{file.copy(\jobname- \filename.tmp,\filename.\f!temporaryextension)}}% \endgroup} \ifx\savebuffer\undefined \def\savebuffer[#1] {\ctxlua{buffers.save(#1)}} \fi \protect \startfilecontents[data.dat] Madam

Re: [NTG-context] Multiple letters

2009-05-10 Thread Otared Kavian
\extension \dostartbuffer[\filename][startfilecontents][stopfilecontents]} \def\stopfilecontents {\doifmode{mkiv}{\savebuffer[\filename]\ctxlua{file.copy(\jobname- \filename.tmp,\filename.\f!temporaryextension)}}% \endgroup} \ifx\savebuffer\undefined \def\savebuffer[#1] {\ctxlua{buffers.save(#1

Re: [NTG-context] \savebuffer disappeared

2009-05-09 Thread Arthur Reutenauer
can always use the original definition: \def\savebuffer{\dosingleempty\dosavebuffer} \def\dosavebuffer[#1]{\ctxlua{buffers.save(#1)}} Arthur ___ If your question is of interest to others

Re: [NTG-context] \doiffontfeature

2009-05-07 Thread Wolfgang Schuster
f = f and f.otfdata f = f and f.luatex f = f and f.features commands.doifelse(f and (f.gpos[name] or f.gsub[name])) end \stopluacode \def\doifelsecurrentfonthasfeature#1% {\ctxlua{commands.doifelsecurrentfonthasfeature(#1)}} \doifelsecurrentfonthasfeature{smcp}{YES

Re: [NTG-context] How can I compare picture variables in metapost?

2009-05-05 Thread Aditya Mahajan
function third.show_circles(n,x,y,r) local tprint = function(s) tex.sprint(tex.ctxcatcodes,s) end local list = third.fill_circles(n,x,y,r) tprint(\\startMPcode) for i,v in pairs(list) do third.toMP(v, 1cm) end tprint(\\stopMPcode) end \stopluacode \def\drawCircles{\ctxlua

Re: [NTG-context] Numerals in mkiv

2009-04-18 Thread Hans Hagen
define the commands ... maybe we need: \def\abjadnumerals #1{\ctxlua{converters.abjadnumerals(\number#1)}} \def\abjadnodotnumerals#1{\ctxlua{converters.abjadnodotnumerals(\number#1)}} \def\abjadnaivenumerals#1{\ctxlua{converters.abjadnumerals(\number#1)}} \defineconversion [arabicnumerals

Re: [NTG-context] Numerals in mkiv

2009-04-18 Thread Otared Kavian
is ... how do we define the commands ... maybe we need: \def\abjadnumerals #1{\ctxlua{converters.abjadnumerals(\number#1)}} \def \abjadnodotnumerals #1{\ctxlua{converters.abjadnodotnumerals(\number#1)}} \def \abjadnaivenumerals#1{\ctxlua{converters.abjadnumerals(\number#1

Re: [NTG-context] Bib module in mkiv

2009-04-17 Thread Wolfgang Schuster
\at.\to\filename \aftersplitstring #1\at.\to\extension \let\f!temporaryextension\extension \dostartbuffer[\filename][startfilecontents][stopfilecontents]} \def\stopfilecontents {\doifmode{mkiv}{\savebuffer[\filename]\ctxlua{file.copy(\jobname- \filename.tmp,\filename.\f

Re: [NTG-context] new beta

2009-04-13 Thread Thomas A. Schmitz
: attempt to call field 'loadtexfile' (a nil value) stack traceback: ...ntal/tex/texmf-context/tex/context/base/lxml-ini.lua:342: in function 'load' ...ntal/tex/texmf-context/tex/context/base/lxml-ini.lua:353: in function 'load' main ctx instance:1: in main chunk. \xmlload #1#2-\ctxlua

Re: [NTG-context] new beta

2009-04-10 Thread Yanrui Li
...text/tex/texmf-context/tex/context/base/luat-sto.lua:58: attempt to call method 'gmatch' (a nil value) stack traceback: ...text/tex/texmf-context/tex/context/base/luat-sto.lua:58: in function 'dump' main ctx instance:1: in main chunk. inserted text ...on \fi \ctxlua {storage.dump

Re: [NTG-context] new beta

2009-04-10 Thread Longmin Wang
: in main chunk. inserted text ...on \fi \ctxlua {storage.dump()} \ctxlua {nodes.cleanup_res... \dump -\the \everydump \normaldump l.343 \protect \errorstopmode \dump \endinput ? It may be caused

[NTG-context] math problems in last beta (cont-en and cont-xp)

2009-03-23 Thread Lutz Haseloff
Hi Hans, hi Taco, hi all, testing math with the latest ConTeXt beta i found some problems. My test file is: \usetypescriptfile[type-buy] \def\currentfontname {\ctxlua{tex.print(font.getfont(font.current()).fullname)}} \starttext \startbuffer[mathbuffer] \currentfontname $a^2 + b^2 = c^2$ $E

Re: [NTG-context] math problems in last beta (cont-en and cont-xp)

2009-03-23 Thread Aditya Mahajan
On Mon, 23 Mar 2009, Lutz Haseloff wrote: Hi Hans, hi Taco, hi all, testing math with the latest ConTeXt beta i found some problems. My test file is: \usetypescriptfile[type-buy] \def\currentfontname {\ctxlua{tex.print(font.getfont(font.current()).fullname)}} \starttext \startbuffer

Re: [NTG-context] pinyin in context

2009-03-17 Thread Bill Long
= string.gsub(str,a4,à) tex.sprint(tex.ctxcatcodes,str) end \stopluacode \def\pinyin#1{\ctxlua{commands.pinyin([[#1]])}} \starttext \definedfont[name:arialunicodems*default] \pinyin{ni2hao3} \pinyin{huai4} \stoptext

Re: [NTG-context] pinyin in context

2009-03-16 Thread Bill Long
) / commands.convertpinyin local parser = (pinyin)^0 function commands.pinyin(str) parser:match(str) end \stopluacode \def\pinyin#1{\ctxlua{commands.pinyin([[#1]])}} \starttext \pinyin{ni2hao3} \pinyin{huai4} \stoptext Wolfgang

Re: [NTG-context] pinyin in context

2009-03-16 Thread Wolfgang Schuster
= string.gsub(str,a4,à) tex.sprint(tex.ctxcatcodes,str) end \stopluacode \def\pinyin#1{\ctxlua{commands.pinyin([[#1]])}} \starttext \definedfont[name:arialunicodems*default] \pinyin{ni2hao3} \pinyin{huai4} \stoptext

Re: [NTG-context] pinyin in context

2009-03-15 Thread Wolfgang Schuster
,text) end local letter = lpeg.R(az) local number = lpeg.R(09) local pinyin = lpeg.C(letter^1) * lpeg.C(number^0) / commands.convertpinyin local parser = (pinyin)^0 function commands.pinyin(str) parser:match(str) end \stopluacode \def\pinyin#1{\ctxlua{commands.pinyin([[#1]])}} \starttext

Re: [NTG-context] Command show in Metapost/Metafun

2009-03-12 Thread Hans Hagen
-mpgraph.log. \ctxlua{metapost.showlog = true} - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74

Re: [NTG-context] Command show in Metapost/Metafun

2009-03-12 Thread Aditya Mahajan
On Thu, 12 Mar 2009, Hans Hagen wrote: \ctxlua{metapost.showlog = true} Can you make this default? Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg

Re: [NTG-context] Simplified input for natural tables

2009-03-12 Thread Wolfgang Schuster
) tex.sprint(tex.ctxcatcodes,\\stopTABLE) end \stopluacode \def\startwikitable {\bgroup \obeylines \dostartwikitable} \long\def\dostartwikitable#1\stopwikitable {\ctxlua{commands.wiki_to_table([[\detokenize{#1}]])}% \egroup} \starttext \startwikitable ^ Heading 1 ^ Heading 2

Re: [NTG-context] Simplified input for natural tables

2009-03-08 Thread Hans Hagen
\stopluacode \def\startwikitable {\bgroup \obeylines \dostartwikitable} \long\def\dostartwikitable#1\stopwikitable {\ctxlua{commands.wiki_to_table([[\detokenize{#1}]])}% \egroup} \startwikitable ^ Heading 1 ^ Heading 2 ^ | Item 1| Item 2 | | Item 3| Item 4 | \stopwikitable

Re: [NTG-context] Simplified input for natural tables

2009-03-08 Thread John Devereux
) tex.sprint(tex.ctxcatcodes,\\stopTABLE) end \stopluacode \def\startwikitable {\bgroup \obeylines \dostartwikitable} \long\def\dostartwikitable#1\stopwikitable {\ctxlua{commands.wiki_to_table([[\detokenize{#1}]])}% \egroup} \startwikitable ^ Heading 1 ^ Heading 2

[NTG-context] the other blog (chemical stuff)

2009-03-06 Thread Hans Hagen
commands.molecule(string) parser:match(string) end \stopluacode \def\molecule#1{\ctxlua{commands.molecule(#1)}} \molecule{H_2SO_4^-2} \molecule{H_2SO_4^{-2}} \molecule{H_2SO_4^{-2{x}}} Hans

Re: [NTG-context] Taco's \molecule fails in mkiv

2009-02-23 Thread Wolfgang Schuster
) end \stopluacode \def\molecule#1{\ctxlua{thirddata.molecule('#1')}} \starttext \molecule{H_2SO_4} \molecule{H_2^+} \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry

Re: [NTG-context] Taco's \molecule fails in mkiv

2009-02-23 Thread luigi scarso
(text) text = string.gsub(text,_,\\low) text = string.gsub(text,%^,\\high) tex.sprint(text) end \stopluacode \def\molecule#1{\ctxlua{thirddata.molecule('#1')}} hmm Isn't better to remember original \molecule ? I mean, something like \let\ORIGINALmolecule\molecule \def\molecule#1

Re: [NTG-context] Serializing nodes

2009-02-03 Thread Hans Hagen
\setbox100=\vbox{Hi} \ctxlua{io.savedata('vbox.hi',nodes.serializebox(100,true, true))} Box reuse:\blank \box100 \blank \ctxlua{initt=loadfile('vbox.hi');initt();tex.box[100] = nodes.FromTableToNodeButItnotExists(t)} %%actually an empty box, of course \box100 \stoptext I was not able to find a table2node

Re: [NTG-context] Serializing nodes

2009-02-03 Thread luigi scarso
and loading node lists can come in handy as soon we are going to use external applications to process node lists./p --ldx]]-- . \starttext \setbox100=\vbox{Hi} \ctxlua{io.savedata('vbox.hi',nodes.serializebox(100,true, true))} Box reuse:\blank \box100 \blank \ctxlua{initt=loadfile

Re: [NTG-context] Serializing nodes

2009-02-03 Thread Hans Hagen
. Also, saving and loading node lists can come in handy as soon we are going to use external applications to process node lists./p --ldx]]-- . \starttext \setbox100=\vbox{Hi} \ctxlua{io.savedata('vbox.hi',nodes.serializebox(100,true, true))} Box reuse:\blank \box100 \blank \ctxlua{initt=loadfile

Re: [NTG-context] Problem Passing \starttabulate into Lua

2009-01-01 Thread Wolfgang Schuster
\starttabulate \NC 0 \NC testing tabulate. \NC \NR \stoptabulate} \stoptext \def\testmacro#1{\ctxlua{d='\luaescapestring{\normalunexpanded{#1}}'}} \starttext \testmacro{\starttabulate[|l|p|] \NC knuth \NC \input knuth \NC\NR \stoptabulate} \ctxlua{tex.sprint(d)} \stoptext Wolfgang

Re: [NTG-context] Problem Passing \starttabulate into Lua

2008-12-30 Thread Wolfgang Schuster
\newcatcodetable \testcatcodes \startcatcodetable \testcatcodes \catcode`\\ = 12 \catcode`\| = 12 \stopcatcodetable \def\testmacro {\bgroup \setcatcodetable\testcatcodes \dotestmacro} \def\dotestmacro#1% {\ctxlua{d='\luaescapestring{#1}'} \egroup} \starttext \testmacro

Re: [NTG-context] Problem Passing \starttabulate into Lua

2008-12-29 Thread Ashlock, Tad A
} \def\dotestmacro#1 {\ctxlua{d='\luaescapestring{#1}'}% \egroup} \starttext \testmacro{\starttabulate \NC text \NC text \NC\NR \stoptabulate} %\ctxlua{tex.sprint(d)} \stoptext Wolfgang Thank you Wolfgang! That's certainly a step in the right direction. But what I (and others?) really

Re: [NTG-context] Problem Passing \starttabulate into Lua

2008-12-29 Thread Wolfgang Schuster
{\bgroup \catcode`\\=12 \dotestmacro} \def\dotestmacro#1 {\ctxlua{d='\luaescapestring{#1}'}% \egroup} \starttext \testmacro{\starttabulate \NC text \NC text \NC\NR \stoptabulate} %\ctxlua{tex.sprint(d)} \stoptext Wolfgang Thank you Wolfgang! That's certainly a step in the right

Re: [NTG-context] Problem Passing \starttabulate into Lua

2008-12-28 Thread Wolfgang Schuster
\testmacro {\bgroup \catcode`\\=12 \dotestmacro} \def\dotestmacro#1 {\ctxlua{d='\luaescapestring{#1}'}% \egroup} \starttext \testmacro{\starttabulate \NC text \NC text \NC\NR \stoptabulate} %\ctxlua{tex.sprint(d)} \stoptext Wolfgang

[NTG-context] Problem Passing \starttabulate into Lua

2008-12-27 Thread Tad Ashlock
... \testmacro ...\directlua 0{d='\luaescapestring {#1 }'} l.8 \stoptabulate} ? = I've tried all sorts of variations on the above example including using \ctxlua, \startlua, \startluacode, etc. I tried using

Re: [NTG-context] markiv, output written on...

2008-12-16 Thread Hans Hagen
that context --result might overload the name so we cannot use jobname here. to cont-new.mkiv add: \ctxlua{ ctx.register_statistics(result saved in file, \letterpercent s.\letterpercent s, function() return \outputfilename, (tex.pdfoutput0 and pdf) or dvi end) } then you can parse

[NTG-context] trick

2008-12-11 Thread Hans Hagen
The next trick is dedicated to Aditya ... % engine=luatex \unprotect \def\Hack#1#2% {\pdfliteral{/Span /ActualText \ctxlua{pdf.hexify(\!!bs\detokenize{#1}\!!es)} BDC}#2\pdfliteral{EMC}} \protect \def\Formula#1{\Hack{#1}{$#1$}} \startTEXpage[offset=3pt] test \Formula{e + a = mc^2

Re: [NTG-context] texexec (and context) stops when using \externalocp

2008-12-10 Thread Taco Hoekwater
by context. The crash is an oversight in luatex.exe that I will try to fix for the next version. Whether hte default context mkiv will ever support external OCPs is upto Hans, but I would not be surprised doubt it never will. To run the example, you can add \ctxlua{kpse.set_program_name('luatex

Re: [NTG-context] texexec (and context) stops when using \externalocp

2008-12-10 Thread Khaled Hosny
it never will. To run the example, you can add \ctxlua{kpse.set_program_name('luatex')} to the top of your file, then it will work. Thanks for the quick help, you saved my day! Regars, Khaled -- Khaled Hosny Arabic localizer and member of Arabeyes.org team signature.asc Description

[NTG-context] modernized and augmented m-r.tex

2008-12-08 Thread Johan Sandblom
The ConTeXt module for interaction with the statistical programming language R currently does not work with MKIV since buffers are not saved to file. The included file fixes this by calling \savebuffer on the buffer in case \ctxlua is defined (a trick gleaned from a discussion on the LilyPond

Re: [NTG-context] printing tab in lua: print('a\tb') fails

2008-11-27 Thread Wolfgang Schuster
file not always is a good solution This would be really great, \start/stoplua with % for comments like \ctxlua and \start/stopluacode with -- as comment, the first is used for longer settings in macros and the second for inline functions. @Luigi: You could try to parse the luacode content

Re: [NTG-context] printing tab in lua: print('a\tb') fails

2008-11-27 Thread luigi scarso
at -- as comment while I have problems to think to % as comment And put lua code in a separate file not always is a good solution This would be really great, \start/stoplua with % for comments like \ctxlua and \start/stopluacode with -- as comment, the first is used for longer settings

Re: [NTG-context] printing tab in lua: print('a\tb') fails

2008-11-27 Thread Hans Hagen
comment end end \stopluacode \def\Foo {\ctxlua{document.luigishouldknowbetter(Hello world!)}} - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH

Re: [NTG-context] printing tab in lua: print('a\tb') fails

2008-11-27 Thread luigi scarso
) for i=1,100 do print(whatever) -- this is a lua comment end end \stopluacode \def\Foo {\ctxlua{document.luigishouldknowbetter(Hello world!)}} Exactly. In my opinion, this is better than my example, because I don't like to mix things

[NTG-context] Error with ctx=x-ldx in char_cmp.lua

2008-11-24 Thread luigi scarso
,{#2{##1}\doprocesscommait... \expanded ...long \xdef \@@expanded {\noexpand #1} \@@expanded l.1 \xmlsetup{764}{ldx:function} \xmlflush #1-\ctxlua {lxml.flush(#1)} \doifelsenothing #1-\edef \!!stringa {#1

Re: [NTG-context] Minimals - problems with format: metafun.mp

2008-11-05 Thread Taco Hoekwater
\the \everysetupxml \ctxlua {input.stoptiming(ctx)} \checkpreprocessor \startluacode document.commands = document.commands or { } function document.commands.somehexcolor(str) local r, g, b = str:match(#(..)(..)(..)) r, g, b = tonumber(r,16) or 0, tonumber(g,16) or 0, tonumber(b,16) or 0

Re: [NTG-context] Minimals - problems with format: metafun.mp

2008-11-03 Thread Hans Hagen
then, these vars are set in mlib-pps.tex 61: {\ctxlua{metapost.first_box, metapost.last_box = \number\MPLIBfirst, \number\MPLIBlast}} so, it more looks like you have a faulty format file - Hans

Re: [NTG-context] Minimals - problems with format: metafun.mp

2008-11-03 Thread Peter Rolf
or 1100 but even then, these vars are set in mlib-pps.tex 61: {\ctxlua{metapost.first_box, metapost.last_box = \number\MPLIBfirst, \number\MPLIBlast}} missed that one (stupid me grep'ed only the lua files...) :) so, it more looks like you have a faulty format file

Re: [NTG-context] Minimals - problems with format: metafun.mp

2008-11-03 Thread Johannes Graumann
-style}}{} \stopxmlsetups \xmlmapvalue{fo:font-weight}{bold}{\bf} \xmlmapvalue{fo:font-style}{italic}{\em} \xmlmapvalue{fo:color}{#ff}{\colored[h=ff]} \setvalue{fo:color}#1{\expandafter\colored\expandafter[h=#1]} %\setvalue{fo:color}#1{\edef\temp{\noexpand\ctxlua

Re: [NTG-context] XML

2008-10-26 Thread Johannes Graumann
\stopluacode \setupcolors[state=start] \def\WhatAMess#1{\ctxlua{document.commands.somehexcolor(#1)}} {test \WhatAMess{\letterhash FF3344} test} \stoptext \starttext \startluacode document.commands = document.commands or { } function document.commands.somehexcolor(str

Re: [NTG-context] new beta

2008-10-22 Thread Wolfgang Schuster
. \savetwopassdata (typo) --- core-two-orig.mkiv 2008-10-14 12:51:02.0 +0200 +++ core-two.mkiv 2008-10-21 17:13:05.0 +0200 @@ -18,7 +18,7 @@ %D I'm not that sure if this behaves exactly like mkii. This needs a cleanup. \def\immediatesavetwopassdata #1#2#3{\expanded{\ctxlua

Re: [NTG-context] XML

2008-10-22 Thread Hans Hagen
, b = str:match(#(..)(..)(..)) r, g, b = tonumber(r,16) or 0, tonumber(g,16) or 0, tonumber(b,16) or 0 tex.sprint(string.format(\\colored[r=%s,g=%s,b=%s],r/255,g/255,b/255)) end \stopluacode \setupcolors[state=start] \def\WhatAMess#1{\ctxlua{document.commands.somehexcolor(#1

Re: [NTG-context] error in mag-01 module with luatex

2008-10-15 Thread Khaled Hosny
09:29:46.324889915 +0200 @@ -1171,7 +1171,7 @@ \newtoks\everydefinefont \def\lowleveldefinefont#1#2% #2 = cs - {\ctxlua{fonts.define.command_1(#1)}% + {\ctxlua{fonts.define.command_1(\luaescapestring{#1})}% % sets \scaledfontmode and \somefontname and \somefontsize \ifcase

Re: [NTG-context] latest beta (again)

2008-10-09 Thread Hans Hagen
, the list is longer): hard to test without test files and fonts -) you can try \ctxlua{fonts.trace=true} and see what is handled % test file % % \starttypescript[serif][mine-1] % \definefontsynonym[Serif] [TeXGyrePagella-Regular] % \definefontsynonym[TeXGyrePagella-Regular

Re: [NTG-context] latest beta (again)

2008-10-09 Thread Thomas A. Schmitz
On Oct 9, 2008, at 11:22 AM, Hans Hagen wrote: hard to test without test files and fonts -) Yes, I can see that :-) Your crystal ball is broken, then? you can try \ctxlua{fonts.trace=true} and see what is handled Well, that kind of confirms my suspicion. I attach the relevant stuff

[NTG-context] new beta

2008-10-03 Thread Hans Hagen
hi, - the current beta has some speedups and mem improvements for fonts - for huge fonts (like chinese) general mem consumption can be made smaller (at the cost of some runtime) by \ctxlua{garbagecollector.enabled=true} although this is not that neccessary when you used the upcoming beta

Re: [NTG-context] ansi codes

2008-10-03 Thread Alan Stone
? Geeks do it with LuaTeX :) I'm not sure if this still works since I have no luatex here, but in theory you can play with something like this: % do whatever you want with it \def\mychar#1#2{#1: #2\crlf} \starttext \ctxlua{ fontname = 'texgyrepagella-regular.otf

Re: [NTG-context] ansi codes

2008-10-01 Thread Mojca Miklavec
, but in theory you can play with something like this: % do whatever you want with it \def\mychar#1#2{#1: #2\crlf} \starttext \ctxlua{ fontname = 'texgyrepagella-regular.otf' tfmdata = fonts.tfm.read_and_define(file: .. fontname, 655360) w = tfmdata.characters for i=0,10

Re: [NTG-context] ansi codes

2008-10-01 Thread Hans Hagen
no luatex here, but in theory you can play with something like this: % do whatever you want with it \def\mychar#1#2{#1: #2\crlf} \starttext \ctxlua{ fontname = 'texgyrepagella-regular.otf' tfmdata = fonts.tfm.read_and_define(file: .. fontname, 655360) w

[NTG-context] overprint and currentcolorname in mkiv

2008-09-12 Thread Peter Rolf
Hi, is overprinting working in mkiv? \ctxlua{overprints.enabled=true} has no effect here or on ConTeXt live. Maybe I'm missing something. Currently I try to adapt some mkii code to mkiv. Overprinting should only be enabled if - a given maximum font size is not exceeded and - the current text

Re: [NTG-context] bug with numeral conversion function

2008-09-02 Thread Khaled Hosny
:49.0 +0200 @@ -17,8 +17,8 @@ \def\romannumerals #1{\ctxlua{converters.romannumerals(\number#1)}} \def\Romannumerals #1{\ctxlua{converters.Romannumerals(\number#1)}} -\def\abjadnumerals #1{\ctxlua{converters.arabicnumerals(\number#1)}} -\def\abjadnodotnumerals #1{\ctxlua

Re: [NTG-context] bug with numeral conversion function

2008-09-02 Thread Hans Hagen
arabicn *.mkiv core-con.mkiv 20: \def\abjadnumerals #1{\ctxlua{converters.arabicnumerals(\number#1)}} core-con.mkiv 21: \def\abjadnodotnumerals #1{\ctxlua{converters.arabicnodotnumerals(\number#1)}} core-con.mkiv 22: \def\abjadnaivenumerals #1{\ctxlua{converters.arabicnaivenumerals(\number#1)}} core

Re: [NTG-context] bug with numeral conversion function

2008-09-02 Thread Khaled Hosny
On Tue, Sep 02, 2008 at 08:25:38PM +0200, Hans Hagen wrote: Khaled Hosny wrote: core-con.mkiv 20: \def\abjadnumerals #1{\ctxlua{converters.arabicnumerals(\number#1)}} core-con.mkiv 21: \def\abjadnodotnumerals #1{\ctxlua{converters.arabicnodotnumerals(\number#1)}} core-con.mkiv 22: \def

Re: [NTG-context] passing dimensions to metapost

2008-08-28 Thread Hans Hagen
get the same result.) \startluacode document.mymodule = document.mymodule or { } function document.mymodule.checkdimen(str) return (str:find(%a%a$) and str) or (str .. mm) end \stopluacode \ctxlua{document.mymodule.checkdimen(#1)} or more fancy: function document.mymodule.checkdimen(str

Re: [NTG-context] passing dimensions to metapost

2008-08-28 Thread Thomas A. Schmitz
= document.mymodule or { } function document.mymodule.checkdimen(str) return (str:find(%a%a$) and str) or (str .. mm) end \stopluacode \ctxlua{document.mymodule.checkdimen(#1)} or more fancy: function document.mymodule.checkdimen(str) if not str:find(%a%a$) then str = str

[NTG-context] Some Arabic ligatures get rendered twice

2008-08-15 Thread Khaled Hosny
and member of Arabeyes.org team \usetypescriptfile[type-arabtype] \usetypescript[Arabtype] \ctxlua { fonts.color.trace = true } \setupcolors[state=start] \setupbodyfont[Arabtype,28pt] \setcharactermirroring[1] \pagedir TRT\bodydir TRT\pardir TRT\textdir TRT \starttext كما علبي علبى \stoptext

Re: [NTG-context] Thank you for the Chinese support, but still one question.

2008-08-10 Thread Longmin Wang
On Fri, Aug 08, 2008 at 11:55:21AM +0200, Hans Hagen wrote: there was a bug as well as the fact that your definition is wrong % engine=luatex \ctxlua{fonts.collections.trace = true} \definefontfeature[zh][mode=node,script=hang,lang=zhs] \starttypescript [serif] [zhfont] \definefontsynonym

Re: [NTG-context] Thank you for the Chinese support, but still one question.

2008-08-08 Thread Hans Hagen
like \bf, \it, don't work. I attach a minimal example in the mail. Is there anything wrong in the document? Thank you. there was a bug as well as the fact that your definition is wrong % engine=luatex \ctxlua{fonts.collections.trace = true} \definefontfeature[zh][mode=node,script=hang,lang=zhs

Re: [NTG-context] Lilypond module

2008-08-06 Thread Wolfgang Schuster
loading: LilyPond module ) utilityfile | not present systems: begin file test-lilypond at line 6 ! You can't use `the character 1' after \the. \lily!figures -1 \dosavebuffer [#1]-\ctxlua {buffers.save(#1 )} \dodostartlilypond ...ilypond

Re: [NTG-context] Lilypond module

2008-08-05 Thread Wolfgang Schuster
can't use `the character 1' after \the. \lily!figures -1 \dosavebuffer [#1]-\ctxlua {buffers.save(#1 )} \dodostartlilypond ...ilypond-\the \lily!figures ] \fi \ifeof 18 \expanded {\... l.8

Re: [NTG-context] Lilypond module

2008-08-05 Thread Olivier Guéry
: begin file test-lilypond at line 6 ! You can't use `the character 1' after \the. \lily!figures -1 \dosavebuffer [#1]-\ctxlua {buffers.save(#1 )} \dodostartlilypond ...ilypond-\the \lily!figures

[NTG-context] Lilypond module

2008-08-04 Thread Olivier Guéry
*big] \stoptext It failed with : (/usr/share/texmf/tex/context/third/lilypond/t-lilypond.tex loading: LilyPond module ) utilityfile | not present systems: begin file test-lilypond at line 6 ! You can't use `the character 1' after \the. \lily!figures -1 \dosavebuffer [#1]-\ctxlua

Re: [NTG-context] hiding content

2008-07-27 Thread Taco Hoekwater
): % engine = luatex \defineattribute [ghosted] \def\starthidden {\dosetattribute{ghosted}\plusone} \def\stophidden {\doresetattribute{ghosted}} \ctxlua{ callback.register ('pre_output_filter', function (h) for v in node.traverse(h) do if ( ( v.id == node.id('hlist

Re: [NTG-context] Passing unicode characters

2008-07-27 Thread Khaled Hosny
and the numbering should be correct. I think this is a bug in converters.alphabetic function, it doesn't handle zero and seem to convert 1-0 2-1 etc. The following code: \ctxlua{converters.alphabetic(0,arabic)} \ctxlua{converters.alphabetic(123456789,arabic)} gives 0 ٠١٢٣٤٥٦٧٨, while it should give ٠١٢٣٤٥٦٧٨٩

Re: [NTG-context] Passing unicode characters

2008-07-27 Thread Mehdi Omidali
, it doesn't handle zero and seem to convert 1-0 2-1 etc. The following code: \ctxlua{converters.alphabetic(0,arabic)} \ctxlua{converters.alphabetic(123456789,arabic)} gives 0 ٠١٢٣٤٥٦٧٨, while it should give ٠١٢٣٤٥٦٧٨٩. Regards, Khaled Wolfgang

Re: [NTG-context] Passing unicode characters

2008-07-22 Thread Mehdi Omidali
, 0x0669 }, core-con.mkiv: \def\arabicnumerals #1{\ctxlua{converters.alphabetic(\number#1,arabic)}} \def\extendedarabicnumerals #1{\ctxlua{converters.alphabetic(\number#1,extendedarabic)}} \defineconversion [arabicnumerals] [\arabicnumerals] \defineconversion [extendedarabicnumerals

[NTG-context] Latest beta + LuaTeX

2008-07-15 Thread Otared Kavian
} \ctxlua { lua.bytedata[\th... \registerctxluafile ...se \ctxluabyteload {#1}{#2} \fi \global \everyloadluac... l.165 \registerctxluafile{luat-env}{1.001} mkiv lua stats : used config path - /usr/local/texlive

<    6   7   8   9   10   11   12   >