ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Michael Ewe <michael.ewe@arcor.de>
To: ntg-context@ntg.nl
Subject: Questions about \setuphead and \framed
Date: Tue, 20 Apr 2010 23:01:57 +0200	[thread overview]
Message-ID: <201004202301.57945.michael.ewe@arcor.de> (raw)

Hi ConTeXt Gurus,
enclosed please find a little snippet of code:

%---snip--snip--snip---
\usetypescript[pagella]
\setupbodyfont[pagella,rm,11pt]
\definefont[FontA][Sans at 36pt]

\definehead[ChapterA][chapter]
\setuphead[ChapterA][command=\Cmd,style=\FontA]
\definehead[ChapterB][chapter]
\setuphead[ChapterB][command=\Cmd,textstyle=\FontA,numberstyle=\FontA]
\def\Cmd#1#2{%
        \hbox{%
        {\framed[frame=on,offset=none,strut=1cm]{#1}}
        {\framed[frame=on,offset=none,strut=1cm]{#2}}
        }
}

\starttext

\ChapterA{Test}
\Cmd{\FontA 1}{\FontA Test}
\hbox{%
{\framed[frame=on,offset=none,strut=1cm]{\FontA 1}}
{\framed[frame=on,offset=none,strut=1cm]{\FontA Test}}
}

\ChapterB{Test}
\Cmd{\FontA 1}{\FontA Test}
\hbox{%
{\framed[frame=on,offset=none,strut=1cm]{\FontA 1}}
{\framed[frame=on,offset=none,strut=1cm]{\FontA Test}}
}
\stoptext
%---snip--snip--snip---

The code defines 2 chapter headings (ChapterA, ChapterB) and my assumption is,
that the effect of setting "style=..." and "fontstyle=..., numberstyle=..." 
should be the same. As an additional test I included the usage of \Cmd and a 
manual copy of \Cmd in the normal text. If you run this through ConTeXt MkIV 
you will see:

1 The frames in the chapter both headings are much bigger than in the normal 
text.

2 The gap between the chapter number and the chapter name is different for 
chapter 1 (on page 1) and chapter 2 (on page 2). The word "test" is not 
aligned

3 The value of "strut" has no effect at all.

I am trying to mimic a chapter style in a book of mine, but with the result 
above I am not sure about the tools to use.

Best Regards from Germany,
Michael Ewe
___________________________________________________________________________________
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:[~2010-04-20 21:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-20 21:01 Michael Ewe [this message]
2010-04-24 12:41 ` Wolfgang Schuster
2010-04-27 20:09   ` Michael Ewe

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=201004202301.57945.michael.ewe@arcor.de \
    --to=michael.ewe@arcor.de \
    --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).