[NTG-context] Fwd: outlinetext broken?

2024-05-13 Thread Jairo A. del Rio
-- Forwarded message -
De: Jairo A. del Rio 
Date: lun, 13 may 2024 a la(s) 9:53 p.m.
Subject: Re: outlinetext broken?
To: Hans Hagen 


Hi, Hans! Thank you for the update! I'm curious about the following issue:
when I use Latin Modern (by default), a thick, filled line is drawn next to
the radical. However, when I use another font such as TeX Gyre Schola, I
get something similar to outlines-003.pdf, which is, in turn, similar to
the result of applying PDF effects. So, shouldn't this result be the
default? Thanks a lot again.

Best regards,

Jairo

El sáb, 11 may 2024 a la(s) 10:04 p.m., Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 5/11/2024 8:33 PM, Jairo A. del Rio wrote:
> > As for the current ConTeXt, the example above still produces the wrong
> > output. Can anyone reproduce this case? Thank you in advance.
> It's a bit tricky but this is what i can get ... see attached.
>
> (You have to wait till a next upload.)
>
> Hans
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: outlinetext broken?

2024-05-11 Thread Jairo A. del Rio
As for the current ConTeXt, the example above still produces the wrong
output. Can anyone reproduce this case? Thank you in advance.

Jairo

El sáb, 4 may 2024 a la(s) 7:23 p.m., Jairo A. del Rio (
jairoadelr...@gmail.com) escribió:

> Hi, list
>
> \startMPpage
> draw outlinetext.d("\mathematics{\sqrt{2}-1}")(withcolor black withpen
>   currentpen) scaled 1;
> \stopMPpage
>
> fails (radicals are not drawn at all). As for context --version,
>
> mtx-context | ConTeXt Process Management 1.06
> mtx-context |
> mtx-context | main context file:
> /usr/local/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv
> mtx-context | current version: 2024.04.01 08:59
> mtx-context | main context file:
> /usr/local/context/tex/texmf-context/tex/context/base/mkxl/context.mkxl
> mtx-context | current version: 2024.04.01 08:59
>
> Maybe it's only me, but I tried with several fonts and the outcome is
> similar.
>
> Best regards,
> Jairo
>


ema.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] outlinetext broken?

2024-05-04 Thread Jairo A. del Rio
Hi, list

\startMPpage
draw outlinetext.d("\mathematics{\sqrt{2}-1}")(withcolor black withpen
  currentpen) scaled 1;
\stopMPpage

fails (radicals are not drawn at all). As for context --version,

mtx-context | ConTeXt Process Management 1.06
mtx-context |
mtx-context | main context file:
/usr/local/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv
mtx-context | current version: 2024.04.01 08:59
mtx-context | main context file:
/usr/local/context/tex/texmf-context/tex/context/base/mkxl/context.mkxl
mtx-context | current version: 2024.04.01 08:59

Maybe it's only me, but I tried with several fonts and the outcome is
similar.

Best regards,
Jairo


ema.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] How to implement word corrections

2023-12-27 Thread Jairo A. del Rio
Hi, list! I'm writing a small module to print word corrections, e.g.,
things like "irregardless" > "regardless"or "alverja" > "arveja" ('pea' in
Spanish) with overstrikes and underlines, but I want feedback to make a
module in the ConTeXt fashion. I hope the PDF attached explains better what
I mean. Just in case, I want to know if anyone else in the mailing list is
acquainted with grammar and orthography quizzes/exercises/exams in ConTeXt.
Merry Christmas and Happy New Year!

Best regards,

Jairo


correction_draft.tex
Description: Binary data


correction_draft.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Score sums and references

2023-12-13 Thread Jairo A. del Rio
Cool. It works once \startlines ... \stoplines is removed. Thank you
very much!

Jairo

El mié, 13 dic 2023 a la(s) 3:40 a.m., Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 12/13/2023 4:05 AM, Jairo A. del Rio wrote:
> > Hi, dear list. Is there a proper "ConTeXt way" to do the following?
> >
> > \integerdef\lmao=0
> > \starttext
> > Sum: \in[trick] % 10 from the result below
> >
> > +1\advance\lmao\plusone
> >
> > +2\advance\lmao\plustwo
> >
> > +3\advance\lmao\plusthree
> >
> > +4\advance\lmao\plusfour
> >
> > \normalexpanded{\reference[trick]{\the\lmao}} % 10 printed above
> > \stoptext
> >
> > I want the result of a sum (either via Lua or TeX) to be printed before
> > summands in text, but without the mess of reference options such as
> > interaction, etc. Thank you in advance and sorry for any inconvenience.
>
> \integerdef\DSlmao=0
>
> \starttext
>
> Sum: \datasetvariable{test-1}{1}{whatever}
>
> \startlines
> +1\advance\DSlmao\plusone
> +2\advance\DSlmao\plustwo
> +3\advance\DSlmao\plusthree
> +4\advance\DSlmao\plusfour
> \stoplines
>
> \normalexpanded{\setdataset[test-1][whatever=\the\DSlmao]}
>
> \stoptext
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Score sums and references

2023-12-12 Thread Jairo A. del Rio
Hi, dear list. Is there a proper "ConTeXt way" to do the following?

\integerdef\lmao=0
\starttext
Sum: \in[trick] % 10 from the result below

+1\advance\lmao\plusone

+2\advance\lmao\plustwo

+3\advance\lmao\plusthree

+4\advance\lmao\plusfour

\normalexpanded{\reference[trick]{\the\lmao}} % 10 printed above
\stoptext

I want the result of a sum (either via Lua or TeX) to be printed before
summands in text, but without the mess of reference options such as
interaction, etc. Thank you in advance and sorry for any inconvenience.

Regards,

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Buffer and \input content as input for \processtokens, etc.

2023-12-06 Thread Jairo A. del Rio
Hi, list! My question is just like that: how do I pass buffers or \input
content to \processtokens. What I have done so far:

\tolerant\protected\def\foo#={\ifparameter#1\or\oof{#1}\fi}
\protected\def\oof#1{<#1>}
\startbuffer[ofo]
% Output: Ths  not a  anymore!
Th{i{s {is} not a {question} anymore!
\stopbuffer
\starttext
\processtokens\foo\foo\relax\space{Th{i}s {is} not a {question} anymore!}
% Neither \inlinebuffer nor \rawbuffer work in the example above
\stoptext

I've also tried a variant of the mechanism described in OPmac trick
described here  to
process content token by token, but it only works with \normalinput. Any
suggestions or guidance? Thank you in advance.

Best regards,
Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Bug or feature? \numexpression and hashes

2023-09-04 Thread Jairo A. del Rio
Hi, list. The following fails with a "Missing number, treated as zero"
error prompt:

\starttext
\expandedrepeat2{\expandedrepeat2{\the\numexpression#I+#P\relax\ }}
\stoptext

OTOH, \numexpr works seamlessly. Tested on ConTeXt 2023.09.03 19:03. Thanks
in advance.

Best regards,

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Building luametatex with Lua symbols exposed

2023-08-30 Thread Jairo A. del Rio
Hi, beloved list. Since sources are in the distribution, I've tried
compiling luametatex by setting LMT_STRIP in CMakeLists.txt to 0, yet the
resulting binary still warns about undefined symbols, such as lua_gettop,
when an external library is loaded in Lua. Any ideas on how to solve it?
Thank you in advance.

Best regards,

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: issue with current latest (2023.07.28 20:04)

2023-07-29 Thread Jairo A. del Rio
El sáb, 29 jul 2023 a la(s) 02:50, Pablo Rodriguez (oi...@gmx.es) escribió:

> Dear list,
>
> trying to generate the format for current latest (2023.07.28 20:04), I
> get this error message:
>
> tex error   > tex error on line 280 in file lang-lab.mkxl: Control
> sequence expected instead of undefined
>
> \lang_labels_define_class_indeed {head}{
>
>  \definelabelclass
> ...ded {\lang_labels_define_class_indeed {#1}{\ifchknumber #2\or
> \lastchknumber
> \else \zerocount \fi }\expandafter \noexpand \csn ...
> 
> \definelabelclass [head]  [0]
>  % titles
>
> 
> You injected something that confused the parser, maybe by using some Lua
> call.
>
> LuaMetaTeX is from 20230727 (just in case it might be relevant).
>
> Could anyone confirm the issue?
>

Same here. If, in line 69 of lang-lab.mkxl, you replace \lastchknumber with
#2 (as it seems it was in older releases, e.g.
https://source.contextgarden.net/tex/context/base/mkxl/lang-lab.mkxl?search=lang-lab),
it works again. Anyway, let's wait for a proper fix by Hans.

Regards,

Jairo


> Many thanks for your help,
>
> Pablo
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Text item groups

2023-07-15 Thread Jairo A. del Rio
Hi, list! I want to know how to make numbers in text item groups run along
with text (for instance, wrt indentation) regardless of their position in
text. In the following example:

\setupindenting[yes,medium]

\starttext

\startitemize[a,text][textdistance=none]

\startitem \input{jojomayer}\stopitem

\startitem \input{jojomayer}\stopitem

\startitem \input{jojomayer}\stopitem

\stopitemize

\stoptext

Indentation is ignored altogether. Thank you in advance

Regards,

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Replacer based on function rathen than tables

2023-05-18 Thread Jairo A. del Rio via ntg-context
Hi, list. There's lang-rep.mkxl and lang-tra.mkxl in the distribution which
allows replacing a list of words and applying transliteration,
respectively. Both are based on tables. I want to know if there's a way to
use a function instead, say

local function nice(str)
   return str .. " is nice"
end

Thanks in advance. Best regards,

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Module authors: please update your metadata

2023-05-15 Thread Jairo A. del Rio via ntg-context
El lun, 15 may 2023 a la(s) 11:45, Henning Hraban Ramm via ntg-context (
ntg-context@ntg.nl) escribió:

> Am 15.05.23 um 17:51 schrieb Jairo A. del Rio via ntg-context:
> > Hi, Hraban. I updated the sudoku module to remove the top redundant
> > folder and added LICENSE, README, and VERSION files. What should I do
> > if I want my module in CTAN? I asked two years ago and it was told to me
> > synchronization with ConTeXt was automatic. Any comments? Thanks in
> advance.
>
> Hi Jairo & thank you!
>
> Yes, CTAN sync should happen automatically.
>
> The metadata for your module looks good, except the missing license.
>
> The file list also looks good:
> https://modules.contextgarden.net/cgi-bin/module.cgi/action=view/id=107
> But the download file is not to be found in the download section.


Check again, please.


>
> Directory and VERSION has the new change date, but nothing more:
> https://modules.contextgarden.net/dl/
>
> I don’t know what happened, would you please try to upload again and/or
> send me your release file?
>

I reuploaded my module. Let me know if problems persist. Thank you very
much!


> Hraban
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Module authors: please update your metadata

2023-05-15 Thread Jairo A. del Rio via ntg-context
Hi, Hraban. I updated the sudoku module to remove the top redundant folder
and added LICENSE, README, and VERSION files. What should I do if I want my
module in CTAN? I asked two years ago and it was told to me synchronization
with ConTeXt was automatic. Any comments? Thanks in advance.

Best regards,

Jairo

El vie, 14 abr 2023 a la(s) 06:53, Henning Hraban Ramm via ntg-context (
ntg-context@ntg.nl) escribió:

> Hi,
> I just updated the module writing guidelines, since I couldn’t find a
> description of the necessary structure of a module release file:
> https://wiki.contextgarden.net/Modules#Module_writing_guidelines
>
> I also added an explanation how the publishing via
> https://modules.contextgarden.net works.
>
> If you ever published a module, please check if its metadata is still
> correct, e.g. if the module works for MkIV / LMTX and how it should be
> published – some modules aren’t installable via rsync as outlined in
> https://wiki.contextgarden.net/Modules#ConTeXt_LMTX
>
> (For me, the “simplified version” works.)
>
> These modules get installed that way:
>
> f-urwgaramond
> f-urwgothic
> t-account
> t-algorithmic
> t-animation
> t-annotation
> t-bnf
> t-chromato
> t-cmscbf
> t-cmttbf
> t-construction-plan
> t-cyrillicnumbers
> t-degrade
> t-fancybreak
> t-filter
> t-fixme
> t-french
> t-fullpage
> t-games (not in dl)
> t-gantt
> t-gnuplot
> t-handlecsv (newer than in dl)
> t-layout
> t-letter
> t-lettrine
> t-lilypond (not in dl, obsolete)
> t-mathsets
> t-rst
> t-ruby
> t-simplefonts
> t-simpleslides
> t-tikz
> t-title
> t-transliterator
> t-typearea
> t-typescripts
> t-vim
> t-visualcounter
>
> Some of these are probably outdated, I didn’t check.
> If you know something is obsolete, please let us know or remove it
> yourself, if you still know your account data.
>
>
> Several more modules are available via
> https://modules.contextgarden.net/dl/ (mentioned as "dl" above).
> I added a comment where the directory structure isn’t quite right:
>
> PocketDiary-V2.zip (module folder on top)
> Collection-of-calendars-based-on-PocketDiary-module.zip (module folder
> on top)
> Date-driven-lists.zip (module folder on top)
> Environment-for-collating-marks.zip (module folder on top)
> aquamints (no structure)
> bibmod-doc (looks right)
> gfsdidot (looks right)
> grph-downsample.lua  (looks right, except .lua in folder name)
> enigma.zip (looks right, except .zip in folder name)
> handlecsv (not unzipped, no VERSION file, but newer version in dl)
> high (looks right)
> karnaugh (looks right)
> lua-widow-control (looks right)
> lucida-cint.zip (looks right, except .zip in folder name)
> metaducks (metaducks folder on top)
> presvoz (looks right)
> pret-c.lua (looks right, except .lua in folder name)
> stormfontsupport (looks right)
> sudoku (sudoku folder on top)
> t-gm (looks right)
> t-greek (looks right)
> t-gs (looks right)
> t-inifile (looks right)
> t-layout (looks right)
> t-letterspace.mkiv (looks right, except .mkiv in folder name)
> t-rsteps (looks right)
> t-simplebib (looks right)
> t-taspresent (looks right)
> u-texshow (looks right)
>
> (“looks right” only means that the structure looks like TDS, many are
> old and probably obsolete, but a few are quite new, like the first four
> by Willi)
>
>
> All the best & happy TeXing,
> Hraban
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] update

2023-04-26 Thread Jairo A. del Rio via ntg-context
This is weird, but documents compile just fine if I comment the following
line in node-pag.mkxl:

\registerctxlua{node-pag}{}

Maybe leftovers from some experiment here?

Best regards.

El mié, 26 abr 2023 a la(s) 21:25, Rik Kabel via ntg-context (
ntg-context@ntg.nl) escribió:

>
> On 2023-04-26 19:54, Jairo A. del Rio via ntg-context wrote:
> > Hi, Hans. The following happens with the last update:
> >
> > loading > ConTeXt Node Macros / Page Building
> > resolvers   > lua > unknown file 'node-pag.lua'
> >
> > error loading file: node-pag.lua (aborting)
> >
> > Indeed, the file is missing in the distribution (there's only
> > node-pag.mkxl). Regards
>
>
> Same here, Windows 11 x64.
>
> --
> Rik
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] update

2023-04-26 Thread Jairo A. del Rio via ntg-context
Hi, Hans. The following happens with the last update:

loading > ConTeXt Node Macros / Page Building
resolvers   > lua > unknown file 'node-pag.lua'

error loading file: node-pag.lua (aborting)

Indeed, the file is missing in the distribution (there's only
node-pag.mkxl). Regards

El mié, 26 abr 2023 a la(s) 16:56, Hans Hagen via ntg-context (
ntg-context@ntg.nl) escribió:

> Hi,
>
> I uploaded a new version with some new features discussed at the end of
> this mail.
>
> - A next version of luatex will break context (format making etc) but
> the change is unavoidable because of other macro package demands wrt
> security (context does that differently). The low level start up command
> has been adapted so unless you update indepdently thinsg should work ok.
>   Of course this has no consequences for lmtx.
>
> - I've done a bit of callback cleanup (like getting rid of some mkiv
> luatex left-overs). It should have no effect on regular usage.
>
> - There again a few improvements wrt math (this time dealing with
> accents artifacts in some fonts). We check all the free math fonts for
> potential issues and then try to fix it (read: deal with it). It's a lot
> of work but we're getting there.
>
> - A few reported buglets have been fixed.
>
> - The biggest addition is however a new number model. In metapost one
> can now use 'posit' (positfun instance) as number mode which will use
> (currently 32 bit but at some point 64 bit) posit unums. It's also bit
> of a playground because 32 bit posits are not more accurate than 64 bit
> doubles. It anyhow exposed some potential issues that we'll look into.
>
> - There's also a (again currently 32 bit) posit library at the Lua end
> as playground.
>
> - However, 32 bit posits come in handy at the tex end because they pack
> better accuracy in 32 bits than floats and it makes it possible to have
> native floats, so we have:
>
> \newfloat  (uses \floatdef, register like \dimendef is used in \newdimen)
>
> \newposit  (uses \positdef, like \dimensiondef etc)
>
> \floatexpr (like \numexpr)
>
> \iffloat   (like \ifnum) (also \ifabsfloat and i'll add the others too)
>
> Actually it adds an extra range of registers so it bumps memory usage a
> bit. I'm considering lowering the number of registers (currently 64K per
> category) because after all, if 64K is not enough then we can as well
> stick to 32K or 16K (for some even less). There's always Lua for
> unlimited storage of quantities.
>
> So,
>
> \newfloat\fooA
>
> \scratchdimen=123.456pt\relax[\type{dim:}
> \the\scratchdimen==123.456pt]\par
> \fooA=123.456\relax  [\type{pos:} \the\fooA
> ==123.456]  \par
> \fooA=\scratchdimen\relax[\type{pos:} \the\fooA
> ==123.456]  \par
> \scratchdimen=\fooA\relax[\type{dim:}
> \the\scratchdimen==123.456pt]\par
> \scratchdimen\dimexpr\fooA+10pt\relax[\type{dim:}
> \the\scratchdimen==133.456pt]\par
>
> produces
>
> [dim: 123.456pt==123.456pt]
> [pos: 123.45600128173828==123.456]
> [pos: 123.45599365234375==123.456]
> [dim: 123.456pt==123.456pt]
> [dim: 133.456pt==133.456pt]
>
> As you can see dimens will get mapped onto floats not as integers
> (scaled points) but in pt units. Counts stay numbers. I need to handle
> glue too (not yet done).
>
> In the future I might use this for fractions but there might be some
> rough ends so for now it's experimental.
>
> Hans
>
>
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Textadept no longer supported?

2022-08-26 Thread Jairo A. del Rio via ntg-context
Sorry for the noise. I found Textadept files in the GitHub repo. However,
it would be nice to have them in the distribution. Have a nice day.

Cordially,

Jairo

El vie, 26 ago 2022 a la(s) 19:01, Jairo A. del Rio (jairoadelr...@gmail.com)
escribió:

> Hi, list.
>
> Last time I installed my ConTeXt distribution from scratch, I've noticed
> Textadept files are no longer in the distribution. I've tried SciTE but
> it's broken in Ubuntu as code highlighting just doesn't work. Has something
> changed? Is it possible to get those files from an older version? Thanks in
> advance.
>
> Best regards,
>
> Jairo
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Textadept no longer supported?

2022-08-26 Thread Jairo A. del Rio via ntg-context
Hi, list.

Last time I installed my ConTeXt distribution from scratch, I've noticed
Textadept files are no longer in the distribution. I've tried SciTE but
it's broken in Ubuntu as code highlighting just doesn't work. Has something
changed? Is it possible to get those files from an older version? Thanks in
advance.

Best regards,

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Sudoku module

2022-07-18 Thread Jairo A. del Rio via ntg-context
Hi. Sorry. I didn't see your message and I had forgotten the very existence
of the module. I'll check it later (final exam weeks for me) so that it
works with MkIV and LMTX properly again. By the way, thanks for the
interest.

Best regards

Jairo

El lun., 18 de jul. de 2022 10:00 a. m., Otared Kavian 
escribió:

> Hi Jairo,
>
> You sent a message last year about your Sudoku module, and today, out of
> curiosity, I wanted to test it. Unfortunately it stops with an error
> message at line 76 of the file t-sudoku.mkiv, where you have:
>
> \def\sudokufunction_direct[#name][#parameters]#content
>
> I would appreciate if you could tell me whether you have a working version
> of you module, or what one has to change in order to typeset your examples.
>
> Best regards: Otared
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Interaction broken for formulas in LMTX

2022-07-14 Thread Jairo A. del Rio via ntg-context
Hi, list!

Sorry, I don't have a MWE, but it looks like interactive references for
formulas (via \in) are not working after the update. I mean, labels are
fine, but they do nothing when clicked. References for tables and figures
are fine, though.

Best regards,

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Harfbuzz plugin and colors

2022-02-13 Thread Jairo A. del Rio via ntg-context
Hi, list! I've tested the Harfbuzz plugin in ConTeXt and it works nicely
for most cases. However, color doesn't seem to work. Is this intended? I
know this plugin won't be supported, but I'll be fine with pointers to
solve this issue. Thanks in advance.

\usemodule[fonts-plugins]
\definefontfeature[harf]
  [mode=plug,
   features=harfbuzz,
   shaper=native]
%Just to test Harfbuzz is actually working
\definefontfeature[devaA][harf]
  [language=dflt,
   script=deva]
\definefontfeature[devaB][default]
  [script=deva]
\definefontfeature[colored][harf]
  [language=dflt,script=arab,
   colr=yes] %doesn't do anything
\startbuffer[hindi]
%From a Wikipedia page
हिन्‍दी भाषा का इतिहास लगभग एक सहस्र वर्ष पुराना माना गया है। हिन्‍दी भाषा
व साहित्‍य के जानकार अपभ्रंश की अन्तिम अवस्‍था 'अवहट्ठ से हिन्‍दी का उद्भव
स्‍वीकार करते हैं। चन्द्रधर शर्मा 'गुलेरी' ने इसी अवहट्ठ को 'पुरानी हिन्दी'
नाम दिया।

अपभ्रंश की समाप्ति और आधुनिक भारतीय भाषाओं के जन्मकाल के समय को
संक्रान्तिकाल कहा जा सकता है। हिन्दी का स्वरूप शौरसेनी और अर्धमागधी
अपभ्रंशों से विकसित हुआ है। 1000 ई॰ के आसपास इसकी स्वतन्त्र सत्ता का परिचय
मिलने लगा था, जब अपभ्रंश भाषाएँ साहित्यिक सन्दर्भों में प्रयोग में आ रही
थीं। यही भाषाएँ बाद में विकसित होकर आधुनिक भारतीय आर्य भाषाओं के रूप में
अभिहित हुईं। अपभ्रंश का जो भी कथ्य रूप था - वही आधुनिक बोलियों में विकसित
हुआ।
\stopbuffer
\starttext
{\righttoleft\definedfont[file:AmiriQuranColored.ttf*colored]\input{khatt-ar}}

{\definedfont[file:Lohit-Devanagari.ttf*devaA]\getbuffer[hindi]}
\blank[line]
{\definedfont[file:Lohit-Devanagari.ttf*devaB]\getbuffer[hindi]}
\stoptext


harfbuzz-tests.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Engine mismatch in Windows 8.1 (32 bits)

2022-01-21 Thread Jairo A. del Rio via ntg-context
Hi everyone! I've just installed ConTeXt on an old machine running Windows
8.1 (x86) and I've noticed the format is regenerated each time I process a
file. It can be read on the log (third line):

warning: engine mismatch (luv: This is LuaMetaTeX 2.09.36 <> bin: This is
LuaMetaTeX 2.09.34), forcing remake

grep -r '09.34' finds a coincidence in mtxrun.exe. Is anyone else facing
this issue?

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Getting ONE, TWO... for chapters

2022-01-01 Thread Jairo A. del Rio via ntg-context
El sáb, 1 ene 2022 a la(s) 15:37, jbf via ntg-context (ntg-context@ntg.nl)
escribió:

> Am typesetting a book that has 'STUDY ONE', 'STUDY TWO' etc. in place of
> CHAPTER ONE, etc. I have no difficulty getting 'STUDY' with
> \setuplabeltext[chapter=STUDY~], and I can achieve 'STUDY One' with the
> key conversion=Words in \setuphead[chapter].
>
> My question: how do I get ONE instead of One.
>
> I tried conversion=WORDS (or WORD), but that is not recognised and the
> output then becomes STUDY 1, which I don't want.
>
> I also tried playing with \definestructureconversionset[myconversion][
> ,A,] then adding the numberconversionset=myconversion to \setuphead.
>
> There must be a simple way to achieve the desire result, and to be
> honest I'm wondering why WORD does not work? Any thoughts?
>
>
Like this?

\setuplabeltext[chapter={Study~,}]
\setuphead[chapter][conversion=words,numberstyle=\WORDS]
\starttext
\startchapter[title=Feliz año nuevo!]
\input{tufte}
\stopchapter
\stoptext

I hope it helps. Happy new year!

Jairo

Julian
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] upload

2021-12-24 Thread Jairo A. del Rio via ntg-context
Hi, Hans. In Ubuntu 20.04:

resolvers   > lua > loading file
'/home/coragyps/lmtx/tex/texmf-context/tex/context/base/mkxl/node-cmp.lmt'
succeeded

fatal error: storage cannot be marked

Jairo


El vie, 24 dic 2021 a la(s) 13:45, Hans Hagen via ntg-context (
ntg-context@ntg.nl) escribió:

> Hi,
>
> When wrapping up before the weekend I uploaded a new lmtx (bottom floats
> fixed afaiks, but hat mechanism might see some improvements anyway next
> year; exit codes more reliable; some low level tracing; side float
> coming loose from section head issue solved; ...).
>
> I'm experimenting with some more efficient low level state info and in
> the process ran into an issue / interference with (also low level)
> attributes. I'm not sure if I solved it (work in progress, i need to run
> into another border case first which may take ages) but the test suite
> runs ok so ...
>
> Hans
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] [DKIM] Primes too high in New Computer Modern

2021-12-07 Thread Jairo A. del Rio via ntg-context
Thank you very much! That's exactly what I needed.

Regards,

Jairo

El mar, 7 dic 2021 a la(s) 03:56, Mikael Sundqvist via ntg-context (
ntg-context@ntg.nl) escribió:

> Hi,
>
> We changed so that newcomputermodern-book (which is bolder than
> newcomputermodern) uses the same lfg file as lm, which works. I attach
> an updated version of the type-imp-newcomputermodern.mkiv, which also
> adds the lfg file to newcomputermodern.
>
> /Mikael
>
> PS If one wants to play with modernlatin, is there a simple way to
> play with the boldness (for example make it just slightly less bold)?
>
>
> On Tue, Dec 7, 2021 at 9:45 AM Hans Hagen via ntg-context
>  wrote:
> >
> > On 12/7/2021 2:39 AM, Jairo A. del Rio via ntg-context wrote:
> > > Hi, list. See the following:
> > >
> > > \starttext
> > > $\alpha'$ {\switchtobodyfont[newcomputermodern]$\alpha'$}
> > > \stoptext
> > there is no lfg file for it but if you just want a bolder latin modern
> > you can also do this (there is an old bachotex presentation about it
> > somewhere):
> >
> > \setupbodyfont[modernlatin]
> >
> > \starttext
> >  $\alpha'$
> > \stoptext
> >
> > Hans
> >
> >
> > -
> >Hans Hagen | PRAGMA ADE
> >Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> > -
> >
> ___
> > If your question is of interest to others as well, please add an entry
> to the Wiki!
> >
> > maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> > webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > wiki : http://contextgarden.net
> >
> ___
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Primes too high in New Computer Modern

