ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* First and last lines on a grid
@ 2011-04-22 12:04 Oliver Buerschaper
  2011-04-22 14:22 ` Wolfgang Schuster
  0 siblings, 1 reply; 7+ messages in thread
From: Oliver Buerschaper @ 2011-04-22 12:04 UTC (permalink / raw)
  To: mailing ConTeXt users list for

Dear all,

I'm having a little trouble with grids and page layout…

I'm trying to align the first and last line of a page properly with the frame of the textblock. That is, I'd like to position the first baseline a certain distance below the textblock's upper border (say, the height of a "C" or even "É") and the last baseline a certain distance above the textblock's lower border (say, the actual depth of a "g").

How would I do that? I tried playing with "\setupinterlinespace", however, its options "top" and "bottom" appear to set relative distances. Once I change the leading funny things happen… like an empty first line.

Also I'd like to typeset the page number flush with the lower border of the footer frame. How would I achieve that?

Please find the source code of my attempt below.

Oliver



---
\definemeasure
    [gridwidth]
    [\dimexpr\paperwidth/9\relax]
\definemeasure
    [gridheight]
    [\dimexpr\paperheight/9\relax]

\setuplayout
    [grid=yes,
     backspace=\measure{gridwidth},
     width=\dimexpr6\measure{gridwidth}\relax,
     topspace=\measure{gridheight},
     height=\dimexpr7\measure{gridheight}\relax,
     leftmargin=\zeropoint,
     rightmargin=\zeropoint,
     header=\zeropoint,
     footer=\measure{gridheight}]

\setupinterlinespace
    [line=\dimexpr\textheight/20\relax]

\setuppagenumbering
    [alternative=doublesided,
     location={footer,right}]


\starttext


\showframe
\showgrid

É
\dorecurse{10}{\input zapf\par}


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


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

* Re: First and last lines on a grid
  2011-04-22 12:04 First and last lines on a grid Oliver Buerschaper
@ 2011-04-22 14:22 ` Wolfgang Schuster
  2011-04-22 15:32   ` Oliver Buerschaper
  2011-04-22 17:32   ` Oliver Buerschaper
  0 siblings, 2 replies; 7+ messages in thread
From: Wolfgang Schuster @ 2011-04-22 14:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 22.04.2011 um 14:04 schrieb Oliver Buerschaper:

> Also I'd like to typeset the page number flush with the lower border of the footer frame. How would I achieve that?

\setuppagenumbering[strut=no]

Wolfgang

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


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

* Re: First and last lines on a grid
  2011-04-22 14:22 ` Wolfgang Schuster
@ 2011-04-22 15:32   ` Oliver Buerschaper
  2011-04-22 17:32   ` Oliver Buerschaper
  1 sibling, 0 replies; 7+ messages in thread
From: Oliver Buerschaper @ 2011-04-22 15:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users

>> Also I'd like to typeset the page number flush with the lower border of the footer frame. How would I achieve that?
> 
> \setuppagenumbering[strut=no]

That's wonderful!

Any idea about the other thing?

Thanks,
Oliver


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


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

* Re: First and last lines on a grid
  2011-04-22 14:22 ` Wolfgang Schuster
  2011-04-22 15:32   ` Oliver Buerschaper
@ 2011-04-22 17:32   ` Oliver Buerschaper
  2011-04-22 17:56     ` Wolfgang Schuster
  1 sibling, 1 reply; 7+ messages in thread
From: Oliver Buerschaper @ 2011-04-22 17:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users

>> Also I'd like to typeset the page number flush with the lower border of the footer frame. How would I achieve that?
> 
> \setuppagenumbering[strut=no]

I just realized that when I use oldstyle figures any pagenumber with a descender is bumped upwards a little. Is there a way to have them protrude (vertically) beyond the frame border?

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


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

* Re: First and last lines on a grid
  2011-04-22 17:32   ` Oliver Buerschaper
@ 2011-04-22 17:56     ` Wolfgang Schuster
  2011-04-22 18:25       ` Oliver Buerschaper
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Schuster @ 2011-04-22 17:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 22.04.2011 um 19:32 schrieb Oliver Buerschaper:

>>> Also I'd like to typeset the page number flush with the lower border of the footer frame. How would I achieve that?
>> 
>> \setuppagenumbering[strut=no]
> 
> I just realized that when I use oldstyle figures any pagenumber with a descender is bumped upwards a little. Is there a way to have them protrude (vertically) beyond the frame border?

This should do the trick:

\define[1]\PagenumberCommand
  {\smash[d]{#1}}

\setuppagenumbering
  [  strut=no,
   command=\PagenumberCommand]

Wolfgang

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


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

* Re: First and last lines on a grid
  2011-04-22 17:56     ` Wolfgang Schuster
@ 2011-04-22 18:25       ` Oliver Buerschaper
  2011-04-23  7:25         ` Oliver Buerschaper
  0 siblings, 1 reply; 7+ messages in thread
From: Oliver Buerschaper @ 2011-04-22 18:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

>> I just realized that when I use oldstyle figures any pagenumber with a descender is bumped upwards a little. Is there a way to have them protrude (vertically) beyond the frame border?
> 
> This should do the trick:
> 
> \define[1]\PagenumberCommand
>  {\smash[d]{#1}}
> 
> \setuppagenumbering
>  [  strut=no,
>   command=\PagenumberCommand]

And how well it does it!

Thanks,
Oliver
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: First and last lines on a grid
  2011-04-22 18:25       ` Oliver Buerschaper
@ 2011-04-23  7:25         ` Oliver Buerschaper
  0 siblings, 0 replies; 7+ messages in thread
From: Oliver Buerschaper @ 2011-04-23  7:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

>> This should do the trick:
>> 
>> \define[1]\PagenumberCommand
>> {\smash[d]{#1}}
>> 
>> \setuppagenumbering
>> [  strut=no,
>>  command=\PagenumberCommand]
> 
> And how well it does it!

Now I managed to align the last line of the grid with the textblock's frame:

---
\definemeasure
    [gridWidth]
    [\dimexpr\paperwidth/9\relax]
\definemeasure
    [gridHeight]
    [\dimexpr\paperheight/9\relax]
\definemeasure
    [leading]
    [\dimexpr(6\measure{gridHeight}+\strutdepth)/20\relax]

\setuplayout
    [grid=yes,
     backspace=\measure{gridWidth},
     width=\dimexpr6\measure{gridWidth}\relax,
     topspace=\measure{gridHeight},
     height=\dimexpr7\measure{gridHeight}\relax,
     leftmargin=\zeropoint,
     rightmargin=\zeropoint,
     header=\zeropoint,
     footer=\measure{gridHeight}]

\setupinterlinespace
    [line=\measure{leading}]

\define[1]\PageNumberCommand{\smash[d]{#1}}
\setuppagenumbering
    [alternative=doublesided,
     location={footer,right},
     strut=no,
     command=\PageNumberCommand]



\starttext


\showframe
\showgrid

É
\dorecurse{10}{\input zapf\par}


\stoptext
---

This only leaves the task of aligning the first line, too. How would I achieve this?

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


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

end of thread, other threads:[~2011-04-23  7:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-22 12:04 First and last lines on a grid Oliver Buerschaper
2011-04-22 14:22 ` Wolfgang Schuster
2011-04-22 15:32   ` Oliver Buerschaper
2011-04-22 17:32   ` Oliver Buerschaper
2011-04-22 17:56     ` Wolfgang Schuster
2011-04-22 18:25       ` Oliver Buerschaper
2011-04-23  7:25         ` Oliver Buerschaper

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