ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Henri Menke <henrimenke@gmail.com>
To: ntg-context@ntg.nl
Subject: horizontal headalternatives ignore indentnext
Date: Thu, 28 Feb 2019 09:39:44 +1300	[thread overview]
Message-ID: <1160c8f5-c803-2c8f-dc07-6924416c02aa@gmail.com> (raw)

Dear list,

If I choose the headalternative to be of horizontal type, e.g. “text”, the head
placement will ignore the indentnext option.  This can be traced back to the
\strc_rendering_stop_placement macro where there is a check

   \ifconditional\headisdisplay
     \useindentnextparameter\headparameter
   \else
     \ignoreparskip
     \noindentation % recently added, was a bug
   \fi

If the headalternative is vertical, \headdisplay is true, if it is horizontal,
\headdisplay is false.  It is easy to see that indentnext is not treated on
equal footing for these two, in fact, indentation is generally ignored for
horizontal headalternatives.  Commenting out \noindentation at least gives
indentation in the following paragraph but that is not a proper solution.

Below you can find a MWE with the fix from above applied.  Try commenting in
and out the \noindentation and see what happens to the second paragraph after
the heading.

Cheers, Henri

---

\unprotect

\def\strc_rendering_stop_placement
  {\n_strc_rendering_hang_lines\zerocount
   \ifconditional\headisdisplay
     \strc_rendering_initialize_line_hang
     % kind of special, we want to snap heads also according to local specs local
     \setbox\b_strc_rendering_head\hbox
       {\hskip\dimexpr\d_strc_rendering_local_leftoffset+\headparameter\c!margin\relax
        \box\b_strc_rendering_head
        \getheadsyncs % a latelua why not in the box
        }%
     \ifgridsnapping
       \applygridmethod
         {\headparameter\c!grid}%
         {\ifconditional\headisdisplay
            \strc_rendering_initialize_style_and_color_display\c!textstyle\c!textcolor
          \fi}%
         {\box\b_strc_rendering_head}
     \else
       \box\b_strc_rendering_head
     \fi
     \flushnotes % new, not really needed
     \endgraf
     \ifvmode
       \ifnum\n_strc_rendering_hang_lines>\zerocount
         \dorecurse\n_strc_rendering_hang_lines{\nointerlineskip\dosomebreak\nobreak\strut\endgraf}% to be checked
       \fi
       \nointerlineskip
       \dosomebreak\nobreak
     \fi
%      \getheadsyncs % a latelua why not in the box
   \else
     % somehow this goes ok even when we push in the margin probably because we gobble pars
     % in the process of collecting index entries etc
     \strut
     \flushnotes % new, here since we're in par mode
     \unhbox\b_strc_rendering_head
     \getheadsyncs % a latelua
     \ifconditional\headissomewhere
       \strc_sectioning_stay_on_this_line % test case: alternative=margintext and \startparagraph ..
     \else
      %\hskip\headnumberdistance\s!plus\headnumberdistance\s!minus.25\dimexpr\headnumberdistance\relax
       \hskip\headtextdistance\relax
       \strc_sectioning_inject_continuous_signal
     \fi
   \fi
   \ifconditional\headisdisplay
     \ifvmode
       \ifgridsnapping % important, font related depth, see comment
         \prevdepth\strutdp
       \else
         \prevdepth\d_strc_rendering_local_depth
       \fi
     \fi
   \fi
   \synctexpopline
   \egroup
   \egroup
   \ifconditional\headisdisplay
     \useindentnextparameter\headparameter
   \else
     \ignoreparskip
     % \noindentation % recently added, was a bug
   \fi}

\protect

\setupindenting[yes,big]
\setuphead[section][alternative=text,indentnext=yes]
\starttext
\section{Introduction}
\input knuth
\stoptext

___________________________________________________________________________________
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:[~2019-02-27 20:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1160c8f5-c803-2c8f-dc07-6924416c02aa@gmail.com \
    --to=henrimenke@gmail.com \
    --cc=ntg-context@ntg.nl \
    /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).