ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <j.hagen@xs4all.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
	Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
Subject: Re: \noindentation not working
Date: Fri, 20 Nov 2020 20:07:22 +0100	[thread overview]
Message-ID: <9e04fa3a-93af-c39a-ba57-ae9570c77bae@xs4all.nl> (raw)
In-Reply-To: <41e0efaf-c6c5-4ef2-2e96-cbf54f60c9bc@gmail.com>

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
___________________________________________________________________________________

  reply	other threads:[~2020-11-20 19:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20 16:41 Pablo Rodriguez
2020-11-20 16:47 ` Otared Kavian
2020-11-20 17:27 ` Wolfgang Schuster
2020-11-20 19:07   ` Hans Hagen [this message]
2020-11-20 19:49     ` Pablo Rodriguez
2020-11-20 20:07     ` RE : " Joseph
2020-11-20 21:05       ` Pablo Rodriguez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9e04fa3a-93af-c39a-ba57-ae9570c77bae@xs4all.nl \
    --to=j.hagen@xs4all.nl \
    --cc=ntg-context@ntg.nl \
    --cc=wolfgang.schuster.lists@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).