ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Questions about \setuphead and \framed
@ 2010-04-20 21:01 Michael Ewe
  2010-04-24 12:41 ` Wolfgang Schuster
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Ewe @ 2010-04-20 21:01 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Questions about \setuphead and \framed
  2010-04-20 21:01 Questions about \setuphead and \framed Michael Ewe
@ 2010-04-24 12:41 ` Wolfgang Schuster
  2010-04-27 20:09   ` Michael Ewe
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schuster @ 2010-04-24 12:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 20.04.10 23:01, schrieb Michael Ewe:
> 1 The frames in the chapter both headings are much bigger than in the normal
> text.
>    
The chapter insert it's own strut in the number and the text and 
changing/disabling
the strut in the header command is useless here (it's a bug but i'll 
report this
in another mail)
> 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
>    
Setting a font for style is not the same as setting it to textstyle and 
numberstyle.
> 3 The value of "strut" has no effect at all.
>    
strut in \setuphead accepts only yes and no, in \framed you can use the 
values
yes, no, global and local, dimensions are no legal argument.

Since you haven't shown what dou want to achieve i can only guess but maybe
this setup is what you want:

\definefont[FontA][Sans at 36pt]

\defineframed[chapterframe][offset=0pt,strut=local]

\definehead[ChapterA][chapter]

\setuphead
   [ChapterA]
   [deeptextcommand=\chapterframe,
    deepnumbercommand=\chapterframe,
    distance=0pt,
    style=FontA]

\starttext
\ChapterA{Test}
\stoptext

Wolfgang
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Questions about \setuphead and \framed
  2010-04-24 12:41 ` Wolfgang Schuster
@ 2010-04-27 20:09   ` Michael Ewe
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Ewe @ 2010-04-27 20:09 UTC (permalink / raw)
  To: ntg-context

On Saturday 24 April 2010 14:41:06 Wolfgang Schuster wrote:
> Am 20.04.10 23:01, schrieb Michael Ewe:
> > 1 The frames in the chapter both headings are much bigger than in the
> > normal text.
> 
> The chapter insert it's own strut in the number and the text and
> changing/disabling
> the strut in the header command is useless here (it's a bug but i'll
> report this
> in another mail)
> 
> > 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
> 
> Setting a font for style is not the same as setting it to textstyle and
> numberstyle.
> 
> > 3 The value of "strut" has no effect at all.
> 
> strut in \setuphead accepts only yes and no, in \framed you can use the
> values
> yes, no, global and local, dimensions are no legal argument.
> 
> Since you haven't shown what dou want to achieve i can only guess but maybe
> this setup is what you want:
> 
> \definefont[FontA][Sans at 36pt]
> 
> \defineframed[chapterframe][offset=0pt,strut=local]
> 
> \definehead[ChapterA][chapter]
> 
> \setuphead
>    [ChapterA]
>    [deeptextcommand=\chapterframe,
>     deepnumbercommand=\chapterframe,
>     distance=0pt,
>     style=FontA]
> 
> \starttext
> \ChapterA{Test}
> \stoptext
> 
> Wolfgang
> ___________________________________________________________________________
> ________ 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
> ___________________________________________________________________________
> ________
> 

Thank you, I will give it another try!
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-04-27 20:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-20 21:01 Questions about \setuphead and \framed Michael Ewe
2010-04-24 12:41 ` Wolfgang Schuster
2010-04-27 20:09   ` Michael Ewe

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).