ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Tom" <Tom@tuxedo-press.com>
To: <ntg-context@ntg.nl>
Subject: [***SPAM***] Minimals ignores structureblockenvironment for frontmatter etc.
Date: Sun, 20 Mar 2011 09:37:00 -0400	[thread overview]
Message-ID: <01ba01cbe703$e3f16f80$abd44e80$@com> (raw)

Minimals MKIV ignores the structureenvironment blocks when the suffix is
'matter' but applies them if the suffix is 'part.' Furthermore, they are
applied in \starttext if between \startfrontmatter -- \stopfrontmatter, etc.
blocks and error if between \startfrontpart -- \stopfrontpart, etc. blocks.
The following code executes but does not apply the environment block
commands. Commenting out the three \startstructureblockenvironment commands
with 'matter" arguments and uncommenting the three 'part' commands will
cause the environment block commands to be executed.

Ironically, the \start-\stop pairs between \starttext and \stoptext error if
'part' is used but execute if 'matter.' 

\def\MyFrontMatterCommand#1#2% #1 is number, #2 is text
     {\framed[frame=off,align=middle,width=broad]
     {\switchtotypeface[ChapterStart] #2}}

\def\MyChapterCommand#1#2% #1 is number, #2 is text
  {\framed[frame=off,bottomframe=on,topframe=off]
     {\vbox{\centerline{\headtext{chapter} #1}\par\blank{\centerline{#2}}}}}


\definepagebreak[mychapterpagebreak][yes,header,right]

\startstructureblockenvironment[frontmatter]
%ignored if frontmatter, applied if frontpart
%\startstructureblockenvironment[frontpart]

\setuppagenumbering[state=start,location=bottom,conversion=romannumerals] 

\setuphead[chapter]
 [command=\MyFrontMatterCommand,textstyle=\ss\bfd,
  header=empty,footer=chapter,page=mychapterpagebreak,
  number=no,after={\blank[0.5in]}]

\stopstructureblockenvironment

\startstructureblockenvironment[bodymatter]
%ignored if bodymatter, applied if bodypart
%\startstructureblockenvironment[bodypart]

\setuppagenumbering[alternative=doublesided,location=]

\setuppagenumbering[state=start,location=bottom,conversion=numbers] 

\setuphead[chapter]
 [command=\MyChapterCommand,textstyle=\ss\bfd,
  header=empty,footer=chapter,page=mychapterpagebreak,
  after={\blank[0.5in]},before={\blank[force,1.0in]}
  \placeinitial] 

\stopstructureblockenvironment

\startstructureblockenvironment[backmatter]
%ignored if back, applied if backpart
%\startstructureblockenvironment[backpart]

\setuphead[title]
 [command=\MyFrontMatterCommand,textstyle=\ss\bfd,
  header=empty,footer=chapter,page=mychapterpagebreak,
  number=no,after={\blank[0.25in]}]

\setuphead[chapter]
 [command=\MyFrontMatterCommand,textstyle=\ss\bfd,
  header=empty,footer=chapter,page=mychapterpagebreak,
  number=no,after={\blank[0.25in]}]


\stopstructureblockenvironment

\starttext 

\startfrontmatter % errors if startfrontpart

%sample front matter
\input knuth     

\completecontent[alternative=c,criterium=all]

\chapter{Preface}
\input knuth

\chapter{Introduction} 
\input knuth          

\stopfrontmatter

\startbodymatter %errors if startbodypart

\chapter{I Was Born}
\input knuth

\chapter{I Observe}
Lorem {\index{lorem}}ipsum dolor sit amet, consectetur adipiscing elit.
Maecenas ipsum turpis, imperdiet vel aliquam eu, iaculis at lorem. Proin ut
orci ac dui sodales commodo vel quis sem. Etiam nunc odio, luctus non cursus
elementum, elementum non. 

\stopbodymatter

\startbackmatter %errors if startbackpart
\title{Appendices}
\page[blank]
\completeindex
\stopbackmatter

\stoptext

Tom Benjey
717-258-9733 voice
717-243-0074 fax
blog: www.TomBenjey.com




___________________________________________________________________________________
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:[~2011-03-20 13:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-20 13:37 Tom [this message]
2011-03-20 13:49 ` Wolfgang Schuster
2011-03-20 15:46   ` Tom
2011-03-20 16:03     ` Aditya Mahajan
2011-03-20 18:49     ` Wolfgang Schuster

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='01ba01cbe703$e3f16f80$abd44e80$@com' \
    --to=tom@tuxedo-press.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).