Grid typesetting: aligning section to top of textarea
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
Am 14.05.2013 um 02:51 schrieb Sietse Brouwer
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.
1. Use the command key to apply the frame to the heading and not textcommand. 2. Apply the style for the title with \setuphead. 3. The location key for \framed doesn’t accept lists (e.g. location={top,hanging}), only single arguments are possible. \define[2]\SubjectCommand {\startframed[align=flushleft,location=top]% #2 \stopframed} \setuphead[subject] [header=high, page=yes, style=AntykwaChapter, grid=low, alternative=command, command=\SubjectCommand] Wolfgang
participants (2)
-
Sietse Brouwer
-
Wolfgang Schuster