From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Simple questions on fonts and how to center vertically
Date: Sun, 16 Nov 2008 13:01:38 +0100 [thread overview]
Message-ID: <3B348229-5457-4273-8E29-E3D91D539606@gmail.com> (raw)
In-Reply-To: <20081116114807.1bb45bb0@kylae>
Am 16.11.2008 um 11:48 schrieb Mildred Ki'Lya:
> Hi,
>
> I would like to create a document where the first page contains a
> title
> and a subtitle. The title would be in bold face, and the subtitle in
> italics. The font size would be something bigger than 12 points and
> those would be centered vertically on the page (with a bit of space
> between them).
>
> After some readings, I came up with the following solution:
You should use ConTeXt markup and try to avoid the plain TeX
commands.
> % ------------------------------------------------------------------
>
> \font\titlefont=cmbx12 scaled\magstep3
Don't do this, use ConTeXts font commands, Aditya Mahajan
wrote a nice article about them, if you want to print it
use the TuGboat version.
http://wiki.contextgarden.net/Font_Switching
> % Header
> \setupheadertexts[\vbox{
> \ifodd\pagenumber
> \hfil{\sc{a Title}}\hfil\hfil\pagenumber\hfil
> \else
> \hfil\pagenumber\hfil\hfil{\sc{author}}\hfil
> \fi
> \break
> \vbox{\hfil\hrulefill\hfil}
> }]
\startsetups header:right
\line{\hfil{\sc a Title}\hfil\hfil\pagenumber\hfil}
\stopsetups
\startsetups header:left
\line{\hfil\pagenumber\hfil\hfil{\sc author}\hfil}
\stopsetups
% Line below the header, you can more solutions in the mail archive
\setupheader[text][after=\hrule]
% header content: alternative a
\setuppagenumbering[location=,alternative=doublesided]
\setupheadertexts[\setups{header:right}][][][\setups{header:left}]
% header content: alternative b
\setuppagenumbering[location=]
\setupheadertexts[\doifoddpageelse{\setups{header:right}}
{\setups{header:left}}]
\starttext
> % Start front page
> \eject\nobreak\vfill
>
> % Title
> {\titlefont
> \centerline{a Title}
> \vskip 1em
> }
>
> \vfil % Leave some space between
>
> % Subtitle
> {\titlefont\it
> \centerline{a Subtitle}
> \vskip 1em
> }
>
> % Stop Front Page
> \nobreak\vfill\eject
\startstandardmakeup[align=middle]
{\definedfont[SansBold sa \magfactor{1}]a Title}
\blank[2cm]
{\definedfont[SansBoldItalic sa \magfactor{1}]a Subtitle}
\stopstandardmakeup
>
> \end
\stoptext
> % ------------------------------------------------------------------
>
>
> The problems are:
> * It is not centered vertically
> * The subtitle is not as big as I would have expected
> * There is not enough space between the title and the subtitle
>
>
> Can you come up with a better solution?
>
> Ideally, I would like to have the font size changed in a way so the
> control sequences like \it, \bf ... continue to work as expected.
\switchtobodyfont[xxpt]\it
> Something I could use like:
>
> {Some normal text \magnify{3} three times magnified text \it the same
> size in italics \bf Three times magnified, bold and italics \dots}
>
> It seems I also have troubles getting the TeX box model right.
> Previously, I tried to create a ruler below the ruler and it took me
> time to figure out how to display it. Naive implementation seamed not
> to work. Especially, i don't understand why the \hfil\hrulefill\hfil
> should be inserted in a \vbox.
>
> Is there some documentation somewhere explaining that?
http://context.aanhet.net/svn/contextman/context-reference/en/co-fonts.pdf
http://context.aanhet.net/svn/contextman/context-reference/en/co-typography.pdf
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 : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
next prev parent reply other threads:[~2008-11-16 12:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-16 10:48 Mildred Ki'Lya
2008-11-16 12:01 ` Wolfgang Schuster [this message]
2008-11-16 13:36 ` Mildred Ki'Lya
2008-11-16 14:12 ` Wolfgang Schuster
2008-11-16 16:07 ` Mildred Ki'Lya
2008-11-16 15:18 ` Arthur Reutenauer
-- strict thread matches above, loose matches on Subject: below --
2008-11-16 10:31 Mildred Ki'Lya
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=3B348229-5457-4273-8E29-E3D91D539606@gmail.com \
--to=schuster.wolfgang@googlemail.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).