ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Lost in the murky detail of designing a page layout
@ 2003-02-04  8:55 Guy Worthington
  2003-02-04  9:44 ` Patrick Gundlach
  0 siblings, 1 reply; 9+ messages in thread
From: Guy Worthington @ 2003-02-04  8:55 UTC (permalink / raw)


I'm out of my depth, I've looked at the s-*.tex layouts, and have read
chapter 3 of the manual, but am not confident in designing a page
layout.  For instance, I'm not sure how I ensure that vsize comes out
as a multiple of baselineskips, or how to ensure that double sided
pages are printed correctly.

 My initial design parameters (for a double sided page) are:

1) paper size = A4

2) hsize = 2.5 times the length of the lowercase alphabet in
           the default font -- lucida-bright at 12pt.
           i.e. \setbox0={abcdefghijklmnopqrstuvwxyz}
                \hsize=2.5\wd0

3) vsize = golden-ratio times hsize (rounded to integer baselineskips)
         = 1.62\hsize

4) backspace margin = hsize divided by seven
                   
5) topspace margin = backspace margin.

How do I translate these into my \setuplayout parameters?

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

* Re: Lost in the murky detail of designing a page layout
  2003-02-04  8:55 Lost in the murky detail of designing a page layout Guy Worthington
@ 2003-02-04  9:44 ` Patrick Gundlach
  2003-02-05  8:07   ` Guy Worthington
  0 siblings, 1 reply; 9+ messages in thread
From: Patrick Gundlach @ 2003-02-04  9:44 UTC (permalink / raw)


Guy Worthington <guyw@multiline.com.au> writes:

Hello,


> How do I translate these into my \setuplayout parameters?

===========================================================
\startbuffer
\setuppapersize[A4][A4]

\setbox0=\hbox{abcdefghijklmnopqrstuvwxyz}

\setuplayout[width=2.5\wd0,
             header=0pt,
             headerdistance=0pt,
             footer=0pt,
             footerdistance=0pt,
             height=1.62\makeupwidth,
             backspace=.143\makeupwidth,
             topspace=\backspace,
             ]
\stopbuffer
\getbuffer
\showframe 
\starttext
\typebuffer
%\the\wd0
\copy0 \copy0 
%\showlayout
\stoptext
===========================================================

Patrick

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

* Re: Lost in the murky detail of designing a page layout
  2003-02-04  9:44 ` Patrick Gundlach
@ 2003-02-05  8:07   ` Guy Worthington
  2003-02-05  9:24     ` Hans Hagen
  0 siblings, 1 reply; 9+ messages in thread
From: Guy Worthington @ 2003-02-05  8:07 UTC (permalink / raw)


Thanks Patrick for the example.  It's a start (the A4 typesetting area
looks good).  Now I need to flesh out some of the details.  If I
explain how I'd go about it using Hans diagram on pg 30 of the english
ConTeXt manual, maybe I'll make myself clearer (well at least clearer
than my initial correspondence).

1) define A4 typesetting area

   width  = 2.5 times the length of the lowercase alphabet in
            the default font -- lucida-bright at 12pt
         
   height = golden-ratio times width

   this is the inclusive area header + text + footer.

2) If you look at the figure on page 30 of the english ConTeXt manual,
   Hans has drawn a hatched area called "footer".

   I'd like the distance between the baseline of the last line of text
   in the main text area and the baseline of the footer to be equal to
   two times the leading of the main font in white space plus the
   leading of the footer line:

   footer = 2 * \baselineskip whitespace + \baselineskip footer text
          
 3) If you look at the hatched area on page 30 called "header"

  I'd like the distance from the top of the header to baseline of line
  1 of the main text to be the twice the leading of the main font in
  white space plus the height of a one strutbox.

   header = \baseline header text + 2 * \baselineskip whitespace +
      \ht\strutbox main text

 4) If you look at the area on page 30 called text, I'd like the text
  area to 41 lines.

   height = 41 \baselineskip

 5) I'd like any whitespace needed to compensate for underfull \vbox
    messages to be divided equally between the whitespace separating
    the header and the text and the footer and the text.

 5) I'd like backspace and topspace margins to be equal to the width
    divided by seven.

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

