From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/107592 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: "Jairo A. del Rio" Newsgroups: gmane.comp.tex.context Subject: Two questions concerning numerals in ConTeXt Date: Mon, 1 Jun 2020 23:25:55 -0500 Message-ID: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0587085845650878496==" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="94219"; mail-complaints-to="usenet@ciao.gmane.io" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Jun 02 06:26:29 2020 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jfyVQ-000OPJ-J7 for gctc-ntg-context-518@m.gmane-mx.org; Tue, 02 Jun 2020 06:26:28 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 6248B183900; Tue, 2 Jun 2020 06:26:10 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RzW-pTXMSlSA; Tue, 2 Jun 2020 06:26:09 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 7090C1847D5; Tue, 2 Jun 2020 06:26:09 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E3A391847D5 for ; Tue, 2 Jun 2020 06:26:07 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5FDiOiMR_nCT for ; Tue, 2 Jun 2020 06:26:07 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.221.41; helo=mail-wr1-f41.google.com; envelope-from=jairoadelrio6@gmail.com; receiver= Original-Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 33D04183900 for ; Tue, 2 Jun 2020 06:26:07 +0200 (CEST) Original-Received: by mail-wr1-f41.google.com with SMTP id x6so1854724wrm.13 for ; Mon, 01 Jun 2020 21:26:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=L6pCC6jvZ0BM93zRaFB0kFaWfoLyQAe/tV1s6L33U1c=; b=vAF0malKnNxuCUWuAIaiHUdCJ4MXvIVN69jfMtukphOK2aslkAUDk/QUqBPtnCEPTf 84jyyM2prxLokhAkFJqUp/56Ir2MUfMteqREaxIfn48LmN7rIULqdSjR32U4aQtxbMq0 XM+YIUeaEuTh2Y9zCQHGTEEL8mgHtzyVFLL6QMPFFVg1/ZtmhLSAiGHI4N8MR+nt5exs WFdhPK5IxlcF/KrGSq2rh4qqskmuju0t5q7R0O8VXaXzbakt2m7KG2hKyq/hwBeuKjXX ittEl95ukVaEkOYxJrjelmlekJslCSZYd1SimKrZWIjvsoWplg9RDDs6SAi5sdluHqsx 0paw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=L6pCC6jvZ0BM93zRaFB0kFaWfoLyQAe/tV1s6L33U1c=; b=MutCPTYMHDK8gm9MQgiAjKNPsjyqp/JTmwHYm2eWYYuq730/NSbBnJNVh2SvJQHqOQ /QvugJ0DTbGnl8brO3vG+d3baruYl7oLIJob/APpVsoFN7y7aEmKFHpZQPuYC7cfFbnb PMgH7Wo6SNfgdLxEc8wlAdxyQmcqSK9KaFNSYHCakpz3Go1oSvQ4JXITKuUVdSu4Gt0S blo3y5JeIflpjqCFEM6R7RQlKB1XizhBNHgHsUEgEvlfeYp3cQ6nd8uOuP8QdLDHO8y1 e8DadXOF2Ru2lwN7T8wLmkHSCsTKCdmvp3l3laUySQioPzeOZ9g6SNvtCWwEAi0G/0T3 vd8w== X-Gm-Message-State: AOAM532GGJByibROXTzElooYzJh7Q4/1662VQYVJF+geV+FfAvv7M1q6 MgXuJg9zLN4McRybK6oHnJmUZGtHxPDgmwbijjNJXut8UuY= X-Google-Smtp-Source: ABdhPJyDAA71smktgs1M4lo8avB8J9O6KX5q1GIr7wiT3eYhy+ucEUw27hC8IDBQv8ji2MXcTejb4N0hXhzT/HmUvtw= X-Received: by 2002:a05:6000:100e:: with SMTP id a14mr24205689wrx.349.1591071966680; Mon, 01 Jun 2020 21:26:06 -0700 (PDT) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:107592 Archived-At: --===============0587085845650878496== Content-Type: multipart/alternative; boundary="00000000000062da2d05a7124f32" --00000000000062da2d05a7124f32 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, everybody. I expect you to be safe. I found the following issues. *First. *The following gives wrong results for Spanish numbers \mainlanguage[es] \starttext \convertnumber{words}{100} %Prints "ciento" instead of "cien" \convertnumber{words}{2000000} %Prints "dos mill=C3=B3n" instead of "dos millones" \stoptext I've read other messages from the list concerning numerals and I found the following in core-con.lua [100] =3D "ciento", [1000000] =3D "mill=C3=B3n", [1000000000] =3D "mil millones", [1000000000000] =3D "bill=C3=B3n", "cien" (for numbers from 100 to 199) and "millones" (for numbers from 2 000 000 to 999 999 999 999) are missing (no issue with "bill=C3=B3n", as Lua do= esn't seem to handle too big numbers natively). *Second. *I tried to use Unicode tally marks (U1D377 and U1D378): \definefont[tallyfont][babelstonehan] %\mainlanguage[es] \startluacode userdata =3D userdata or {} userdata.tallymarks =3D function(n) local one =3D [[\char"1D377]] --Also tried "\u{1D377}" local five =3D [[\char"1D378]] --Also tried "\u{1D377}" return string.rep(five, (tonumber(n)//5))..string.rep(one, (tonumber(n)%5)) end \stopluacode \def\tallymarks#1{\ctxlua{userdata.tallymarks("#1")}} \starttext \tallyfont \tallymarks{47} \stoptext This works on Lua 5.4.0 (rc4) interpreter, but it doen't on ConTeXt LMTX nor LuaTeX and codes are printed instead (1D3781D378...). What is weird considering that \starttext \char"1D377 \stoptext gives the right output with an adequate font. Btw, I know about the Metafun alternative described on the book, but I'd prefer to use Unicode when possible. Thank you in advance. Jairo :D --00000000000062da2d05a7124f32 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi, everybody. I expect you to be safe.
I found the following issues.

First= . The following gives wrong results for Spanish numbers
<= br>
\mainlanguage[es]
\starttext
\convertnumber{words}{100}=
%Prints "ciento" instead of "cien"
\convertnumber{words}{2000000}
%Prints "dos mill=C3=B3n&quo= t; instead of "dos millones"
\stoptext
I've read other messages from the list concerning numerals= and I found the following in core-con.lua

[10= 0] =3D "ciento",
[1000000] =3D "mill=C3=B3n",=
[1000000000] =3D "mil millones",
[100000= 0000000] =3D "bill=C3=B3n",

"cien&q= uot; (for numbers from 100 to 199) and "millones" (for numbers fr= om 2 000 000 to 999 999 999 999) are missing (no issue with "bill=C3= =B3n", as Lua doesn't seem to handle too big numbers natively).

Second. I tried to use Unicode ta= lly marks (U1D377 and U1D378):

\definefont[tal= lyfont][babelstonehan]
%\mainlanguage[es]
\startluacode
userdata = =3D userdata or {}
userdata.tallymarks =3D function(n)
local one =C2= =A0=3D [[\char"1D377]]
--Also tried "\u{1D377}&quo= t;
local five =3D [[\char"1D378]]
--Also = tried "\u{1D377}"
return string.rep(five, (tonumber= (n)//5))..string.rep(one, (tonumber(n)%5))
end
\stopluacode
\def\t= allymarks#1{\ctxlua{userdata.tallymarks("#1")}}
\starttext
= \tallyfont \tallymarks{47}
\stoptext

This works= on Lua 5.4.0 (rc4) interpreter, but it doen't on ConTeXt LMTX nor LuaT= eX and codes are printed instead (1D3781D378...). What is weird considering= that

\starttext
\char"1D= 377
\stoptext

gives the right output wit= h an adequate font. Btw, I know about the Metafun alternative described on = the book, but I'd prefer to use Unicode when possible.
Thank you in advance.

Jairo :D <= br>
--00000000000062da2d05a7124f32-- --===============0587085845650878496== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============0587085845650878496==--