[NTG-context] Re: QR Code (Henning Hraban Ramm)

2024-04-29 Thread Benjamin Buchmuller
Hi Hraban,

Downgrading zint to 2.12.0 worked for me. Many thanks!

In case someone is experiencing similar issues, I ran:

brew remove zint
curl 
https://raw.githubusercontent.com/Homebrew/homebrew-core/962d789d26c9d8f760affe272689f21388f7d3e2/Formula/z/zint.rb
 > zint.rb
brew install zint.rb
zint --version (should be 2.12.0)

[follow the instructions to symlink zint to 
tex/texmf-osx-64/bin/lib/luametatex/zint]

mtxrun --generate


___
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: ConteXt commands in an rtl environment

2024-04-29 Thread Wolfgang Schuster

Alan Bowen schrieb am 29.04.2024 um 19:37:

I used TeXShop and PopChar Pro to get the letter ר so that it is l2r.

Not a great solution but it works when one is working in r2l text. 
(Thank heaven for Unicode.)


I will have a look at Visual Studio Code.


I tested a few text editors with better RTL support and all of them show 
the text in the same way as TeXShop.


Support for RTL in Visual Studio Code seems to be limited because the 
editor doesn't use the Unicode Bidi Algorithm [1].


[1] https://wiki.archlinux.org/title/Bidirectional_text#Editors

Wolfgang

___
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: unprotecting when defining in Lua

2024-04-29 Thread Pablo Rodriguez via ntg-context
On 4/29/24 19:32, Wolfgang Schuster wrote:
> Pablo Rodriguez via ntg-context schrieb am 29.04.2024 um 18:21:
>> Is \protected the same as \unexpanded?
>
> Yes they are the same (\protected is the primitive and \unexpanded is a
> copy) but this wasn't always the case.
>
> Original TeX didn't provide a mechanism to create protected commands
> and creators of macro packages had to create their own mechanism for
> this, the ConTeXt solution was \unexpanded. With the etex extensions
> the \protected primitive was added and \unexpanded uses the new
> primitive when you used a engine which supported it.

Many thanks for your fast reply and your explanation, Wolfgang.

Pablo

___
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: unprotecting when defining in Lua

2024-04-29 Thread Wolfgang Schuster

Pablo Rodriguez via ntg-context schrieb am 29.04.2024 um 18:21:

On 4/29/24 18:04, Wolfgang Schuster wrote:

Pablo Rodriguez via ntg-context schrieb am 29.04.2024 um 17:22:

[...]
Which is the right way to use "interfaces.definecommand" to get a simple
command as in standard TeX?

I mean, no a non \permanent or non \protected command.

You can't create unprotected command with interfaces.definecommand
but this not a problem because you can just use interfaces.implement
to create your command which is then unprotected by default. Using
implement instead of definecommand doesn't matter because
definecommand is just a wrapper for the implement function with the
option to create a environment.

Many thanks for your fast reply, Wolfgang.

I’m reading it now in cld-mkiv.pdf.

Is \protected the same as \unexpanded?


Yes they are the same (\protected is the primitive and \unexpanded is a 
copy) but this wasn't always the case.


Original TeX didn't provide a mechanism to create protected commands and 
creators of macro packages
had to create their own mechanism for this, the ConTeXt solution was 
\unexpanded. With the etex extensions
the \protected primitive was added and \unexpanded uses the new 
primitive when you used a engine

which supported it.

Wolfgang

___
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: ConteXt commands in an rtl environment

2024-04-29 Thread Wolfgang Schuster

Alan Bowen schrieb am 29.04.2024 um 18:27:
I discovered what the problem was. Just in case someone else may also 
wonder how to do this, one way (not necessarily the best) is to insert:

{ר}high\
where the letter in parentheses (resh) should be entered in a l2r 
context, not r2l.


Which editor do you use?

There is no universal solution for this because different editors 
require different methods, I tries Notepad++ and VSCode and latter was 
easier to use for me.


See the attached snipped how the input looks in Visual Studio Code.

Wolfgang

___
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: Why Difference Between \placefloat and \definefloat

2024-04-29 Thread Wolfgang Schuster

urba...@ca.rr.com schrieb am 28.04.2024 um 19:54:
I swear I used to understand this stuff.  I plead old age.   Why do I 
get two different results from the float placements here:


\definefloat[mysidebar][mysidebars]
\setupfloat[mysidebar][leftmargindistance=-.25in,rightmargindistance=-.25in,outer,none]


1. You can't pass assignments and keywords to the same argument.

2. The \setupfloat command accepts only assignments as arguments, this 
means "outer" and "none" are ignored.


To set a default location for the float use 
\setupfloat[...][default={outer,none}]



\defineframedtext [sidebartext]
[width=.4\textwidth,bodyfont=small,corner=round,background=color,backgroundcolor=lightgray,align=flushleft]