* Re: Re: Lost in the murky detail of designing a page layout
  2003-02-05  8:07   ` Guy Worthington
@ 2003-02-05  9:24     ` Hans Hagen
  2003-02-06  8:48       ` Guy Worthington
  0 siblings, 1 reply; 9+ messages in thread
From: Hans Hagen @ 2003-02-05  9:24 UTC (permalink / raw)


At 04:07 PM 2/5/2003 +0800, you wrote:
>Thanks Patrick for the example.  It's a start (the A4 typesetting area
>looks good).  Now I need to flesh out some of the details.  If I
>explain how I'd go about it using Hans diagram on pg 30 of the english
>ConTeXt manual, maybe I'll make myself clearer (well at least clearer
>than my initial correspondence).

mainly a matter of calculating, like:

>1) define A4 typesetting area
>
>    width  = 2.5 times the length of the lowercase alphabet in
>             the default font -- lucida-bright at 12pt
>
>    height = golden-ratio times width
>
>    this is the inclusive area header + text + footer.

\setbox\scratchbox\hbox{\dorecurse{26}{\character\recurselevel}}

\def \MyRatio {1.5}
\edef\MyWidth {\the\dimexpr(2.5\wd\scratchbox)}
\edef\MyHeight{\the\dimexpr(\MyRatio\wd\scratchbox)}

\setuplayout
   [height=\MyHeight,
    width=\MyWidth]

\showframe

\starttext

\input tufte

\stoptext
-------------------------------------------------------------------------
                                   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
-------------------------------------------------------------------------

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

* Re: Lost in the murky detail of designing a page layout
  2003-02-05  9:24     ` Hans Hagen
@ 2003-02-06  8:48       ` Guy Worthington
  2003-02-06 11:49         ` Patrick Gundlach
  0 siblings, 1 reply; 9+ messages in thread
From: Guy Worthington @ 2003-02-06  8:48 UTC (permalink / raw)


Thanks to Patrick and Hans I've a layout approaching what I want.  My
layout look slightly different to the one I'm posting.  However this
layout demonstrates my question, and uses a more available font.

If you look at the output, you'll see, at the bottom of the main text
area, whitespace.  The whitespace exists because there isn't enough
room to fit another line in the text area.  My question is, can I
specify an integer number of lines in the text area, and have the
excess whitespace distributed evenly in my \headerdistance and
\footerdistance.

If this isn't possible without calculations, is it possible to log the
underfull \vbox messages?  So I've some feedback that I can use to
adjust my \headerdistance and \footerdistance manually.


%-- tryISOLayout.ctx --------------------------------------------
%output=pdf

\setuppapersize[A4][A4]
\setupencoding[default=texnansi]    
\setupbodyfont[cmr,14.4pt]

\def\GoldenRatio{1.61803}    
\setbox0\hbox{\dorecurse{26}{\character\recurselevel}}

\setuplayout[width=2.5\wd0,
             header=\lineheight,
             headerdistance=\lineheight,
             footer=\lineheight,
             footerdistance=\lineheight,
             height=\GoldenRatio\makeupwidth,
             backspace=\dimexpr(\makeupwidth/7),
             topspace=\dimexpr(\makeupwidth/7)]

\showframe 
\starttext

  \startlinenumbering
    \dorecurse{5}{\input tufte}
  \stoplinenumbering

\stoptext
%-- end tryISOLayout.ctx -----------------------------------------

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

* Re: Lost in the murky detail of designing a page layout
  2003-02-06  8:48       ` Guy Worthington
@ 2003-02-06 11:49         ` Patrick Gundlach
  2003-02-07  8:22           ` Hans Hagen
  2003-02-09  6:36           ` Guy Worthington
  0 siblings, 2 replies; 9+ messages in thread
From: Patrick Gundlach @ 2003-02-06 11:49 UTC (permalink / raw)


Guy Worthington <guyw@multiline.com.au> writes:

Hello again,

> If you look at the output, you'll see, at the bottom of the main text
> area, whitespace.  The whitespace exists because there isn't enough
> room to fit another line in the text area.  My question is, can I
> specify an integer number of lines in the text area, and have the
> excess whitespace distributed evenly in my \headerdistance and
> \footerdistance.

%output=pdf

\setuppapersize[A4][A4]
\setupencoding[default=texnansi]    
\setupbodyfont[cmr,14.4pt]

\def\GoldenRatio{1.61803}    
\setbox0\hbox{\dorecurse{26}{\character\recurselevel}}

\setuplayout[width=2.5\wd0,
             header=\lineheight,
             footer=\lineheight,
             height=\GoldenRatio\makeupwidth,
             footerdistance=\dimexpr(
             (\makeupheight-37\lineheight-\headerheight-\footerheight) /2),
% does not work, why?
%             headerdistance=\footerdistance,
             headerdistance=\dimexpr(
             (\makeupheight-37\lineheight-\headerheight-\footerheight) /2),
             backspace=\dimexpr(\makeupwidth/7),
             topspace=\dimexpr(\makeupwidth/7)]
\showlayout
\showframe 
\starttext
 \startlinenumbering
    \dorecurse{5}{\input knuth}
  \stoplinenumbering

\stoptext

%%% Local Variables: 
%%% mode: context
%%% TeX-master: t
%%% End: 



But: I have two questions:

