ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Stuart Jansen <sjansen@gurulabs.com>
Subject: Re: Setting up chapter.
Date: Mon, 11 Jul 2005 15:34:05 -0600	[thread overview]
Message-ID: <1121117645.9221.5.camel@localhost.localdomain> (raw)
In-Reply-To: <200507111712.58013.john@wexfordpress.com>


[-- Attachment #1.1: Type: text/plain, Size: 1437 bytes --]

On Mon, 2005-07-11 at 17:12 +0000, John R. Culleton wrote:
> I am trying to set up chapter heads a certain way and my code
> keeps getting uglier. Here are the specs:
> 
> 1. Chapter number centered, with decorations on either side.
> 2. Chapter title centered below chapter number.
> 3. Additional decoration centered below chapter title.
> 4. Both number and text show up in TOC in normal Context manner.
> 
> Can this be done easily using the normal chapter macro or should
> I do it all from scratch? (If I roll my own I worry about getting
> info to the TOC.)

I am doing something like that now. Sorry the example isn't very pretty,
had to rip out parts that were specific to the font I'm using, but
should give you an idea of what you need to do.

=====
\unexpanded\def\chaptercase{\uppercase}
\def\mychapter#1#2%
{\setupframed[width=1.75in,align={right,broad},frame=off]\vbox{% 

\framed{\setupbodyfont[18pt]\setupinterlinespace[height=0,depth=0]Chapter}%
 \framed{\setupbodyfont[36pt]\setupinterlinespace[height=.1,depth=0]#1}%
\godown[-1ex]\framed{\setupbodyfont[24pt]\setupinterlinespace[line=2ex]#2\par}%
}}
\setuphead
  [chapter]
  [command=\mychapter,textcommand=\chaptercase,
   textstyle=\sl,numberstyle=\bf]
\starttext
\placelist[chapter,section][criterium=all,alternative=b]
\chapter{foo}
\chapter{bar}
\stoptext
=====


-- 
Stuart Jansen <sjansen@gurulabs.com>
Guru Labs, L.C.

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

  reply	other threads:[~2005-07-11 21:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-11 17:12 John R. Culleton
2005-07-11 21:34 ` Stuart Jansen [this message]
2005-07-12  8:32   ` John R. Culleton
2005-07-12 13:05     ` Otared Kavian
2005-07-12 13:15     ` luigi.scarso
2005-07-12 16:31       ` John R. Culleton
2005-07-13 17:37         ` John R. Culleton
2005-07-14  5:35           ` luigi.scarso

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=1121117645.9221.5.camel@localhost.localdomain \
    --to=sjansen@gurulabs.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).