Re: [NTG-context] Commands with arguments before in ConTeXt

2020-06-29 Thread Jairo A. del Rio
I'll take a look at it. Thank you a lot, Taco. Regards, Jairo :) El lun., 29 de jun. de 2020 a la(s) 05:36, Taco Hoekwater ( t...@elvenkind.com) escribió: > Hi, > > Oversimplifying: > > TeX (and derivatives like luatex) read the input file as a list of > operators with optional suffix

Re: [NTG-context] Commands with arguments before in ConTeXt

2020-06-29 Thread Hans Hagen
On 6/29/2020 3:48 PM, Jairo A. del Rio wrote: |Oh, I was just asking about luatexbase.add_to_callback("process_input_buffer", blabla, "blabla" )| | | |and | | luatexbase.remove_from_callback("process_input_buffer", "blabla" ) | We always had such things but I never advertise their usage.

Re: [NTG-context] Commands with arguments before in ConTeXt

2020-06-29 Thread Jairo A. del Rio
Oh, I was just asking about luatexbase.add_to_callback("process_input_buffer", blabla, "blabla" ) and luatexbase.remove_from_callback("process_input_buffer", "blabla" ) LuaLaTeX users do that way and I want to be sure it won't interfere with ConTeXt way of doing things so I can play with the

Re: [NTG-context] Commands with arguments before in ConTeXt

2020-06-29 Thread Hans Hagen
On 6/29/2020 12:21 PM, Jairo A. del Rio wrote: Wouldn't it be slow for larger documents? I will try anyway. By the way, I've seen Lua(La)TeX users recurring to callbacks (process input buffer) to make string replacements and I've done so myself sometimes. Does ConTeXt do preprocessing the same

Re: [NTG-context] Commands with arguments before in ConTeXt

2020-06-29 Thread Hans Hagen
On 6/29/2020 1:06 PM, Taco Hoekwater wrote: Sorry, that was a bit too much oversimplification: On 29 Jun 2020, at 12:36, Taco Hoekwater wrote: In math mode, there *is* an expression state maintained, and that is why \over and \atop work. Actually (still oversimplifying), the found

Re: [NTG-context] Commands with arguments before in ConTeXt

2020-06-29 Thread Taco Hoekwater
Sorry, that was a bit too much oversimplification: > On 29 Jun 2020, at 12:36, Taco Hoekwater wrote: > > In math mode, there *is* an expression state maintained, and that is why > \over and \atop work. Actually (still oversimplifying), the found commands are saved in a temporary list, that

Re: [NTG-context] Commands with arguments before in ConTeXt

2020-06-29 Thread Taco Hoekwater
Hi, Oversimplifying: TeX (and derivatives like luatex) read the input file as a list of operators with optional suffix arguments. In normal (text) mode, there is no expression state maintained except inside the handling of such optional arguments. It follows that, if there is a top-level

Re: [NTG-context] Commands with arguments before in ConTeXt

2020-06-29 Thread Jairo A. del Rio
Wouldn't it be slow for larger documents? I will try anyway. By the way, I've seen Lua(La)TeX users recurring to callbacks (process input buffer) to make string replacements and I've done so myself sometimes. Does ConTeXt do preprocessing the same way or is a better alternative possible? Thank you

Re: [NTG-context] Commands with arguments before in ConTeXt

2020-06-29 Thread Jairo A. del Rio
Hans, after your explanation I'm actually curious now about details, but my knowledge is too limited now (maybe reading source codes would be better? Worse?). I do a bit of C, but I don't know about Pascal at all and I'm not sure where to start from in order to understand TeX better. Well, at

Re: [NTG-context] Commands with arguments before in ConTeXt

2020-06-29 Thread luigi scarso
On Sun, Jun 28, 2020 at 10:48 PM Jairo A. del Rio wrote: > I've read the following is not possible in TeX > > \def#1\macro{blabla#1} > > where arguments come before. The only partial exceptions are commands like > \atop or \over, which are in fact primitives. Is there a way to do this in >

Re: [NTG-context] Commands with arguments before in ConTeXt

2020-06-29 Thread Hans Hagen
On 6/28/2020 10:48 PM, Jairo A. del Rio wrote: I've read the following is not possible in TeX \def#1\macro{blabla#1} where arguments come before. The only partial exceptions are commands like \atop or \over, which are in fact primitives. Is there a way to do this in ConTeXt? Could it be a

[NTG-context] Commands with arguments before in ConTeXt

2020-06-28 Thread Jairo A. del Rio
I've read the following is not possible in TeX \def#1\macro{blabla#1} where arguments come before. The only partial exceptions are commands like \atop or \over, which are in fact primitives. Is there a way to do this in ConTeXt? Could it be a feature request for LuaMetaTeX? I've seen Hans