Thanks. Does the fix apply for similar issue I raised with below where all paragraphs are indented (expected is that first par is not indented) ?

 

\setupindenting[yes, next, 1em]

 

\starttext

\input knuth

\stoptext

 

De : Hans Hagen
Envoyé le :vendredi 20 novembre 2020 20:07
À : mailing list for ConTeXt users; Wolfgang Schuster
Objet :Re: [NTG-context] \noindentation not working

 

On 11/20/2020 6:27 PM, Wolfgang Schuster wrote:

> Pablo Rodriguez schrieb am 20.11.2020 um 17:41:

>> Dear list,

>> 

>> I have the following MWE:

>> 

>>    \showframe\showgrid

>>    \setupindenting[yes, always, big]

>>    \starttext

>>    \noindentation

>>    a

>> 

>>    a

>>    \stoptext

>> 

>> Using LMTX (2020.11.19 11:28), I get indentation with \noindentation.

>> 

>> Could anyone confirm this?

>

> Yes, something is wrong.

>

> %%%% begin example

> \showgrid

>

> \starttext

>

> \parindent\emwidth

>

> a

>

> \everypar{\setbox\scratchbox\lastbox}

> a

>

> \stoptext

> %%%% end example

 

Ah, okay. We have normalization enabled now. That means two things:

 

- instead if a hbox being used for indentation (with >= 0 width) we now

have a skip (with no stretch but that might become an option some day);

the tex engine uses a hbox because it is easier on the par builder (less

checking, as glue, being a valid breakpoint, involves quite a bit)

 

- after breaking a paragraph into lines the result is normalized, that

is: we have left/right hang, left/right skip. left/right parfilskip

instead of a mix of either or not present left/right skip, and shifted

boxes in case of some hang features (again, the original approach is

easier for the engine, but machines are fast enough and have plenty of

memory so we can stop worrying about it)

 

The ideas is that this way we can make some lua nodelist hackery more

elegant (but I need to catch up with that: most tex files are now split

in mkiv and lmtx and next comes the lua files after which we can start

some more drastic upgrading ... keep in mind that quite some code is

from more than a decase ago, evolved a bit but seldom changed conceptually).

 

Here's a fix:

 

\unprotect

 

\def\spac_indentation_remove

   {\ifzeropt\parindent \else

      \begingroup

      \unskip % we also need to check for the subtype

      \setbox\scratchbox\lastbox % we also need to check for the

      \endgroup

    \fi}

 

\protect

 

(we might need adapt some more code); actually more correct would be:

 

\def\spac_indentation_remove

   {\ifzeropt\parindent \else

      \begingroup

      \ifnum\lastnodetype=\gluenodecode

        \unskip % we also need to check for the subtype

      \orelse\ifnum\lastnodetype=\hlistnodecode

        \setbox\scratchbox\lastbox % we also need to check for the subtype

      \else

        % forget about it

      \fi

      \endgroup

    \fi}

 

(it actually makes sense to have a native \unindent primitive but we can

simulate that in lua)

 

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

___________________________________________________________________________________