2021-12-06 Thread Jairo A. del Rio via ntg-context
Hi, list. See the following:

\starttext
$\alpha'$ {\switchtobodyfont[newcomputermodern]$\alpha'$}
\stoptext

Thank you in advance.

Best regards,

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] upload

2021-12-05 Thread Jairo A. del Rio via ntg-context
Hi, Hans. I've got a question. Negative steps are treated as positive:

\starttext
\expandedloop 10 0 -2 {\the\currentloopiterator\ }
\stoptext

gives

0 2 4 6 8 10

Is this expected behavior? If so, it would be fine to have something more
alike to MetaPost's "for ... step ... until" loop. Thank you in advance.

Regards,

Jairo

El vie, 3 dic 2021 a la(s) 09:29, Hans Hagen via ntg-context (
ntg-context@ntg.nl) escribió:

> Hi,
>
> a new upload
>
> - some keywords renamed in the engine and therefore more split between
> mkiv and lmtx (hopefully i included all files) .. if something doesn't
> work any more it might be because i missed a rename.
>
> - i finally decied that it does make sense to have native loops at the
> primitive level (after all, metapost as macro language also has them)
> and although much is possible in macros it doesn't mean we have to do it
> the (often ugly and showing-off-by-abusing-side-effects way).
>
> We have just a constructor:
>
>\unexpandedloop  1 100 1 {.}
>
> and a fully expandable one for e.g. use in \edef:
>
>\expandedloop1 100 1 {.}
>
> plus an also fully expandable one for anywhere but with potential side
> effects (out of order local loops):
>
>\localcontrolledloop 1 100 1 {.}
>
> complemented by a few status primitives (integers, use \the or \number
> to serialize them):
>
>\currentloopiterator
>\currentloopnesting
>
> and a quitter that aborts at the next iteration:
>
>\quitloop
>
> as usual it's experimental for a while. Among the rationales are 'less
> tracing clutter', 'performance' and 'more natural primitive tex coding'
> (but that one is personal).
>
> Hans
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Concerning dictionaries. glossaries and related in ConTeXt

2021-11-26 Thread Jairo A. del Rio via ntg-context
Nice. Looks interesting and, if I understand correctly, entries are
open-ended, which turns out to be useful to customize dictionaries. It
would be a profitable addition! Thank you very much.

Regards,

Jairo

El vie, 26 de nov. de 2021 a la(s) 08:16, Hans Hagen via ntg-context (
ntg-context@ntg.nl) escribió:

> Hi,
>
> kind of like this but maybe we need to go setups as we do with lists and
> sections adn such
>
> Hans
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
>
> -___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Concerning dictionaries. glossaries and related in ConTeXt

2021-11-26 Thread Jairo A. del Rio via ntg-context
Hi, list. I want to know how I should handle alphabetically sorted data in
ConTeXt. So far, I'm abusing registers in order to get simple glossaries,
but I prefer to manage data with tools such as JabRef rather than manually
typing entries inside a document. I attach an example of what I achieved:

\unprotect
\mainlanguage[\s!es]
\enableexperiments[fonts.compact]
\setupbodyfont[computer-modern-unicode]
\setuphead[chapter]
  [\c!alternative=\v!middle]
\defineregister[Russian]
\setupregister[Russian]
  [\c!expansion=\v!yes,
   \c!balance=\v!no,
   \c!n=2,
   \c!command=\Words,
   \c!pagenumber=\v!no,
   \c!language=\s!ru]
