Dear list,

I am making a foray into grid typesetting, and would like to align the
top of my (possibly multi-line) section titles with the top of the
textarea. I thought I could do that with
\setuphead[subject][grid={broad,high}], but this is not working. I
have tried nearly every other combination of grid keywords, and then
tried them again with the subject wrapped in a framed.

The "It's in the details" manual didn't provide help. I found an old
e-mail by Honza, but that never got a reply.
http://www.pragma-ade.com/general/manuals/details.pdf
http://www.mail-archive.com/ntg-context@ntg.nl/msg58456.html

I put an MWE below, and I have attached its output. If anybody has any
clues for me, (or 'not currently available, you can stop trying'), I
would be most grateful.

Cheers,

Sietse

\setuppapersize[A5]

%% Activate grid
\setuplayout
   [grid=yes,
    width=middle, topspace=2\lineheight, height=31\lineheight,
    header=2\lineheight, footer=0\lineheight,]

\setupbodyfont[schola,13pt]
\definefont[AntykwaChapter][antykwatorunskaregular at 18pt]%

%% If wrapping the subject in a framed is needed, this command does it
\def\subjectcommand#1{%
    \framed[
        frame=on,
        framecolor=blue,
        width=\textwidth,
        align=flushleft,
        offset=none,
        %% strut=no does not work
        %% so cancel out lineheight-fontsize diff with -toffset
        toffset=-4.5pt,
        %% This *should* mean:
        %% * take topmost line in framed as reference line
        %% * align top of reference line with external baseline.
        %% but grid=yes may disable that.
        location={top, hanging},
    ]{\AntykwaChapter #1}}

%% The head-specific grid setup comes here
\setuphead[subject]
   [header=high,   % no header; extend textarea into header area
    page=yes,
    %% Take the box, assume it is a snug fit of its contents, and align
    %% its top with the grid line above it?
    %% Seems to do nothing
    %% A tweak like '-3pt' ditto
    grid={fit,high},
    textcommand=\subjectcommand,
    % textstyle=\AntykwaChapter,
]

\showframe
\showgrid
\showstruts

%% Example text
\starttext

\subject{The hoard of the gibbelins}

The Gibbelins eat, as is well known, nothing less good than man.

\startsubject[
        title={How Nyth would have worked his art upon the gnoles},
        marking=How Nuth would have worked his art,
    ]

Despite the advertisements of rival firms, it is probable that every
tradesman knows that nobody in business at the present time has a
position equal to that of Mr. Nuth.
\stopsubject

\stoptext

Attachment: mwe-placesubject.pdf
Description: Adobe PDF document

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

Reply via email to