ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Aligning hboxes on top instead of on baseline
@ 2000-11-14  9:32 Berend de Boer
  2000-11-14 11:34 ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Berend de Boer @ 2000-11-14  9:32 UTC (permalink / raw)


Hello All,

I want to `align' text on the top of their boxes instead of using the
baselineskip or whatever is causing the problem.

I've defined a chapter that puts its number in the right margin.
However, the number is much larger than the chapter title. TeX aligns
these on the bottom of the text, so the number `pushes' the chapter
title down. But I want them aligned at the top, so the number should
stick out to the bottom.

Is this possible to do independent of the body font and the selected
number font size?  I've done things like this by manual shifting things
down until it looked good, but perhaps their is a more elegant solution.

Demo:

-------------------------------
% interface=en

\setupbodyfont
  [ber,pos,ss]

% put chapter title above paragraph, number in right margin
\def\myhead#1#2%
  {\doifsomething{#1}%
     {\rlap{\hskip\tekstbreedte\hskip\rechtermargeafstand#1}}%
   #2}

\setuphead
  [chapter]
  [style=\bfc,
   numberstyle={\switchtobodyfont[36pt]},
   command=\myhead]

\starttext

\chapter{Test}

\input tufte.tex

\stoptext
--------------------------------------

Groetjes,

Berend. (-:


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

end of thread, other threads:[~2000-11-14 13:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-14  9:32 Aligning hboxes on top instead of on baseline Berend de Boer
2000-11-14 11:34 ` Hans Hagen
2000-11-14 13:01   ` Berend de Boer
2000-11-14 13:55     ` Hans Hagen

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