I’d like to change some input to modify used font but only in parts of it, for 
example to implement having first line with different font. So basically if I 
have text with macros etc…:

\WORD{i}eu \Note[]{}{Ebrieux \LeftDot 11.a.}crea au commencement le ciel et la 
terre. Et la terre
estoit \Note[]{*}{{\Hebreu\Tav\He\Vav} c'est a dire/ vaine/ qui ne proffite et 
ne sert a rien.}indisposee et \Note[]{*}{{\Hebreu\Bet\He\Vav} non remplie & 
ornee/ de plantes et d'animaux.}vuyde/ et les tenebres estoient sus les 
abysmes/ et \Note[]{*}{Selon les Ebrieux/ ou esperit: car 
{\Hebreu\Dalet\Vav\Het} signifie vent & esperit.}le vent \Note[]{*}{ou/ 
vehement car {\Hebreu\Alef\Lamed\Resh\He\Yod\Memfinal} se prent aucunesfois 
pour hault/ excellent/ & puissant.}de Dieu se demenoit par dessus les eaues.

I’d like to typeset the beginning of that using a different font BigFont (but 
letting lua code to determine the position of closing brace). Ie :

{\BigFont \WORD{i}eu \Note[]{}{Ebrieux \LeftDot 11.a.}crea au commencement le 
ciel et la terre.} Et la terre
estoit \Note[]{*}{{\Hebreu\Tav\He\Vav} c'est a dire/ vaine/ qui ne proffite et 
ne sert a rien.}indisposee et \Note[]{*}{{\Hebreu\Bet\He\Vav} non remplie & 
ornee/ de plantes et d'animaux.}vuyde/ et les tenebres estoient sus les 
abysmes/ et \Note[]{*}{Selon les Ebrieux/ ou esperit: car 
{\Hebreu\Dalet\Vav\Het} signifie vent & esperit.}le vent \Note[]{*}{ou/ 
vehement car {\Hebreu\Alef\Lamed\Resh\He\Yod\Memfinal} se prent aucunesfois 
pour hault/ excellent/ & puissant.}de Dieu se demenoit par dessus les eaues.

To do this I’d need to extract the macros etc… « Worst » case scenario I’ll 
write a simple adhoc lpeg grammar to parse input, but was wondering if such 
grammar existed already in context lua code, or elsewhere.

Thanks

De : Hans Hagen
Envoyé le :mercredi 28 novembre 2018 09:04
À : Joseph Canedo; mailing list for ConTeXt users
Objet :Re: [NTG-context] Grammar to parse TeX input?

On 11/27/2018 11:00 PM, Joseph Canedo wrote:
> I’ve tried context.processbuffer but I am afraid it’s not what I am 
> after, most probably I have not phrased clearly my question.
> 
> What I am looking for is roughly what’s described in Taco’s presentation 
> https://meeting.contextgarden.net/2014/talks/2014-09-12-taco-luatex/luatextalk.pdf
> 
> A way to decompose some input into tokens which represent either normal 
> text, csnames etc…  I had a try to this token library in LuaTeX but I 
> could not find examples of how to use it. I suspect that buffers 
> mechanism use it somehow.
you can pick up stuff from the input so in principle you can start your 
input with a token scanner, but then you not only end up with lots of 
'tokens' but also need to interpret them ... and that is actually what 
tex is quite effecient in and good at, so the question is: what do you 
want to achieve ... there might be better ways

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
___________________________________________________________________________________

Reply via email to