\def\Ruso[#1]%
  {\begingroup
   \getdummyparameters[word=,category=,meaning=,#1]%
   \Russian[\dummyparameter{word}]%
   {\bold{\dummyparameter{word}}
   \italic{\dummyparameter{category}}
   \dummyparameter{meaning}}%
   \endgroup}
\protect
\Ruso
[word=исчисление,
 category=n. neutr.,
 meaning=cálculo]
\Ruso
[word=вероятность,
 category=n. fem.,
 meaning=probabilidad]
\Ruso
[word=обозначать,
 category=v.,
 meaning=denotar]
\Ruso
[word=область,
 category=n. fem,
 meaning={región, área}]
\Ruso
[word=событие,
 category=n. neutr.,
 meaning=evento]
\Ruso
[word=определение,
 category=n. neutr.,
 meaning=definición]
\Ruso
[word=знание,
 category=n. neutr,,
 meaning=conocimiento]
\Ruso
[word=бесконечно,
 category=adv.,
 meaning=infinitamente]
\Ruso
[word=сборник,
 category=n. masc.,
 meaning={colección, compilación, compendio}]
\Ruso
[word=неравенство,
 category=n. neutr.,
 meaning=desigualdad]
\starttext
\starttitle[title=Ruso-español]
\placeRussian
\stoptitle
\stoptitle
\stoptext

Reading the manuals, I find that the publication mechanism for bibliography
kinda fits my needs (using ConTeXt to sort and type data generated via
external software) but, unlike registers, it doesn't seem to include
options for alphabetical headers. Is it fine to keep using registers in
this case? Is there a better mechanism for this task in ConTeXt? Thank you
in advance.

Best regards,

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Macro for a comma separated list of authors

2021-11-24 Thread Jairo A. del Rio via ntg-context
Hola.

Maybe you need \commalistsentence?

\def\Autores{%
  {Luis David Gómez-Méndez, Ph. D.},
  {Adriana del Pilar Pulido-Villamarín, M. Sc.},
  {Rubiela Castañeda-Salazar, M. Sc.},
  {Juan Carlos Ulloa-Rubiano, Ph. D.},
  {Adriana Matiz-Villamil, M. Sc.},
  {Fidson Juarismy Vesga-Pérez, Ph. D}%
}
\starttext
\commalistsentence[\Autores][{;\space},{\space\letterampersand\space}]
\stoptext

Check lang-lab.mkxl for other goodies and examples.

Best regards,

Jairo

El mié, 24 de nov. de 2021 a la(s) 19:10, Andres Conrado Montoya via
ntg-context (ntg-context@ntg.nl) escribió:

> I'm trying to produce a document with several authors, using macros for
> comma separated lists. My MWE is as follows:
>
> %%
> \def\autores{%
>   {Luis David Gómez-Méndez, Ph. D.},
>   {Adriana del Pilar Pulido-Villamarín, M. Sc.},
>   {Rubiela Castañeda-Salazar, M. Sc.},
>   {Juan Carlos Ulloa-Rubiano, Ph. D.},
>   {Adriana Matiz-Villamil, M. Sc.}%
> }
>
> \def\lastAutor{Fidson Juarismy Vesga-Pérez, Ph. D}
>
> \def\autorParaLista#1{#1;\space}
> \def\listaAutores{\processcommacommand[\autores]\autorParaLista &
> \lastAutor: autores.}
>
> \starttext
>
> \listaAutores
>
> \stoptext
> %%%
>
> So far, no luck trying to extract the last item from a comma separated
> list. That's the reason I created a "\lastAutor" macro, so I can treat the
> last one differently.
>
> This produces:
>
> %%
> Luis David Gómez-Méndez, Ph.D.; Adriana del Pilar Pulido-Villamarín, M.
> Sc.; Rubiela Castañeda-Salazar, M. Sc.; Juan Carlos Ulloa-Rubiano, Ph.D.;
> Adriana Matiz-Villamil, M. Sc.; & Fidson Juarismy Vesga-Pérez, Ph.D:
> autores.
> %%
>
> However, what I'm trying to get is:
>
> %%
> Luis David Gómez-Méndez, Ph.D.; Adriana del Pilar Pulido-Villamarín, M.
> Sc.; Rubiela Castañeda-Salazar, M. Sc.; Juan Carlos Ulloa-Rubiano, Ph.D.;
> Adriana Matiz-Villamil, M. Sc. & Fidson Juarismy Vesga-Pérez, Ph.D: autores.
> %%
>
> Which is very close to what I need, except the ";" just before the "&". So
> the question is: is it possible to do this in a more effective or simpler,
> or better way, and write a macro that outputs something like "Author1;
> Author2; Author3 & Author4: authors.", given a comma separated list of
> authors?
>
> --
> Andrés Conrado Montoya
> Andi Kú
> andresconr...@gmail.com
> http://sesentaycuatro.com
> http://messier87.com
> http://chiquitico.org
> 
> Los fines no justifican los medios, porque la medida verdadera de nuestro
> carácter está dada por los medios que estamos dispuestos a utilizar, no por
> los fines que proclamamos.
> 
>
> “You develop an instant global consciousness, a people orientation, an
> intense dissatisfaction with the state of the world, and a compulsion to do
> something about it. From out there on the moon, international politics look
> so petty. You want to grab a politician by the scruff of the neck and drag
> him a quarter of a million miles out and say, ‘Look at that, you son of a
> bitch.’” — Apollo 14 astronaut Edgar Mitchell
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Checking for a macro in a string without expanding it

2021-11-16 Thread Jairo A. del Rio via ntg-context
If I understand it correctly, you may need something like this...?

% Protection is key
\protected\def\inner[#1]{\empty}
% \outer is (or was) already defined in \CONTEXT
% Please use another name
\def\Outer{\inner[123] and \inner[some text] etc.}
\startluacode
local implement = interfaces.implement
local argument = tokens.scanners.argument
local function parseinner()
  local r = {}
  local str = argument()
  str = str:gsub("\\inner%s*(%b[])",function(s)r[#r+1] = s:sub(2,#s-1)end)
  context(table.concat(r," ")) -- Change " " by another spacer if needed
end
implement{name = "parseinner", public = true, actions = parseinner}
\stopluacode
\starttext
\parseinner{\Outer}
\stoptext

However, this will only work with very simple cases (no nesting, etc.).
Hope this helps.

Best regards,

Jairo

El mar, 16 de nov. de 2021 a la(s) 14:22, Joey McCollum via ntg-context (
ntg-context@ntg.nl) escribió:

> As the subject of this question suggests, this is really more of a
> question about expansion control (a topic that is still a bit obscure to
> me). Suppose I have a macro \inner that expects a single argument or an
> assignment of parameters in brackets. For my purposes, I don't want this
> macro to do anything when it is typeset, so I'll just define it as empty:
>
> ```
> \def\inner[#1]\empty
> ```
>
> Now suppose I have another macro \outer that invokes this macro with some
> specific input and sets some plain text after it:
>
> ```
> \def\outer{\inner[123] etc.}
> ```
>
> What I'd like to do is parse the argument of \inner in \outer. I was
> hoping that a string search in Lua would work, but I'm not having any luck.
> A minimal (non)-working example is included below:
>
> ```
>
> \def\inner[#1]\empty
>
> \def\outer{\inner[123] etc.}
>
>
> \startluacode
>
> local userdata = userdata or {}
>
> function userdata.parseinner(str)
>
> local innerparams = ""
>
> if string.find(str, "\\inner(%b[])") then
>
>   i, j = string.find(str, "\\inner(%b[])")
>
>   innerparams = string.sub(str, i+1, j-1) -- we just want the content
> inside the brackets
>
> end
>
> context(innerparams)
>
> return
>
> end
>
> \stopluacode
>
> \def\parseinner#1{\ctxlua{userdata.parseinner([==[#1]==])}}
>
>
> \starttext
>
> Testing:\blank
>
> \parseinner{\outer}
>
> \stoptext
> ```
>
> My problem is that when I pass \outer to the \parseinner macro, it gets
> fully expanded, so there isn't anything left to match "\\inner%b[]". Is
> there a way to expand \outer when I pass it to the \parseinner macro
> without also expanding the \inner macro inside it? Or is there some other
> preferred way of doing this?
>
> Joey
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Concerning \installparameterhashhandler and family

2021-11-09 Thread Jairo A. del Rio via ntg-context
Hi. Reading at mult-aux.mkxl, I've seen command handlers define, among
others,  \installparameterhashhandler, However, in files such as those
related with symbol management, only \installparameterhandler and
\installsetuphandler are. When writing basic modules, sometimes only the
"raw" macros above are actually needed. So, what are "parameterset",
"hashhander", "rootparameterhandler", etc. for? Where would they ease
module writing? Thank you a lot and sorry for the long question.

Best regards,

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Hyphenation on digits

2021-11-03 Thread Jairo A. del Rio via ntg-context
Hi again. I've noticed \hyphenateddigits fails with alphabetical symbols,
e.g. with hexadecimal numbers. Maybe there's a better solution, but
something like

--From phys-dim.lua
actions   = function(filler, digits)
digits = gsub(digits,"(%d)","%1\\digitsbreak ") --space added.
Would a "\relax " do better?
digits = gsub(digits,"\\-$",filler)
context(digits)
end

would fix it.

Best regards,

Jairo

El jue, 28 de ene. de 2021 a la(s) 09:00, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 1/28/2021 12:50 PM, Jairo A. del Rio wrote:
> > Hi, list.
> >
> > I want to know if ConTeXt provides an option to automatically
> > hyphenate/break digits as if they were alphabetic characters. Example,
> > in a narrow page I expect something like that (I've used (-) for an
> > optional hyphen):
> >
> > *π = *3.141592653(-)
> > 58979323846264(-)
> > 33832795028841(-)
> > 97169399375105(-)
> > ...
> >
> > I found myself unable to read a satisfactory solution in the mailing
> > list archive nor other TeX related resources. Maybe LMTX has some magic
> > for that?
>
> I'll add support for:
>
> \starttext
>
> \hsize6cm
>
> \pi\ =
> \hyphenateddigits[\unknown]{3.141592653589793238462643383279502884197169399375105}
>
>   \blank
> \pi\ =
> \hyphenateddigits{3.141592653589793238462643383279502884197169399375105}
> \blank
> x $\pi  =
> \hyphenateddigits[\unknown]{3.141592653589793238462643383279502884197169399375105}$
>
> \blank
> x $\pi  =
> \hyphenateddigits{3.141592653589793238462643383279502884197169399375105}$
>   \blank
>
> \stoptext
>
> A quick and dirty hack as we don't need some full blown mechanism for
> such a rare case.
>
> Hans
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] getting number from context.figurewidth

2021-10-27 Thread Jairo A. del Rio via ntg-context
Hi, Pablo. I have no idea of what you need to do, but in grph-inc.lua you
find the following (line 709):

implement { name = "figurestatus",   actions = { get, context }, arguments
= { "'status'",  "string", "string" } }

So that \figureheight calls this function via \clf_figurestatus and, in
turn, it calls figures.get. If I'm right,

figures.get('status','height','0') -- or '"status"' ?

would have to return the value you're asking for (at the TeX end, "sp"
units are added). A MWE wouldn't hurt. I hope this helps or, at least, it
leads you through the right direction.

Cordially,

Jairo

El mié, 27 de oct. de 2021 a la(s) 14:20, Pablo Rodriguez via ntg-context (
ntg-context@ntg.nl) escribió:

> On 10/26/21 6:31 PM, Pablo Rodriguez via ntg-context wrote:
> > [...]
> > Is there a way that I can get a number from context.figureheight, such
> > as I get it from tex.dimen.paperheight?
>
> Sorry for insisting, I need it for a Lua script that in the relevant
> line reads:
>
>   loader_times:write('.box placeholder width=' .. context.figurewidth
>  .. ' height=' .. context.figureheight)
>
> I cannot concatenate string and function (and I need the number, not the
> unit).
>
> Is there no way of doing it?
>
> Many thanks for your help,
>
> Pablo
> --
> http://www.ousia.tk
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Romanization of ancient greek

2021-10-26 Thread Jairo A. del Rio via ntg-context
Ugly hack: add this before loading transliterator:

\startluacode
unicode = unicode and unicode or _G
\stopluacode

I get the following output:

kakon anagkē, all' udemia anagkē zēn meta anagkēs

I hope this helps. I also think you should mail Philipp so that he fixes it
(the Lua code looks pretty old).

Cordially,

Jairo

El mar, 26 de oct. de 2021 a la(s) 05:08, Marcus Vinicius Mesquita via
ntg-context (ntg-context@ntg.nl) escribió:

> I tried the MWE example below with the transliterator module, but context
> throws an error:
> token call, execute:
> ...ules/tex/context/third/transliterator/transliterator.lua:20: attempt to
> index a nil value (global 'unicode')
>
> \usemodule[transliterator]
> \starttext
> \transliterate[mode=gr]{κακὸν ἀνάγκη, ἀλλ' οὐδεμία ἀνάγκη ζῆν μετὰ ἀνάγκης}
> \stoptext
>
> I'm using context current version: 2021.10.24 21:45
> Marcus Vinicius
>
>
>
>
> On Tue, Oct 26, 2021 at 5:13 AM Marcus Vinicius Mesquita <
> marcusvinicius.mesqu...@gmail.com> wrote:
>
>> Thank you, Wolfgang. I'll look into it.
>>
>> Regards
>>
>> Marcus Vinicius
>>
>> On Tue, Oct 26, 2021 at 1:22 AM Wolfgang Schuster <
>> wolfgang.schuster.li...@gmail.com> wrote:
>>
>>> Marcus Vinicius Mesquita via ntg-context schrieb am 26.10.2021 um 00:38:
>>> > Dear list,
>>> >
>>> > Is there anything in ConTeXt that could help me with automatic
>>> > romanization of ancient greek words?
>>>
>>> Is the Transliterator module from Philipp Gesang what you're looking for?
>>>
>>>
>>> https://modules.contextgarden.net/cgi-bin/module.cgi/ruid=5025059042/action=view/id=50
>>>
>>> Wolfgang
>>>
>>>
>>
>> --
>> Todas as coisas fatigam o corpo, salvo a música, que não fatiga nem o
>> corpo nem seus membros, por ser descanso da alma, primavera do coração,
>> distração do aflito, entretenimento do solitário, e viático do viajante.
>>
>> Kunnâsh al-Hâ'ik (Cancioneiro de al-Hâ'ik)
>>
>
>
> --
> Todas as coisas fatigam o corpo, salvo a música, que não fatiga nem o
> corpo nem seus membros, por ser descanso da alma, primavera do coração,
> distração do aflito, entretenimento do solitário, e viático do viajante.
>
> Kunnâsh al-Hâ'ik (Cancioneiro de al-Hâ'ik)
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Metafun's utflen not working in certain contexts

2021-10-05 Thread Jairo A. del Rio via ntg-context
Nice, thanks.

Jairo

El lun, 4 de oct. de 2021 a la(s) 13:23, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 10/3/2021 9:28 PM, Jairo A. del Rio via ntg-context wrote:
> > Hi, list. The following works for MkIV, but not LMTX (adapted from here:
> >
> https://tex.stackexchange.com/questions/617597/how-can-i-use-luas-string-len-inside-a-metapost-function
> > <
> https://tex.stackexchange.com/questions/617597/how-can-i-use-luas-string-len-inside-a-metapost-function
> >):
> >
> > \startMPinclusions
> >
> > vardef MotMystere(expr taille, speciale, index) =
> >
> > save avant,apres,case;
> >
> > numeric avant,apres;
> >
> > path case;
> >
> > case := fullsquare scaled 13;
> >
> > avant := speciale-1;
> >
> > %For Unicode, use "utflen" instead
> >
> > apres := utflen(taille) - speciale;
> >
> > if avant >= 1:
> >
> > for j=1 upto avant:
> >
> > draw (case rotated 180
> >
> > cutafter point 3 of case rotated 180)
> >
> > shifted (-13j,-13*index);
> >
> > endfor;
> >
> > fi;
> >
> > label.lft (index,point 3.5 of
> >
> > case shifted (-13*avant,-13*index));
> >
> > draw case yshifted (-13*index);
> >
> > fill case yshifted (-13*index)
> >
> > withcolor \MPcolor{gray-8};
> >
> > if apres > 0:
> >
> > for j=1 upto apres:
> >
> > draw (case cutafter point 3 of case)
> >
> > shifted (13j,-13*index);
> >
> > endfor;
> >
> > fi;
> >
> > enddef;
> >
> > \stopMPinclusions
> >
> > \starttext
> >
> > An example with "enigma"
> >
> >
> > \startMPcode
> >
> > MotMystere("enigma",4,1)
> >
> > \stopMPcode
> >
> > \stoptext
> for the moment use ()
>
> apres := (utflen(taille)) - speciale;
>
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Metafun's utflen not working in certain contexts

2021-10-03 Thread Jairo A. del Rio via ntg-context
Hi, list. The following works for MkIV, but not LMTX (adapted from here:
https://tex.stackexchange.com/questions/617597/how-can-i-use-luas-string-len-inside-a-metapost-function
):

\startMPinclusions

vardef MotMystere(expr taille, speciale, index) =

save avant,apres,case;

numeric avant,apres;

path case;

case := fullsquare scaled 13;

avant := speciale-1;

%For Unicode, use "utflen" instead

apres := utflen(taille) - speciale;

if avant >= 1:

for j=1 upto avant:

draw (case rotated 180

cutafter point 3 of case rotated 180)

shifted (-13j,-13*index);

endfor;

fi;

label.lft (index,point 3.5 of

case shifted (-13*avant,-13*index));

draw case yshifted (-13*index);

fill case yshifted (-13*index)

withcolor \MPcolor{gray-8};

if apres > 0:

for j=1 upto apres:

draw (case cutafter point 3 of case)

shifted (13j,-13*index);

endfor;

fi;

enddef;

\stopMPinclusions

\starttext

An example with "enigma"


\startMPcode

MotMystere("enigma",4,1)

\stopMPcode

\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Getting Textadept to open pdf?

2021-09-26 Thread Jairo A. del Rio via ntg-context
El dom, 26 de sep. de 2021 a la(s) 22:29, jbf (roma83...@gmail.com)
escribió:

> Hmm. I'm not using evince (could, I suppose) but I see that in the file
> you mention there is already:
>
> ['okular']= [[okular --unique "%filename%"]], and I have already
> adapted the init.lua file in /.texadept to use okular rather than sumatra,
> with textadept.run.compile_commands.tex =
> '/home/me/bin/context/tex/texmf-linux-64/bin/mtxrun --autogenerate --script
> context --autopdf=okular "%f"'
>
> So, following your logic, I should then only need to add, further on,
> pdfview.method = "okular", which I have done, but still no joy.
>
> In such a case, you only need to comment on the second option, i. e.
Sumatra:

--The last one wins
pdfview.method = "okular"
--pdfview.method = "sumatra" -- faster and more complete

I haven't edited textadept settings btw, so it works for me with --autopdf
alone.

> Julian
>
>
> On 27/9/21 1:06 pm, Jairo A. del Rio wrote:
>
> Hi. Maybe there's an easier way to do it without changing any file or via
> mtxrun's command line, but the following is what I do:
>
> In l-pdfview.lua (mkiv folder, lines from 38) PDF view options are
> available. I've added
>
> ['evince']= [[evince "%filename%"]] -- My favorite viewer
>
> And then, after pdfview.method assignments,
>
> pdfview.method = "evince"
>
> Now textadept opens the .tex file once compiled. I don't know if making
> the format again is mandatory, but it doesn't hurt, anyways. I hope this
> helps.
> Best regards,
>
> Jairo
>
>
>
> El dom, 26 de sep. de 2021 a la(s) 20:54, jbf via ntg-context (
> ntg-context@ntg.nl) escribió:
>
>> The occasional response to a similar question can be found, e.g. on
>> stackexchange, but none of the responses work for me.
>>
>> Textadept is very fast at compiling (and does compile correctly). I can
>> certainly open the pdf independently in various pdf viewers, but I
>> cannot get Textadept to automatically open, say, Okular (installed on
>> Linux Mint), at the end of the process.
>>
>> The last part of the log reads:
>>
>> mkiv lua stats  > runtime: 0.640 seconds, 8 processed pages, 8 shipped
>> pages, 12.492 pages/second
>> mtx-context | pdfview methods: auto default okular pdfxcview
>> sumatra, current method: okular (directives_pdfview_method)
>> pdfview | command: okular --unique "test1.pdf" 1>/dev/null
>> 2>/dev/null &
>> mtx-context | pdfview overhead: 0.001 seconds
>> system  | total runtime: 0.649 seconds of 0.701 seconds
>>
>>  > exit status: 0
>>
>> Have tried setting up a custom text editor on okular with:
>> /home/me/.textadept "%f" -e textadept.editing.goto_line(%l-1), as
>> suggested by one response, but to no avail. Current version of ConTeXt
>> is 2021.09.17 10:01
>>
>> Anyone tried Textadept successfully and might have a suggestion?
>>
>> Julian
>>
>>
>> ___
>> If your question is of interest to others as well, please add an entry to
>> the Wiki!
>>
>> maillist : ntg-context@ntg.nl /
>> http://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : http://contextgarden.net
>>
>> ___
>>
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Getting Textadept to open pdf?

2021-09-26 Thread Jairo A. del Rio via ntg-context
Hi. Maybe there's an easier way to do it without changing any file or via
mtxrun's command line, but the following is what I do:

In l-pdfview.lua (mkiv folder, lines from 38) PDF view options are
available. I've added

['evince']= [[evince "%filename%"]] -- My favorite viewer

And then, after pdfview.method assignments,

pdfview.method = "evince"

Now textadept opens the .tex file once compiled. I don't know if making the
format again is mandatory, but it doesn't hurt, anyways. I hope this helps.
Best regards,

Jairo



El dom, 26 de sep. de 2021 a la(s) 20:54, jbf via ntg-context (
ntg-context@ntg.nl) escribió:

> The occasional response to a similar question can be found, e.g. on
> stackexchange, but none of the responses work for me.
>
> Textadept is very fast at compiling (and does compile correctly). I can
> certainly open the pdf independently in various pdf viewers, but I
> cannot get Textadept to automatically open, say, Okular (installed on
> Linux Mint), at the end of the process.
>
> The last part of the log reads:
>
> mkiv lua stats  > runtime: 0.640 seconds, 8 processed pages, 8 shipped
> pages, 12.492 pages/second
> mtx-context | pdfview methods: auto default okular pdfxcview
> sumatra, current method: okular (directives_pdfview_method)
> pdfview | command: okular --unique "test1.pdf" 1>/dev/null
> 2>/dev/null &
> mtx-context | pdfview overhead: 0.001 seconds
> system  | total runtime: 0.649 seconds of 0.701 seconds
>
>  > exit status: 0
>
> Have tried setting up a custom text editor on okular with:
> /home/me/.textadept "%f" -e textadept.editing.goto_line(%l-1), as
> suggested by one response, but to no avail. Current version of ConTeXt
> is 2021.09.17 10:01
>
> Anyone tried Textadept successfully and might have a suggestion?
>
> Julian
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Passing colors to Metafun and TeX's bitmapimage macros

2021-09-01 Thread Jairo A. del Rio via ntg-context
Hi, list!
I want to know if there's a handy way to pass predefined colors, either RGB
or CMYK, e.g. those in svg or crayola, to Metafun's bitmapimage. Say,
something like:

\startMPpage

% svg's gold definition

draw bitmapimage(2, 2, "ffd700 ffd700 ffd700 00") scaled 3cm;

\stopMPpage

using "gold" instead of its definition so that I can set bitmap image
colors by name rather than numbers. In a similar vein, I wonder if
something analogous is possible for ConTeXt's \bitmapimage macro. Thank you
in advance.

Cordially,

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Using ConTeXt Lua libraries

2021-07-28 Thread Jairo A. del Rio via ntg-context
Hi everyone!

I want to know the proper way to load ConTeXt Lua modules/libraries *en
masse*. such as those listed in cld-mkiv, without actual typesetting in
order to write some scripts. I thought about creating a .cld file with no
output, but I suspect there's a better way. Thanks in advance.

Regards,
Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] reusableMPgraphic

2021-07-15 Thread Jairo A. del Rio
Hi, list! Is this already fixed in a new upload? I'm compiling old
documents and having the same problem as Thomas, although Wolfgang's
comment fixes it nicely.

Cordially,

Jairo

El lun, 12 de jul. de 2021 a la(s) 11:18, Wolfgang Schuster (
wolfgang.schuster.li...@gmail.com) escribió:

> Thomas A. Schmitz schrieb am 12.07.2021 um 18:02:
> > Hi all,
> >
> > I don’t know if I’m overlooking something really basic or if this is a
> bug. The following MWE compiles with mkiv, but not with lmtx:
> >
> > \startreusableMPgraphic{fold}
> > fill unitsquare xyscaled (1mm,1mm) withcolor blue ;
> > \stopreusableMPgraphic
> >
> > \definelayer[foldingmarkslayer][width=\paperwidth,height=\paperheight]
> > \setlayer[foldingmarkslayer][y=101mm,x=11mm]{\reuseMPgraphic{fold}}
> >
> > \setupbackgrounds [page][background=foldingmarkslayer]
> >
> > \starttext
> >
> > Test
> >
> > \stoptext
> >
> > The error I get:
> >
> > tex error on line 6 in file ./test.tex: Use of \meta_usempgraphic_nop
> doesn't match its definition
> >
> > Any pointers? Thanks
>
> meta-ini.mkxl
>
> -\def\meta_usempgraphic_nop#=#*#=%
> +\tolerant\def\meta_usempgraphic_nop#=#*#=%
>{\meta_begin_graphic_group{#1}%
> ...
> \meta_end_graphic_group}
>
> Wolfgang
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Install script not working

2021-06-24 Thread Jairo A. del Rio
It works again! Thank you very much

Jairo

El jue, 24 de jun. de 2021 a la(s) 17:23, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 6/24/2021 11:58 PM, Jairo A. del Rio wrote:
> >
> >
> > El jue, 24 de jun. de 2021 a la(s) 16:55, Hans Hagen (j.ha...@xs4all.nl
> > <mailto:j.ha...@xs4all.nl>) escribió:
> >
> > On 6/24/2021 11:47 PM, Jairo A. del Rio wrote:
> >  >
> >  >
> >  > El jue, 24 de jun. de 2021 a la(s) 16:42, Hans Hagen
> > (j.ha...@xs4all.nl <mailto:j.ha...@xs4all.nl>
> >  > <mailto:j.ha...@xs4all.nl <mailto:j.ha...@xs4all.nl>>) escribió:
> >  >
> >  > On 6/24/2021 11:35 PM, Jairo A. del Rio wrote:
> >  >  >
> >  >  >
> >  >  > El jue, 24 de jun. de 2021 a la(s) 16:30, Hans Hagen
> >  > (j.ha...@xs4all.nl <mailto:j.ha...@xs4all.nl>
> > <mailto:j.ha...@xs4all.nl <mailto:j.ha...@xs4all.nl>>
> >  >  > <mailto:j.ha...@xs4all.nl <mailto:j.ha...@xs4all.nl>
> > <mailto:j.ha...@xs4all.nl <mailto:j.ha...@xs4all.nl>>>) escribió:
> >  >  >
> >  >  > On 6/24/2021 11:20 PM, Jairo A. del Rio wrote:
> >  >  >  > It prints:
> >  >  >  >
> >  >  >  > uname -m rb
> >  >  > hm, that is a real last resort attempt to determine
> what
> >  > system it is
> >  >  > running on (we try to avoid such calls)
> >  >  >
> >  >  > -- on linux if HOSTNAME is not known (did that change?)
> >  >  > -- on sunos always  (does anyone know an env var?)
> >  >  > -- on freebsd always (does anyone know an env var?)
> >  >  >
> >  >  >
> >  >  > Tbh I don't know. I'm on Ubuntu 20.04 and I haven't made
> any
> >  > important
> >  >  > changes on the OS. In case it helps, only the latest LMTX
> >  > produces this
> >  >  > error.
> >  >  >
> >  >  > (the 'rb' looks suspicious ... i'll check that)
> >  > what does
> >  >
> >  > echo $HOSTTYPE
> >  >
> >  >
> >  > The same as uname -m: x86_64
> >
> > weird, so can you add a print (around 4037)
> >
> > elseif name=="linux" then
> >function resolvers.platform(t,k)
> > print("!",os.getenv("HOSTTYPE"))
> > local architecture=os.getenv("HOSTTYPE") or resultof("uname -m")
> > or ""
> >
> >
> > It prints "nil" here
> i uploaded a version that might do better (lua is picky about the 'rb'
> which i need for binary pipes)
>
> now this nil ... on my opensuse on wsl it does print the expected ...
> puzzling
>
> Hans
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Install script not working

2021-06-24 Thread Jairo A. del Rio
El jue, 24 de jun. de 2021 a la(s) 16:55, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 6/24/2021 11:47 PM, Jairo A. del Rio wrote:
> >
> >
> > El jue, 24 de jun. de 2021 a la(s) 16:42, Hans Hagen (j.ha...@xs4all.nl
> > <mailto:j.ha...@xs4all.nl>) escribió:
> >
> > On 6/24/2021 11:35 PM, Jairo A. del Rio wrote:
> >  >
> >  >
> >  > El jue, 24 de jun. de 2021 a la(s) 16:30, Hans Hagen
> > (j.ha...@xs4all.nl <mailto:j.ha...@xs4all.nl>
> >  > <mailto:j.ha...@xs4all.nl <mailto:j.ha...@xs4all.nl>>) escribió:
> >  >
> >  > On 6/24/2021 11:20 PM, Jairo A. del Rio wrote:
> >  >  > It prints:
> >  >  >
> >  >  > uname -m rb
> >  > hm, that is a real last resort attempt to determine what
> > system it is
> >  > running on (we try to avoid such calls)
> >  >
> >  > -- on linux if HOSTNAME is not known (did that change?)
> >  > -- on sunos always  (does anyone know an env var?)
> >  > -- on freebsd always (does anyone know an env var?)
> >  >
> >  >
> >  > Tbh I don't know. I'm on Ubuntu 20.04 and I haven't made any
> > important
> >  > changes on the OS. In case it helps, only the latest LMTX
> > produces this
> >  > error.
> >  >
> >  > (the 'rb' looks suspicious ... i'll check that)
> > what does
> >
> > echo $HOSTTYPE
> >
> >
> > The same as uname -m: x86_64
>
> weird, so can you add a print (around 4037)
>
> elseif name=="linux" then
>   function resolvers.platform(t,k)
> print("!",os.getenv("HOSTTYPE"))
>local architecture=os.getenv("HOSTTYPE") or resultof("uname -m") or ""
>
>
It prints "nil" here


> and see what is printed
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Install script not working

2021-06-24 Thread Jairo A. del Rio
El jue, 24 de jun. de 2021 a la(s) 16:42, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 6/24/2021 11:35 PM, Jairo A. del Rio wrote:
> >
> >
> > El jue, 24 de jun. de 2021 a la(s) 16:30, Hans Hagen (j.ha...@xs4all.nl
> > <mailto:j.ha...@xs4all.nl>) escribió:
> >
> > On 6/24/2021 11:20 PM, Jairo A. del Rio wrote:
> >  > It prints:
> >  >
> >  > uname -m rb
> > hm, that is a real last resort attempt to determine what system it is
> > running on (we try to avoid such calls)
> >
> > -- on linux if HOSTNAME is not known (did that change?)
> > -- on sunos always  (does anyone know an env var?)
> > -- on freebsd always (does anyone know an env var?)
> >
> >
> > Tbh I don't know. I'm on Ubuntu 20.04 and I haven't made any important
> > changes on the OS. In case it helps, only the latest LMTX produces this
> > error.
> >
> > (the 'rb' looks suspicious ... i'll check that)
> what does
>
> echo $HOSTTYPE
>
>
The same as uname -m: x86_64


> report?
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Install script not working

2021-06-24 Thread Jairo A. del Rio
El jue, 24 de jun. de 2021 a la(s) 16:30, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 6/24/2021 11:20 PM, Jairo A. del Rio wrote:
> > It prints:
> >
> > uname -m rb
> hm, that is a real last resort attempt to determine what system it is
> running on (we try to avoid such calls)
>
> -- on linux if HOSTNAME is not known (did that change?)
> -- on sunos always  (does anyone know an env var?)
> -- on freebsd always (does anyone know an env var?)
>
>
Tbh I don't know. I'm on Ubuntu 20.04 and I haven't made any important
changes on the OS. In case it helps, only the latest LMTX produces this
error.


> (the 'rb' looks suspicious ... i'll check that)
>
> Hans
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Install script not working

2021-06-24 Thread Jairo A. del Rio
Rather than missing something, it seems that "rb" confuses uname here, as
it prints:

uname: operando extra «rb»
Pruebe 'uname --help' para más información.

Using only uname -m I get:

x86_64

Am I right?

Jairo

El jue, 24 de jun. de 2021 a la(s) 16:14, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 6/24/2021 11:02 PM, Jairo A. del Rio wrote:
> > When I try to install ConTeXt with install.sh (Linux 64 bit), the
> > following happens:
> >
> > lua error : function call: /home/coragyps/lmtx/bin/mtxrun.lua:299: bad
> > argument #2 to 'popen' (invalid mode)
> > cp: no se puede efectuar `stat' sobre
> > '/home/coragyps/lmtx/tex/texmf-linux-64/bin/mtxrun': No existe el
> > archivo o el directorio
> > cp: no se puede efectuar `stat' sobre
> > '/home/coragyps/lmtx/tex/texmf-context/scripts/context/lua/mtxrun.lua':
> > No existe el archivo o el directorio
> > cp: no se puede efectuar `stat' sobre
> >
> '/home/coragyps/lmtx/tex/texmf-context/scripts/context/lua/mtx-install.lua':
>
> > No existe el archivo o el directorio
> >
> > Messages in Spanish say the directory or file doesn't exist. Am I
> > missing something? Thanks in advance
> can you check what is missing by adding a print?
>
>   local popen=io.popen   if popen   then function print(...) io.popen
> (...) flush() return popen  (...) end end
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Install script not working

2021-06-24 Thread Jairo A. del Rio
It prints:

uname -m rb

Jairo

El jue, 24 de jun. de 2021 a la(s) 16:14, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 6/24/2021 11:02 PM, Jairo A. del Rio wrote:
> > When I try to install ConTeXt with install.sh (Linux 64 bit), the
> > following happens:
> >
> > lua error : function call: /home/coragyps/lmtx/bin/mtxrun.lua:299: bad
> > argument #2 to 'popen' (invalid mode)
> > cp: no se puede efectuar `stat' sobre
> > '/home/coragyps/lmtx/tex/texmf-linux-64/bin/mtxrun': No existe el
> > archivo o el directorio
> > cp: no se puede efectuar `stat' sobre
> > '/home/coragyps/lmtx/tex/texmf-context/scripts/context/lua/mtxrun.lua':
> > No existe el archivo o el directorio
> > cp: no se puede efectuar `stat' sobre
> >
> '/home/coragyps/lmtx/tex/texmf-context/scripts/context/lua/mtx-install.lua':
>
> > No existe el archivo o el directorio
> >
> > Messages in Spanish say the directory or file doesn't exist. Am I
> > missing something? Thanks in advance
> can you check what is missing by adding a print?
>
>   local popen=io.popen   if popen   then function print(...) io.popen
> (...) flush() return popen  (...) end end
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Install script not working

2021-06-24 Thread Jairo A. del Rio
When I try to install ConTeXt with install.sh (Linux 64 bit), the following
happens:

lua error : function call: /home/coragyps/lmtx/bin/mtxrun.lua:299: bad
argument #2 to 'popen' (invalid mode)
cp: no se puede efectuar `stat' sobre
'/home/coragyps/lmtx/tex/texmf-linux-64/bin/mtxrun': No existe el archivo o
el directorio
cp: no se puede efectuar `stat' sobre
'/home/coragyps/lmtx/tex/texmf-context/scripts/context/lua/mtxrun.lua': No
existe el archivo o el directorio
cp: no se puede efectuar `stat' sobre
'/home/coragyps/lmtx/tex/texmf-context/scripts/context/lua/mtx-install.lua':
No existe el archivo o el directorio

Messages in Spanish say the directory or file doesn't exist. Am I missing
something? Thanks in advance

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] \startstaticMPfigure not producing .pdf or .mp.md5 files

2021-05-30 Thread Jairo A. del Rio
It seems \startstarticMPfigure ... \stopstaticMPfigure is now a wrapper for
reusable MP graphics, so auxiliary files are no longer generated. I don't
think this counts as an answer but you could use \typesetbuffer and
\startMPpage ... \stopMPpage instead. Two auxiliary PDF files with funny
names are generated.

\startbuffer[center]

\startMPpage

draw fullcircle scaled 2cm ;

dotlabel.bot(textext("(0,0)"),origin) ;

\stopMPpage

\stopbuffer


\startbuffer[radius]

\startMPpage

draw fullcircle scaled 2cm ;

drawarrow (0,0)--(1cm,0) ;

label.bot(textext("$r$"),(5mm,0)) ;

\stopMPpage

\stopbuffer


\starttext


Circle centered \typesetbuffer[center][width=1cm] at origin with radius

\typesetbuffer[radius][width=1cm] $r=1\,\text{cm}$.


\stoptext

Regards,


Jairo

El dom, 30 de may. de 2021 a la(s) 09:37, Gavin (gavinpub...@comcast.net)
escribió:

> Hello colleagues,
>
> I’m writing a physics textbook with lots of figures, some quite complex.
> I’ve been using TikZ, but I’m experimenting with MetaPost. Consulting the
> ConTeXt wiki, I found that \startstaticMPfigure and friends are designed
> exactly for this sort of use. However, I’m not seeing the documented
> behavior. In particular, I’m not seeing .pdf and .mp.md5 files being
> produced. Perhaps I don’t know where to look. I thought they would be in
> the same directory as the document.
>
> The example from the wiki is this:
>
> \startstaticMPfigure{center}
>  draw fullcircle scaled 2cm ;
>  dotlabel.bot(textext("(0,0)"),origin) ;
> \stopstaticMPfigure
>
> \startstaticMPfigure{radius}
>  draw fullcircle scaled 2cm ;
>  drawarrow (0,0)--(1cm,0) ;
>  label.bot(textext("$r$"),(5mm,0)) ;
> \stopstaticMPfigure
>
> \starttext
> Circle centered \usestaticMPfigure[center][width=1cm] at origin with radius
> \usestaticMPfigure[radius][width=1cm] $r=1\,\text{cm}$.
> \stoptext
>
> I would expect this to produce files center.pdf, radius.pdf,
> center.mp.md5, radius.md.mp5, and perhaps other logs, etc. I don’t see them
> anywhere.
>
> I’m running on MacOS with a current LMTX from TeXShop with the script:
>
> #!/bin/bash
> export PATH=/Users/Gavin/context-osx-64/tex/texmf-osx-64/bin:$PATH
> ~/context-osx-64/tex/texmf-osx-64/bin/mtxrun --autogenerate --script
> context --directives="system.showerror" --autopdf "$1”
>
> I’ve also tried MkIV and the TeXLive 2021 versions with the same results.
>
> I don’t actually need the separate pdf, but I do want the diagrams to be
> redrawn only when something has changed. Without a .mp.md5, I’m not sure
> what to expect.
>
> If the behavior has changed, I can update the wiki. I’m also curious about
> why \staticMPfigure is not mentioned in the MetaFun manual.
>
> Thanks
> Gavin
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] ctxlua percentage format escape

2021-05-29 Thread Jairo A. del Rio
Hi, Adam. There are some ways to do it. I'm sure there are many more, but I
don't remember them right now. Hi, Hans. There's a bug (?) in syst-lua.lua
related to \expression in MkIV (xmath and xcomplex aren't defined). Please
fix that


%Temporary hack for MkIV

%Only use it in case \expression ... \relax doesn't work

\startmkivmode

\startluacode

xmath = xmath or math

xcomplex = xcomplex or {} --maybe math too???

\stopluacode

\stopmkivmode

\starttext

$\pi = \ctxlua{context("\letterpercent.6f", math.pi)}$


$\pi = \expression string.format("\letterpercent.6f", pi)\relax$


%Changing catcodes so $ and % are letter characters

\startasciimode

\m{\pi = \expression ("%.6f"):format(pi) \relax}


\m{\pi = \ctxlua{context("%.6f", math.pi)}}

\stopasciimode

\stoptext

Regards,


Jairo

El sáb, 29 de may. de 2021 a la(s) 07:32, Adam Reviczky (revic...@gmail.com)
escribió:

> Hi,
>
> I was trying to use a quick calculation like the new mathfun in lmtx for
> an older mkiv document.
>
> MWE from the wiki:
> https://wiki.contextgarden.net/Programming_in_LuaTeX#Examples
>
> \starttext
> $\pi = \ctxlua{context("\%.6f", math.pi)}$
> \stoptext
>
> But that gives an error (actually for both lmtx and mkiv): token call,
> syntax: [ctxlua]:1: invalid escape sequence near '"\%'
>
> Whereas
>
> \starttext
> $\pi = \startluacode context("%.6f", math.pi) \stopluacode$
> \stoptext
>
> Works fine as expected.
>
> Is there a way to escape the percentage sign in ctxlua as a format value?
>
> Adam
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mathfun

2021-05-23 Thread Jairo A. del Rio
Thank you a lot for the explanation! It makes more sense now and
definitively is something very promising to play with. Wrt the module
itself, is it possible to consider language-dependent labels? I noticed
"\sin" is "sin" when it should be "sen" once the module is loaded.

Jairo

El dom, 23 de may. de 2021 a la(s) 09:35, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 5/23/2021 3:45 PM, Jairo A. del Rio wrote:
> > El dom, 23 de may. de 2021 a la(s) 04:51, Hans Hagen (j.ha...@xs4all.nl
> > <mailto:j.ha...@xs4all.nl>) escribió:
> >
> > On 5/22/2021 11:34 PM, Jairo A. del Rio wrote:
> >  > Hi. Is \thewithproperty documented elsewhere? Is this a new
> > primitive?
> >  > It looks interesting.
> > In the case of the \sin trick particular case \let\computer\the would
> > also work; i added the \thewithproperty feature just because
> i
> > expect that users can come up with variants (like \drawme\sin ...)
> > which
> > then would adapt behaviour (via \dowithproperty2).
> >
> >
> > Having flags for computing and drawing would be awesome. I think it
> > would nicely extend ConTeXt's drawing features...
> >
> > So, indeed it's a new primitive but (for now) only used with these
> lua
> > hacks. Actually it's no big deal to reimplement \thewithoutunit
> as
> >
> >
> > So, is this Lua-specific?
>
> it relates to teh way tex sees things ... thihnk of
>
>\dimen0=10pt
>
> where \dimen expects a number, optional equal and value
>
> while
>
>\the\dimen0
>
> the '\the' expects all kind of things, with '\dimen' being one of then
> in which case its value is serialized
>
> in order to implement 'new primitives' using lua (like some that need to
> be implemented for compatibility reasons due to the backend differences)
> we need to be able to distinguish between setting and getting a value
>
> so in that sense it's indeed lua specific: a specific class of lua
> functions knows if it's triggered by serialization
>
> and that is what we 'kind of' abuse here and also why i did add this
> additional 'pseudo prefix' so that we ca ndo more clever things if we
> want to
>
> > \thewithoutunit{\dowithproperty1\the}
> >
> > and then
> >
> > \thewithcmunit{\dowithproperty2\the}
> >
> > to serialize the dimension in cm but normally i need to "wonder for a
> > while if it makes sense".
> >
> > Btw, adding primitives (related to the token related bits and pieces
> of
> > the engine) only makes sense if the gain is in
> >
> > -- avoiding clumsy code: although that can hurt someones pride and
> joy
> > over a nice and complex macro doing the same ... don't worry, i threw
> > away plenty of code by now
> >
> > -- significant performance gain: which is seldom the case (there
> really
> > is not much to gain, at least not in context which is rather
> optimized
> > already)
> >
> > -- giving way less noise in tracing: which for me is a good reason
> > (tracing changed a bit anyway)
> >
> > -- not adding much code to the engine or the need to refactor:
> although
> > for some luametatex extensions some internals had to change
> > fundamentally
> >
> > a good example is the extended macro argument handling: less clumsy
> tex
> > code, a bit of performance gain and easier full expansion, way less
> > tracing, but it violates the last argument because it did lead to
> some
> > refactoring (i also had to make sure the extra overhead didn't slow
> > down
> > macro definitions and expansion)
>
> > I did the following and I have two questions:
> >
> > 1. What if I want to have more than one property? Say \plusone for
> > computation and \plustwo for drawing.
>
> you can do that but keep in mind that \compute is then an 'official'
> context one (bound to 1) and any other number can conflict with other
> context numbers in the future, so best start at 1000 or so for private
> ones
>
> > 2. What does 'usage="value"' mean in the implement function (looks new,
> > but I'm prolly wrong)?
>
> indeed, it is already there for a while and it lets the function
> definition follow a different route ... basically one that can follow
> \the; I suppose that I can also make 'property' a valid usage (alias)
>
> (btw often features like this are described in articles or wrapups inm
> documents in the distribution or even mentioned here but as usu

Re: [NTG-context] mathfun

2021-05-23 Thread Jairo A. del Rio
El dom, 23 de may. de 2021 a la(s) 04:51, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 5/22/2021 11:34 PM, Jairo A. del Rio wrote:
> > Hi. Is \thewithproperty documented elsewhere? Is this a new primitive?
> > It looks interesting.
> In the case of the \sin trick particular case \let\computer\the would
> also work; i added the \thewithproperty feature just because i
> expect that users can come up with variants (like \drawme\sin ...) which
> then would adapt behaviour (via \dowithproperty2).
>

Having flags for computing and drawing would be awesome. I think it would
nicely extend ConTeXt's drawing features...

So, indeed it's a new primitive but (for now) only used with these lua
> hacks. Actually it's no big deal to reimplement \thewithoutunit as
>

So, is this Lua-specific?

   \thewithoutunit{\dowithproperty1\the}
>
> and then
>
>\thewithcmunit{\dowithproperty2\the}
>
> to serialize the dimension in cm but normally i need to "wonder for a
> while if it makes sense".
>
> Btw, adding primitives (related to the token related bits and pieces of
> the engine) only makes sense if the gain is in
>
> -- avoiding clumsy code: although that can hurt someones pride and joy
> over a nice and complex macro doing the same ... don't worry, i threw
> away plenty of code by now
>
> -- significant performance gain: which is seldom the case (there really
> is not much to gain, at least not in context which is rather optimized
> already)
>
> -- giving way less noise in tracing: which for me is a good reason
> (tracing changed a bit anyway)
>
> -- not adding much code to the engine or the need to refactor: although
> for some luametatex extensions some internals had to change fundamentally
>
> a good example is the extended macro argument handling: less clumsy tex
> code, a bit of performance gain and easier full expansion, way less
> tracing, but it violates the last argument because it did lead to some
> refactoring (i also had to make sure the extra overhead didn't slow down
> macro definitions and expansion)
>
> Hans
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>

I did the following and I have two questions:

1. What if I want to have more than one property? Say \plusone for
computation and \plustwo for drawing.

2. What does 'usage="value"' mean in the implement function (looks new, but
I'm prolly wrong)?

\permanent\protected\def\drawme{\thewithproperty\plussix} %better than 666

\startluacode

local interfaces = interfaces

local implement = interfaces.implement

local context = context


local drawme_code = 6


local drawing = [==[

draw fullcircle scaled 10mm;

draw fullcircle shifted up scaled 5mm;

draw fulltriangle shifted (up+1/2right) scaled 5mm;

]==]


local function chicken(value)

if value == "value" or value == drawme_code then

context.metafun.start()

context.metafun(drawing);

context.metafun.stop()

--elseif then ...

else

context("Chicken!")

end

end


implement{

name = "chicken",

public = true,

usage = "value", --What does it do?

overload = true,

actions = chicken

}

\stopluacode

\starttext\chicken\ and \drawme\chicken\stoptext

Thank you in advance.

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] mathfun

2021-05-22 Thread Jairo A. del Rio
Hi. Is \thewithproperty documented elsewhere? Is this a new primitive? It
looks interesting.

Jairo

El vie, 21 de may. de 2021 a la(s) 08:15, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> Hi,
>
>
> I uploaded an lmtx update (only m-mathfun added).
>
> Attached a short description of this (windy stormy friday afternoon)
> math experiment. The question is, what similar features using this
> trickery come to mind.
>
> Hans
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Trouble constructing a drawer rail with MP

2021-05-21 Thread Jairo A. del Rio
Hi!

Do

p[102] := (origin--dir(194)*10mm) shifted Pkt[1];

and

p[103] := (origin--dir(166)*10mm) shifted Pkt[2];

do what you need?

Jairo

El vie, 21 de may. de 2021 a la(s) 05:57, Willi Egger (cont...@boede.nl)
escribió:

> Hello MP Gurus!
>
> I wanted to make a technical drawing. However the enclosed mwe does not
> give me the required results.
>
> While the vector from point 1 is directing in the desired direction of 194
> degrees, the second vector from point 2 does not as defined point in the
> direction of 166 degrees.
>
> What am I doing wrong here?
>
>
> Thanks for pointing me into the right direction :-)
>
> Willi
>
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] NotoColorEmoji - loca table not found

2021-05-13 Thread Jairo A. del Rio
El jue, 13 de may. de 2021 a la(s) 19:52, Adam Reviczky (revic...@gmail.com)
escribió:

> Thanks Jairo,
>
> That indeed works, should've read that it is bitmap only.
>
> I do get a white background though (MKIV), is that how the bitmap is
> stored?
>
>
In LuaLaTeX with Harfbuzz shaper as well as ConTeXt LMTX, transparency is
properly handled, so I suppose ConTeXt MkIV is to blame in this case. In
case you understand how does ConTeXt handle with bitmap fonts, relevant
files are under
/home/coragyps/lmtx/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/fonts/


> \definefontfeature[Emoji][default][sbix=yes]
>
> \starttext
>
>
> \framed[background=color,background=black]{\definedfont[file:NotoColorEmoji.ttf*Emoji]\char"1F91D}
>
> \stoptext
>
>
> In Hans' example for applecoloremoji there is no white background (page 5,
> bachotex-2017-emoji.pdf).
>
> I also do not get a white background with LibreOfiice.
>
>
>
I'd wait for Hans to fix it, as I don't really understand font management
in ConTeXt...

Jairo


> Adam
>
> On Fri, May 14, 2021 at 12:51 AM Jairo A. del Rio 
> wrote:
>
>> In ConTeXt LMTX this works just fine (try mtxrun --generate and context
>> --make first):
>>
>> \definefontfeature[Emoji][default][sbix=yes]
>>
>> \starttext
>>
>> \definedfont[file:NotoColorEmoji.ttf*Emoji]\char"1F91D
>>
>> \stoptext
>>
>> However, when one tries to convert it with ImageMagick the following
>> happens:
>>
>> Error reading a content stream. The page may be incomplete.
>>Output may be incorrect.
>> Error: Ignoring spurious ET operator.
>>Output may be incorrect.
>> Error: File did not complete the page properly and may be damaged.
>>Output may be incorrect.
>>
>>
>> Only SVG fonts don't trigger this error in LMTX.
>>
>>
>> I confirm ConTeXt MkIV is having issues with emoji fonts. It seems that
>> GraphicsMagick is not properly generating images as it complains about an
>> improper header.
>>
>> Jairo
>>
>> El jue, 13 de may. de 2021 a la(s) 18:26, Adam Reviczky (
>> revic...@gmail.com) escribió:
>>
>>> Hi,
>>>
>>> I am trying to use the 'handshake' character (
>>> https://www.fileformat.info/info/unicode/char/1f91d/fontsupport.htm)
>>> from the Noto Color Emoji font (
>>> https://github.com/googlefonts/noto-emoji/blob/main/fonts/NotoColorEmoji.ttf
>>> ).
>>>
>>> The following MWE gives an error:
>>>
>>> \starttext
>>>
>>> \definedfont[file:NotoColorEmoji.ttf] \char"1F91D
>>>
>>> \stoptext
>>>
>>> fonts   > otf loading > loading 'NotoColorEmoji.ttf', hash
>>> 'notocoloremoji'
>>> system  > lua > compiling
>>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tma'
>>> into
>>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tmc'
>>> system  > lua > dumping
>>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tma'
>>> into
>>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tmc'
>>> stripped
>>> fonts   > otf loading > loading done
>>> fonts   > otf loading > saving 'NotoColorEmoji.ttf' in cache
>>> system  > lua > compiling
>>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tma'
>>> into
>>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tmc'
>>> system  > lua > dumping
>>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tma'
>>> into
>>> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tmc'
>>> stripped
>>> fonts   > otf loading > loading, optimizing, packing and caching
>>> time 2.557
>>> pages   > flushing realpage 1, userpage 1, subpage 1
>>> close source> level 2, order 3

Re: [NTG-context] NotoColorEmoji - loca table not found

2021-05-13 Thread Jairo A. del Rio
In ConTeXt LMTX this works just fine (try mtxrun --generate and context
--make first):

\definefontfeature[Emoji][default][sbix=yes]

\starttext

\definedfont[file:NotoColorEmoji.ttf*Emoji]\char"1F91D

\stoptext

However, when one tries to convert it with ImageMagick the following
happens:

    Error reading a content stream. The page may be incomplete.
   Output may be incorrect.
    Error: Ignoring spurious ET operator.
   Output may be incorrect.
    Error: File did not complete the page properly and may be damaged.
   Output may be incorrect.


Only SVG fonts don't trigger this error in LMTX.


I confirm ConTeXt MkIV is having issues with emoji fonts. It seems that
GraphicsMagick is not properly generating images as it complains about an
improper header.

Jairo

El jue, 13 de may. de 2021 a la(s) 18:26, Adam Reviczky (revic...@gmail.com)
escribió:

> Hi,
>
> I am trying to use the 'handshake' character (
> https://www.fileformat.info/info/unicode/char/1f91d/fontsupport.htm) from
> the Noto Color Emoji font (
> https://github.com/googlefonts/noto-emoji/blob/main/fonts/NotoColorEmoji.ttf
> ).
>
> The following MWE gives an error:
>
> \starttext
>
> \definedfont[file:NotoColorEmoji.ttf] \char"1F91D
>
> \stoptext
>
> fonts   > otf loading > loading 'NotoColorEmoji.ttf', hash
> 'notocoloremoji'
> system  > lua > compiling
> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tma'
> into
> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tmc'
> system  > lua > dumping
> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tma'
> into
> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/png/notocoloremoji.tmc'
> stripped
> fonts   > otf loading > loading done
> fonts   > otf loading > saving 'NotoColorEmoji.ttf' in cache
> system  > lua > compiling
> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tma'
> into
> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tmc'
> system  > lua > dumping
> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tma'
> into
> '/home/ubuntu/.texlive2020/texmf-var/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/fonts/otl/notocoloremoji.tmc'
> stripped
> fonts   > otf loading > loading, optimizing, packing and caching
> time 2.557
> pages   > flushing realpage 1, userpage 1, subpage 1
> close source> level 2, order 3, name '/tmp/MWE.tex'
> close source> level 1, order 3, name
> '/usr/share/texmf/tex/context/base/mkiv/cont-yes.mkiv'
> ! error:  (file NotoColorEmoji.ttf) (ttf): loca table not foundmtx-context
> | fatal error: return code: 256
>
> Any idea what is wrong?
>
> Adam
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Fwd: Fuzzy lines

2021-05-12 Thread Jairo A. del Rio
-- Forwarded message -
De: Jairo A. del Rio 
Date: mié, 12 de may. de 2021 a la(s) 14:08
Subject: Re: [NTG-context] Fuzzy lines
To: mailing list for ConTeXt users 




El mié, 12 de may. de 2021 a la(s) 13:03, Henning Hraban Ramm (
te...@fiee.net) escribió:

> Hi Jairo,
>
> thank you for the suggestion.
>
> > Am 11.05.2021 um 14:56 schrieb Jairo A. del Rio  >:
> >
> > For simple pens, you may define your own (section 9.7 of MetaPost
> manual).
>
> Unfortunately, pens don’t work as patterns but only as outlines.
>
> > For complicated strokes, something along these lines could be useful as
> a starting point (I'm not taking cyclic paths in consideration, btw). I did
> something similar with duck footprints some weeks ago:
> >
> > %Sorry for the ugly code...
> > \starttext
> > \startMPpage
> > %Unit size
> > numeric u; u := 1mm;
> >
> > %In a picture you are able to include everything, kinda
> > picture Pluma;
> > Pluma := image(
> >   for i = 1 upto 5:
> >   for j = 1 upto 5:
> >   draw (i,j) randomized 1;
> >   endfor
> >   endfor
> > );
>
> Unfortunately, that’s the same pattern over and over.
> The randomization is only applied once.
> Good for footprints, bad for fuzzy patterns.
>

You only need to move "randomized" at the drawing stage:

\starttext

\startMPpage

numeric u; u := 1mm;

picture Pluma;

Pluma := image(

for i = 1 upto 5:

for j = 1 upto 5:

draw (i,j);

endfor

endfor

);

path Camino;

Camino := origin for i = 1 upto 30: .. (u*i, u*sind (12i mod 360)) endfor;

for i = 0 step 1/2 until length Camino:

draw Pluma randomized 1 rotated (90 + angle direction i of Camino)

shifted point i of Camino;

endfor

\stopMPpage

\stoptext

But "randomized" will deform paths. Maybe you want something like this?

\starttext

\startMPpage[align=]

begingroup;

save Rnd; let Rnd = uniformdeviate;


numeric u; u := 3mm;

picture Pluma;

Pluma := image(

for i = 1 upto 5:

for j = 1 upto 5:

fill fullcircle shifted (i,j); %try fulltriangle or another shape

endfor

endfor

);

path Camino;

Camino := origin for i = 1 upto 30: .. u*i*left endfor;

for i = 0 step 1/2 until length Camino:

draw image(

for x within Pluma:

fill pathpart x %Assuming our image only contains cyclic paths

scaled (1+Rnd 1)

shifted (1/2dir Rnd 360)

withcolor hsvtorgb(6round(Rnd 60),9/10,1); %Colors just because they look
cute

endfor

) rotated (90 + angle direction i of Camino)

shifted point i of Camino;

endfor

endgroup;

\stopMPpage

\stoptext

> %Simple curve
> > path Camino;
> > Camino := origin for i = 1 upto 30: .. (u*i, u*sind (12i mod 360))
> endfor;
> >
> > %Strokes
> > for i = 0 step 1/2 until length Camino:
> >   draw Pluma rotated (90 + angle direction i of Camino)
> >   shifted point i of Camino;
> > endfor
>
> Since I have more or less straight lines but of different length, the "one
> pattern per 1/n path segment" doesn’t work for me. I could try to construct
> my paths differently.
>

You only need to use fractions, i.e., "for 0 step 1/n until 1: ... endfor"
if you work with straight lines defined using only two points. In the
example above I made one from more than two points just for ease of
manipulation. With examples and feedback from the mailing list, you might
define your own function using the new Metafun interface for LMTX.


>
> Hraban
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___
>
>

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Fuzzy lines

2021-05-11 Thread Jairo A. del Rio
For simple pens, you may define your own (section 9.7 of MetaPost manual).
For complicated strokes, something along these lines could be useful as a
starting point (I'm not taking cyclic paths in consideration, btw). I did
something similar with duck footprints some weeks ago:

%Sorry for the ugly code...

\starttext

\startMPpage
%Unit size

numeric u; u := 1mm;

%In a picture you are able to include everything, kinda

picture Pluma;

Pluma := image(

for i = 1 upto 5:

for j = 1 upto 5:

draw (i,j) randomized 1;

endfor

endfor

);


%Simple curve

path Camino;

Camino := origin for i = 1 upto 30: .. (u*i, u*sind (12i mod 360)) endfor;


%Strokes

for i = 0 step 1/2 until length Camino:

draw Pluma rotated (90 + angle direction i of Camino)

shifted point i of Camino;

endfor

\stopMPpage

\stoptext


Not sure if that's what you need...

Regards,


Jairo

El mar, 11 de may. de 2021 a la(s) 06:31, Mikael Sundqvist (mic...@gmail.com)
escribió:

> Hi!
>
> Not really what you ask for, perhaps, but this could be interesting
> for you: https://tex.stackexchange.com/q/39296/52406
>
> /Mikael
>
> On Tue, May 11, 2021 at 12:58 PM Henning Hraban Ramm 
> wrote:
> >
> > Hi MetaFans,
> >
> > is it possible to get lines with Metapost that look like they were drawn
> with a pencil or brush?
> >
> > Some vector graphics apps (in my case: Affinity Designer) can use such
> naturally looking brushes for vector graphics (and I don’t know how they do
> it), but I’d like to automate/parametrize some designs, and that would
> finally be a reason to learn Metapost...
> >
> > Hraban
> >
> ___
> > If your question is of interest to others as well, please add an entry
> to the Wiki!
> >
> > maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> > webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > wiki : http://contextgarden.net
> >
> ___
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>


163.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] \char not working with private unicodes

2021-05-11 Thread Jairo A. del Rio
Hi, list! Following this thread:
https://tex.stackexchange.com/questions/596610/how-to-use-luatex-with-large-unicode-codepoint,
I tried to replicate it in ConTeXt. Both LMTX and LMTX fail to display the
right symbol and, as it's discussed in the linked page, there's an offset
by 14. Is this intentional (in ConTeXt)? A bug? Minimal (non-)working
example:


%Font available here: https://materialdesignicons.com/

\starttext

\definedfont[file:materialdesignicons-webfont.ttf]\char"F1372\relax

\stoptext

Thanks in advance.

Cordially,

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] \prime is too high

2021-05-08 Thread Jairo A. del Rio
The following:

\starttext
$s''$ %or $s^{\prime}$
\stoptext

gives a too high symbol in ConTeXt LMTX 2021.05.06 23:35. ConTeXt MkIV
isn't affected for such an issue.

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Conflict between MetaPost (LMTX) and cmarrows

2021-04-27 Thread Jairo A. del Rio
So, should I share relevant files? AFAIK only cmarrows and .mf files in the
cm source folder are involved. I hope you can check it if a solution is
possible and not too demanding. Thanks beforehand.

Regards,

Jairo

El lun, 26 de abr. de 2021 a la(s) 03:56, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 4/26/2021 9:59 AM, Jairo A. del Rio wrote:
> >
> >
> > El lun, 26 de abr. de 2021 a la(s) 01:49, Hans Hagen (j.ha...@xs4all.nl
> > <mailto:j.ha...@xs4all.nl>) escribió:
> >
> > On 4/26/2021 6:59 AM, Jairo A. del Rio wrote:
> >  > The following:
> >  >
> >  > \starttext
> >  >
> >  > \startMPinitializations
> >  >
> >  > input cmarrows;
> >  >
> >  > setup_cmarrows(arrow_name = "texarrow"; parameter_file =
> "cmr6.mf";
> >  > macro_name = "nicearrow");
> >  >
> >  > \stopMPinitializations
> >  >
> >  > \startMPpage
> >
> >  > metafun > log > error: Equation cannot be performed (numeric=pair)
> > I don't know, but from the message it looks like some 'local'
> variables
> > is not saved and defined. I'm surprised that loading some mf file
> works
> > at all (because it also assumes some mf related definitions). I also
> > hav
> > eno clue if such a package adopts 'core' metafun code (and mpiv
> metafun
> > is different from mpii).
> >
> >
> > It's a generic, "pure" MetaPost package:
> >
> > https://www.ctan.org/pkg/cmarrows <https://www.ctan.org/pkg/cmarrows>
>
> that doesn't make it immune from clashes in used variables with differnt
> types ... metafun is more than plain mp so more can clash
>
> > Fonts are in /fonts/source/public in a TeX Live distribution, in case it
> > helps.
> i have a rather minimal tex setup so i can't run that (i'm not going to
> clutter my system now)
>
> Hans
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Conflict between MetaPost (LMTX) and cmarrows

2021-04-26 Thread Jairo A. del Rio
El lun, 26 de abr. de 2021 a la(s) 01:49, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 4/26/2021 6:59 AM, Jairo A. del Rio wrote:
> > The following:
> >
> > \starttext
> >
> > \startMPinitializations
> >
> > input cmarrows;
> >
> > setup_cmarrows(arrow_name = "texarrow"; parameter_file = "cmr6.mf";
> > macro_name = "nicearrow");
> >
> > \stopMPinitializations
> >
> > \startMPpage
>
> > metafun > log > error: Equation cannot be performed (numeric=pair)
> I don't know, but from the message it looks like some 'local' variables
> is not saved and defined. I'm surprised that loading some mf file works
> at all (because it also assumes some mf related definitions). I also hav
> eno clue if such a package adopts 'core' metafun code (and mpiv metafun
> is different from mpii).
>

It's a generic, "pure" MetaPost package:

https://www.ctan.org/pkg/cmarrows

Fonts are in /fonts/source/public in a TeX Live distribution, in case it
helps.

Hans
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Conflict between MetaPost (LMTX) and cmarrows

2021-04-25 Thread Jairo A. del Rio
The following:

\starttext

\startMPinitializations

input cmarrows;

setup_cmarrows(arrow_name = "texarrow"; parameter_file = "cmr6.mf";
macro_name = "nicearrow");

\stopMPinitializations

\startMPpage


nicearrow (origin -- (1cm*left));

\stopMPpage

\stoptext

compiles perfectly with ConTeXt MkIV. With LMTX, however, the following
happens:

metapost > initializing instance 'metafun:1' using format 'metafun' and
method 'default'

metapost > loading 'metafun' as 'metafun.mpxl' using method 'default'

metapost > initializing number mode 'scaled'

metapost > message : Loading cmarrows 2006/12/18, v0.9

metafun > log > overloading immutable 'eps'

metafun > log >

metafun > log > error: Equation cannot be performed (numeric=pair)

metafun > log >

metapost > log >

metapost > log > 

metapost > log > ;

metapost > log >  z_[incr.n]:=(EXPR0);

metapost > log > ENDFOR

metapost > log > 
...nt(length(path))of(path),z2,point.ttt.of(path),z9-(0,3rule_thickness#),point.tt.of(path)-3rule_thickness#*(unitvector(direction.tt.of(path))rotated90):z_[incr.n]:=z;endfor

metapost > log > ;transform.T...

metapost > log > hide->exitif.numeric.begingroup(TEXT0)

metapost > log > ;endgroup;

metapost > log >
mapto->begingroup.hide(numeric.n;n:=0;numeric.x,x_[],y,y_[];for.z=(TEXT2):z_[incr.n]:=z;endfor;transform.T;z_2=z_1transformed.T;z_4=z_3transformed.T;z_6=z_5transformed.T;)

metapost > log > T.endgroup

metapost > log >
nicearrow__sgbxww->...(z0,point(length(EXPR2))of(EXPR2),z2,point.ttt.of(EXPR2),z9-(0,3rule_thickness#),point.tt.of(EXPR2)-3rule_thickness#*(unitvector(direction.tt.of(EXPR2))rotated90))

metapost > log > ;fi.save.f,s...

metapost > log > 

metapost > log > ;

metapost > log > <*> nicearrow (origin -- (1cm*left));

metafun > log >

metafun > log > I'm sorry, but I don't know how to make such things equal.
(See the two

expressions just above the error message.)

metafun > log >

metapost > log > ;

metapost > log >

What's happening? Is that intended or a bug?

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Fwd: Corrupt PDF files with LMTX?

2021-04-25 Thread Jairo A. del Rio
Thank you a lot for the fix!

Regards,

Jairo

El sáb, 24 de abr. de 2021 a la(s) 11:18, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 4/24/2021 3:05 PM, Jairo A. del Rio wrote:
> > gives
> >
> >  Error: stream Length incorrect.
> > Output may be incorrect.
> >  Error: stream Length incorrect.
> > Output may be incorrect.
>
> I'll check it
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Fwd: Corrupt PDF files with LMTX?

2021-04-24 Thread Jairo A. del Rio
-- Forwarded message -
De: Jairo A. del Rio 
Date: sáb, 24 de abr. de 2021 a la(s) 08:05
Subject: Re: [NTG-context] Corrupt PDF files with LMTX?
To: Hans Hagen 


The following:


\starttext

\startMPpage

fill fullcircle scaled 1cm withcolor red

\stopMPpage

\stoptext

gives

    Error: stream Length incorrect.
   Output may be incorrect.
    Error: stream Length incorrect.
   Output may be incorrect.

However, an image is generated. However, when it includes text, the message
above appears. As Thomas says, it happens even with simple documents.

Jairo

El sáb, 24 de abr. de 2021 a la(s) 01:36, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 4/24/2021 8:03 AM, Jairo A. del Rio wrote:
> > Hi, list!
> > When I try to convert a PDF generated by ConTeXt LMTX to PNG using
> > ImageMagick's convert the following happens:
> hard to handle when there is no mwe ...
>
> Hans
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Corrupt PDF files with LMTX?

2021-04-24 Thread Jairo A. del Rio
Hi, list!
When I try to convert a PDF generated by ConTeXt LMTX to PNG using
ImageMagick's convert the following happens:

    Error: stream Length incorrect.
   Output may be incorrect.
    Error:  An error occurred while reading an XREF table.
    The file has been damaged.  This may have been caused
    by a problem while converting or transfering the file.
    Ghostscript will attempt to recover the data.
    However, the output may be incorrect.
Error: /ioerror in --runpdf--
Operand stack:
   post_eof_count   4096   --nostringval--   4571
Execution stack:
   %interp_exit   .runexec2   --nostringval--   runpdf   --nostringval--
2   %stopped_push   --nostringval--   runpdf   runpdf   false   1
%stopped_push   1990   1   3   %oparray_pop   1989   1   3   %oparray_pop
1977   1   3   %oparray_pop   1978   1   3   %oparray_pop   runpdf   runpdf
  runpdf   runpdf   runpdf   runpdf   runpdf
Dictionary stack:
   --dict:735/1123(ro)(G)--   --dict:1/20(G)--   --dict:80/200(L)--
--dict:80/200(L)--   --dict:135/256(ro)(G)--   --dict:315/325(ro)(G)--
--dict:28/32(L)--
Current allocation mode is local
GPL Ghostscript 9.50: Unrecoverable error, exit code 1
convert-im6.q16: FailedToExecuteCommand `'gs' -sstdout=%stderr -dQUIET
-dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=5
-dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=pngalpha' -dTextAlphaBits=4
-dGraphicsAlphaBits=4 '-r300x300'
 '-sOutputFile=/tmp/magick-55690XUwDR8veJQEc%d'
'-f/tmp/magick-55690zbxNvSPCVCYe' '-f/tmp/magick-55690aVvG11u3p8wd'' (1) @
error/pdf.c/InvokePDFDelegate/291.
convert-im6.q16: no images defined `151.png' @
error/convert.c/ConvertImageCommand/3258.

I'd blame ImageMagick, except for the fact that 1) other converters fail
too and 2) it doesn't happen with ConTeXt MkIV (PDF is successfully
converted).

Cordially,

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] \processassignmentlist inside a \setup... or related

2021-04-20 Thread Jairo A. del Rio
Oh, that's nice, but the \setupsomething part is still missing, i.e. I
still want to be able to invoke \somethingparameter{...}. My question is
about merging two tasks in one in a better way than the one I proposed, if
possible. Thanks for the help.

Jairo

El mar, 20 de abr. de 2021 a la(s) 02:00, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 4/20/2021 4:23 AM, Jairo A. del Rio wrote:
> > Hi, list! I hope my example shows clearly enough what I intend to do:
> >
> > \startluacode
> >
> > userdata = userdata or {}
> >
> > userdata.mydata = {}
> >
> >
> > local function registermydata(data,...)
> >
> > table.insert(userdata.mydata, data)
> >
> > end
> >
> >
> > interfaces.implement{
> >
> > name = "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{love}
> >
> >
> > \cldcontext{userdata.mydata[2]}
> >
> > \stoptext
> >
> > What I want to know is if there's a less hackish way to pass keys (yep,
> > only keys, not values) to Lua using \getdummyparameters (actually I'm
> > using an user-defined \setupsomething, but it's more or less the same)
> > and \processassignmentlist. Is it possible, for instance, to
> > automatically pass a key to Lua when it's set in \setupsomething? Thanks
> > in advance.
> >
> > Jairo
> >
> > PS: Sorry if I missed something in the test suite again
> It's probably somewhere ...
>
> \startluacode
>
> userdata = userdata or { }
> userdata.mydataA = { }
> userdata.mydataB = { }
>
> interfaces.implement {
> name  = "RegisterMyDataA",
>  public= true,
> arguments = { "hash" },
> actions   = function(t)
>  for k, v in pairs(t) do
>  table.insert(userdata.mydataA,k)
>  end
>  end,
> }
>
> interfaces.implement {
> name  = "RegisterMyDataB",
>  public= true,
> arguments = { "array" },
> actions   = function(t)
>  for k, v in ipairs(t) do
>  table.insert(userdata.mydataB,string.split(v,"=")[1])
>  end
>  end,
> }
>
> \stopluacode
>
>
> \unprotect
>
> \protect
>
> \starttext
>
> \RegisterMyDataA[love=nice,hate=awful]%
> \RegisterMyDataB[love=nice,hate=awful]%
>
> \cldcontext{userdata.mydataA[2]} % unordered
> \cldcontext{userdata.mydataB[1]} % ordered
>
> \stoptext
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] \processassignmentlist inside a \setup... or related

2021-04-19 Thread Jairo A. del Rio
Hi, list! I hope my example shows clearly enough what I intend to do:

\startluacode

userdata = userdata or {}

userdata.mydata = {}


local function registermydata(data,...)

table.insert(userdata.mydata, data)

end


interfaces.implement{

name = "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{love}


\cldcontext{userdata.mydata[2]}

\stoptext

What I want to know is if there's a less hackish way to pass keys (yep,
only keys, not values) to Lua using \getdummyparameters (actually I'm using
an user-defined \setupsomething, but it's more or less the same) and
\processassignmentlist. Is it possible, for instance, to automatically pass
a key to Lua when it's set in \setupsomething? Thanks in advance.

Jairo

PS: Sorry if I missed something in the test suite again
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Sorting items in Lua

2021-04-18 Thread Jairo A. del Rio
Oh, yes, I've just found it. Thanks!

Jairo

El dom, 18 de abr. de 2021 a la(s) 10:52, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 4/18/2021 4:21 PM, Jairo A. del Rio wrote:
>
> > Also, as registers allow to set a language for sorting, I want to know
> > how to do the same through Lua, e.g., sorting the same list according to
> > English and then Spanish rules. I've searched for examples in the
> > archive, but I've only found cases working on the TeX side. Thank you in
> > advance.
>
> hint: the test suite
>   Hans
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Sorting items in Lua

2021-04-18 Thread Jairo A. del Rio
Hi, list. I want to know how to use ConTeXt sorters, as those used in
registers, in Lua. Like this:

\starttext

\startluacode

--Spanish

local list = {"ñandú", "perrera", "zócalo", "árnica"}

--What's "sortingfunction"?

context(table.concat(sortingfunction(list)," "))

\stopluacode

\stoptext

Also, as registers allow to set a language for sorting, I want to know how
to do the same through Lua, e.g., sorting the same list according to
English and then Spanish rules. I've searched for examples in the archive,
but I've only found cases working on the TeX side. Thank you in advance.

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] A Metafun-Problem

2021-04-12 Thread Jairo A. del Rio
Is this what you need? If so, change unitsquare by fullsquare.

Jairo

El lun, 12 de abr. de 2021 a la(s) 16:06, Willi Egger (cont...@boede.nl)
escribió:

> Hi
>
> can somebody tell me why I do not get a trapezoid with bottom angles of
> 120 degrees?
>
> Please try the attached minimal example.
>
> Thank you!
>
> Willi
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>


test.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Sudoku module

2021-04-12 Thread Jairo A. del Rio
Hi, list! I've just finished a minimal module for sudoku puzzles based on
Peter Norvig's algorithm. The module and examples are in the link below:

https://github.com/JairoAdelRio/context-sudoku

My port is a sorta literal translation of Python's version, so improvements
are to be done. As always, I'm having trouble passing color data from TeX
to Lua so that sudokus have more customizable aesthetics. I'll gladly
accept any feedback and recommendations before I submit the module to the
Garden. Thank you very much. Stay safe.

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Issue with \handletokens\with and Lua-defined macros

2021-03-29 Thread Jairo A. del Rio
Hi list! See the following example:

\startluacode

userdata = userdata or {}


--Toy example

--My actual function receives an argument, but the problem remains the same


userdata.myfunction = function()

return

"343327959841638047651959775267761420323" ..

"657838053757849835434002826851807933276" ..

"324327913964298509889902373459201557839" ..

"84828001486412574060553756854137069878601"

end


interfaces.implement{

name = "myfunction",

public = true,

actions =

function ()

context(userdata.myfunction())

end

}

\stopluacode

\def\colorfulnumbers#1{\colored[h=\luaexpr{40*#1},s=1,v=1]{#1}\ }%

\starttext

%It doesn't work

%\handletokens{\myfunction}\with\colorfulnumbers

\expandafter\handletokens\expandafter{\myfunction}\with\colorfulnumbers

\stoptext


As readily seen from my example, I want to color each figure of the numbers
generated by a Lua function. However, the use of \expandafter's is
cumbersome in this case. I don't want to loop over the result in Lua
because I want to be able to apply \handletokens...\with... (or another
macro with a similar purpose) with different macros at the TeX end once Lua
has delivered results. How should I do it in ConTeXt?

Thanks in advance. Cordially,

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Writing to .tuc directly from Lua

2021-03-24 Thread Jairo A. del Rio
El mié, 24 de mar. de 2021 a la(s) 16:47, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 3/24/2021 6:33 PM, Jairo A. del Rio wrote:
> > Hi, Hans. Here's my (miserably failing) attempt:
> >
> > \definedataset[nicedata]
> >
> > \starttext
> >
> > \startluacode
> >
> > local name = "nicedata"
> >
> >
> > -- For exposition only
> >
> > local function dofactorial(n)
> >
> > local function inner(c,m)
> >
> > if m<2 then return c end
> >
> > return inner(c*m, m-1)
> >
> > end
> >
> > return inner(1,n)
> >
> > end
> >
> >
> > local function factorial(n)
> >
> > local stringn = tostring(n)
> >
> > if job.datasets.collected[name] then
> >
> > return job.datasets.collected[name].factorial[stringn]
> >
> > else
> >
> > local mydata = {[stringn] = tostring(dofactorial(n))}
> >
> > job.datasets.setdata{
> >
> > name = name,
> >
> > tag = "factorial",
> >
> > data = mydata
> >
> > }
> >
> > return mydata[stringn]
> >
> > end
> >
> > end
> >
> >
> > interfaces.implement{
> >
> > name = "factorial",
> >
> > public = true,
> >
> > arguments = {"string"},
> >
> > actions = {tonumber, factorial, context}
> >
> > }
> >
> >
> > \stopluacode
> >
> > \factorial{7}
> >
> > \stoptext
> >
> >
> > What happens is that, in each run, both the first and the second
> > conditions are met, so the compilation is twice as slow, the opposite
> > result of what I meant to do. How do I fix that?
>
> \definedataset[nicedata]
>
> \starttext
>
> \startluacode
>
> local function dofactorial(n)
> local function inner(c,m)
> if m < 2 then
>  return c
>  else
>  return inner(c*m, m-1)
>  end
> end
> return inner(1,n)
> end
>
> local function factorial(n)
>  local data = job.datasets.getdata("factorials","list")
>  if not data then
>  data = { }
>  end
>  local f = data[n]
>  if not f then
> f = dofactorial(n)
>  data[n] = f
>  end
>  job.datasets.setdata {
>  name = "factorials",
>  tag  = "list",
>  data = data
>  }
>  return f
> end
>
> interfaces.implement{
> name  = "factorial",
> public= true,
> arguments = { "integer" },
> actions   = { factorial, context }
> }
>
> \stopluacode
>
> \dorecurse {20} {
>  \factorial #1 \relax
> }
>
> \stoptext
>
>
It does exactly what I need. It's good to know datasets can be directly
generated, too. Thank you a lot!


> but you probably don't gain much as these factorials are not that slow
> (if you use them many times in a document you can just cache them)
>
>
It was only a toy example. I intend to work with way larger numbers. :)


> Hans
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>

Best regards,

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Writing to .tuc directly from Lua

2021-03-24 Thread Jairo A. del Rio
No, no actually. I only put a toy example. What I need to solve is related
with storing data in the .tuc file when processes take a long time.
Memoization doesn't work as data is lost with each new run.

Jairo

El mié, 24 de mar. de 2021 a la(s) 15:36, Aditya Mahajan (adit...@umich.edu)
escribió:

> On Wed, 24 Mar 2021, Jairo A. del Rio wrote:
>
> > Hi, Hans. Here's my (miserably failing) attempt:
> >
> > \definedataset[nicedata]
> >
> > \starttext
> >
> > \startluacode
> >
> > local name = "nicedata"
> >
> >
> > -- For exposition only
> >
> > local function dofactorial(n)
> >
> > local function inner(c,m)
> >
> > if m<2 then return c end
> >
> > return inner(c*m, m-1)
> >
> > end
> >
> > return inner(1,n)
> >
> > end
>
> Is this an example or your actual use case? In case you want to just
> compute the factorial without doing tail recursion:
>
> function factorial(n)
>   local product = 1
>   for i = 1,n do
> product = product * i
>   end
>   return product
> end
>
> is reasonable fast (for values of n for which factorial(n) doesn't
> overflow anyways).
>
> Aditya
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Writing to .tuc directly from Lua

2021-03-24 Thread Jairo A. del Rio
Hi, Hans. Here's my (miserably failing) attempt:

\definedataset[nicedata]

\starttext

\startluacode

local name = "nicedata"


-- For exposition only

local function dofactorial(n)

local function inner(c,m)

if m<2 then return c end

return inner(c*m, m-1)

end

return inner(1,n)

end


local function factorial(n)

local stringn = tostring(n)

if job.datasets.collected[name] then

return job.datasets.collected[name].factorial[stringn]

else

local mydata = {[stringn] = tostring(dofactorial(n))}

job.datasets.setdata{

name = name,

tag = "factorial",

data = mydata

}

return mydata[stringn]

end

end


interfaces.implement{

name = "factorial",

public = true,

arguments = {"string"},

actions = {tonumber, factorial, context}

}


\stopluacode

\factorial{7}

\stoptext


What happens is that, in each run, both the first and the second conditions
are met, so the compilation is twice as slow, the opposite result of what I
meant to do. How do I fix that?

Jairo

El mié, 24 de mar. de 2021 a la(s) 01:38, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 3/24/2021 5:20 AM, Jairo A. del Rio wrote:
> > Thank you very much. It's useful, indeed. However, what I need is to
> > bypass TeX (Lua > .tuc) if possible, since all the data I need to handle
> > is generated with Lua scripts.
> datasets-001.tex in the test suite
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Writing to .tuc directly from Lua

2021-03-23 Thread Jairo A. del Rio
Thank you very much. It's useful, indeed. However, what I need is to bypass
TeX (Lua > .tuc) if possible, since all the data I need to handle is
generated with Lua scripts.

Jairo

El mar, 23 de mar. de 2021 a la(s) 23:12, Aditya Mahajan (adit...@umich.edu)
escribió:

> On Tue, 23 Mar 2021, Jairo A. del Rio wrote:
>
> > Hi, list. I read about this:
> >
> > https://www.mail-archive.com/ntg-context@ntg.nl/msg60217.html
> >
> > But I want to know how to pass data to the .tuc file directly from Lua. I
> > think about some complex strings are calculations which are done in each
> > pass and slow down the whole compilation process. Something like:
> >
> > local function factorial(n)
> > if in_tuc then -- whatever in_tuc means
> >return factorials[n]
> > else
> >...
> >factorials[n] = ...
> >return ...
> > end
> > end
> >
> > Is that feasible? Should I use the CLD versions of the TeX macros
> instead?
>
> Does this help:
>
>
> https://wiki.contextgarden.net/System_Macros/Key_Value_Assignments#Multi-pass_data
>
> Aditya
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Writing to .tuc directly from Lua

2021-03-23 Thread Jairo A. del Rio
Hi, list. I read about this:

https://www.mail-archive.com/ntg-context@ntg.nl/msg60217.html

But I want to know how to pass data to the .tuc file directly from Lua. I
think about some complex strings are calculations which are done in each
pass and slow down the whole compilation process. Something like:

local function factorial(n)
if in_tuc then -- whatever in_tuc means
   return factorials[n]
else
   ...
   factorials[n] = ...
   return ...
end
end

Is that feasible? Should I use the CLD versions of the TeX macros instead?

Best regards,

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Problems with new ConTeXt in Linux

2021-03-20 Thread Jairo A. del Rio
Thank you very much. For the moment, it solves the problem.

Jairo

El sáb, 20 de mar. de 2021 a la(s) 08:41, Wolfgang Schuster (
wolfgang.schuster.li...@gmail.com) escribió:

> Jairo A. del Rio schrieb am 20.03.2021 um 14:21:
> > I deleted the .tma files. I'm still having the same issue.
>
> You have to wait for newer binaries but you can also try the ones I put
> online (will be deleted in a few days):
>
> https://www.dropbox.com/sh/liggfcfulksscvf/AAD1gIlsRaKFSUIebDx2vxiLa?dl=0
>
> Wolfgang
>
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Problems with new ConTeXt in Linux

2021-03-20 Thread Jairo A. del Rio
I deleted the .tma files. I'm still having the same issue.

Jairo

El sáb, 20 de mar. de 2021 a la(s) 06:00, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 3/20/2021 8:13 AM, Jairo A. del Rio wrote:
> > When I update to ConTeXt LMTX version 2021.03.20 01:07, the following
> > happens during format generation:
> >
> > tex error   > tex error on line 25 in file spac-hor.mkxl: Undefined
> > control sequence
> >
> >  \bitwiseflip \normalizelinemode \flattendiscretionariescode
> >
> > 
> >
> > So, what is happening here?
> are you sure that you have the new binary?
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Problems with new ConTeXt in Linux

2021-03-20 Thread Jairo A. del Rio
When I update to ConTeXt LMTX version 2021.03.20 01:07, the following
happens during format generation:

tex error   > tex error on line 25 in file spac-hor.mkxl: Undefined
control sequence

 \bitwiseflip \normalizelinemode \flattendiscretionariescode



So, what is happening here?

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] \underbar and co. not working properly in MkIV

2021-03-10 Thread Jairo A. del Rio
Hi, list. The following works well in LMTX, but it applies underlining to
the next dash sign when compiled with MkIV:


\starttext

%\overbar{foo}-bar

\underbar{foo}-bar

\stoptext

I've found a workaround for it, but I want to know about the reason for
such a strange behavior. Thanks beforehand.

Best regards,


Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] \showcolor broken in LMTX

2021-02-27 Thread Jairo A. del Rio
Thank you for the fix.

Best regards,

Jairo :)

El vie, 26 de feb. de 2021 a la(s) 07:53, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 2/26/2021 12:16 AM, Jairo A. del Rio wrote:
> > Hi, list. The following example fails in LMTX, but it works in MkIV:
> >
> > \starttext\showcolor[svg]\stoptext
> >
> > LMTX complains about a s-colors-run file not found
> i'll fix it (that hardly used runtime code has been moved) and the name
> is wrong
>
> Hans
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] \hbox to ... equivalent in ConTeXt (\framed)

2021-02-26 Thread Jairo A. del Rio
Wow, both \maxaligned and "paragraph" are new (and useful) to me. Thank you
again.

Jairo

El vie, 26 de feb. de 2021 a la(s) 17:24, Wolfgang Schuster (
wolfgang.schuster.li...@gmail.com) escribió:

> Jairo A. del Rio schrieb am 26.02.2021 um 23:09:
> > Nice, but it also adds spacing between characters inside a word. So,
> > what I was asking is if I can stretch only spaces between words via
> > key-value pairs in \framed, if possible, of course. Thank you very much.
>
> \starttext
>
> \framed[width=10cm,align=normal]{\maxaligned{Uno dos tres}}
>
> \framed[width=10cm,align=paragraph]{Uno dos tres}
>
> \stoptext
>
> Wolfgang
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] \hbox to ... equivalent in ConTeXt (\framed)

2021-02-26 Thread Jairo A. del Rio
Nice, but it also adds spacing between characters inside a word. So, what I
was asking is if I can stretch only spaces between words via key-value
pairs in \framed, if possible, of course. Thank you very much.

Jairo :)

El vie, 26 de feb. de 2021 a la(s) 17:06, Wolfgang Schuster (
wolfgang.schuster.li...@gmail.com) escribió:

> Jairo A. del Rio schrieb am 26.02.2021 um 22:38:
> > Hi list.
> >
> > Is there an interface for \hbox to  via framed? I think it's not
> > the ConTeXt spirit to do something like
> >
> > \framed[offset=0cm]{\hbox to 10cm{Uno dos tres}}
> >
> > where spacing is stretched so all the available space is filled, so I
> > want to know about a better way. Thank you beforehand.
>
> \starttext
>
> \framed{Uno dos tres}
>
> \framed{\stretched[width=10cm]{Uno dos tres}}
>
> \framed[width=10cm,align=normal]{\stretched{Uno dos tres}}
>
> \stoptext
>
> Wolfgang
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] \hbox to ... equivalent in ConTeXt (\framed)

2021-02-26 Thread Jairo A. del Rio
Hi list.

Is there an interface for \hbox to  via framed? I think it's not the
ConTeXt spirit to do something like

\framed[offset=0cm]{\hbox to 10cm{Uno dos tres}}

where spacing is stretched so all the available space is filled, so I want
to know about a better way. Thank you beforehand.

Cordially,

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] \showcolor broken in LMTX

2021-02-25 Thread Jairo A. del Rio
Hi, list. The following example fails in LMTX, but it works in MkIV:

\starttext\showcolor[svg]\stoptext

LMTX complains about a s-colors-run file not found

Best regards,

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Arbitrary equation tags... again

2021-02-23 Thread Jairo A. del Rio
I found a workaround for anyone interested:


\setupinteraction[state=start,focus=standard]

\starttext

\startplaceformula[title=$\alpha$,reference=alpha]

\startformula

1 + 1 = 2

\stopformula

\stopplaceformula

\dorecurse{20}{\samplefile{knuth}}

I'm in \in{$\alpha$}[alpha] %so the reference is now visible

\stoptext

However, one has to manually write a label and a title independently, so
I'm not sure that's a clean solution...

Best regards,

Jairo

El lun, 22 de feb. de 2021 a la(s) 23:28, Jairo A. del Rio (
jairoadelr...@gmail.com) escribió:

> Hi again. The following doesn't work (the tag is missing):
>
> \startTEXpage[offset=2bp]
> \startplaceformula[title=A,reference=alpha]
>  \startformula
>  1 + 1 = 2
>  \stopformula
> \stopplaceformula
> I'm in \in[alpha]
> \stopTEXpage
>
> Jairo
>
> El lun, 22 de feb. de 2021 a la(s) 09:00, Jairo A. del Rio (
> jairoadelr...@gmail.com) escribió:
>
>> Oh, dumb me, sorry for the noise and thank you very much. Not every day
>> is a good one, sorry again.
>>
>> Jairo.
>>
>> El lun, 22 de feb. de 2021 a la(s) 08:51, Hans Hagen (j.ha...@xs4all.nl)
>> escribió:
>>
>>> On 2/22/2021 2:05 PM, Jairo A. del Rio wrote:
>>> > Hi. list.
>>> > Is it possible to assign an arbitrary equation tag in ConTeXt? I've
>>> seen
>>> > solutions here;
>>> >
>>> >
>>> https://tex.stackexchange.com/questions/400257/tag-equation-in-context-with-arbitrary-text
>>> > <
>>> https://tex.stackexchange.com/questions/400257/tag-equation-in-context-with-arbitrary-text
>>> >
>>> >
>>> > but none of them works as expected (either the formula counter is
>>> still
>>> > incrementing with arbitrary conversions or cross-references don't
>>> work).
>>>
>>> Define 'expected' ... \eqno is something low level (a primitive) and we
>>> have that nilled at the user level and only use it deep down. It was
>>> never meant as user command.
>>>
>>> > I imagine some things have changed in 2021 and I hope a better
>>> solution
>>> > is feasible nowadays.
>>>
>>> \startTEXpage[offset=2bp]
>>> \startplaceformula[title=A]
>>>  \startformula
>>>  1 + 1 = 2
>>>  \stopformula
>>> \stopplaceformula
>>> \stopTEXpage
>>>
>>> Hans
>>>
>>> -
>>>Hans Hagen | PRAGMA ADE
>>>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>>> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
>>> -
>>>
>>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Arbitrary equation tags... again

2021-02-22 Thread Jairo A. del Rio
Hi again. The following doesn't work (the tag is missing):

\startTEXpage[offset=2bp]
\startplaceformula[title=A,reference=alpha]
 \startformula
 1 + 1 = 2
 \stopformula
\stopplaceformula
I'm in \in[alpha]
\stopTEXpage

Jairo

El lun, 22 de feb. de 2021 a la(s) 09:00, Jairo A. del Rio (
jairoadelr...@gmail.com) escribió:

> Oh, dumb me, sorry for the noise and thank you very much. Not every day is
> a good one, sorry again.
>
> Jairo.
>
> El lun, 22 de feb. de 2021 a la(s) 08:51, Hans Hagen (j.ha...@xs4all.nl)
> escribió:
>
>> On 2/22/2021 2:05 PM, Jairo A. del Rio wrote:
>> > Hi. list.
>> > Is it possible to assign an arbitrary equation tag in ConTeXt? I've
>> seen
>> > solutions here;
>> >
>> >
>> https://tex.stackexchange.com/questions/400257/tag-equation-in-context-with-arbitrary-text
>> > <
>> https://tex.stackexchange.com/questions/400257/tag-equation-in-context-with-arbitrary-text
>> >
>> >
>> > but none of them works as expected (either the formula counter is still
>> > incrementing with arbitrary conversions or cross-references don't work).
>>
>> Define 'expected' ... \eqno is something low level (a primitive) and we
>> have that nilled at the user level and only use it deep down. It was
>> never meant as user command.
>>
>> > I imagine some things have changed in 2021 and I hope a better solution
>> > is feasible nowadays.
>>
>> \startTEXpage[offset=2bp]
>> \startplaceformula[title=A]
>>  \startformula
>>  1 + 1 = 2
>>  \stopformula
>> \stopplaceformula
>> \stopTEXpage
>>
>> Hans
>>
>> -
>>Hans Hagen | PRAGMA ADE
>>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
>> -
>>
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Arbitrary equation tags... again

2021-02-22 Thread Jairo A. del Rio
Oh, dumb me, sorry for the noise and thank you very much. Not every day is
a good one, sorry again.

Jairo.

El lun, 22 de feb. de 2021 a la(s) 08:51, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 2/22/2021 2:05 PM, Jairo A. del Rio wrote:
> > Hi. list.
> > Is it possible to assign an arbitrary equation tag in ConTeXt? I've seen
> > solutions here;
> >
> >
> https://tex.stackexchange.com/questions/400257/tag-equation-in-context-with-arbitrary-text
> > <
> https://tex.stackexchange.com/questions/400257/tag-equation-in-context-with-arbitrary-text
> >
> >
> > but none of them works as expected (either the formula counter is still
> > incrementing with arbitrary conversions or cross-references don't work).
>
> Define 'expected' ... \eqno is something low level (a primitive) and we
> have that nilled at the user level and only use it deep down. It was
> never meant as user command.
>
> > I imagine some things have changed in 2021 and I hope a better solution
> > is feasible nowadays.
>
> \startTEXpage[offset=2bp]
> \startplaceformula[title=A]
>  \startformula
>  1 + 1 = 2
>  \stopformula
> \stopplaceformula
> \stopTEXpage
>
> Hans
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Arbitrary equation tags... again

2021-02-22 Thread Jairo A. del Rio
Hi. list.
Is it possible to assign an arbitrary equation tag in ConTeXt? I've seen
solutions here;

https://tex.stackexchange.com/questions/400257/tag-equation-in-context-with-arbitrary-text

but none of them works as expected (either the formula counter is still
incrementing with arbitrary conversions or cross-references don't work). I
imagine some things have changed in 2021 and I hope a better solution is
feasible nowadays.

Best regards,

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Are positional graphics still working?

2021-02-17 Thread Jairo A. del Rio
It works fine now. Thank you a lot for the fix.

Cordially,

Jairo :)

El mié, 17 de feb. de 2021 a la(s) 06:09, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 2/17/2021 12:18 AM, Jairo A. del Rio wrote:
> > I've copied the following example from the ConTeXt archive:
> >
> > \defineoverlay[frames][\positionoverlay{frames}]
> >
> > \setupbackgrounds[text][background=frames]
> >
> >
> > \startMPpositiongraphic{frame}
> >
> > if unknown context_apos : input mp-apos.mpiv ; fi ;
> >
> > \MPgetposboxes{\MPvar{self}}{\MPanchorid}
> >
> > if nofposboxes = 1 :
> >
> > draw posboxes[1] ;
> >
> > fi ;
> >
> > \stopMPpositiongraphic
> >
> >
> > \startpositionoverlay{frames}
> >
> > \setMPpositiongraphic{one}{frame}
> >
> > \setMPpositiongraphic{two}{frame}
> >
> > \stoppositionoverlay
> >
> >
> > \starttext
> >
> > This \hpos{one}{word} should be \hpos{two}{framed}.
> >
> > \stoptext
> >
> > Frames are misplaced, so I don't know if that's a bug or something else
> > has been updated/changed/deprecated. Thank you in advance.
> As a step-up to further integrated (more lmtx-ish) support for this the
> next upload will have this:
>
> \defineoverlay[frames][\positionoverlay{frames}]
>
> \setupbackgrounds[text][background=frames]
>
> \startMPpositiongraphic{frame}
>  getposboxes("self","anchor") ;
>  if nofposboxes = 1 :
>  draw posboxes[1] ;
>  fi ;
> \stopMPpositiongraphic
>
> \startpositionoverlay{frames}
>  \setMPpositiongraphic{one}{frame}
>  \setMPpositiongraphic{two}{frame}
> \stoppositionoverlay
>
> \starttext
>  This \hpos{one}{\strut word} should \hpos{two}{\strut also be framed}.
> \stoptext
>
> Hans
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Are positional graphics still working?

2021-02-16 Thread Jairo A. del Rio
I've copied the following example from the ConTeXt archive:

\defineoverlay[frames][\positionoverlay{frames}]

\setupbackgrounds[text][background=frames]


\startMPpositiongraphic{frame}

if unknown context_apos : input mp-apos.mpiv ; fi ;

\MPgetposboxes{\MPvar{self}}{\MPanchorid}

if nofposboxes = 1 :

draw posboxes[1] ;

fi ;

\stopMPpositiongraphic


\startpositionoverlay{frames}

\setMPpositiongraphic{one}{frame}

\setMPpositiongraphic{two}{frame}

\stoppositionoverlay


\starttext

This \hpos{one}{word} should be \hpos{two}{framed}.

\stoptext

Frames are misplaced, so I don't know if that's a bug or something else has
been updated/changed/deprecated. Thank you in advance.

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Loop?

2021-02-12 Thread Jairo A. del Rio
There's \processseparatedlist[][]\command with an
arbitrary  other than a comma...

You should take a look at syst-aux.mkiv and syst-aux.mkxl to see more
helpers:

https://source.contextgarden.net/tex/context/base/mkiv/syst-aux.mkxl

El vie, 12 de feb. de 2021 a la(s) 14:49, Angel M Alganza (a...@ugr.es)
escribió:

> Hi Jairo:
>
> On Fri, Feb 12, 2021 at 01:50:58PM -0500, Jairo A. del Rio wrote:
>
> > Hi, Ángel. Like this?
>
> > \def\mylist{Fulano,Mengano,Sutano}
> > \def\mycommand#1{#1\blank{\red Something here}\blank}
> > \starttext
> > \processcommacommand[\mylist]\mycommand
> > \stoptext
>
> Yes, exactly like this, thank you.  Now, I have the names writen like:
>
> Family Name, Name
>
> So, is it possible to use a list separatd by something else than a
> comma?  A semicolon, for example?  To test I've replaced those commas by
> a colon and it works fine, but I'd rather have a comma, if possible.
>
> Again, thank you so much!
>
> Cheers,
> Ángel
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Loop?

2021-02-12 Thread Jairo A. del Rio
Oh, I knew about the environment form, but I didn't know about
\currentcommalistitem. Useful to avoid to define ad hoc commands :)
As always, thank you very much for the lesson.

Best regards,

Jairo

El vie, 12 de feb. de 2021 a la(s) 14:25, Wolfgang Schuster (
wolfgang.schuster.li...@gmail.com) escribió:

> Jairo A. del Rio schrieb am 12.02.2021 um 19:50:
> > Hi, Ángel. Like this?
> >
> > \def\mylist{Fulano,Mengano,Sutano}
> >
> > \def\mycommand#1{#1\blank{\red Something here}\blank}
> >
> > \starttext
> >
> > \processcommacommand[\mylist]\mycommand
> >
> > \stoptext
> >
> > There are better ways to deal with data in ConTeXt, but it's basically
> > that way, I think.
>
>
> You can use the commalist environment:
>
> \starttext
>
> \startprocesscommalist[One,Two,Three,Four]
>  Person Number \currentcommalistitem\par
> \stopprocesscommalist
>
> \blank
>
> \defineexpandable\NameList{One,Two,Three,Four}
>
> \startprocesscommacommand[\NameList]
>  Person Number \currentcommalistitem\par
> \stopprocesscommacommand
>
> \stoptext
>
>
> Another way is to use the database module:
>
> \usemodule[database]
>
> \starttext
>
> \defineseparatedlist
>[namelist]
>[command=\NameEntry]
>
> \starttexdefinition unexpanded NameEntry #1
>  Person Number #1\par
> \stoptexdefinition
>
> \startseparatedlist[namelist]
> One
> Two
> Three
> Four
> \stopseparatedlist
>
> \stoptext
>
>
> Wolfgang
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Loop?

2021-02-12 Thread Jairo A. del Rio
Oops, it's "zutano". Sorry for the typo.

Jairo :)

El vie, 12 de feb. de 2021 a la(s) 13:50, Jairo A. del Rio (
jairoadelr...@gmail.com) escribió:

> Hi, Ángel. Like this?
>
> \def\mylist{Fulano,Mengano,Sutano}
>
> \def\mycommand#1{#1\blank{\red Something here}\blank}
>
> \starttext
>
> \processcommacommand[\mylist]\mycommand
>
> \stoptext
>
> There are better ways to deal with data in ConTeXt, but it's basically
> that way, I think.
>
> Jairo
>
>
>
> El vie, 12 de feb. de 2021 a la(s) 13:44, Angel M Alganza (a...@ugr.es)
> escribió:
>
>> Hello:
>>
>> I am trying to print a list of names always followed by the same info
>> (generated by a new command).  At the moment, I have all the names
>> followed by the command like so:
>>
>> Person Number One
>> \mycommand
>> Person Number Two
>> \mycommand
>> Person Number Three
>> \mycommand
>> Person Number Four
>> \mycommand
>> Person Number Five
>> \mycommand
>> .
>> .
>> .
>>
>> I'd rather have the list of people stored somewhere (a list? an array?)
>> and loop through it and then inserting \mynewcommand at compilation
>> time.  That way, when I need to replace the list of people with a new
>> one, I'd just do that instead of building the above structure again and
>> again.
>>
>> Is it possible to do that with just ConTeXt or would I need to resort to
>> Lua.  I guess it should be possible both ways, but I haven't figure out
>> how to do it.  Any pointer, please?
>>
>> Thank you so much in advance.
>>
>> Cheers,
>> Ángel
>>
>> ___
>> If your question is of interest to others as well, please add an entry to
>> the Wiki!
>>
>> maillist : ntg-context@ntg.nl /
>> http://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : http://contextgarden.net
>>
>> ___
>>
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Loop?

2021-02-12 Thread Jairo A. del Rio
Hi, Ángel. Like this?

\def\mylist{Fulano,Mengano,Sutano}

\def\mycommand#1{#1\blank{\red Something here}\blank}

\starttext

\processcommacommand[\mylist]\mycommand

\stoptext

There are better ways to deal with data in ConTeXt, but it's basically that
way, I think.

Jairo



El vie, 12 de feb. de 2021 a la(s) 13:44, Angel M Alganza (a...@ugr.es)
escribió:

> Hello:
>
> I am trying to print a list of names always followed by the same info
> (generated by a new command).  At the moment, I have all the names
> followed by the command like so:
>
> Person Number One
> \mycommand
> Person Number Two
> \mycommand
> Person Number Three
> \mycommand
> Person Number Four
> \mycommand
> Person Number Five
> \mycommand
> .
> .
> .
>
> I'd rather have the list of people stored somewhere (a list? an array?)
> and loop through it and then inserting \mynewcommand at compilation
> time.  That way, when I need to replace the list of people with a new
> one, I'd just do that instead of building the above structure again and
> again.
>
> Is it possible to do that with just ConTeXt or would I need to resort to
> Lua.  I guess it should be possible both ways, but I haven't figure out
> how to do it.  Any pointer, please?
>
> Thank you so much in advance.
>
> Cheers,
> Ángel
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] SVG fonts not working properly

2021-02-06 Thread Jairo A. del Rio
Ah, sorry. I'll try again.

Jairo

El sáb., 6 de feb. de 2021 3:45 p. m., Hans Hagen 
escribió:

> On 2/6/2021 3:08 AM, Jairo A. del Rio wrote:
> > svg=fixdepth breaks, with or without the patch.
> >
> > fatal lua error:
> >
> >
> > run callback [6]: [string
> > "/home/coragyps/lmtx/tex/texmf-context/tex/con..."]:1587: attempt to
> > perform arithmetic on a nil value (field 'depth')
>
> did you remake the format?
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] SVG fonts not working properly

2021-02-05 Thread Jairo A. del Rio
svg=fixdepth breaks, with or without the patch.

fatal lua error:


run callback [6]: [string
"/home/coragyps/lmtx/tex/texmf-context/tex/con..."]:1587: attempt to
perform arithmetic on a nil value (field 'depth')

stack traceback:

[string "/home/coragyps/lmtx/tex/texmf-context/tex/con..."]:1587: in local
'glyphtopdf'

[string "/home/coragyps/lmtx/tex/texmf-context/tex/con..."]:1879: in local
'writer'

[string "/home/coragyps/lmtx/tex/texmf-context/tex/con..."]:2080: in field
'integer index'

[string "/home/coragyps/lmtx/tex/texmf-context/tex/con..."]:782: in upvalue
'run'

[string "/home/coragyps/lmtx/tex/texmf-context/tex/con..."]:811: in field
'finalizedocument'

[string "/home/coragyps/lmtx/tex/texmf-context/tex/con..."]:2958: in field
'?'

...mtx/tex/texmf-context/tex/context/base/mkiv/luat-run.lua:56: in function
<...mtx/tex/texmf-context/tex/context/base/mkiv/luat-run.lua:54>

Jairo

El vie, 5 de feb. de 2021 a la(s) 17:02, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 2/5/2021 6:29 PM, Jairo A. del Rio wrote:
> > The following examples doesn't work as expected:
> >
> >
> > \definefontfeature[emojis][default,color:svg][script=latn,language=dflt]
> >
> > \definefont[gilbert][file:Gilbert-ColorBoldPreview5*emojis @ 13bp]
> >
> > \starttext
> >
> > {\gilbert abcdefghijklmnpqrstuvwxyz}
> >
> > \stoptext
> >
> > Letters are displayed correctly, but ascenders and descenders don't. It
> > looks like characters are inserted like images rather than actual
> > characters. Am I missing something? Thank you in advance.
> svg fonts are a bit of a mess adn there are not many (scaling, offset
> etc. and specs kind of fuzzy .. one needs for instance treat the visible
> area in a special way .. there is no metadata wrt the glyph involved so
> we need to experiment a bit (i don't want to end up with heuristics
> based on guesswork)
>
> anyway, them being svg they are actually images (there was time that
> acrobat has svg on board but that was dropped) so what we end up is with
> is a pdf stream but in such a way that they are actual characters
>
> you can try this:
>
> \definefontfeature[color:svg][ccmp=yes,dist=yes,svg=fixdepth]
>
> and patch lpdf-emb with
>
>   -- local y = - b[4] - b[2] - (d.depth
> or 0)
>  local y = - (d.depth or 0)
>
> and try some more (like emoji) ... no time now ... so you do the
> checking and later i will look at the result
>
> Hans
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


  1   2   3   >