ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Zhichu Chen <chenzhichu@sinap.ac.cn>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: unwanted head behavior
Date: Sat, 9 Apr 2016 21:02:32 +0800	[thread overview]
Message-ID: <5708FD68.7030300@sinap.ac.cn> (raw)
In-Reply-To: <5706370A.4080108@wxs.nl>

Dear Hans,


On 04/07/2016 06:31 PM, Hans Hagen wrote:
> \def\currentsectioncountervalue 
> {\clf_depthnumber\numexpr\thenamedheadlevel\currenthead\relax}
> %def\previoussectioncountervalue{\clf_depthnumber\numexpr\thenamedheadlevel\currenthead+\minusone\relax} 
>
> \def\previoussectioncountervalue{\clf_depthnumber\numexpr\thenamedheadlevel\previoushead\relax} 
>
>
> \let\previoushead\empty
>
> \def\strc_sectioning_handle_page_nop
>   {\edef\p_continue{\headparameter\c!continue}%
>    \ifx\p_continue\v!yes
>      \ifx\currenthead\previoushead % not really needed
>         \strc_sectioning_check_layout
>      \else\ifnum\previoussectioncountervalue=\zerocount
>         \strc_sectioning_check_layout
>      \else\ifnum\currentsectioncountervalue>\zerocount
>         \strc_sectioning_check_layout
>      \fi\fi\fi
>    \else
>      \strc_sectioning_check_layout
>    \fi
>    \globallet\previoushead\currenthead}
>
> \def\strc_sectioning_handle_page_yes
>   {\ifconditional\c_strc_sectioning_ignore_page
>      \setfalse\c_strc_sectioning_ignore_page
>    \else
>      % beware, these numbers are not yet know here
>      \strc_sectioning_handle_page_nop
>      \edef\p_aligntitle{\headparameter\c!aligntitle}%
>      \ifx\p_aligntitle\v!float
>          \ifconditional\c_strc_sectioning_auto_break
>            \vspacing[\v!samepage-\currentheadlevel]%
>          \fi
>          \headparameter\c!before\relax
>          \indent
>      \else
>          \page_otr_command_flush_side_floats
>          \ifconditional\c_strc_sectioning_auto_break
>            \vspacing[\v!samepage-\currentheadlevel]%
>          \fi
>          \headparameter\c!before\relax
>      \fi
>      \global\c_strc_sectioning_preceding_level\currentheadlevel
>    \fi
>    \globallet\previoushead\currenthead}
>
> but it really needs testing with other cases
Tested and confirmed working in my project and this MWE. Thanks for the 
work.
>
>
>
> -----------------------------------------------------------------
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>       tel: 038 477 53 69 | www.pragma-ade.com | 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________


-- 
Best regards,
ℤhichu ℂhen

Shanghai Institute of Applied Physics
No. 2019, Jialuo Road
Jiading, Shanghai, P.R.China
Tel: +86-21-39194888

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

      reply	other threads:[~2016-04-09 13:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <57032823.9020809@sinap.ac.cn>
2016-04-05  5:19 ` Zhichu Chen
2016-04-07  3:42   ` Zhichu Chen
2016-04-07  8:05     ` Hans Hagen
2016-04-07  6:28   ` Zhichu Chen
2016-04-07  8:03     ` Hans Hagen
2016-04-07 10:31     ` Hans Hagen
2016-04-09 13:02       ` Zhichu Chen [this message]

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=5708FD68.7030300@sinap.ac.cn \
    --to=chenzhichu@sinap.ac.cn \
    --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).