ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: state=high vs state=empty for headers and footers
Date: Wed, 12 Feb 2014 11:28:38 -0500 (EST)	[thread overview]
Message-ID: <alpine.LNX.2.03.1402121121230.18553@hzvpu.rqh> (raw)

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1263 bytes --]

If one uses

\setuplayout[header][text][frame=on]

then the frame is drawn on pages with header=empty but not drawn on pages 
with header=high.

By default, the 'empty' pagebreak method (in page-txt.mkvi) sets the 
header and footer state to empty rather than high. This means that header 
frames are drawn on empty pages. For example, see attached file.

Would it make sense to change the definition in page-txt.mkvi to the 
following:

\installpagebreakmethod \v!empty
   {\page_otr_flush_all_floats
    \page_otr_command_next_page

\doifnot{\namedlayoutelementparameter\v!header\c!state}\v!stop{\setuplayoutelement[\v!header][\c!state=\v!high]}%

\doifnot{\namedlayoutelementparameter\v!footer\c!state}\v!stop{\setuplayoutelement[\v!footer][\c!state=\v!high]}%
    \page_otr_insert_dummy_page}

\installpagebreakmethod \v!header

{\doifnot{\namedlayoutelementparameter\v!header\c!state}\v!stop{\setuplayoutelement[\v!header][\c!state=\v!high]}}

\installpagebreakmethod \v!footer

{\doifnot{\namedlayoutelementparameter\v!footer\c!state}\v!stop{\setuplayoutelement[\v!footer][\c!state=\v!high]}}

or, if that is too drastic of a change, create a new pagebreakmethod 
called high. This request is motivated by:

http://tex.stackexchange.com/q/110701/323

Aditya

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: TEXT/x-tex; name=test.tex, Size: 903 bytes --]

%\showframe

\setuplayout
  [
    header=\lineheight,
    headerdistance=\lineheight,
  ]

\setuppagenumbering
  [
    location=,
    alternative=doublesided,
  ]

\definepagebreak
  [chapterpagebreak]
  [yes,empty,right]

\setuphead
  [chapter]
  [
    style=\bfc,
    header=high,
    before={\blank[force,\the\headerheight]},
    page=chapterpagebreak,
  ]

\setupheader[style=bold]

\setupheadertexts
  [{\getmarking[sectionnumber]\hskip1em\getmarking[section][first]}]
  [pagenumber]
  [{Chapter~\getmarking[chapternumber]\hskip1em\getmarking[chapter]}]
  [pagenumber]

\setupbackgrounds[header][text][bottomframe=on]

\starttext
\chapter{First Chapter}
this is the first chapter
\page   
the second page of the first chapter
\page
third page
\chapter{Second Chapter}
this is the second chapter
\page
the second page of the second chapter
\stoptext

[-- Attachment #3: 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
___________________________________________________________________________________

                 reply	other threads:[~2014-02-12 16:28 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=alpine.LNX.2.03.1402121121230.18553@hzvpu.rqh \
    --to=adityam@umich.edu \
    --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).