ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* grid versus whitespace
@ 2007-01-18  9:38 Steffen Wolfrum
  2007-01-18 15:23 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Steffen Wolfrum @ 2007-01-18  9:38 UTC (permalink / raw)


Hi,

please have a look at following example:

\starttext
\setupwhitespace[5pt]
\setuplayout[grid=no] \showstruts \showgrid \showgridboxes
\setuphead[section][grid=fit]

\section{Heading One}

\input tufte

\input knuth
\stoptext


For the section is too high, I set grid=yes which gives the desired  
section distance.

But now the whitespace 5pt between the regular paragraphs gets lost!


Is there a way to have both: section grid snapping *and* regular  
whitespace?


Steffen

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

* Re: grid versus whitespace
  2007-01-18  9:38 grid versus whitespace Steffen Wolfrum
@ 2007-01-18 15:23 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2007-01-18 15:23 UTC (permalink / raw)


Steffen Wolfrum wrote:
> Hi,
>
> please have a look at following example:
>
> \starttext
> \setupwhitespace[5pt]
> \setuplayout[grid=no] \showstruts \showgrid \showgridboxes
> \setuphead[section][grid=fit]
>
> \section{Heading One}
>
> \input tufte
>
> \input knuth
> \stoptext
>
>
> For the section is too high, I set grid=yes which gives the desired  
> section distance.
>
> But now the whitespace 5pt between the regular paragraphs gets lost!
>
>
> Is there a way to have both: section grid snapping *and* regular  
> whitespace?
>   
hm, we can permits halflines 

\chardef\baselinegridmode=1 % not the default ! 

\def\dodosetupwhitespace % can go in core (or cont-new) 
  {\ifgridsnapping
     \witruimteflexibelfalse
     \ctxparskip1\ctxparskip
     \ifdim\ctxparskip>\zeropoint
       \ifcase\baselinegridmode
         \ctxparskip\baselineskip % normal ! ! ! ! !!
       \or
         \ifdim\scratchdimen=\baselineskip % maybe range
           \ctxparskip\baselineskip % normal ! ! ! ! !!
         \else
           \ctxparskip\numexpr
\ctxparskip/\dimexpr.5\lineheight\relax\relax\dimexpr.5\lineheight\relax
         \fi
       \else
         \ctxparskip\baselineskip % normal ! ! ! ! !!
       \fi
     \fi
   \else
     \ifwitruimteflexibel \else \ctxparskip1\ctxparskip \fi
   \fi
   \parskip\ctxparskip}

\starttext

\setuplayout[grid=yes] \showstruts \showgrid \showgridboxes

\setupwhitespace[halfline]

\setuphead[section][grid=fit]

\section{Heading One}

\input tufte

\input knuth

\stoptext



-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

end of thread, other threads:[~2007-01-18 15:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-18  9:38 grid versus whitespace Steffen Wolfrum
2007-01-18 15:23 ` 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).