From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/113432 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Marcus Vinicius Mesquita via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: new upload, new trickery Date: Tue, 16 Nov 2021 10:52:44 -0300 Message-ID: References: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9130839898897395752==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34881"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Marcus Vinicius Mesquita To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Nov 16 14:53:29 2021 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mmytr-0008sS-R9 for gctc-ntg-context-518@m.gmane-mx.org; Tue, 16 Nov 2021 14:53:27 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id C92C82893D4; Tue, 16 Nov 2021 14:53:06 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 67_mwi41RV9Q; Tue, 16 Nov 2021 14:53:04 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 16A9E289394; Tue, 16 Nov 2021 14:53:04 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id DADE3289394 for ; Tue, 16 Nov 2021 14:53:01 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DxAEBcP-caeS for ; Tue, 16 Nov 2021 14:52:59 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.210.170; helo=mail-pf1-f170.google.com; envelope-from=marcusvinicius.mesquita@gmail.com; receiver= Original-Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 41116280582 for ; Tue, 16 Nov 2021 14:52:59 +0100 (CET) Original-Received: by mail-pf1-f170.google.com with SMTP id n26so13628126pff.3 for ; Tue, 16 Nov 2021 05:52:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=jbG+3kpyh9HKG+7/HLdqwbbrtWOyoyPAA/VXy2ReMnI=; b=kt2AR4h4QUtq7jPjKiLP50AftXrxxDHrWhZqk/VKpaEr5GhwNJReVf0o1RPO7MA88n XOQGt6Rq6L+g5EfNbHT0uqz33C1U5h3DyIAnbNEjGtPywulY3vSvMeIETj7v5Ow7z9pv VNet2zbvSjskUdjlmGKTaYPBjwpnzD8kSdARCLqWJk57Zpo7IU6U/lPfJFbGgH6b9PsK ZcCzj/I4oRaDr4PEFjrRuNApUQ4SWR5lZoEG0DnrmdGNXJwpuDImkR/8zvZCf0mNuMeY F4Usyib9Qi+SfBlASQmKmEQOmk+xwy3xGsQINklYQbDOA62MhyJ7mrtMl8okdvJaDN5S V6fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=jbG+3kpyh9HKG+7/HLdqwbbrtWOyoyPAA/VXy2ReMnI=; b=u/7HJCdSvQWdyoEpabpD1KF0bt44CKeotzy3RKKef2fZfN43+qAvq6R95hNs6x6glh lEFtlpHPOGi0MoOyVVRmbiLRsrr04givkDUlQ/uCx88CDSp7qbzsvGuoKk9CJjQ+egIK oxqq/dXCm15ePBmnKxXXJZpFT7hg6ekmRREDPgFQ0aWMLEPcP9Tkk25/jcZ4+oy72c7m eFRTCXswneL7V1n34XgkgEg3nuHnsT93029Pf4oyZ0cQhumn6OJxayoXksfrAqWZ6/A2 CsEP7SrVVpJ1h3wfOR058ncT3hSZ/5f7Rww33Lwyqt8cq/sMcQuO2tSHBQ3b6GqUy6am 1ljg== X-Gm-Message-State: AOAM530tZmhn5L4P1lzExKlfmLgmbPHt1b/E6Pvief9JV5FQrDepSZXW W2eaxZJGiGyRDs6PshV+ADucpmoIRebPwoh4wOIFchuzBAU= X-Google-Smtp-Source: ABdhPJyLMhNMvNtogi1dYoat0gblxWslsV/U2vEjB/Yrn0Q0GaRAMbp7SHFlMny5C2rDlRB095vM5yU03W5HjErlXlQ= X-Received: by 2002:a63:160b:: with SMTP id w11mr4826288pgl.235.1637070776715; Tue, 16 Nov 2021 05:52:56 -0800 (PST) In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:113432 Archived-At: --===============9130839898897395752== Content-Type: multipart/alternative; boundary="0000000000001e4e8c05d0e83ecb" --0000000000001e4e8c05d0e83ecb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Hans I tried to run your first example, but ConTeXt throws an error and complains that \resetleftparbox was never defined. Using version: 2021.11.13 Regards Marcus Vinicius On Thu, Oct 28, 2021 at 6:24 AM Hans Hagen via ntg-context < ntg-context@ntg.nl> wrote: > Hi, > > Among the 'can they be made better' candidates in the engine are > \vadjust and \local[left|right]box primitives that are not really used > in context (okay, vadjust is used in mkii). > > The \vadjust vertical injector can be illustrated with > > \starttext > \ignorespaces\input tufte \removeunwantedspaces > we want a break before this line \vadjust pre {\break}% > \ignorespaces\input tufte \removeunwantedspaces > > \page > > \ignorespaces\input tufte \removeunwantedspaces > we want seperate lines now \leftparbox{\vadjust post {\break}}% > \ignorespaces\input tufte \removeunwantedspaces > \resetleftparbox{} > \stoptext > > It's a signal that injects something in a vertical list without > interupting the horizontal text flow. One can inject before (pre) or > after (post which is default). New is that we can also influence the > order: after vs before preceding \vadjust in the same line. Also new is > that deeply nested adjustments can migrate (so the hole los: marks, > inserts and vadjust are now in sync) which is demonstrated with the next > example: > > \starttext > \showstruts > \input tufte \removeunwantedspaces\space > \localleftbox par {% > \hbox to 0pt{% > \llap{L}% > \vadjust{\strut\blackrule[width=3D1cm,color=3Dred]}% > \hbox{\vadjust pre{\strut\blackrule[width=3D1cm,color=3Dgreen]= }}% > }\hss > }% > \localrightbox par {}% > \input tufte \removeunwantedspaces\space > \vadjust pre {\strut BEFORE 1}% > \vadjust pre {\strut BEFORE 2}% > \vadjust before {\strut AFTER 1}% > \vadjust before {\strut AFTER 2}% > \ignorespaces > \input tufte > \stoptext > > Indeed it looks bad (ugly) but it illustrates the idea. What makes > vadjust sort of useless for content is that it messes up spacing (but if > there is real demand and usage i can sort that out at some point, maybe > some new options or so). Thsi example also brings us to local boxes: > > \showframe > > \starttext > > \showmakeup[hbox] > > \startnarrower[2*left] \raggedleft > {\localleftbox par {L1}\input tufte \par} > \stopnarrower > \blank > > \startnarrower[2*middle] \raggedcenter > {\localrightbox par {R1}\input tufte \par} > \stopnarrower > \blank > > \stoptext > > New is the par keyword that forces the setting to be applied from the > first line downards (fyio: these commands, when display set registers, > when inline they set registers and inject a node). Watch out: one needs > to use grouping in order not to bleed into other mechanisms. > > Also new is that we can query the content of these registers using \the, > as in: > > \dorecurse{10}{ > \showboxes > \localleftbox{\ruledhbox {\smallinfofont\setstrut\strut[L #1.0]}}% > \localleftbox{\ruledhbox {\smallinfofont\setstrut\strut[L > #1.1]}\the\localleftbox}% > \localleftbox{\ruledhbox {\smallinfofont\setstrut\strut[L > #1.2]}\the\localleftbox}% > \localleftbox{\ruledhbox {\smallinfofont\setstrut\strut[L > #1.3]}\the\localleftbox}% > % > \localrightbox{\ruledhbox > {\smallinfofont\setstrut\strut[R #1.0]}}% > > \localrightbox{\the\localrightbox\ruledhbox{\smallinfofont\setstrut\strut= [R > > #1.1]}}% > > \localrightbox{\the\localrightbox\ruledhbox{\smallinfofont\setstrut\strut= [R > > #1.2]}}% > \localrightbox{\the\localrightbox\ruledhbox{\smallinfofont[R #1.3]}}= % > % \localrightbox{}% > \samplefile{tufte} > } > > Flushing permits us to append and prepend but it's still ugly so that is > why we now have a new interface (context layer on top of engine): > > \dorecurse{10}{ > \showboxes > % > \resetleftparbox > \resetrightparbox > % > \prependleftparbox {\ruledhbox{\smallinfofont\setstrut\strut[L > #1.0]}}% > \prependleftparbox {\ruledhbox{\smallinfofont\setstrut\strut[L > #1.1]}}% > \prependleftparbox {\ruledhbox{\smallinfofont\setstrut\strut[L > #1.2]}}% > \prependleftparbox {\ruledhbox{\smallinfofont\setstrut\strut[L > #1.3]}}% > % > \appendrightparbox{\ruledhbox{\smallinfofont\setstrut\strut[R #1.0]}= }% > \appendrightparbox{\ruledhbox{\smallinfofont\setstrut\strut[R #1.1]}= }% > \appendrightparbox{\ruledhbox{\smallinfofont\setstrut\strut[R #1.2]}= }% > \appendrightparbox{\ruledhbox{\smallinfofont[R #1.3]}}% > % > \samplefile{tufte} > } > > But as this is not really user friendly, there is more: a mechanism for > hooking in handlers. > > \definelocalboxes > [linenumber] > [command=3D\LeftNumber, > location=3Dleft, > width=3D3em, > style=3D\bs, > color=3Ddarkred] > > \definelocalboxes > [linenumbertwo] > [linenumber] > [command=3D\RightNumber, > location=3Dright, > width=3D6em, > style=3D\bf, > color=3Ddarkgreen] > > \definelocalboxes > [linetext] > [command=3D\LeftText, > location=3Dlefttext, > style=3D\bs, > color=3Ddarkblue] > > \definelocalboxes > [linetexttwo] > [linetext] > [command=3D\RightText, > location=3Drighttext, > style=3D\bf, > color=3Ddarkgray] > > % just using the content > > % \protected\def\LeftNumber {\hbox to > \localboxesparameter{width}{\strut\box\localboxcontentbox\hss)}} > % \protected\def\RightNumber{\hbox to > \localboxesparameter{width}{\strut(\hss\box\localboxcontentbox)}} > > % using the provided line number: > > % \def\LineNumberL{\the\localboxlinenumber} > % \def\LineNumberR{\the\localboxlinenumber} > > % using a tex counter > > % \newcount\MyLineNumberL > % \newcount\MyLineNumberR > % \def\LineNumberL{\global\advance\MyLineNumberL\plusone\the\MyLineNumber= L} > % \def\LineNumberR{\global\advance\MyLineNumberR\plusone\the\MyLineNumber= R} > > % using proper counters > > \definecounter[MyLineNumberL] > \definecounter[MyLineNumberR] > > \setupcounter[MyLineNumberL][numberconversion=3Dcharacters] > \setupcounter[MyLineNumberR][numberconversion=3Dromannumerals] > > > \def\LineNumberL{\incrementcounter[MyLineNumberL]\convertedcounter[MyLine= NumberL]} > > \def\LineNumberR{\incrementcounter[MyLineNumberR]\convertedcounter[MyLine= NumberR]} > > \protected\def\LeftNumber {\hbox to > \localboxesparameter{width}{\strut(\LineNumberL\hss)}} > \protected\def\RightNumber{\hbox to > \localboxesparameter{width}{\strut(\hss\LineNumberR)}} > > \protected\def\LeftText #1{#1\quad} > \protected\def\RightText#1{\quad#1} > > \showframe > > \starttext > > \start > \localbox[linenumber]{}% > \localbox[linenumbertwo]{}% > \localbox[linetext]{L}% > \startlocalbox[linetexttwo] > R > \stoplocalbox > \dorecurse{100}{ > \samplefile{tufte} > \par > } > \stop > > If you play a bit with these low level mechanism the luametatex / > context combination now permits weird applications (which for sure some > of you will (ab)use). The above example shows how to implement line > numbers (there are drawbacks compared to the existing mechanisms) and > other stuff in the margins and text edges but the most important aspect > is that when the content in these boxes has width, it will be taken into > account in the par builder because that is what this is about: these > local boxes are taken into acount when breaking lines. When the handlers > kick in, you have > > \localboxattribute : more for internal use > \localboxlinenumber : as the par builder sees it > \localboxwidth : the local box width > \localboxoffset : the total distance to the edge > \localboxleftskip : the effective leftskip > \localboxrightskip : the effective rightskip > \localboxlefthang : the current shape related value > \localboxrighthang : the current shape related value > \localboxindent : only first line > \localboxparfillleftskip : effective value (onky last line) > \localboxparfillrightskip : effective value (only last line) > \localboxovershoot : overfull compensation > > most of these relate to normalized lines and as such there is plenty to > play with. Others can be seen in the examples. > > I might add some more control to both these 'injection' mechanism > because directly out of the (pdftex/omega/luatex) they are not that > useful (which is probably also why we don't use them.) These are cheap > extensions so they don't really influence runtime much, so .. when not > used ... no harm done. I really have no clue how useful this is. > > I need to ponder this usage: > > \definelocalboxes > [linetextA] > [command=3D\LeftTextA, > location=3Dlefttext, > style=3D\bs, > color=3Ddarkblue] > > \protected\def\LeftTextA#1{\llap{#1}\quad} > > \definelocalboxes > [linetextB] > [command=3D\LeftTextB, > location=3Dleft, > style=3D\bs, > color=3Ddarkgreen] > > \protected\def\LeftTextB{\llap{\unhbox\localboxcontentbox}\quad} > > \starttext > > \dorecurse{10}{some text #1 } > \leftparbox {\red \bf keyword}HERE\leftparbox{} > \dorecurse{10}{some text #1 } > \blank > > {\dorecurse{10}{some text #1 } > \leftparbox {\red \bf keyword}test > \dorecurse{10}{some text #1 }} > \blank > > {\dorecurse{10}{some text #1 } > \localbox[linetextA]{keyword}HERE > \dorecurse{10}{some text #1 }} > > {\dorecurse{10}{some text #1 } > \localbox[linetextB]{keyword}HERE > \dorecurse{10}{some text #1 }} > > {\dorecurse{10}{some text #1 } > \localbox[linetextB]{keyword 1}HERE1 > \dorecurse{10}{some text #1 } > \localbox[linetextB]{keyword 2}HERE2 > \dorecurse{10}{some text #1 }} > > \stoptext > > so there's always so echallenge left. > > 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 > > _________________________________________________________________________= __________ > --=20 Todas as coisas fatigam o corpo, salvo a m=C3=BAsica, que n=C3=A3o fatiga n= em o corpo nem seus membros, por ser descanso da alma, primavera do cora=C3=A7=C3=A3o,= distra=C3=A7=C3=A3o do aflito, entretenimento do solit=C3=A1rio, e vi=C3=A1tico do viajante. Kunn=C3=A2sh al-H=C3=A2'ik (Cancioneiro de al-H=C3=A2'ik) --0000000000001e4e8c05d0e83ecb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi, Hans

