Custom definition of a bodyfont (and using it)
Hi, I'm trying to make my own headings, and it doesn't really come out the way I want. I'll describe what I'm trying to do, and maybe someone has something that can help me. I'd like to have the chapter number really big, in a (light) colour in the background. The title should go over the number. If possible/needed, the number may end up (partially) under the text. I think I can get the positioning correct (in metapost/metafun if I have to), but defining the (huge) font in ConTeXt proves a hurdle I cannot tackle. My attempts (copied rather directly from the manual) are below. Thanks for your time, Maarten %% This generated no error, but not a really large font either \definebodyfont[9pt][rm][tfe=LucidaBright at 36pt] \definebodyfont[9pt][ss][fte=LucidaSans at 36pt] %% after the following definition, TeX claims it cannot find %% \MyChapNumLetter %\definebodyfont[MyChapNumLetter][LucidaSans-DemiItalic sa 4] %% this example also comes from the manual \def\MyChapterHeadingCommand#1#2{\hbox to \hsize\bgroup% \setupframed[offset=.5em,frame=off]% \tbox{\framed{{\color[MyChapNumColor]{\fte\ss\bf #1}}}}% \tbox{\framed[width=8cm,align=right]{{\tfa\ss\bf #2}}}% \egroup} %% the obligatory version info: %% ConTeXt ver: 2003.3.11 fmt: 2003.3.26 int: english mes: english %% (on texlive 7)
Hi again. I've progressed a little. I've defined my private command the will generate the heading as I want it to come out. This command works when in stand-alone mode, for testing purposes. It nicely leaves everything after it on the grid, just like I want it. When you want to read along with what I'm doing, the code can be found here: http://www.nat.vu.nl/~sneep/msneep.tex Problem is that when I say: \setuphead[chapter][command=\MyChapCommand] some unexpected side effects occur, and an error appears (message reproduced below). When I remove the \placeongrid code, another error (undefined control sequence) comes up. And I'd really like to stay on grid... I would really appreciate it if someone could take a look at the code and suggest some improvements. Kind regards, Maarten Sneep ! Missing } inserted. <inserted text> } <to be read again> \vskip \forcedpresnapcorrection ...trut }\nobreak \vskip -\openlineheight \fi \dodowithnextbox ... \fi \forcedpresnapcorrection \ifdim \nextboxht
\ht \st...
\doplaatskoptekst ...ttributes \dostopattributes } }\fi \endheadplacement {#1... \dodododosomekop ...{#4}\marking [#1\v!nummer ]{}} \writesection {#1}{-}{#4}\... ... l.222 ^^I\chapter [knuth]{Donald Knuth} On woensdag, apr 23, 2003, at 14:42 Europe/Amsterdam, I wrote:
I'm trying to make my own headings, and it doesn't really come out the way I want. I'll describe what I'm trying to do, and maybe someone has something that can help me.
I'd like to have the chapter number really big, in a (light) colour in the background. The title should go over the number. If possible/needed, the number may end up (partially) under the text.
[snip]
%% the obligatory version info: %% ConTeXt ver: 2003.3.11 fmt: 2003.3.26 int: english mes: english %% (on texlive 7)
At 19:39 23/04/2003 +0200, Maarten Sneep wrote:
Hi again.
I've progressed a little. I've defined my private command the will generate the heading as I want it to come out. This command works when in stand-alone mode, for testing purposes. It nicely leaves everything after it on the grid, just like I want it.
When you want to read along with what I'm doing, the code can be found here: http://www.nat.vu.nl/~sneep/msneep.tex
Problem is that when I say: \setuphead[chapter][command=\MyChapCommand]
some unexpected side effects occur, and an error appears (message reproduced below). When I remove the \placeongrid code, another error (undefined control sequence) comes up. And I'd really like to stay on grid...
I would really appreciate it if someone could take a look at the code and suggest some improvements.
Kind regards,
Maarten Sneep
! Missing } inserted. <inserted text> } <to be read again> \vskip
this normally means that you are in the wrong mode, try to add \endgraf or put a vbox around your code; this messag eis about one of the fuzziest that tex can bring up Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Maarten Sneep