* unwanted head behavior [not found] <57032823.9020809@sinap.ac.cn> @ 2016-04-05 5:19 ` Zhichu Chen 2016-04-07 3:42 ` Zhichu Chen 2016-04-07 6:28 ` Zhichu Chen 0 siblings, 2 replies; 7+ messages in thread From: Zhichu Chen @ 2016-04-05 5:19 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 1716 bytes --] Dear Hans and Wolfgang, The following code generates a pdf that I cannot understand. 1. Although "placehead" is set to "no," the \part macro still makes an empty line. 2. The first \chapter does not open a new page, but if we switch the first \title and the first \chapter, the result seems to be all right. Is there a simple fix? Thanks in advance. ================================== \setuphead [part,chapter,title,section] [continue=yes,page=yes,number=no] \setuphead[part][placehead=no] \showframe \starttext \input ward\page \part{TITLE}\input ward\par \title{Title} \chapter{Title} \chapter{Title} \title{Title} \chapter{Title} \stoptext ================================== ConTeXt minimal information: zhichu ~ context -version mtx-context | ConTeXt Process Management 0.63 mtx-context | mtx-context | main context file: /opt/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv mtx-context | current version: 2016.03.26 13:51 zhichu ~ luatex -version This is LuaTeX, Version beta-0.90.0 (TeX Live 2016) Execute 'luatex --credits' for credits and version details. There is NO warranty. Redistribution of this software is covered by the terms of the GNU General Public License, version 2 or (at your option) any later version. For more information about these matters, see the file named COPYING and the LuaTeX source. LuaTeX is Copyright 2016 Taco Hoekwater and the LuaTeX Team. zhichu ~ -- Best regards, ℤhichu ℂhen Shanghai Institute of Applied Physics No. 2019, Jialuo Road Jiading, Shanghai, P.R.China Tel: +86-21-39194888 [-- Attachment #1.2: Type: text/html, Size: 2670 bytes --] [-- Attachment #2: Type: text/plain, Size: 485 bytes --] ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: unwanted head behavior 2016-04-05 5:19 ` unwanted head behavior Zhichu Chen @ 2016-04-07 3:42 ` Zhichu Chen 2016-04-07 8:05 ` Hans Hagen 2016-04-07 6:28 ` Zhichu Chen 1 sibling, 1 reply; 7+ messages in thread From: Zhichu Chen @ 2016-04-07 3:42 UTC (permalink / raw) To: ntg-context [-- Attachment #1.1: Type: text/plain, Size: 3085 bytes --] Hi, I found the empty line is due to the definition of \strc_rendering_place_head_empty in strc-ren.mkiv: ==================== \unexpanded\def\strc_rendering_place_head_empty {\hbox \headreferenceattributes {\getheadsyncs}} ==================== The definition in strc-sec.mkiv works fine (put the following lines just before \starttext) ==================== \unexpanded\def\strc_rendering_place_head_empty {\setheadmarking \getheadsyncs} ==================== Isn't that a bug? On 04/05/2016 01:19 PM, Zhichu Chen wrote: > > > > > > > > > > > > Dear Hans and Wolfgang, > > The following code generates a pdf that I cannot understand. > > 1. Although "placehead" is set to "no," the \part macro still makes an empty line. > 2. The first \chapter does not open a new page, but if we switch the first \title > and the first \chapter, the result seems to be all right. > > Is there a simple fix? > > Thanks in advance. > > ================================== > \setuphead > [part,chapter,title,section] > [continue=yes,page=yes,number=no] > > \setuphead[part][placehead=no] > > > \showframe > > \starttext > > \input ward\page > > \part{TITLE}\input ward\par > \title{Title} > \chapter{Title} > \chapter{Title} > \title{Title} > \chapter{Title} > > \stoptext > ================================== > > ConTeXt minimal information: > > zhichu ~ context -version > > mtx-context | ConTeXt Process Management 0.63 > mtx-context | > mtx-context | main context file: > /opt/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv > mtx-context | current version: 2016.03.26 13:51 > zhichu ~ luatex -version > This is LuaTeX, Version beta-0.90.0 (TeX Live 2016) > > Execute 'luatex --credits' for credits and version details. > > There is NO warranty. Redistribution of this software is covered by > the terms of the GNU General Public License, version 2 or (at your option) > any later version. For more information about these matters, see the file > named COPYING and the LuaTeX source. > > LuaTeX is Copyright 2016 Taco Hoekwater and the LuaTeX Team. > > zhichu ~ > > -- > 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 > ___________________________________________________________________________________ -- Best regards, ℤhichu ℂhen Shanghai Institute of Applied Physics No. 2019, Jialuo Road Jiading, Shanghai, P.R.China Tel: +86-21-39194888 [-- Attachment #1.2: Type: text/html, Size: 5106 bytes --] [-- Attachment #2: Type: text/plain, Size: 485 bytes --] ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: unwanted head behavior 2016-04-07 3:42 ` Zhichu Chen @ 2016-04-07 8:05 ` Hans Hagen 0 siblings, 0 replies; 7+ messages in thread From: Hans Hagen @ 2016-04-07 8:05 UTC (permalink / raw) To: ntg-context On 4/7/2016 5:42 AM, Zhichu Chen wrote: > Hi, > > I found the empty line is due to the definition of > \strc_rendering_place_head_empty in strc-ren.mkiv: > ==================== > \unexpanded\def\strc_rendering_place_head_empty > {\hbox \headreferenceattributes {\getheadsyncs}} > ==================== > > The definition in strc-sec.mkiv works fine (put the following lines just > before \starttext) > ==================== > \unexpanded\def\strc_rendering_place_head_empty > {\setheadmarking > \getheadsyncs} > ==================== > > Isn't that a bug? no, (one can argue that it should be exactly one line heigh but that would break existing code) this trickery is to make sure that hyperlink and list entries still work ok Hans ----------------------------------------------------------------- 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: unwanted head behavior 2016-04-05 5:19 ` unwanted head behavior Zhichu Chen 2016-04-07 3:42 ` Zhichu Chen @ 2016-04-07 6:28 ` Zhichu Chen 2016-04-07 8:03 ` Hans Hagen 2016-04-07 10:31 ` Hans Hagen 1 sibling, 2 replies; 7+ messages in thread From: Zhichu Chen @ 2016-04-07 6:28 UTC (permalink / raw) To: ntg-context [-- Attachment #1.1: Type: text/plain, Size: 4050 bytes --] If I understand correctly, the "continue=yes" key prevents a new page generated by a lower-level structure, e.g., section, following a higher-level structure, e.g., chapter. Then why the checking is so complex in strc-sec.mkiv: ================================== \def\strc_sectioning_handle_page_nop {\edef\p_continue{\headparameter\c!continue}% \ifx\p_continue\v!yes \ifnum\previoussectioncountervalue=\zerocount \strc_sectioning_check_layout \else\ifnum\currentsectioncountervalue>\zerocount \strc_sectioning_check_layout \fi\fi \else \strc_sectioning_check_layout \fi} ================================== I temporarily changed the definition to: ================================== \newcount\previousheadlevel \previousheadlevel\plusone \def\strc_sectioning_handle_page_nop {\edef\p_continue{\headparameter\c!continue}% \ifx\p_continue\v!yes \ifnum\currentheadlevel>\previousheadlevel\else \strc_sectioning_check_layout \fi \else \strc_sectioning_check_layout \fi \previousheadlevel\currentheadlevel} ================================== Seems fine. PS: irrelevant to my problem, but I just wish ConTeXt to be perfect. So: 1, line 1060, file strc-sec.mkiv: \global\setfalse\c_strc_rendering_continue shouldn't this line be "\global\setfalse\c_strc_rendering_continuous"? 2, a lot of \.._strc_sectioniong_... macros in strc-sec.mkiv. I think changing the "sectioniong" to "sectioning" may prevent potential typos. On 04/05/2016 01:19 PM, Zhichu Chen wrote: > > Dear Hans and Wolfgang, > > The following code generates a pdf that I cannot understand. > > 1. Although "placehead" is set to "no," the \part macro still makes an empty line. > 2. The first \chapter does not open a new page, but if we switch the first \title > and the first \chapter, the result seems to be all right. > > Is there a simple fix? > > Thanks in advance. > > ================================== > \setuphead > [part,chapter,title,section] > [continue=yes,page=yes,number=no] > > \setuphead[part][placehead=no] > > > \showframe > > \starttext > > \input ward\page > > \part{TITLE}\input ward\par > \title{Title} > \chapter{Title} > \chapter{Title} > \title{Title} > \chapter{Title} > > \stoptext > ================================== > > ConTeXt minimal information: > > > context -version > > mtx-context | ConTeXt Process Management 0.63 > mtx-context | > mtx-context | main context file: > /opt/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv > mtx-context | current version: 2016.03.26 13:51 > > > luatex -version > This is LuaTeX, Version beta-0.90.0 (TeX Live 2016) > > Execute 'luatex --credits' for credits and version details. > > There is NO warranty. Redistribution of this software is covered by > the terms of the GNU General Public License, version 2 or (at your option) > any later version. For more information about these matters, see the file > named COPYING and the LuaTeX source. > > LuaTeX is Copyright 2016 Taco Hoekwater and the LuaTeX Team. > -- > 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 > ___________________________________________________________________________________ -- Best regards, ℤhichu ℂhen Shanghai Institute of Applied Physics No. 2019, Jialuo Road Jiading, Shanghai, P.R.China Tel: +86-21-39194888 [-- Attachment #1.2: Type: text/html, Size: 5558 bytes --] [-- Attachment #2: Type: text/plain, Size: 485 bytes --] ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: unwanted head behavior 2016-04-07 6:28 ` Zhichu Chen @ 2016-04-07 8:03 ` Hans Hagen 2016-04-07 10:31 ` Hans Hagen 1 sibling, 0 replies; 7+ messages in thread From: Hans Hagen @ 2016-04-07 8:03 UTC (permalink / raw) To: ntg-context On 4/7/2016 8:28 AM, Zhichu Chen wrote: > PS: irrelevant to my problem, but I just wish ConTeXt to be perfect. So: > 1, line 1060, file strc-sec.mkiv: > \global\setfalse\c_strc_rendering_continue > shouldn't this line be "\global\setfalse\c_strc_rendering_continuous"? yes (but it's not used anywhere) > 2, a lot of \.._strc_sectioniong_... macros in strc-sec.mkiv. I think > changing the "sectioniong" to "sectioning" may prevent potential typos. indeed, i'll fix it > > On 04/05/2016 01:19 PM, Zhichu Chen wrote: >> >> Dear Hans and Wolfgang, >> >> The following code generates a pdf that I cannot understand. >> >> 1. Although "placehead" is set to "no," the \part macro still makes an empty line. try 'empty' instead of 'no' (you can also use 'hidden' but then you need to flush the sync nodes yourself: \synchronizehead{part} ... something one does when the title is placed somewhere else that it gets triggered) ----------------------------------------------------------------- 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: unwanted head behavior 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 1 sibling, 1 reply; 7+ messages in thread From: Hans Hagen @ 2016-04-07 10:31 UTC (permalink / raw) To: ntg-context On 4/7/2016 8:28 AM, Zhichu Chen wrote: > If I understand correctly, the "continue=yes" key prevents a new page > generated by a lower-level structure, e.g., section, following a > higher-level structure, e.g., chapter. > > Then why the checking is so complex in strc-sec.mkiv: > ================================== > \def\strc_sectioning_handle_page_nop > {\edef\p_continue{\headparameter\c!continue}% > \ifx\p_continue\v!yes > \ifnum\previoussectioncountervalue=\zerocount > \strc_sectioning_check_layout > \else\ifnum\currentsectioncountervalue>\zerocount > \strc_sectioning_check_layout > \fi\fi > \else > \strc_sectioning_check_layout > \fi} > ================================== > > I temporarily changed the definition to: > ================================== > \newcount\previousheadlevel > \previousheadlevel\plusone > \def\strc_sectioning_handle_page_nop > {\edef\p_continue{\headparameter\c!continue}% > \ifx\p_continue\v!yes > \ifnum\currentheadlevel>\previousheadlevel\else > \strc_sectioning_check_layout > \fi > \else > \strc_sectioning_check_layout > \fi > \previousheadlevel\currentheadlevel} > ================================== > > Seems fine. \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 ----------------------------------------------------------------- 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: unwanted head behavior 2016-04-07 10:31 ` Hans Hagen @ 2016-04-09 13:02 ` Zhichu Chen 0 siblings, 0 replies; 7+ messages in thread From: Zhichu Chen @ 2016-04-09 13:02 UTC (permalink / raw) To: mailing list for ConTeXt users 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-04-09 13:02 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <57032823.9020809@sinap.ac.cn> 2016-04-05 5:19 ` unwanted head behavior 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 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).