why does \headerdistance=\footerdistance not work the way I'd expect
(making 'em equal)?

Why is there a difference between knuth.tex and tufte.tex in the
example (try \input tufte instead of \input knuth).



Patrick

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

* Re: Re: Lost in the murky detail of designing a page layout
  2003-02-06 11:49         ` Patrick Gundlach
@ 2003-02-07  8:22           ` Hans Hagen
  2003-02-09  6:36           ` Guy Worthington
  1 sibling, 0 replies; 9+ messages in thread
From: Hans Hagen @ 2003-02-07  8:22 UTC (permalink / raw)


At 12:49 PM 2/6/2003 +0100, you wrote:
>Guy Worthington <guyw@multiline.com.au> writes:
>
>Hello again,
>
> > If you look at the output, you'll see, at the bottom of the main text
> > area, whitespace.  The whitespace exists because there isn't enough
> > room to fit another line in the text area.  My question is, can I
> > specify an integer number of lines in the text area, and have the
> > excess whitespace distributed evenly in my \headerdistance and
> > \footerdistance.
>
>%output=pdf
>
>\setuppapersize[A4][A4]
>\setupencoding[default=texnansi]
>\setupbodyfont[cmr,14.4pt]
>
>\def\GoldenRatio{1.61803}
>\setbox0\hbox{\dorecurse{26}{\character\recurselevel}}
>
>\setuplayout[width=2.5\wd0,
>              header=\lineheight,
>              footer=\lineheight,
>              height=\GoldenRatio\makeupwidth,
>              footerdistance=\dimexpr(
>              (\makeupheight-37\lineheight-\headerheight-\footerheight) /2),
>% does not work, why?

there is some order in calculations; the header is calculated before the 
footer -)

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

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

* Re: Lost in the murky detail of designing a page layout
  2003-02-06 11:49         ` Patrick Gundlach
  2003-02-07  8:22           ` Hans Hagen
@ 2003-02-09  6:36           ` Guy Worthington
  2003-02-09 18:31             ` Patrick Gundlach
  1 sibling, 1 reply; 9+ messages in thread
From: Guy Worthington @ 2003-02-09  6:36 UTC (permalink / raw)


Hello again Patrick,

The reason I've taken so long to reply, is that I've been trying to
understand TeX's line-breaking mechanism.  Your perceptive question:

> Why is there a difference between knuth.tex and tufte.tex in the
> example (try \input tufte instead of \input knuth).

In the example below

%-- tryISOLayout.ctx ----------------------------------------
%output=pdf

\setuppapersize[A4][A4] 
\setupencoding[default=texnansi]     
\setupbodyfont[cmr,14.4pt] 
 
\def\GoldenRatio{1.61803}     
\setbox0\hbox{\dorecurse{26}{\character\recurselevel}} 
 
\setuplayout[width=2.5\wd0, 
             header=\lineheight, 
             footer=\lineheight, 
             height=\GoldenRatio\makeupwidth, 
             headerdistance=\dimexpr( 
             (\makeupheight-37\lineheight-\headerheight-\footerheight) /2), 
	     footerdistance=\headerdistance, 
             backspace=\dimexpr(\makeupwidth/7), 
             topspace=\dimexpr(\makeupwidth/7)] 

\showframe  
\starttext 
 \startlinenumbering 

    \dorecurse{5}{\input tufte} 

  \stoplinenumbering 
 
\stoptext 

%-- end tryISOLayout.ctx ------------------------------------

I think is due to TeX trying very hard not to generate a widow line.

Even after fiddling around with \looseness, I couldn't force TeX to
add the 37th line.  I've a feeling that if you come across a
pathological case like the above, you really have to follow Knuth's
advice and rewrite the paragraph. 

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

* Re: Lost in the murky detail of designing a page layout
  2003-02-09  6:36           ` Guy Worthington
@ 2003-02-09 18:31             ` Patrick Gundlach
  0 siblings, 0 replies; 9+ messages in thread
From: Patrick Gundlach @ 2003-02-09 18:31 UTC (permalink / raw)


Guy Worthington <guyw@multiline.com.au> writes:

Hello Guy,

> I think is due to TeX trying very hard not to generate a widow line.
>
> Even after fiddling around with \looseness, I couldn't force TeX to
> add the 37th line.  I've a feeling that if you come across a
> pathological case like the above, you really have to follow Knuth's
> advice and rewrite the paragraph. 

I was playing with \widowpenalty but it did not help. But setting 

\brokenpenalty=0

works fine (although it is not nice to have a hyphen as the last line)

Patrick

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

end of thread, other threads:[~2003-02-09 18:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-04  8:55 Lost in the murky detail of designing a page layout Guy Worthington
2003-02-04  9:44 ` Patrick Gundlach
2003-02-05  8:07   ` Guy Worthington
2003-02-05  9:24     ` Hans Hagen
2003-02-06  8:48       ` Guy Worthington
2003-02-06 11:49         ` Patrick Gundlach
2003-02-07  8:22           ` Hans Hagen
2003-02-09  6:36           ` Guy Worthington
2003-02-09 18:31             ` Patrick Gundlach

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