ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Unconventional page number placement
@ 2005-02-18 18:40 Matt Gushee
  2005-02-18 20:14 ` Adam Lindsay
  0 siblings, 1 reply; 3+ messages in thread
From: Matt Gushee @ 2005-02-18 18:40 UTC (permalink / raw)


Hello, all--

Sorry about the repost, but I asked about this several days ago and 
didn't get any response. If there is a documented way to do what I want, 
feel free to just give me a hint as to where it is documented; or if 
there is no way to do it without deep hackery, please just let me know 
that. Thanks!

%%

I am creating a layout for electronic books in which all the body text 
is in a single, fairly narrow column, with minimal space at the top and 
bottom of each page. I would like to place page numbers in the left 
margin, aligned with the bottom of the text, and the running heads (if 
any) also in the left margin, aligned with the top of the text. Is there 
a way to do this in ConTeXt? I can see that the standard page numbering 
and header commands don't support this kind of placement. I can come 
very close to the desired effect with the following:

   * Place the page numbers in the margin area of the footer, e.g.:

      \setuppagenumbering [...,location=inleft]

   * Place the header text in the margin area of the header, e.g.:

      \setupheadertext [margin] [section] []

   * Use negative dimensions to cause the header and footer to overlap
     the text area, e.g.:

      \setuplayout [...,headerdistance=-0.35in,footerdistance=-0.5in]

As I said, this comes very close to the desired effect, but it seems 
impossible to correctly align the header text and page numbers with the 
main text. Also, the header texts are mostly too long to fit on a single 
line in the margin, and I have not found a way to induce line wrapping.

Your suggestions are greatly appreciated.

-- 
Matt Gushee
Englewood, CO, USA

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

* Re: Unconventional page number placement
  2005-02-18 18:40 Unconventional page number placement Matt Gushee
@ 2005-02-18 20:14 ` Adam Lindsay
  2005-02-21 12:13   ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Adam Lindsay @ 2005-02-18 20:14 UTC (permalink / raw)


Hi Matt.

I don't have a total solution, but I think you were much closer than you
thought.

Matt Gushee said this at Fri, 18 Feb 2005 11:40:22 -0700:

>   * Use negative dimensions to cause the header and footer to overlap
>     the text area, e.g.:
>
>      \setuplayout [...,headerdistance=-0.35in,footerdistance=-0.5in]
>
>As I said, this comes very close to the desired effect, but it seems 
>impossible to correctly align the header text and page numbers with the 
>main text. 

How about this:

\setuppapersize[A4,landscape][A4,landscape]
\setuplayout[width=16cm,rightedge=\marginwidth]
\setuplayout[headerdistance=-2\lineheight,
                 header=2\lineheight,
                 footerdistance=-2\lineheight,
                 footer=2\lineheight,
                 height=middle]
\setupheadertexts[margin][section][]
\setupfootertexts[margin][pagenumber][]
\setuphead[section][page=yes]
\starttext
\showframe
\section{one}
\section{two}

You had it pretty much right, you just need to make sure that the text
blocks reach the bottom, a la the grid or \setupalign[line] stuff on the
list these past weeks.

Actually, at first, I thought this was a job for texttexts (weird, yeah,
but in the manual...), but I have not idea how to move those up and down,
where you want them.

And that rightedge block isn't really relevant here, but it looks nice on
the page. :)
\section{three}
\setuptext[margin][style=bold]
\setuptexttexts[margin][section][pagenumber]
\section{four}
\stoptext

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Adam T. Lindsay, Computing Dept.     atl@comp.lancs.ac.uk
 Lancaster University, InfoLab21        +44(0)1524/510.514
 Lancaster, LA1 4WA, UK             Fax:+44(0)1524/510.492
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

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

* Re: Unconventional page number placement
  2005-02-18 20:14 ` Adam Lindsay
@ 2005-02-21 12:13   ` Hans Hagen
  0 siblings, 0 replies; 3+ messages in thread
From: Hans Hagen @ 2005-02-21 12:13 UTC (permalink / raw)


Adam Lindsay wrote:
> Hi Matt.
> 
> I don't have a total solution, but I think you were much closer than you
> thought.
> 
> Matt Gushee said this at Fri, 18 Feb 2005 11:40:22 -0700:
> 
> 
>>  * Use negative dimensions to cause the header and footer to overlap
>>    the text area, e.g.:
>>
>>     \setuplayout [...,headerdistance=-0.35in,footerdistance=-0.5in]
>>
>>As I said, this comes very close to the desired effect, but it seems 
>>impossible to correctly align the header text and page numbers with the 
>>main text. 
> 
> 
> How about this:
> 
> \setuppapersize[A4,landscape][A4,landscape]
> \setuplayout[width=16cm,rightedge=\marginwidth]
> \setuplayout[headerdistance=-2\lineheight,
>                  header=2\lineheight,
>                  footerdistance=-2\lineheight,
>                  footer=2\lineheight,
>                  height=middle]
> \setupheadertexts[margin][section][]
> \setupfootertexts[margin][pagenumber][]
> \setuphead[section][page=yes]
> \starttext
> \showframe
> \section{one}
> \section{two}
> 
> You had it pretty much right, you just need to make sure that the text
> blocks reach the bottom, a la the grid or \setupalign[line] stuff on the
> list these past weeks.
> 
> Actually, at first, I thought this was a job for texttexts (weird, yeah,
> but in the manual...), but I have not idea how to move those up and down,
> where you want them.
> 
> And that rightedge block isn't really relevant here, but it looks nice on
> the page. :)
> \section{three}
> \setuptext[margin][style=bold]
> \setuptexttexts[margin][section][pagenumber]
> \section{four}
> \stoptext

you can play with ...

\startsetups one

\vbox to \textheight \bgroup

   \strut \getmarking[section]
   \vfill
   \strut \pagenumber

\egroup

\stopsetups

\setuptexttexts[margin][\setups{one}][\setups{two}]

etc



-- 

-----------------------------------------------------------------
                                           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] 3+ messages in thread

end of thread, other threads:[~2005-02-21 12:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-18 18:40 Unconventional page number placement Matt Gushee
2005-02-18 20:14 ` Adam Lindsay
2005-02-21 12:13   ` 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).