rings in such
ligatures as ct and st.
More can be added.
\startluacode
fonts.handlers.otf.addfeature {
name= "michael",
type= "ligature",
--~ nocheck = true,
data= {
[0x00C6] = { 0x0041, 0x0065 }, -- A + e -> Æ
[0x00E6] = { 0x0
kend code code loaded, this can badly interfere
as you love hacking to the level of dangerous, here is an example of
where all this stuff is getting weird
\startluacode
local t = tex.hashtokens()
local l = { }
for i=1,#t do
if string.find(t[i],"mmm") then
l[#l+1] = t[
gestions on a solution to this would be greatly appreciated.
Best Wishes
Keith
\startluacode
local namedColors = {
red = { 255, 0, 0},
green = { 0, 255, 0},
blue = { 0, 0, 255},
white = { 255, 255, 255},
black = { 0, 0, 0},
yellow = { 255, 255, 0},
cyan = { 0, 255, 255},
magenta = { 255, 0
Am 03.07.2025 um 19:53 schrieb Henning Hraban Ramm:
Am 03.07.25 um 16:34 schrieb Wolfgang Schuster:
Am 03.07.2025 um 16:04 schrieb Henning Hraban Ramm:
Hi,
I’m trying to get a simple function with a variable number of
parameters working:
"""
\startluacode
interfaces.impl
Am 03.07.25 um 16:34 schrieb Wolfgang Schuster:
Am 03.07.2025 um 16:04 schrieb Henning Hraban Ramm:
Hi,
I’m trying to get a simple function with a variable number of
parameters working:
"""
\startluacode
interfaces.implement {
name = "Autoren",
publi
Am 03.07.2025 um 16:04 schrieb Henning Hraban Ramm:
Hi,
I’m trying to get a simple function with a variable number of parameters
working:
"""
\startluacode
interfaces.implement {
name = "Autoren",
public = true,
arguments = { "hash
Hi,
I’m trying to get a simple function with a variable number of parameters
working:
"""
\startluacode
interfaces.implement {
name = "Autoren",
public= true,
arguments = { "hash" },
actions = function(t)
logs.report('Autoren&
formatting is handled more easily on the lua end or not, I can't really
gauge. There is in fact a great number of formatting keys available that might
be easy to parse in the context interface. So, maybe all that is needed is an
optional secondary argument "format="? I could come up w
Hi,
the xml parser fails on attribute list settings in xml files.
begin example
\startbuffer[jmdict]
]>
\stopbuffer
\starttext
\startluacode
local jmdict = lxml.loadbuffer("","jmdict",false)
inspect(jmdict)
\stopluacode
\stoptext
%%%
:
|\setupbackend[format={PDF/UA-1}] \setuptagging[state=start]
\enabledirectives[backend.usetags=crap] \startluacode
lpdf.injectxmpinfo("xml://rdf:RDF","1",false) \stopluacode |
Many thanks for the code, Rik.
Just in case anyone intends to use any form of TDM reservation, it
}] \setuptagging[state=start]
\enabledirectives[backend.usetags=crap] \startluacode
lpdf.injectxmpinfo("xml://rdf:RDF","1",false) \stopluacode |
Many thanks for the code, Rik.
Just in case anyone intends to use any form of TDM reservation, it seems
that it might break PDF/A validatio
-archive.com/ntg-context@ntg.nl/msg64956.html> and inserted
> it successfully as follows:
>
>
> \setupbackend[format={PDF/UA-1}]
> \setuptagging[state=start]
> \enabledirectives[backend.usetags=crap]
> \startluacode
> lpdf.injectxmpinfo("xml://rdf:RDF"
list at https://www.mail-
>> archive.com/ntg-context@ntg.nl/msg64956.html and inserted it
>> successfully as follows:
>>
>> |\setupbackend[format={PDF/UA-1}] \setuptagging[state=start]
>> \enabledirectives[backend.usetags=crap] \startluacode
>> lpdf.injectxmpinfo(&
gt; \enabledirectives[backend.usetags=crap] \startluacode
> lpdf.injectxmpinfo("xml://rdf:RDF"," xmlns:tdm='http://www.w3.org/ns/tdmrep/'>1 tdm:reservation>",false) \stopluacode |
Many thanks for the code, Rik.
Just in case anyone intends to use any form of TDM re
successfully as follows:
|\setupbackend[format={PDF/UA-1}] \setuptagging[state=start]
\enabledirectives[backend.usetags=crap] \startluacode
lpdf.injectxmpinfo("xml://rdf:RDF","xmlns:tdm='http://www.w3.org/ns/tdmrep/'>1"
0pt, bottomspace=0pt,
>height=middle, width=middle,
>backspace=0pt]
>
> \starttext
> \startluacode
> require "lfs"
> function GetFileExtension(url)
> return url:match("^.+(%..+)$")
> end
> cwd=lfs.currentdir()
>
pt]
\starttext
\startluacode
require "lfs"
function GetFileExtension(url)
return url:match("^.+(%..+)$")
end
cwd=lfs.currentdir()
for file in lfs.dir(cwd) do
suffix = GetFileExtension(file)
if suffix == ".png" then
ima
tive to add/remove features on the fly?
>
> nothing changed there
>
> move the luacode before the \starttext or any place before the main font
> is defined because features are bound to fonts so new ones have to be
> defined beforehanbd
>
> > MNWE:
> >
> > ===
> &g
cause features are bound to fonts so new ones have to be
defined beforehanbd
MNWE:
===
\starttext
\startluacode
fonts.handlers.otf.addfeature{
name = "fanum",
type = "substitution",
data = {
[0x30] = 0x41 -- '0' => 'A'
}
}
Hello,
\addff (and \doaddfeature) no longer seem to work. What's the alternative
to add/remove features on the fly?
MNWE:
===
\starttext
\startluacode
fonts.handlers.otf.addfeature{
name = "fanum",
type = "substitution",
data = {
[0
>
> > I have some code like this:
> >
> > -
> > \def\MakeSomething{... some code that returns number 12}
> >
> > \startluacode
> > function WorkWithSomething(data)
> >-- call MakeSomething to obtain 12
> >
Am 29.03.2025 um 16:06 schrieb Mohammad Hossein Bateni:
Hello,
I have some code like this:
-
\def\MakeSomething{... some code that returns number 12}
\startluacode
function WorkWithSomething(data)
-- call MakeSomething to obtain 12
-- base on the value
gt; \else%
> X%
> \fi%
> }
>
> \newcount\mycounter
> \define\incrementmycounter{%
> \advance\mycounter by 1\relax%
> }
>
> \startluacode
> local function WorkWithSomething(data)
>
ething{%
\setbox0=\hbox{#1}%
\ifdim\wd0>12pt\relax%
12%
\else%
X%
\fi%
}
\newcount\mycounter
\define\incrementmycounter{%
\advance\mycounter by 1\relax%
}
\startluacode
local function WorkWi
Hello,
I have some code like this:
-
\def\MakeSomething{... some code that returns number 12}
\startluacode
function WorkWithSomething(data)
-- call MakeSomething to obtain 12
-- base on the value above make some decisions
end
WorkWithSomething(some_data
ali:to,y]}\endgroup}
>> --
>>
>> does \setdate expand to something non-empty?
>>
>> note that with the above ideas, we cannot get "mm" with leading zeros to
>> work because
>> \persiandecimals drops the leading zero. the following ugly hack wo
above ideas, we cannot get "mm" with leading zeros to
> work because
> \persiandecimals drops the leading zero. the following ugly hack works if
> I insist on using
> \currentdate to format the output and I want Indic digits.
>
>
> \startluacode
> f
expand to something non-empty?
note that with the above ideas, we cannot get "mm" with leading zeros to
work because
\persiandecimals drops the leading zero. the following ugly hack works if I
insist on using
\currentdate to format the output and I want Indic digits.
\startluacode
\d_marginwidth
\d_marginwidth=\dimexpr\fontdimen6\font*\c_margincount\relax
\newdimen\d_textlineheight\d_textlineheight=
\dimexpr\baselineskip*\c_heightcount-\baselineskip+
\ifdim\topskip<\ht\strutbox\topskip\else\ht\strutbox\fi\relax
\protect
\startluacode
local todi
Am 13.02.25 um 16:35 schrieb Wolfgang Schuster:
\setuppagenumbering[location={footer,middle}, alternative=onesided]
onesided isn't a valid keyword for the alternative key, only
singlesided and doublesided can be used.
Okay! It seems better. I never got an error message.
\startlu
={footer,middle}, alternative=onesided]
onesided isn't a valid keyword for the alternative key, only singlesided
and doublesided can be used.
\setuplayout[
lines=44,
grid=yes,
]
\showgrid
\startluacode
function userdata.Ddate(str)
local year = string.sub(str,1,4)
local mo
s Hagen via ntg-context:
On 2/13/2025 10:58 AM, Thomas Meyer wrote:
\startluacode
function userdata.Ddate(str)
local year = string.sub(str,1,4)
local month = string.sub(str,5,6)
local day = string.sub(str,7,8)
context.date({d=day,m=month,y=year},{"weekday,{, },day, {.
},mont
On 2/13/2025 10:58 AM, Thomas Meyer wrote:
\startluacode
function userdata.Ddate(str)
local year = string.sub(str,1,4)
local month = string.sub(str,5,6)
local day = string.sub(str,7,8)
context.date({d=day,m=month,y=year},{"weekday,{, },day,
{. },month,space,year&qu
\setuplayout[
lines=44,
grid=yes,
]
\showgrid
\startluacode
function userdata.Ddate(str)
local year = string.sub(str,1,4)
local month = string.sub(str,5,6)
local day = string.sub(str,7,8)
context.date({d=day,m=month,y=year},{"weekday,{, },day,{.
},month,space,year"})
end
\s
tation for the interaction with sqlite
from the context garden
(https://www.pragma-ade.nl/general/manuals/sql-mkiv.pdf):
```tex
\starttext
\startluacode
require("util-sql")
utilities.sql.setmethod("sqlite")
require("util-sql-loggers")
local loggers = utilities.sq
ext garden
(https://www.pragma-ade.nl/general/manuals/sql-mkiv.pdf):
```tex
\starttext
\startluacode
require("util-sql")
utilities.sql.setmethod("sqlite")
require("util-sql-loggers")
local loggers = utilities.sql.loggers
local presets = {
-- method = "sq
these files with my local context system and use setup to enable
it directly.
I want directly use
%%%
\setupregister[index][n=4,language=cn-alpha,]
%%%
instead of
\input sort-alpha.lua
\setupregister[index][
n=4,
language={cn-alpha},]
%%%
remove \startluacode and \stopluacode in that
ndfor;
fi;
%label the columns
if (length second) = 1:
for i = 0,1:
label.top(textext(codeOne[i]), ((i+1)*wd,.3ht));
endfor;
else:
for i = 0 upto 3:
label.top(textext(codeTwo[i]), ((i+1)*wd,.3ht));
endfor;
fi;
setbounds currentpicture to boundingbox currentpictur
On 1/11/2025 4:01 PM, Jeong Dal via ntg-context wrote:
Dear all,
I save a table “tfList” using table.save in Lua:
\startluacode
...
table.save(“tempList.lua”,tfList)
...
\stopluacode
And I call it in MetaFun using a method explained in the MetaFun book.
\startMPcode
lua("MP = { } MP
Dear all,
I save a table “tfList” using table.save in Lua:
\startluacode
...
table.save(“tempList.lua”,tfList)
...
\stopluacode
And I call it in MetaFun using a method explained in the MetaFun book.
\startMPcode
lua("MP = { } MP.data = table.load('te
led (1.8wd,1ht) shifted (.6wd,-2.1ht) withpen pencircle
scaled 2pt withcolor .625red ;
\stopbuffer
\starttext
\startluacode
function document.MakeHead(p,a)
if not a then
local t = p
p = string.rep("|mcw(1cm)",#p-1) .. "|mcw(2cm)|"
a = t
end
))
-- return ((p == "0" or q == "0") and r == "1") or (p == "1" and (q
== "1" or r == "0"))
end
Is not working. The outputs are blank(for false) and “?”(for true)
Here is a working example.
Thank you for enhancin
ot; or q == "0") and r == "1") or (p == "1" and (q == "1"
> or r == "0"))
> end
>
Is not working. The outputs are blank(for false) and “?”(for true)
Here is a working example.
Thank you for enhancing the code.
Best regards,
Dalyoung
\s
simple code:
\starttext
\startluacode
if 0 then context("True")
else context("False")
end
\stopluacode
\stoptext
The output
The output is “True”.
Ah, i didn't check the function, so how about this:
local tf = { true, false }
--local tf = { "1", "0"
d
>end
>document.MakeFooter()
>end
I think that the logical function “document.logicF()"is not working for the
array tf={“1”,”0”}.
In python, 1 and 0 are treated as true and false. But, I read that only “false”
and “nil” are treated as false in Lua, that is, “0” i
.
>> It works! It draw the truth table of the given logic functions.
>> Thanks a lot.
>> Best regards,
>> Dalyoung
>> \startluacode
>> function document.MakeHead(p,a)
>> if not a then
>> local t = p
>> p = string.rep("|mcw(1cm)",#p-1) ..
.
2. And call the functions in the text.
It works! It draw the truth table of the given logic functions.
Thanks a lot.
Best regards,
Dalyoung
\startluacode
function document.MakeHead(p,a)
if not a then
local t = p
p = string.rep("|mcw(1cm)",#p-1) .. "|mcw(1.5cm)|"
a = t
end
c
! It draw the truth table of the given logic functions.
Thanks a lot.
Best regards,
Dalyoung
\startluacode
function document.MakeHead(p,a)
if not a then
local t = p
p = string.rep("|mcw(1cm)",#p-1) .. "|mcw(1.5cm)|"
a = t
end
conte
Dear Florent, Wolfgang, and Hans,
Thank you for the solutions.
All solutions are working well.
I add more rows for the last solution to show the truth table of a logical
function.
I may modify it for 2-variable function.
Thanks again.
Best regards,
Dalyoung
\starttext
\startluacode
f table.
How can I fix this error?
Thank you.
Best regards,
Dalyoung
\starttext
\startluacode
function makeHead(a)
local n = #a
context.HL()
for i = 1, n do
context.NC() context(a[i])
end
context.NC()context.AR()
context.HL()
end
\stopluacode
%\starttabulate[|mcw(1cm)|mcw(1cm)|mcw(1cm)|mcw(
f table.
How can I fix this error?
Thank you.
Best regards,
Dalyoung
\starttext
\startluacode
function makeHead(a)
local n = #a
context.HL()
for i = 1, n do
context.NC() context(a[i])
end
context.NC()context.AR()
context.HL()
end
\stopluacode
%\starttabulate[|mcw(1cm)|mcw(1cm)|mcw(1cm)|mcw(
of table.
How can I fix this error?
Thank you.
Best regards,
Dalyoung
\starttext
\startluacode
function makeHead(a)
local n = #a
context.HL()
for i = 1, n do
context.NC() context(a[i])
end
context.NC()context.AR()
context.HL()
end
\stopluacode
%\starttabulate[|mcw(1cm)|mcw(1
Dear Dalyoung,
I am not sure what the issue is; but as a workaround it seems that using
\ctxlua works:
___
\starttext
\startluacode
function makeHead(a)
local n = #a
context.HL()
for i = 1, n do
context.NC() context(a[i
t regards,
Dalyoung
\starttext
\startluacode
function makeHead(a)
local n = #a
context.HL()
for i = 1, n do
context.NC() context(a[i])
end
context.NC()context.AR()
context.HL()
end
\stopluacode
%\starttabulate[|mcw(1cm)|mcw(1cm)|mcw(1cm)|mcw(1cm)|]
\startluaco
On 16/12/2024 22:18, Pablo Rodriguez via ntg-context wrote:
It seems that it is too complex for me (and I have already invested two
afternoons in this).
For some reason, not meant to be in my case,
like everyday for one year
8<---
\startluacode
function userdata.now(dd)
local wd
def\pdflastxpos{\numexpr\clf_lastxpos\relax}
\frozen\overloaded\protected\def\pdflastypos{\numexpr\clf_lastypos\relax}
\protect
\fi
\ifdefined\pdfstrcmp\else
\startluacode
interfaces.implement {
name = "pdfstrcmp",
arguments = "2 s
etter solution.
\startluacode
local shapedcodes = { }
for k, v in next, characters.data do
local s = v.shcode
if s then
if type(s) == "number" then
shapedcodes[utf.char(k)] = { utf.char(s) }
elseif #s == 2 then
shapedcodes[utf.char(k)] =
Hi!
I run into a problem reading in certain CSV files. I nailed it down
to the following example:
\starttext
\startluacode
local mycsvsplitter = utilities.parsers.rfc4180splitter{
separator = ",",
quote = '"'}
-- fails with
-- token call, execute: [ctxlu
timing
pretty late, like this:
\startluacode
luatex.wrapup (
function()
--
print("saving runtime in foo.txt")
io.savedata("foo.txt",statistics.elapsedtime(lua.getruntime()))
--
local t = {
runtime = st
. you need to register timing
pretty late, like this:
\startluacode
luatex.wrapup (
function()
--
print("saving runtime in foo.txt")
io.savedata("foo.txt",statistics.elapsedtime(lua.getruntime()))
--
local t = {
ru
juh+ntg-context--- via ntg-context schrieb am 14.11.2024 um 09:18:
Am 14.11.24 um 08:59 schrieb juh+ntg-context--- via ntg-context:
\starttext
\startluacode
context(string.formatters["%0.2M"](1000))
\stopluacode
\stoptext
Gives 10.2000,00
context(string.formatters["%M"
Am 14.11.24 um 08:59 schrieb juh+ntg-context--- via ntg-context:
\starttext
\startluacode
context(string.formatters["%0.2M"](1000))
\stopluacode
\stoptext
Gives 10.2000,00
context(string.formatters["%M"](1000))
Gives the right result. But I am
Am 15.10.24 um 17:16 schrieb Hans Hagen via ntg-context:
On 10/15/2024 2:33 PM, juh+ntg-context--- via ntg-context wrote:
local sum = string.formatters["%0.2M"](0.3 * 100)
This does not work here with numbers with more than three digits.
\starttext
\startluacode
context(string.
you can control that.
\startluacode
local classes = fonts.protrusions.classes
local vectors = fonts.protrusions.vectors
classes.rik = {
vector = 'rik',
factor = 1,
}
vectors.rik = table.merged (
vectors.quality,
{
[0x0054] = { 0.35, 0 }, -- T
})
\s
On 11/4/2024 6:39 PM, Rik Kabel wrote:
On 2024-11-04 10:55, Wolfgang Schuster wrote:
Mikael Sundqvist schrieb am 04.11.2024 um 07:35:
Hi,
You can try this below (from test suite), but then, as you see, also
upright T will move out. Not sure how/if you can control that.
\startluacode
local
On 2024-11-04 10:55, Wolfgang Schuster wrote:
Mikael Sundqvist schrieb am 04.11.2024 um 07:35:
Hi,
You can try this below (from test suite), but then, as you see, also
upright T will move out. Not sure how/if you can control that.
\startluacode
local classes = fonts.protrusions.classes
Mikael Sundqvist schrieb am 04.11.2024 um 07:35:
Hi,
You can try this below (from test suite), but then, as you see, also
upright T will move out. Not sure how/if you can control that.
\startluacode
local classes = fonts.protrusions.classes
local vectors = fonts.protrusions.vectors
On 2024-11-04 01:35, Mikael Sundqvist wrote:
\startluacode
local classes = fonts.protrusions.classes
local vectors = fonts.protrusions.vectors
classes.rik = {
vector = 'rik',
factor = 1,
}
vectors.rik = table.merged (
vectors.quality,
{
[0x0054] = { 0.35,
Hi,
You can try this below (from test suite), but then, as you see, also
upright T will move out. Not sure how/if you can control that.
\startluacode
local classes = fonts.protrusions.classes
local vectors = fonts.protrusions.vectors
classes.rik = {
vector = 'rik',
menu File format where it is called
Lua script).
Then I use ConTeXt to run the lua file…
Another possibility is to put your lua file between \startluacode …
\stopluacode in a TeX file and then you typeset the TeX file in
TeXShop with ConTeXt.
But probably this is not what you want to do.
Best
{\sc þýðask}
123
Nothing has changed (in fact, the font handler hasn't been touched that
much at all, apart from some fixes for border cases that you're unlikely
to run into).
There are several issues with your approach, one being that you add a
featur
","3968","1489"
"2010","3975","1479"
"2011","3885","1470"
"2012","3879","1484"
"2013","4000","1553"
"2014","4068","1572"
Hi,
I use TeXShop and it is possible to save a file with a .lua suffix (under «
Save as… » you choose the menu File format where it is called Lua script).
Then I use ConTeXt to run the lua file…
Another possibility is to put your lua file between \startluacode …
\stopluacode in a TeX file and
;3975","1479"
"2011","3885","1470"
"2012","3879","1484"
"2013","4000","1553"
"2014","4068","1572"
"2015","4134","1622"
"2016"
>>
>> ```ConTeXt
>>
>> \mainlanguage[cn]
>>
>> \language[cn]
>>
>> \setscript[hanzi]
>>
>> \usetypescriptfile[mscore]
>>
>> \usebodyfont [mschinese,12pt]
>>
>> \showglyphs
>>
>> \startluacode
>>
>&
470"
"2012","3879","1484"
"2013","4000","1553"
"2014","4068","1572"
"2015","4134","1622"
"2016","4251","1745"
"2017","4096",
\ in the output.
begin example
\starttext
\currentdate[weekday,{, },day,. ,month,space,year]
%\currentdate[weekday,{, },day,.\ ,month,space,year]
\currentdate[weekday,\textcomma\ ,day,\textperiod\ ,month,space,year]
\startluacode
context.currentdate{ "weekday,{, },day,. ,month,space
]
\currentdate[weekday,\textcomma\ ,day,\textperiod\ ,month,space,year]
\startluacode
context.currentdate{ "weekday,{, },day,. ,month,space,year" }
\stopluacode
\startluacode
context.currentdate{ "weekday,\\textcomma\\ ,day,\\textperiod\\
,month,space,year" }
\stopluacode
o get output back from the Lua side to TeX you use the tex.sprint (or
tex.print) function.
begin example
\startluacode
function Date(str)
local year = string.sub(str,1,4)
local month = string.sub(str,5,6)
local day = string.sub(str,7,8)
tex.sprint(day,".",month,".&qu
gt; characters and non-Chinese characters
> >
> > ```ConTeXt
> >
> > \mainlanguage[cn]
> >
> > \language[cn]
> >
> > \setscript[hanzi]
> >
> > \usetypescriptfile[mscore]
> >
> > \usebodyfont [mschinese,12pt]
> >
`ConTeXt
>
> \mainlanguage[cn]
>
> \language[cn]
>
> \setscript[hanzi]
>
> \usetypescriptfile[mscore]
>
> \usebodyfont [mschinese,12pt]
>
> \showglyphs
>
> \startluacode
>
> Thirddata = Thirddata or {}
>
> local glyph_id = nodes
side to TeX you use the tex.sprint (or
tex.print) function.
begin example
\startluacode
function Date(str)
local year = string.sub(str,1,4)
local month = string.sub(str,5,6)
local day = string.sub(str,7,8)
tex.sprint(day,".",month,".",year)
-- tex.s
. Sorry, I'm a totally novice in Lua.
\starttext
\startluacode
function ddate(s)
i = 1
j = 4
y1 = string.sub(s,i,j)
i = 5
j = 6
m1 = string.sub(s,i,j)
i = 7
j = 8
d1 = string.sub(s,i,j)
context("Geht das: %s.%s.%s", d1, m1, y1) -- that works!
--re
This is a preliminary solution for inserting spaces between Chinese
characters and non-Chinese characters
```ConTeXt
\mainlanguage[cn]
\language[cn]
\setscript[hanzi]
\usetypescriptfile[mscore]
\usebodyfont [mschinese,12pt]
\showglyphs
\startluacode
Thirddata = Thirddata or {}
local glyph_id
pendaction problem,
> mini-try.lmtx, as
>
> ```ConTeXt
> \startluacode
> Moduledata = Moduledata or {}
> Moduledata.vtypeset = Moduledata.vtypeset or {}
>
> function Moduledata.vtypeset.rotate_all1(head)
> print(">>>>>> HERE IS ROTATE_A
ze.
>
> How can a converter function access …
> – the final (scaled) size of a placed image
> – the original pixel size of an image
> ?
> With that information it would be easy to calculate the target pixel
> size.
>
> And then it would be nice to hook this function into
hook this function into
\setupexternalfigure[conversion=]
"""
\startluacode
local function downsampler(oldname, newname, resolution)
if not resolution or resolution == "" then
resolution = 72
end
local cmd = string.format(
[[gm convert
nimum runnable example for the appendaction problem,
mini-try.lmtx, as
```ConTeXt
\startluacode
Moduledata = Moduledata or {}
Moduledata.vtypeset = Moduledata.vtypeset or {}
function Moduledata.vtypeset.rotate_all1(head)
print(">>>>>> HERE IS ROTATE_ALL1")
ConTeXt
using the Lua C API.
* Compile the code and wrappers in a shared library and linking to the
static lua library used by LuaMetaTeX (liblua.a on Linux).
* In the .tex file, import the new library using, e.g.,
```
\startluacode
mylib = require("mylib")
-- additional code u
to use \setinterfaceconstant.
You can run the following example to get a list with a predefined
constant. When you uncomment the first three lines you see the new entry
also appears in the list.
begin example
% \startinterface all
% \setinterfaceconstant {pointstyle} {pointstyle}
% \stopi
gt; values help too, so thanks to you both!
Hi Kirill,
this font feature may work too:
\startluacode
fonts.handlers.otf.addfeature {
name = "addedsc",
type = "substitution",
data = {
A = "A.sc",
B = "B.sc",
C = "C.sc",
D = "
={one-three}]
> > ```
> > The order could also be implicitly defined after the order of the
> > \definestacking calls.
> >
> > Or would it be possible to have numbers always automatically (additionally)
> > available as stacking layer?
> > So that this "j
d a proof} of \stacking [2] {concept} indeed.
\stopbuffer
...
\setupstacking[criterium={1-}]
```
I also wondered, if it is possible to define a lot of layers semiautomatically
in Lua
(in some graphics I needed around 20 layers). It seems that numbers in layer
names currently are not allowed.
Is code like t
t; This is a test \stacking [1] {and a proof} of \stacking [2] {concept} indeed.
> \stopbuffer
> ...
> \setupstacking[criterium={1-}]
> ```
>
> I also wondered, if it is possible to define a lot of layers
> semiautomatically in Lua
> (in some graphics I needed around 2
I also wondered, if it is possible to define a lot of layers semiautomatically
in Lua
(in some graphics I needed around 20 layers). It seems that numbers in layer
names currently are not allowed.
Is code like this possible somehow?
```
\startluacode
for i = 1, 20 do
context.definestacking(s
[state=]
\setupcaptions[number=no]
\starttext
\startluacode
context.setupblank({"10mm"})
context.setupcombinations({distance="10mm", after=context.blank()})
context.startplacefigure({title = ""})
context.startcombination({nx=3, ny=4})
for i=1,
fotocal={Photo Calendar}]
\setuplabeltext[nl][fotocal=Fotokalender]
\setuplabeltext[de][fotocal=Fotokalender]
\setuplabeltext[fr][fotocal={Calendrier photo}]
\setuplabeltext[it][fotocal={Calendario fotografico}]
\setuplabeltext[es][fotocal={Calendario fotográfico}]
%D Let lua is perform the magic:
\star
12 directories, 0 files
Finally, make a new file somewhere in the "examples/" folder with the
following contents:
\startluacode
package.loaded.unicode = { utf8 = string }
package.loaded.lualibs = {}
kpse.find_file = function(name)
local path = resolvers.
\definemeasure[mymeasure][10pt]
\newdimen\mydimen \mydimen=10pt
\definemeasure[measureexpr][1in + 27.73pt]
\startluacode
-- Returns the unexpanded value of some variable in a namespace.
local function get_variable(namespace, variable)
-- -- Doesn
work okay:
\definemeasure[mymeasure][10pt]
\newdimen\mydimen \mydimen=10pt
\definemeasure[measureexpr][1in + 27.73pt]
\startluacode
-- Returns the unexpanded value of some variable in a namespace.
local function get_variable(namespace, variable)
1 - 100 of 1088 matches
Mail list logo