: 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
:
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
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
{\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
{\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
/rent.1}
}
\calculateexternalfigure ...xlua {figures.check()}
\ctxlua {figures.include()...
\dodoplaceexternalfigure ...[][#1][#2][#3][#4][#5]
\popmacro
()}
\ctxlua {figures.include()...
\dodoplaceexternalfigure ...[][#1][#2][#3][#4][#5]
\popmacro \textunderscore ...
...
l.4
?
.
Anyway the problem occurs also with mkii and pstopdf
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
] is useful.
\stoptext
\def\dodospecialfrom[#1]%
{\dontleavehmode\goto{\ctxlua{jobreferences.from(#1)}}[url(#1)]}
-
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt
://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
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
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
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
=
(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
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
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
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
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
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
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
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
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
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
+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
][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
\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
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
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
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
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
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
\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
: 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
...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
: 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
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
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
= 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
) /
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
= 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
,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
-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
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
)
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
\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
)
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
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
)
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
(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
\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
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
. 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
\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
\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
}
\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
{\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
\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
...
\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
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
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
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
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
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
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
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
comment
end
end
\stopluacode
\def\Foo
{\ctxlua{document.luigishouldknowbetter(Hello world!)}}
-
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH
)
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
,{#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
\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
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
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
-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
\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
. \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
, 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
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
, 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
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
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
?
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
, 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
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
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
: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
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
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
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
= 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
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
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
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
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
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
: 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
*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
):
% 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
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 ٠١٢٣٤٥٦٧٨٩
, 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
, 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
}
\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
1001 - 1100 of 1162 matches
Mail list logo