\starttext
This is a bit of text
\placefloat[sidebar][leftmargindistance=-.25in,rightmargindistance=-.25in,outer,none]{}{


1. You're again passing assignments and keywords with a single argument.

2. The \placefloat commands accepts only keywords and ignores all 
assignments, this means your distance settings have no effect.


Wolfgang

___
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: ConteXt commands in an rtl environment

2024-04-29 Thread Alan Bowen
I discovered what the problem was. Just in case someone else may also
wonder how to do this, one way (not necessarily the best) is to insert:
{ר}high\
where the letter in parentheses (resh) should be entered in a l2r context,
not r2l.

Alan


On Sun, Apr 28, 2024 at 4:23 PM Alan Bowen  wrote:

> I am having trouble entering ConteXt commands in an rtl language, in this
> case Hebrew.
>
> How does one make the last(left hand) letter of the Hebrew word
> אשר
> a superscript?
>
> My experiments with \high{...} have not been successful so far in part, I
> think, because I have not got the brackets right.
>
> Any tips or pointers will be gratefully received.
>
> Alan
>
___
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: unprotecting when defining in Lua

2024-04-29 Thread Pablo Rodriguez via ntg-context
On 4/29/24 18:04, Wolfgang Schuster wrote:
> Pablo Rodriguez via ntg-context schrieb am 29.04.2024 um 17:22:
>> [...]
>> Which is the right way to use "interfaces.definecommand" to get a simple
>> command as in standard TeX?
>>
>> I mean, no a non \permanent or non \protected command.
>
> You can't create unprotected command with interfaces.definecommand
> but this not a problem because you can just use interfaces.implement
> to create your command which is then unprotected by default. Using
> implement instead of definecommand doesn't matter because
> definecommand is just a wrapper for the implement function with the
> option to create a environment.

Many thanks for your fast reply, Wolfgang.

I’m reading it now in cld-mkiv.pdf.

Is \protected the same as \unexpanded?

Many thanks for your help again,

Pablo
___
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: unprotecting when defining in Lua

2024-04-29 Thread Wolfgang Schuster

Pablo Rodriguez via ntg-context schrieb am 29.04.2024 um 17:22:

Dear list,

I have the following sample:

   \starttext
   \startluacode
 function document.test(str)
   context(str)
 end

 interfaces.definecommand {
   name = "testing",
   protected = false,
   macro = document.test,
 }
   \stopluacode

   \meaningfull\testing

   \def\test#1{#1}

   \meaningfull\test
   \stoptext

Which is the right way to use "interfaces.definecommand" to get a simple
command as in standard TeX?

I mean, no a non \permanent or non \protected command.


You can't create unprotected command with interfaces.definecommand but 
this not a problem
because you can just use interfaces.implement to create your command 
which is then unprotected
by default. Using implement instead of definecommand doesn't matter 
because definecommand
is just a wrapper for the implement function with the option to create a 
environment.


Wolfgang

___
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] unprotecting when defining in Lua

2024-04-29 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \starttext
  \startluacode
function document.test(str)
  context(str)
end

interfaces.definecommand {
  name = "testing",
  protected = false,
  macro = document.test,
}
  \stopluacode

  \meaningfull\testing

  \def\test#1{#1}

  \meaningfull\test
  \stoptext

Which is the right way to use "interfaces.definecommand" to get a simple
command as in standard TeX?

I mean, no a non \permanent or non \protected command.

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://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: statistical charts module re-published

2024-04-29 Thread Tomáš Hála
Hi Hraban,

> published the new version to https://modules.contextgarden.net (i.e. 
> installation with
> "mtxrun --script install-modules --install > statistical-charts"

thank you, this is very userful.

Tomáš

___
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: QR Code

2024-04-29 Thread Henning Hraban Ramm

Hi Ben,

I’m not sure if this is your issue, but the zint library’s API used to 
change with every version, so that ConTeXt supports only the “latest” 
few, and probably that’s still 2.10 to 2.12.


I still have 2.12 via MacPorts on MacOS 10.15, and it works.
Can you try an older zint version?

And just for information, MkIV used to call the zint binary, while LMTX 
uses the library to create the structures and converts them via MP into 
PDF objects (no additional files).


Hraban

Am 29.04.24 um 05:03 schrieb Benjamin Buchmuller:

Catching up on an earlier thread by Ursula and Hraban,

I'm also experienceing problems with \usemodule[zint] while \usemodule[t-zint] 
works fine.

Running on macOS (ConTeXt  ver: 2024.04.01 08:59 LMTX  fmt: 2024.4.28).

The issue seems somewhat unrelated to ConTeXt on first glance (??) if this is 
helpful. My code stopped working after I updated the OS (to Sonoma) and my 
homebrew cellar (to zint 2.13.0) while keeping a ConTeXt version from 2022 
which compiled the barcodes perfectly fine before these updates. This being 
said, the newer ConTeXt version doesn't resolve the issue.

Observations:

1) Zint (and Inkscape) is in my PATH and correctly sym-linked as specified in the 
wiki (~/tex/texmf-osx-64/bin/lib/luametatex/zint/libzint.so 
). However, the library was (still) not fount after mtxrun 
--generate

[This seems an odd, but unrelated problem]

2) So, I hardcoded libfile in libs-impzint.lmt to

local libfile = "/usr/local/Cellar/zint/2.13.0/lib/libzint.dylib"

3) Running the wiki example:

   \usemodule[m-zint]
\starttext
\barcode[alternative=isbnx, text=9783865419026, width=4cm]
\barcode[alternative=qrcode, text={https://wiki.contextgarden.net},
width=3cm]
\barcode[alternative=maxicode, text={test}, width=3cm]
\stoptext

* With \usemodule[m-zint], I correctly get:

zint --barcode=qrcode  --output="zint-qrcode-495165e08dbc5ce650aaaf13caa2229f.eps" 
--input="zint-qrcode-495165e08dbc5ce650aaaf13caa2229f.tmp"
zint --barcode=maxicode  --output="zint-maxicode-098f6bcd4621d373cade4e832627b4f6.eps" 
--input="zint-maxicode-098f6bcd4621d373cade4e832627b4f6.tmp"

[Barcodes show up as expected]

* With \usemodule[zint], no success:

optional> using library 
'/usr/local/Cellar/zint/2.13.0/lib/libzint.dylib'
zint> something went wrong: invalid result vector
zint> something went wrong: invalid result
zint> something went wrong: invalid result vector

Maybe this is helpful to pinpoint the issue?


___
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
___