I tried to run your first example, but Con= TeXt throws an error and complains that \resetleftparbox was never defined.=
Using version: 2021.11.13

Regards

Marcus Vinicius


On Thu, Oct 28, 2021 at 6:24 AM Hans Hagen = via ntg-context <ntg-context@ntg.n= l> wrote:
Hi,

Among the 'can they be made better' candidates in the engine are \vadjust and \local[left|right]box primitives that are not really used
in context (okay, vadjust is used in mkii).

The \vadjust vertical injector can be illustrated with

\starttext
=C2=A0 =C2=A0 =C2=A0\ignorespaces\input tufte \removeunwantedspaces
=C2=A0 =C2=A0 =C2=A0we want a break before this line \vadjust pre {\break}%=
=C2=A0 =C2=A0 =C2=A0\ignorespaces\input tufte \removeunwantedspaces

=C2=A0 =C2=A0 =C2=A0\page

=C2=A0 =C2=A0 =C2=A0\ignorespaces\input tufte \removeunwantedspaces
=C2=A0 =C2=A0 =C2=A0we want seperate lines now \leftparbox{\vadjust post {\= break}}%
=C2=A0 =C2=A0 =C2=A0\ignorespaces\input tufte \removeunwantedspaces
=C2=A0 =C2=A0 =C2=A0\resetleftparbox{}
\stoptext

