Dear list,
I have the following sample (saved as "a.tex"):
\starttext
\getdocumentfilename{1}
\cldcontext{document.files[1]}
\getdocumentfilename{2}
\cldcontext{document.files[2]}
\getdocumentfilename{3}
\cldcontext{document.files[3]}
\stoptext
I compile it with:
number into a tel:link - without spaces
\def\phonelink#1%
{\goto{#1} [url(tel:\cldcontext{string.nospaces("#1")})]}
% Derive an individual's name
\def\name#1%
{\ifxmlattempty{#1}{first_name} {\xmlatt{#1}{initials}} \else {\xmlatt{#1}{initials}, \xmlatt{#1}{first_name}} \fi
\ifxmla
)})]
}
ConTeXt has a Lua function to remove spaces.
\starttext
\cldcontext{string.nospaces("01234 56789")}
\stoptext
Wolfgang
___
If your question is of interest to others as well, please add an ent
.
\startluacode
function document.leadingzeros(str)
local lzeros = 3-str:len()
return ("0"):rep(lzeros)
end
\stopluacode
\unexpanded\def\lzeros#1%
{\cldcontext{document.leadingzeros("#1")}}
Same. With numbercommand, Lua gets "\s and can’t handle it
t.leadingzeros(str)
local lzeros = 3-str:len()
return ("0"):rep(lzeros)
end
\stopluacode
\unexpanded\def\lzeros#1%
{\cldcontext{document.leadingzeros("#1")}}
> * I can force a section number with “ownnumber”, but the next one is
> back in the previous
ore inpiut and discussion for that
\starttexdefinition DoWithSection #1#2
\startpagemakeup
\externalfigure[#1.pdf][page=#2]
\stoppagemakeup
\stoptexdefinition
\starttexdefinition LoadSectionsA #1#2
\ctxlua{document.loadsection("#1","#2")}
\doifnot{\cldcontext{do
uot;)
function sha256(str)
if os.name == "windows" then
return utilities.sha2.hash256(str:gsub("\r", "\r\n"))
else
return utilities.sha2.hash256(str:gsub("\r", "\n"))
end
end
\stopluacode
\def\shabuffer#1%
{\cldcont
and another one
\stopbuffer
\starttext
\startluacode
require("util-sha")
function sha256(str)
return utilities.sha2.hash256(
str:gsub(string.char(0x0D), string.char(0x0A))
)
end
\stopluacode
\def\shabuffer#
habuffer#1%
{\cldcontext{utilities.sha2.hash256(buffers.raw("#1"))}}
\def\shafile#1%
{\cldcontext{utilities.sha2.hash256(io.loaddata("#1"))}}
\def\shabufferfile#1%
{\cldcontext{utilities.sha2.hash256(buffers.raw("#1"))}}
\shabuffer{test}
\savebuffer[tes
est
\stopbuffer
\starttext
\startluacode
require("util-sha")
function document.sha512buffer(buffer)
return utilities.sha2.hash512(buffers.raw(buffer))
end
\stopluacode
\def\shabuffer#1
{\cldcontext{document.sha512buffer("#1")}}
\shabuff
Dear list,
I have the following sample:
\ctxlua{require("util-sha")}
\starttext
\startbuffer[abc]
samples
\stopbuffer
\cldcontext{utilities.sha2.hash512("buffer-name")}
\stoptext
Is there any way to get "utilities.sha2.hash512" with the conte
ontext
> garden.
> Where to look?
Dear dr. van der Meer,
it is my fault since Hans explained this before (to me).
Here you have the minimal sample:
\ctxlua{require("util-sha")}
\def\shatwo#1{%
\cldcontext{utilities.sha2.hash256("#1")}}
\def\shafive#1{%
userdata.save_data[#1] = userdata.visual_order
> > }%
> > }
> >
> > \let\old_footnote=\footnote
> >
> > \starttexdefinition protected footnote #1
> > \begingroup
> > \clf_set_footnote_number
> >
>
userdata.visual_order = userdata.visual_order + 1
> userdata.save_data[#1] = userdata.visual_order
> }%
> }
>
> \let\old_footnote=\footnote
>
> \starttexdefinition protected footnote #1
> \begingroup
> \clf_set_footnote_
\def\insert##1\bgroup##2\egroup{
\normalexpanded{
\noexpand\save_footnote_data
{\cldcontext{userdata.input_order}}
}
\normalinsert##1{##2}
}
\old_footnote{#1}
\endgroup
\stoptexdefiniti
setxheight [#1][#2]
> > \switchtobodyfont[#1, 12pt]
> > \scratchdimen=\dimexpr#2\relax
> > \switchtobodyfont[#1, \cldcontext{tex.dimen.scratchdimen /
> tex.sp"1ex"
> > * tex.sp"1em" .. "sp"}]
> > \stoptexdefinition
> >
> > But I can't
I'm using the following macro to set the font size via h-height:
\starttexdefinition setxheight [#1][#2]
\switchtobodyfont[#1, 12pt]
\scratchdimen=\dimexpr#2\relax
\switchtobodyfont[#1, \cldcontext{tex.dimen.scratchdimen / tex.sp"1ex"
* tex.sp"1em" .. "sp&quo
[#1, 12pt]
\scratchdimen=\dimexpr#2\relax
\switchtobodyfont[#1, \cldcontext{tex.dimen.scratchdimen / tex.sp"1ex"
* tex.sp"1em" .. "sp"}]
\stoptexdefinition
But I can't figure out how to use that in MPpage.
Any help would be a
old version expected direct input, not a \dimen. Try this:
>
> \starttexdefinition setxheight [#1][#2]
> \switchtobodyfont[#1, 12pt]
> \scratchdimen=\dimexpr#2\relax
> \switchtobodyfont[#1, \cldcontext{tex.dimen.scratchdimen /
> tex.sp"1ex"
]
\switchtobodyfont[#1, 12pt]
\scratchdimen=\dimexpr#2\relax
\switchtobodyfont[#1, \cldcontext{tex.dimen.scratchdimen / tex.sp"1ex" *
tex.sp"1em" .. "sp"}]
\stoptexdefinition
\definemeasure[xheight][2.5pt]
\starttext
\setxheight[advento
How would one specify the font size in LMTX, but via x-height?
>>
>> You could try this:
>>
>> \starttexdefinition setxheight [#1][#2]
>> \switchtobodyfont[#1, 12pt]
>> \switchtobodyfont[#1, \cldcontext{tex.sp"#2" / tex.sp&qu
\switchtobodyfont[#1, \cldcontext{tex.sp"#2" / tex.sp"1ex" *
> tex.sp"1em" .. "sp"}]
> \stoptexdefinition
>
> Demo:
>
> \starttexdefinition setxheight [#1][#2]
> \switchtobodyfont[#1, 12pt]
>
How would one specify the font size in LMTX, but via x-height?
You could try this:
\starttexdefinition setxheight [#1][#2]
\switchtobodyfont[#1, 12pt]
\switchtobodyfont[#1, \cldcontext{tex.sp"#2" / tex.sp"1ex" * tex.sp"1em" ..
"
On 9/11/2021 2:35 PM, Pablo Rodriguez via ntg-context wrote:
Dear list,
I have the following sample:
\starttext
\setupinteraction
[state=start,
title={\cldcontext{pdfe.open("b.pdf").Info.Title}}]
\null
\stoptext
From a document composed with \insertpag
Dear list,
I have the following sample:
\starttext
\setupinteraction
[state=start,
title={\cldcontext{pdfe.open("b.pdf").Info.Title}}]
\null
\stoptext
From a document composed with \insertpages, I need to transfer medatada.
But I get the raw value "feff0061&
)
\starttext
% \enabletrackers[system.randomizer.details]
% empty == default
\newrepeatablerandom\MyRandom {Welcome 2 America}
\newrepeatablerandom\MyRandomN{\randomnumber{0}{1000}}
\newrepeatablerandom\MyRandomM{\randomnumber{0}{1000}}
\cldcontext
t; > when the word contains the letters ó or ô.
> > We get zoolco instead of zoológico, and termtro instead of termômetro.
> > What am I doing wrong?
> >
> > mwe:
> >
> > \def\stripnumber#1%
> > {\cldcontext{lpeg.match(lpeg.stripper("[¹²³⁴
:
\def\stripnumber#1%
{\cldcontext{lpeg.match(lpeg.stripper("[¹²³⁴⁵⁶⁷⁸⁹⁰]"),
[==[#1]==])}}
\starttext
\stripnumber{árbitro⁶}
\stripnumber{ébano¹}
\stripnumber{ícone⁸}
\stripnumber{zoológico⁰}
\stripnumber{eletroacústico⁹}
\stripnumber{trânsfuga⁷}
\stripnumber{fa
Dear list,
in the mwe below, the expected result is ok for most entries but fails when
the word contains the letters ó or ô.
We get zoolco instead of zoológico, and termtro instead of termômetro. What
am I doing wrong?
mwe:
\def\stripnumber#1%
{\cldcontext{lpeg.match(lpeg.stripper
e call):
>>>>>>>>>>io.open(filename,"r")
filename=events/hga-0372-1764-63.xml=>file (0x7fff974160b8)
Open file two levels deeper fails:
>>>>>>>>>>io.open(filename,"r")
filename=events/transcripten/hga-0372-1764
>>>>>>io.open(filename,"r") filename=events/hga-0372-1764-63.xml=>file
>>>>>>>>>>(0x7fff974160b8)
Open file two levels deeper fails:
>>>>>>>>>>io.open(filename,"r")
>>>>>>>>>>file
t; arguments = "2 strings",
> >
> > actions = registermydata
> >
> > }
> >
> > \stopluacode
> >
> >
> > \unprotect
> >
> > \def\mysetups[#1]%
> >
> > {\getdummyparameters[#1]%
> >
> > \processassignmentlist[#1]\clf_registermy
= "registermydata",
arguments = "2 strings",
actions = registermydata
}
\stopluacode
\unprotect
\def\mysetups[#1]%
{\getdummyparameters[#1]%
\processassignmentlist[#1]\clf_registermydata}
\protect
\starttext
\mysetups[love=nice,hate=awful]%
\dummyparameter
"2 strings",
actions = registermydata
}
\stopluacode
\unprotect
\def\mysetups[#1]%
{\getdummyparameters[#1]%
\processassignmentlist[#1]\clf_registermydata}
\protect
\starttext
\mysetups[love=nice,hate=awful]%
\dummyparameter{love}
\cldcontext{userdata.mydata[2]}
\stoptext
: Re: [NTG-context] Randomize order of blocks
> Following up my previous message, here is an example:
>
> %% begin shuffled list of exercises
> \setuprandomize[2021]
>
> \startluacode
> function shuffle(tableau)
> local maxsize, t, tt
>
> "-2x\\sin(x^2)",
> "x\\cos(x) + \\sin(x)",
> "1 + \\tan(x)^2",
> "3x^2 - 6x",
> "\\frac{-2x}{(1 + x^2)^2}",
> "\\frac{
"\\frac{\\cos(\\log(x))}{x}",
}
\stopluacode
\starttext
% We define a buffer and a shuffled list of integers
\startbuffer[test-derivatives]
\startluacode
ShuffledList = shuffle({1,2,3,4,5,6})
\stopluacode
Let $\cldcontext{ListOfNames[Shuffl
Hi, Joseph.
Something like this?
\starttext
\cldcontext{converters.convert("r",118):gsub("i$", "j") }
\stoptext
Jairo
El mié, 25 de nov. de 2020 a la(s) 14:30, Joseph (josephcan...@gmail.com)
escribió:
> Yes, I replace last ‘i’ with a ‘j’ in roman number,
sCc : JosephObjet :Re: [NTG-context] Issue with tex.romannumeral output Joseph schrieb am 25.11.2020 um 19:51:> Dear list,> > Following MWE outputs only ‘m’ characters (with latest upload). Is there a reason why you don't use the conversion mechanism? \starttext \convertnumber{r}{7} \cldcontext{conver
Joseph schrieb am 25.11.2020 um 19:51:
Dear list,
Following MWE outputs only ‘m’ characters (with latest upload).
Is there a reason why you don't use the conversion mechanism?
\starttext
\convertnumber{r}{7}
\cldcontext{converters.convert("r",7)}
\stoptext
\cldcontext{document.name} is the name.
\stoptext
[...]
I’m using current latest (ConTeXt MkIV 2020.11.08 12:42).
I’m not sure what I am missing or whether I have hit a bug.
This has been discussed before I think. It has to do with how you
configured your system (what encoding) and how
On 11/12/20 10:55 PM, Hans Hagen wrote:
> On 11/12/2020 10:39 PM, Pablo Rodriguez wrote:
>> Dear list,
>>
>> I have the following sample:
>>
>>\starttext
>>\startluacode
>>io.write(' Name? ')
>>document.name = io.read() or ''
On 11/12/2020 10:39 PM, Pablo Rodriguez wrote:
Dear list,
I have the following sample:
\starttext
\startluacode
io.write(' Name? ')
document.name = io.read() or ''
\stopluacode
\cldcontext{document.name} is the name.
\stoptext
Running it on Linux, I can input non-ascii
Dear list,
I have the following sample:
\starttext
\startluacode
io.write(' Name? ')
document.name = io.read() or ''
\stopluacode
\cldcontext{document.name} is the name.
\stoptext
Running it on Linux, I can input non-ascii characters.
When running in Windows, if the input chars
t with
the first run mode.
\startmode[*first]
\startluacode
io.write("\n\n Document URL?")
document.url_address = io.read()
\stopluacode
\definedataset[document_data]
\setdataset[document_data]
[url=\cldcontext{document.url_address}]
\stopmode
\star
e[*last]
> > \startluacode
> > io.write("¿Cuál es el mensaje? ")
> > document.message = io.read()
> > \stopluacode
> > %~ \stopmode
> >
> > El mensaje es: \cldcontext{document.message}
> > \stoptext
> >
> I
ocument.message = io.read()
> \stopluacode
> %~ \stopmode
>
> El mensaje es: \cldcontext{document.message}
> \stoptext
>
> I have two questions about it.
>
> How can I invoke an extra run (as mentioned at
> http://www.pragma-ade.com/general/manuals/
Dear list,
I have the following sample:
\mainlanguage[es]
\setupbodyfont[dejavu]
\starttext
%~ \startmode[*last]
\startluacode
io.write("¿Cuál es el mensaje? ")
document.message = io.read()
\stopluacode
%~ \stopmode
El mensaje es: \cldcontext{docume
Dear list,
I have this sample:
\setupinteraction[state=start]
\starttext
\def\cB{file.pdf}
\def\cC{file with spaces.pdf}
%~ \def\PathName{\cldcontext{[[\env{completepath}]]}}
\def\PathName{%
\cldcontext{string.gsub([[\env{completepath
t;> return string.match(name, "%d+")
>> end
>>\stopluacode
>>
>>\define[1]\numbersfname
>>{\cldcontext{userdata.numbersfname([==[#1]==])}}
>
> Untested:
>
> \defineexpandable[1]\numbersfname
> {\cldcontext{userd
On 10/13/20 5:33 PM, Pablo Rodriguez wrote:
> [...]
> \starttext
> \ctxlua{ d = [[\env{fname}]] }
>
> d: \cldcontext{d}\\
> \doifelse{\cldcontext{d:match("\letterpercent d+")}}
> {123}{yes}{no}
> \stoptext
> [...]
> 3. I’m trying this on
communicating
between tex and lua. For example:
[...]
\define[1]\numbersfname
{\cldcontext{userdata.numbersfname([==[#1]==])}}
This is the first time I see that way of wrapping an argument.
In any case, I cannot compare to a number:
\startluacode
userdata = userdata or {}
function
and lua. For example:
> [...]
> \define[1]\numbersfname
> {\cldcontext{userdata.numbersfname([==[#1]==])}}
This is the first time I see that way of wrapping an argument.
In any case, I cannot compare to a number:
\startluacode
userdata = userdata or {}
funct
Pablo Rodriguez schrieb am 13.10.2020 um 17:33:
Dear list,
I have the following sample:
\starttext
\def\numbersfname
{\cldcontext{string.match([[\env{fname}]], "\letterpercent d+")}}
\ctxlua{ c = context.getvariable("environment", "fname") or &quo
On Tue, 13 Oct 2020, Pablo Rodriguez wrote:
> Dear list,
>
> I have the following sample:
>
> \starttext
> \def\numbersfname
> {\cldcontext{string.match([[\env{fname}]], "\letterpercent d+")}}
> \ctxlua{ c = context.getvariable("environment"
Dear list,
I have the following sample:
\starttext
\def\numbersfname
{\cldcontext{string.match([[\env{fname}]], "\letterpercent d+")}}
\ctxlua{ c = context.getvariable("environment", "fname") or "a" }
\ctxlua{ d = [[\env{fname}]] }
tex:
Dear list,
I have the following sample:
\starttext
\ctxlua{ context.setvariable("environment", "filename", "abc123") }
\ctxlua{ c = context.getvariable("environment", "filename") or "a" }
\ctxlua{ d = [[\env{filename}]]
\def\startswith[#1][#2]
{\cldcontext{document.starts_with("#1", "#2")}}
You need a % at the end of the definition, otherwise TeX expects a space
after the second argument to end the command.
\unexpanded\def\startswith[#1][#2]%
{...}
To improve your comma
Dear list,
I have the following sample:
\starttext
\startluacode
function document.starts_with(str, start)
if str:sub(1, #start) == start then
context(start)
end
end
\stopluacode
\unexpanded\def\startswith[#1][#2]
{\cldcontext
any thanks for your reply, Lukas.
I found another workaround at the ConTeXt file (b.tex).
\cldcontext{string.gsub([[\env{PDFdocument}]], "", "/")}
I don’t know why I needed to add "" instead of "\\". (otherwise, I
I guess that's as Ctx translates &qu
Lukas.
I found another workaround at the ConTeXt file (b.tex).
\cldcontext{string.gsub([[\env{PDFdocument}]], "", "/")}
I don’t know why I needed to add "" instead of "\\". (otherwise, I
kept getting "C://Users//username//Desktop//document.pdf
. Is there a way to deal with this? Perhaps
something similar like \hyphenatedurl{} or an extended version of
\setbreakpoints.
(I currently use zero-width spaces, so I got rid of ISBNs in the
margins, but a more automatic solution would be great.)
\unexpanded\def\isbnnumber#1%
{\cldcontext
something
similar like \hyphenatedurl{} or an extended version of \setbreakpoints.
(I currently use zero-width spaces, so I got rid of ISBNs in the
margins, but a more automatic solution would be great.)
\unexpanded\def\isbnnumber#1%
{\cldcontext{string.gsub("#1","-","
On 8/27/20 7:35 PM, Wolfgang Schuster wrote:
> [...]
> You have to replace %% with \letterpercent\letterpercent because you're
> still playing with TeX rules.
>
> \startxmlsetups xml:special
> \startitem
> \cldcontext{string.gsub("\xmlraw{#1}{.}"
Pablo Rodriguez schrieb am 27.08.2020 um 19:16:
On 8/27/20 6:16 PM, Wolfgang Schuster wrote:
Pablo Rodriguez schrieb am 27.08.2020 um 17:56:
[...]
\startxmlsetups xml:special
\startitem
\cldcontext{string.gsub([[\xmlraw{#1}{.}]], "%%",
"
On 8/27/20 6:16 PM, Wolfgang Schuster wrote:
> Pablo Rodriguez schrieb am 27.08.2020 um 17:56:
>> [...]
>>\startxmlsetups xml:special
>> \startitem
>> \cldcontext{string.gsub([[\xmlraw{#1}{.}]], "%%",
>> "\\letterp
xmlsetsetup{#1}{html}{xml:gen}
\stopxmlsetups
\xmlregistersetup{xml:initialize}
\startxmlsetups xml:gen
\startitemize
\xmlfilter{#1}{/**/span[@class='special']/command(xml:special)}
\stopitemize
\stopxmlsetups
\startxmlsetups xml:special
\startitem
\cldcontext{stri
up{#1}{html}{xml:gen}
\stopxmlsetups
\xmlregistersetup{xml:initialize}
\startxmlsetups xml:gen
\startitemize
\xmlfilter{#1}{/**/span[@class='special']/command(xml:special)}
\stopitemize
\stopxmlsetups
\startxmlsetups xml:special
\startitem
\cldcontext{string.gsub([[\xmlr
...]
\startxmlsetups xml:initialize
\xmlsetsetup{#1}{html}{xml:gen}
\xmlsetsetup{#1}{span[@class='special']}{xml:span:special}
\stopxmlsetups
[...]
\startxmlsetups xml:span:special
(\cldcontext{(string.gsub([[\xmlraw{#1}{.}]]," of the ", ""))})
\stopxmlsetups
Many
\startxmlsetups xml:initialize
> \xmlsetsetup{#1}{html}{xml:gen}
> \xmlsetsetup{#1}{span[@class='special']}{xml:span:special}
> \stopxmlsetups
> [...]
> \startxmlsetups xml:span:special
> (\cldcontext{(string.gsub([[\xmlraw{#1}{.}]]," of the ", ""
string for you to modify.
Many thanks for your explanation, Taco.
> Also, the special (catcode, space handling) rules for setups and \cldcontext
> do not help you.
>
> That does not mean it can’t be done. As I don’t know a of a nice way,
> here is a low-level ‘ugly' way:
>
\xmlfilter{#1}{/**/div/command(xml:special)}
\stopxmlsetups
\startxmlsetups xml:special
%~ \startitem
\cldcontext{string.gsub(lxml.flush([[#1]]),
" of the ", "")}\stopitem
\stopxmlsetups
\starttext
\xmlprocessbuffer{main}{demo}{}
\stopte
up{#1}{html}{xml:gen}
> \stopxmlsetups
>
> \xmlregistersetup{xml:initialize}
>
> \startxmlsetups xml:gen
> \xmlfilter{#1}{/**/div/command(xml:special)}
> \stopxmlsetups
>
> \startxmlsetups xml:special
>%~ \startitem
>\cldcontext{string.gsub(lxml.flush(
\startxmlsetups xml:special
%~ \startitem
\cldcontext{string.gsub(lxml.flush([[#1]]),
" of the ", "")}\stopitem
\stopxmlsetups
\starttext
\xmlprocessbuffer{main}{demo}{}
\stoptext
Is there any way to remove " of " and " of the " in the fil
Hello Pablo,
although I'm not sure about what to achieve, should this be helpful for
you?
Ctx source:
Pablo.mkiv
\starttext
\setupheadertexts[][\cldcontext{"Mode = " .. (tex.modes["1"] and "1"
or tex.modes["2"] and "2" or "??&q
)}
$=\cldcontext{document.myfunction(2,355/113)} \sim 0$.
\startplacefigure[title={Nothing works\dots}]
\startMPcode{GridAxis}
numeric gu ; gu = 5mm ; % gu = graph unit
draw image (
draw function (1,"x","document.myfunction(2,x)", % <-- this does not
wor
)
local S
S = math.sin(n*x)
return S
end
\stopluacode
\starttext
Here \type{document.myfunction(n,x)} is $\sin(nx)$. For instance when $n = 2$
and $x = 355/113$ we have:
\type{document.myfunction(2,355/113)}
$=\cldcontext{document.myfunction(2,355/113
anyone explain me what I’m doing wrong?
You try to pass a protected (\expanded\def) command to a argument of
another command
which doesn't work: Remove \unexpanded and your output is as expected.
\def\giveattachment#1%
{\cldcontext{document.special_attachment("#1")}}
Many thanks for
e explain me what I’m doing wrong?
>
> You try to pass a protected (\expanded\def) command to a argument of
> another command
> which doesn't work: Remove \unexpanded and your output is as expected.
>
> \def\giveattachment#1%
> {\cldcontext{document.special_attachment
, 10)
attachment_url = "https://www.boe.es/buscar/pdf/; ..
year .. "/" .. reference .. "-consolidado.pdf"
return attachment_url
end
\stopluacode
\unexpanded\def\giveattachment#1{%
\cldcontext{document.special_attachment(
oe.es/buscar/pdf/; ..
year .. "/" .. reference .. "-consolidado.pdf"
return attachment_url
end
\stopluacode
\unexpanded\def\giveattachment#1{%
\cldcontext{document.special_attachment("#1")}}
\def\cE{BOE-A-1978-31229}
t; .. reference .. "-consolidado.pdf"
return attachment_url
end
\stopluacode
\unexpanded\def\giveattachment#1{%
\cldcontext{document.special_attachment("#1")}}
\def\cE{BOE-A-1978-31229}
\attachment[file={\giveattachment{\cE}}, color=red]
\attachm
the
result
of the first random value is stored in the macro.
\def\RandomA{\cldcontext{math.random(1,4)}}
\edef\RandomB{\cldcontext{math.random(1,4)}}
\starttext
\dorecurse{10}{A: \RandomA \quad B: \RandomB\par}
\stoptext
Wolfgang
Willi Egger schrieb am 21.04.2019 um 19:28:
Hi all,
"when manipulating in one area you will have to manipulate also in other aeras”
I must confess.
I asked some time ago about manipulating the pagenumber. Wolfgang provide me
the following approach:
\cldcontext{“\letterperce
Hi all,
"when manipulating in one area you will have to manipulate also in other aeras”
I must confess.
I asked some time ago about manipulating the pagenumber. Wolfgang provide me
the following approach:
\cldcontext{“\letterpercent.0f”,(\pagenumber+1)/2}
This works indeed fine. Howeve
pulate the page number. However I
> get an error:
>
>
> MWE:
>
> \setuppapersize [A6] [A6]
>
> \setuppagenumbering[location=none]
>
> \startsetups [Pagenumber]
> \doifrightpageelse
>{\cldcontext{"\letterpercent d",(\pagenumber+1)/2}}
>
Willi Egger schrieb am 02.04.19 um 21:17:
Hello!
I have the following code, which should manipulate the page number. However I
get an error:
MWE:
\setuppapersize [A6] [A6]
\setuppagenumbering[location=none]
\startsetups [Pagenumber]
\doifrightpageelse
{\cldcontext{"\letterpe
Hello!
I have the following code, which should manipulate the page number. However I
get an error:
MWE:
\setuppapersize [A6] [A6]
\setuppagenumbering[location=none]
\startsetups [Pagenumber]
\doifrightpageelse
{\cldcontext{"\letterpercent d",(\pagenumber+1)/2}}
{}
\
On 3/11/19 10:36 PM, Wolfgang Schuster wrote:
> Pablo Rodriguez schrieb am 11.03.19 um 22:23:
>> [...]
>> Is there a single command for \ctxlua{context(...)}?
>
> \cldcontext{...}
Many thanks for your fast reply, Wolfgang.
Pablo
--
Pablo Rodriguez schrieb am 11.03.19 um 22:23:
Dear list,
I know this has been already posted to the list, but I cannot find it
right now.
Is there a single command for \ctxlua{context(...)}?
\cldcontext{...}
Wolfgang
[pagenumber]
\doifoddpageelse
{\cldcontext{"\letterpercent d",(\pagenumber+1)/2}}
{}
\stopsetups
\setupheadertexts [\directsetup{pagenumber}]
\starttext
\dorecurse{10}{\samplefile{knuth}}
\stoptext
Variant 2:
\defineexpandable[1]\DwarsliggerNumber
{\cldcontext{"\
lor[mycolor][r=0.5*0.7]
>
> \starttext
>
> \colored[r=\cldcontext{0.5*0.7}]{\cldcontext{0.5*0.7}}
>
> \colored[r=\cldcontext{"\letterpercent
> .3f",0.5*0.7}]{\cldcontext{"\letterpercent .3f",0.5*0.7}}
>
> \stoptext
>
Better use \luaexpr. From th
Mohammad Hossein Bateni schrieb am 18.02.19 um 04:37:
Hi,
When I use definecolor, (how) can I use computations in setting the
value of a component? Something like the following...
\definecolor[mycolor][r=0.5*0.7]
\starttext
\colored[r=\cldcontext{0.5*0.7}]{\cldcontext{0.5*0.7}}
\colored
quot;15px" src="Lab01_eq10401623798909303081.png" width="95px"/>
\stopbuffer
\startxmlsetups whatever
\xmlsetsetup{#1}{p|equation}{xml:*}
\stopxmlsetups
\xmlregistersetup{whatever}
\startxmlsetups xml:p
\xmlflush{#1}
\stopxmlsetups
\startxml
finished string
near eof”. Obviously caused by the %’s.
How to get this working? \textpercent will not do, off course within
Luacode.
% = \letterpercent
$ = \letterdollar
You can also replace
\directlua{tex.print(...)}
with
\ctxlua{context(...)}
or
\cldcontext
On 11/22/2018 2:05 PM, Procházka Lukáš Ing. wrote:
Hello,
the function 'debug.getinfo' was removed?
The following code:
\startluacode
print(debug.getinfo)
\stopluacode
\starttext
A \cldcontext{tostring(debug.getinfo)}
\stoptext
gives/prints 'nil'.
IIRC, the function was non
On Thu, Nov 22, 2018 at 2:02 PM Procházka Lukáš Ing. wrote:
> Hello,
>
> the function 'debug.getinfo' was removed?
>
> The following code:
>
>
> \startluacode
>print(debug.getinfo)
> \stopluacode
>
> \starttext
>A \cldcontext{tostring(debug
Hello,
the function 'debug.getinfo' was removed?
The following code:
\startluacode
print(debug.getinfo)
\stopluacode
\starttext
A \cldcontext{tostring(debug.getinfo)}
\stoptext
gives/prints 'nil'.
IIRC, the function was non-nil some weeks ago...
Best regards,
Lukas
--
Ing
/18 05:37, Jan U. Hasecke wrote:
On 13.08.2018 17:57, Pablo Rodriguez wrote:
if you don’t mind using Lua, here you have it:
\starttext
\def\duedate{\cldcontext{os.date('\letterpercent d/\letterpercent
m/\letterpercent Y', os.time()+ 10 * 24 * 3600)}}
\duedate
On 13.08.2018 17:57, Pablo Rodriguez wrote:
> if you don’t mind using Lua, here you have it:
>
> \starttext
> \def\duedate{\cldcontext{os.date('\letterpercent d/\letterpercent
> m/\letterpercent Y', os.time()+ 10 * 24 * 3600)}}
>
> \duedate
> \st
1 - 100 of 199 matches
Mail list logo