ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Section title font define
@ 2007-04-03  9:14 Roy Zuo
  2007-04-03  9:31 ` Zhichu Chen
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Roy Zuo @ 2007-04-03  9:14 UTC (permalink / raw)
  To: ntg-context


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

Hi all,

I am going to write my thesis with ConTeXt. The problem is that our
University wants chapter titles to be 18 points while body text is 11
points. I do not want to use \switchtobodyfont every time I type a chapter
title, but I have no idea how to make it a style in the setup area.
Any hints? Thanks a lot.

Yous,

Roy

[-- Attachment #1.2: Type: text/html, Size: 354 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

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

* Re: Section title font define
  2007-04-03  9:14 Section title font define Roy Zuo
@ 2007-04-03  9:31 ` Zhichu Chen
  2007-04-03 10:15 ` Mari Voipio
  2007-04-03 10:40 ` Wolfgang Schuster
  2 siblings, 0 replies; 5+ messages in thread
From: Zhichu Chen @ 2007-04-03  9:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi Roy,

I think these little will do what you want:
====================================
\setupbodyfont [11pt] <file://\\definebodyfont[11pt][rm][tff=Regular>
\definebodyfont[11pt][rm][tff=Regular at 18pt]

\setuphead
  [chapter]
  [textstyle=\tff,
   numberstyle=\tff]
====================================


On 4/3/07, Roy Zuo <roylzuo@gmail.com> wrote:
>
> Hi all,
>
> I am going to write my thesis with ConTeXt. The problem is that our
> University wants chapter titles to be 18 points while body text is 11
> points. I do not want to use \switchtobodyfont every time I type a chapter
> title, but I have no idea how to make it a style in the setup area.
> Any hints? Thanks a lot.
>
> Yous,
>
> Roy
>
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>
>


-- 
Sincerely yours,
Chen
----------------------------------------------------------------

          Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
         No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
             tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
                                               | www.sinap.ac.cn
----------------------------------------------------------------

[-- Attachment #1.2: Type: text/html, Size: 2680 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

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

* Re: Section title font define
  2007-04-03  9:14 Section title font define Roy Zuo
  2007-04-03  9:31 ` Zhichu Chen
@ 2007-04-03 10:15 ` Mari Voipio
  2007-04-03 10:40 ` Wolfgang Schuster
  2 siblings, 0 replies; 5+ messages in thread
From: Mari Voipio @ 2007-04-03 10:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users



On Tue, 3 Apr 2007, Roy Zuo wrote:
> I do not want to use \switchtobodyfont every time I type a chapter
> title, but I have no idea how to make it a style in the setup area.

Good news is that this is fairly easily done.

The Hello World document on ConTextwiki (ConTeXtGarden) has one 
solution where the common nominators are given in one go and then more 
stuff is added separately; see http://wiki.contextgarden.net/Hello_world 
and the stuff starting with \setuphead


Now, my solution has been to define each heading level separately:

% This sets the look of the first level headings
\setuphead
     [chapter]
     [style=\sstfc,
     prefix=+]

% This sets the look of the second level headings
\setuphead
     [section]
     [style=\sstfb,
     before={\blank[2*big]}]

\setuphead
     [subject]
     [style=\sstfb,
      before={\blank[2*big]}]

% Third level headings
\setuphead
     [subsection]
     [style=\ssbf]


Note: "section" and "subject" are of same level, but section is numbered 
(1.2 etc.) while subject is not.


You can find this information and more

1) In the wiki on page http://wiki.contextgarden.net/Titles

2) In the beginner's manual ("Excursion") at 
http://www.pragma-ade.com/general/manuals/ms-cb-en.pdf under "5 Headers" 
(!)

3) In the big manual at 
http://www.pragma-ade.com/general/manuals/cont-eni.pdf (this is the 
interactive on-screen version) under "8 Text Elements"



Now, interestingly, I cannot find any direct examples how to give point 
size to chapter heading, I'm used to doing just \tfa, \tfb and \tfc 
(somewhat bigger than standard, quite a bit bigger, huge).

However, judging from the Hello World document, this might work out:

\setuphead
 	[chapter]
 	[style={\switchtobodyfont[18pt]}] %is {} needed here?

If the text should also be sans serif (Arial etc), this might be the way:

\setuphead
         [chapter]
         [style={\ss\switchtobodyfont[18pt]}]


Yep, both of the above work at least in my ConTeXt. So I learned something 
new today! (Mostly thanks to Sanjoy's wonderful Hello World...)



This should give you a reasonable starting point, the rest you can 
probably figure out with the documentation and some testing (been there, 
done that, got it right in the end....)


Mari

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

* Re: Section title font define
  2007-04-03  9:14 Section title font define Roy Zuo
  2007-04-03  9:31 ` Zhichu Chen
  2007-04-03 10:15 ` Mari Voipio
@ 2007-04-03 10:40 ` Wolfgang Schuster
  2007-04-03 11:17   ` Roy Zuo
  2 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2007-04-03 10:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

2007/4/3, Roy Zuo <roylzuo@gmail.com>:
>
> Hi all,
>
> I am going to write my thesis with ConTeXt. The problem is that our
> University wants chapter titles to be 18 points while body text is 11
> points. I do not want to use \switchtobodyfont every time I type a chapter
> title, but I have no idea how to make it a style in the setup area.
> Any hints? Thanks a lot.
>
> Yous,
>
> Roy


Hi Roy,

\definefont[chapterfont][Sans at 18pt]
\setuphead[chapter][style=\titlefont]

\setupbodyfont[12pt]

\starttext

\chapter{Knuth}

\input knuth

\stoptext

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 930 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

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

* Re: Section title font define
  2007-04-03 10:40 ` Wolfgang Schuster
@ 2007-04-03 11:17   ` Roy Zuo
  0 siblings, 0 replies; 5+ messages in thread
From: Roy Zuo @ 2007-04-03 11:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Thanks Wolfgang and Mari! You are really nice.
I have never noticed that Sanjoy's Hello World includes so many ConTeXt
features, and it is really great! I think I have to carefully read that
Hello World source before starting my thesis.

Yours,

Roy

On 4/3/07, Wolfgang Schuster <schuster.wolfgang@googlemail.com> wrote:
>
>
>
> 2007/4/3, Roy Zuo <roylzuo@gmail.com>:
> >
> > Hi all,
> >
> > I am going to write my thesis with ConTeXt. The problem is that our
> > University wants chapter titles to be 18 points while body text is 11
> > points. I do not want to use \switchtobodyfont every time I type a chapter
> > title, but I have no idea how to make it a style in the setup area.
> > Any hints? Thanks a lot.
> >
> > Yous,
> >
> > Roy
>
>
> Hi Roy,
>
> \definefont[chapterfont][Sans at 18pt]
> \setuphead[chapter][style=\titlefont]
>
> \setupbodyfont[12pt]
>
> \starttext
>
> \chapter{Knuth}
>
> \input knuth
>
> \stoptext
>
> Wolfgang
>
>
>
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>
>

[-- Attachment #1.2: Type: text/html, Size: 2070 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

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

end of thread, other threads:[~2007-04-03 11:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-03  9:14 Section title font define Roy Zuo
2007-04-03  9:31 ` Zhichu Chen
2007-04-03 10:15 ` Mari Voipio
2007-04-03 10:40 ` Wolfgang Schuster
2007-04-03 11:17   ` Roy Zuo

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