It's a signal that injects something in a vertical list without
interupting the horizontal text flow. One can inject before (pre) or
after (post which is default). New is that we can also influence the
order: after vs before preceding \vadjust in the same line.=C2=A0 Also new = is
that deeply nested adjustments can migrate (so the hole los: marks,
inserts and vadjust are now in sync) which is demonstrated with the next example:

\starttext
=C2=A0 =C2=A0 =C2=A0\showstruts
=C2=A0 =C2=A0 =C2=A0\input tufte \removeunwantedspaces\space
=C2=A0 =C2=A0 =C2=A0\localleftbox=C2=A0 par {%
=C2=A0 =C2=A0 =C2=A0 =C2=A0 \hbox to 0pt{%
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\llap{L}%
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\vadjust{\strut\blackrule[width=3D= 1cm,color=3Dred]}%
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\hbox{\vadjust pre{\strut\blackrul= e[width=3D1cm,color=3Dgreen]}}%
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }\hss
=C2=A0 =C2=A0 =C2=A0}%
=C2=A0 =C2=A0 =C2=A0\localrightbox par {}%
=C2=A0 =C2=A0 =C2=A0\input tufte \removeunwantedspaces\space
=C2=A0 =C2=A0 =C2=A0\vadjust pre=C2=A0 =C2=A0 {\strut BEFORE 1}%
=C2=A0 =C2=A0 =C2=A0\vadjust pre=C2=A0 =C2=A0 {\strut BEFORE 2}%
=C2=A0 =C2=A0 =C2=A0\vadjust before {\strut AFTER=C2=A0 1}%
=C2=A0 =C2=A0 =C2=A0\vadjust before {\strut AFTER=C2=A0 2}%
=C2=A0 =C2=A0 =C2=A0\ignorespaces
=C2=A0 =C2=A0 =C2=A0\input tufte
\stoptext

