ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Alfredo Catalina <alfredo.catalina@gmail.com>
To: ntg-context@ntg.nl
Subject: Customizing chapter heads
Date: Sun, 25 Jan 2009 00:49:10 +0100	[thread overview]
Message-ID: <b33fbfe10901241549k30e39cd1ta9c82b1918bb26f6@mail.gmail.com> (raw)


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

I am new to ConTeXt. I am trying to define a customized head for chapters
but I am finding some problems. The sentences below are based on the chapter
Text Elements which may be found in the ConTeXt manual.

Prior to setting up the title, a new Head command is defined
by \def\HeadTitle#1#2%. It takes two arguments, the chapter number and the
chapter title. The Head so defined will show the word "C h a p t e r" in
capitals, then the chapter number at 80pt, then a horizontal line, and
finally the title.

The definition works quite well except that both, the chapter number and the
chapter title, are not show at the specified font size.

\definebodyfont[10pt,11pt,12pt][rm][tff=Regular at 80pt]
\definebodyfont[10pt,11pt,12pt][rm][tfe=Regular at 42pt]

\def\HeadTitle#1#2%
    {\hbox to \hsize \bgroup
        {\hfill %
        \setupframed[height=7cm,offset=.5em,frame=off]
         \framed[width=9cm,align=left]
            {
                {\tfc \sc {C~h~a~p~t~e~r}} ~~ {\tff #1}\\
                \hairline
                {\ss \tfe #2}
            }
        }
        \egroup
    }
\starttext
\setuphead[chapter] [command=\HeadTitle]
\chapter{An Insight\\Into Fred's Design}
\stoptext

An easy workaround for the chapter number replaces the argument #1 by
\currentheadnumber

\def\HeadTitle#1#2%
    {\hbox to \hsize \bgroup
        {\hfill %
        \setupframed[height=7cm,offset=.5em,frame=off]
         \framed[width=9cm,align=left]
            {
                {\tfc \sc {C~h~a~p~t~e~r}} ~~ {\tff #1}\\
                \hairline
                {\ss \tfe #2}
            }
        }
        \egroup
    }

Now the chapter number is shown at 80pt as defined. But I have not found the
way to solve the problem with the head title, #2. ¿Any ideas?

Thanks in advance.
Alfredo.

[-- Attachment #1.2: Type: text/html, Size: 3278 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

             reply	other threads:[~2009-01-24 23:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-24 23:49 Alfredo Catalina [this message]
2009-01-25  9:43 ` 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=b33fbfe10901241549k30e39cd1ta9c82b1918bb26f6@mail.gmail.com \
    --to=alfredo.catalina@gmail.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).