Indeed it looks bad (ugly) but it illustrates the idea. What makes
vadjust sort of useless for content is that it messes up spacing (but if there is real demand and usage i can sort that out at some point, maybe some new options or so). Thsi example also brings us to local boxes:

\showframe

\starttext

\showmakeup[hbox]

\startnarrower[2*left] \raggedleft
{\localleftbox par {L1}\input tufte=C2=A0 \par}
\stopnarrower
\blank

\startnarrower[2*middle] \raggedcenter
{\localrightbox par {R1}\input tufte=C2=A0 \par}
\stopnarrower
\blank

\stoptext

New is the par keyword that forces the setting to be applied from the
first line downards (fyio: these commands, when display set registers,
when inline they set registers and inject a node). Watch out: one needs to use grouping in order not to bleed into other mechanisms.

Also new is that we can query the content of these registers using \the, as in:

\dorecurse{10}{
=C2=A0 =C2=A0 =C2=A0\showboxes
=C2=A0 =C2=A0 =C2=A0\localleftbox{\ruledhbox {\smallinfofont\setstrut\strut= [L #1.0]}}%
=C2=A0 =C2=A0 =C2=A0\localleftbox{\ruledhbox {\smallinfofont\setstrut\strut= [L
#1.1]}\the\localleftbox}%
=C2=A0 =C2=A0 =C2=A0\localleftbox{\ruledhbox {\smallinfofont\setstrut\strut= [L
#1.2]}\the\localleftbox}%
=C2=A0 =C2=A0 =C2=A0\localleftbox{\ruledhbox {\smallinfofont\setstrut\strut= [L
#1.3]}\the\localleftbox}%
=C2=A0 =C2=A0 =C2=A0%
=C2=A0 =C2=A0 =C2=A0\localrightbox{\ruledhbox
{\smallinfofont\setstrut\strut[R #1.0]}}%

\localrightbox{\the\localrightbox\ruledhbox{\smallinfofont\setstrut\strut[R=
#1.1]}}%

\localrightbox{\the\localrightbox\ruledhbox{\smallinfofont\setstrut\strut[R=
#1.2]}}%
=C2=A0 =C2=A0 =C2=A0\localrightbox{\the\localrightbox\ruledhbox{\smallinfof= ont[R #1.3]}}%
=C2=A0 =C2=A0 =C2=A0% \localrightbox{}%
=C2=A0 =C2=A0 =C2=A0\samplefile{tufte}
}

Flushing permits us to append and prepend but it's still ugly so that i= s
why we now have a new interface (context layer on top of engine):

\dorecurse{10}{
=C2=A0 =C2=A0 =C2=A0\showboxes
=C2=A0 =C2=A0 =C2=A0%
=C2=A0 =C2=A0 =C2=A0\resetleftparbox
=C2=A0 =C2=A0 =C2=A0\resetrightparbox
=C2=A0 =C2=A0 =C2=A0%
=C2=A0 =C2=A0 =C2=A0\prependleftparbox {\ruledhbox{\smallinfofont\setstrut\= strut[L #1.0]}}%
=C2=A0 =C2=A0 =C2=A0\prependleftparbox {\ruledhbox{\smallinfofont\setstrut\= strut[L #1.1]}}%
=C2=A0 =C2=A0 =C2=A0\prependleftparbox {\ruledhbox{\smallinfofont\setstrut\= strut[L #1.2]}}%
=C2=A0 =C2=A0 =C2=A0\prependleftparbox {\ruledhbox{\smallinfofont\setstrut\= strut[L #1.3]}}%
=C2=A0 =C2=A0 =C2=A0%
=C2=A0 =C2=A0 =C2=A0\appendrightparbox{\ruledhbox{\smallinfofont\setstrut\s= trut[R #1.0]}}%
=C2=A0 =C2=A0 =C2=A0\appendrightparbox{\ruledhbox{\smallinfofont\setstrut\s= trut[R #1.1]}}%
=C2=A0 =C2=A0 =C2=A0\appendrightparbox{\ruledhbox{\smallinfofont\setstrut\s= trut[R #1.2]}}%
=C2=A0 =C2=A0 =C2=A0\appendrightparbox{\ruledhbox{\smallinfofont[R #1.3]}}%=
=C2=A0 =C2=A0 =C2=A0%
=C2=A0 =C2=A0 =C2=A0\samplefile{tufte}
}

But as this is not really user friendly, there is more: a mechanism for hooking in handlers.

\definelocalboxes
=C2=A0 =C2=A0[linenumber]
=C2=A0 =C2=A0[command=3D\LeftNumber,
=C2=A0 =C2=A0 location=3Dleft,
=C2=A0 =C2=A0 width=3D3em,
=C2=A0 =C2=A0 style=3D\bs,
=C2=A0 =C2=A0 color=3Ddarkred]

\definelocalboxes
=C2=A0 =C2=A0[linenumbertwo]
=C2=A0 =C2=A0[linenumber]
=C2=A0 =C2=A0[command=3D\RightNumber,
=C2=A0 =C2=A0 location=3Dright,
=C2=A0 =C2=A0 width=3D6em,
=C2=A0 =C2=A0 style=3D\bf,
=C2=A0 =C2=A0 color=3Ddarkgreen]

\definelocalboxes
=C2=A0 =C2=A0[linetext]
=C2=A0 =C2=A0[command=3D\LeftText,
=C2=A0 =C2=A0 location=3Dlefttext,
=C2=A0 =C2=A0 style=3D\bs,
=C2=A0 =C2=A0 color=3Ddarkblue]

\definelocalboxes
=C2=A0 =C2=A0[linetexttwo]
=C2=A0 =C2=A0[linetext]
=C2=A0 =C2=A0[command=3D\RightText,
=C2=A0 =C2=A0 location=3Drighttext,
=C2=A0 =C2=A0 style=3D\bf,
=C2=A0 =C2=A0 color=3Ddarkgray]

% just using the content

% \protected\def\LeftNumber {\hbox to
\localboxesparameter{width}{\strut\box\localboxcontentbox\hss)}}
% \protected\def\RightNumber{\hbox to
\localboxesparameter{width}{\strut(\hss\box\localboxcontentbox)}}

% using the provided line number:

% \def\LineNumberL{\the\localboxlinenumber}
% \def\LineNumberR{\the\localboxlinenumber}

% using a tex counter

% \newcount\MyLineNumberL
% \newcount\MyLineNumberR
% \def\LineNumberL{\global\advance\MyLineNumberL\plusone\the\MyLineNumberL}=
% \def\LineNumberR{\global\advance\MyLineNumberR\plusone\the\MyLineNumberR}=

% using proper counters

\definecounter[MyLineNumberL]
\definecounter[MyLineNumberR]

\setupcounter[MyLineNumberL][numberconversion=3Dcharacters]
\setupcounter[MyLineNumberR][numberconversion=3Dromannumerals]

\def\LineNumberL{\incrementcounter[MyLineNumberL]\convertedcounter[MyLineNu= mberL]}
\def\LineNumberR{\incrementcounter[MyLineNumberR]\convertedcounter[MyLineNu= mberR]}

\protected\def\LeftNumber {\hbox to
\localboxesparameter{width}{\strut(\LineNumberL\hss)}}
\protected\def\RightNumber{\hbox to
\localboxesparameter{width}{\strut(\hss\LineNumberR)}}

\protected\def\LeftText #1{#1\quad}
\protected\def\RightText#1{\quad#1}

\showframe

\starttext

\start
=C2=A0 =C2=A0 =C2=A0\localbox[linenumber]{}%
=C2=A0 =C2=A0 =C2=A0\localbox[linenumbertwo]{}%
=C2=A0 =C2=A0 =C2=A0\localbox[linetext]{L}%
=C2=A0 =C2=A0 =C2=A0\startlocalbox[linetexttwo]
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0R
=C2=A0 =C2=A0 =C2=A0\stoplocalbox
=C2=A0 =C2=A0 =C2=A0\dorecurse{100}{
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\samplefile{tufte}
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\par
=C2=A0 =C2=A0 =C2=A0}
\stop

If you play a bit with these low level mechanism the luametatex /
context combination now permits weird applications (which for sure some of you will (ab)use). The above example shows how to implement line
numbers (there are drawbacks compared to the existing mechanisms) and
other stuff in the margins and text edges but the most important aspect is that when the content in these boxes has width, it will be taken into account in the par builder because that is what this is about: these
local boxes are taken into acount when breaking lines. When the handlers kick in, you have

\localboxattribute=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0: more for internal use=
\localboxlinenumber=C2=A0 =C2=A0 =C2=A0 =C2=A0 : as the par builder sees it=
\localboxwidth=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0: the local b= ox width
\localboxoffset=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 : the total distan= ce to the edge
\localboxleftskip=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 : the effective leftski= p
\localboxrightskip=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0: the effective rightsk= ip
\localboxlefthang=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 : the current shape rel= ated value
\localboxrighthang=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0: the current shape rel= ated value
\localboxindent=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 : only first line<= br> \localboxparfillleftskip=C2=A0 =C2=A0: effective value (onky last line)
\localboxparfillrightskip=C2=A0 : effective value (only last line)
\localboxovershoot=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0: overfull compensation=

most of these relate to normalized lines and as such there is plenty to play with. Others can be seen in the examples.

I might add some more control to both these 'injection' mechanism <= br> because directly out of the (pdftex/omega/luatex) they are not that
useful (which is probably also why we don't use them.) These are cheap =
extensions so they don't really influence runtime much, so .. when not =
used ... no harm done. I really have no clue how useful this is.

I need to ponder this usage:

\definelocalboxes
=C2=A0 =C2=A0[linetextA]
=C2=A0 =C2=A0[command=3D\LeftTextA,
=C2=A0 =C2=A0 location=3Dlefttext,
=C2=A0 =C2=A0 style=3D\bs,
=C2=A0 =C2=A0 color=3Ddarkblue]

\protected\def\LeftTextA#1{\llap{#1}\quad}

\definelocalboxes
=C2=A0 =C2=A0[linetextB]
=C2=A0 =C2=A0[command=3D\LeftTextB,
=C2=A0 =C2=A0 location=3Dleft,
=C2=A0 =C2=A0 style=3D\bs,
=C2=A0 =C2=A0 color=3Ddarkgreen]

\protected\def\LeftTextB{\llap{\unhbox\localboxcontentbox}\quad}

\starttext

\dorecurse{10}{some text #1 }
\leftparbox {\red \bf keyword}HERE\leftparbox{}
\dorecurse{10}{some text #1 }
\blank

{\dorecurse{10}{some text #1 }
\leftparbox {\red \bf keyword}test
\dorecurse{10}{some text #1 }}
\blank

{\dorecurse{10}{some text #1 }
\localbox[linetextA]{keyword}HERE
\dorecurse{10}{some text #1 }}

{\dorecurse{10}{some text #1 }
\localbox[linetextB]{keyword}HERE
\dorecurse{10}{some text #1 }}

{\dorecurse{10}{some text #1 }
\localbox[linetextB]{keyword 1}HERE1
\dorecurse{10}{some text #1 }
\localbox[linetextB]{keyword 2}HERE2
\dorecurse{10}{some text #1 }}

\stoptext

so there's always so echallenge left.

Hans

-----------------------------------------------------------------
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0Hans Hagen | PRAGMA ADE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Ridderstraat 27 | 80= 61 GH Hasselt | The Netherlands
=C2=A0 =C2=A0 =C2=A0 =C2=A0 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 t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/nt= g-context
webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.net=
archive=C2=A0 : https://bitbucket.org/phg/context-m= irror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
___________________________________________________________________________= ________


--
Todas as coisas fatigam o corpo, salvo a m=C3=BAsica, = que n=C3=A3o fatiga nem o corpo nem seus membros, por ser descanso da alma,= primavera do cora=C3=A7=C3=A3o, distra=C3=A7=C3=A3o do aflito, entretenime= nto do solit=C3=A1rio, e vi=C3=A1tico do viajante.

Kunn=C3=A2sh al-H=C3=A2'ik (Cancioneiro de al-H=C3=A2'ik)
--0000000000001e4e8c05d0e83ecb-- --===============9130839898897395752== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============9130839898897395752==--