ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Mojca Miklavec" <mojca.miklavec.lists@gmail.com>
Subject: Re: Newbie questions
Date: Sun, 25 Jun 2006 17:33:05 +0200	[thread overview]
Message-ID: <6faad9f00606250833o4bbcd54am9ea50b8e27e66d5e@mail.gmail.com> (raw)
In-Reply-To: <D7CCE484-9BC1-499B-BACC-DF29BCD76449@pomona.edu>

On 6/24/06, Thomas Moore wrote:
> 1.  I have successfully set up a doublesided layout that has a text
> column and an outer margin for margin notes and some small figures. I
> would like to set up a header that has the chapter number and name
> (e.g.  "3. Third Chapter Name") on the inner edge of the text column,
> and the page number aligned with the *outer* edge of the margin and a
> 1-pt rule below the entire header (from below the chapter number to
> below the page number). How would one do this elegantly (or even
> inelegantly)?

First forget about the wrong pagenumber positioning. Here's the most
elegant solution for drawing the line:

\setuppagenumbering
	[alternative=doublesided,
	 location=]

\setupheadertexts
	[pagenumber]
	[chapter]
	[chapter]
	[pagenumber]

\setuplayout
	[header=15pt,
	 headerdistance=20pt]

\setupbackgrounds
	[header]
	[text]
	[bottomframe=on,
	 rulethickness=1pt]

\starttext
\chapter{first}
\dorecurse{50}{\input tufte }
\chapter{second}
\dorecurse{20}{\input tufte }
\stoptext

But I don't know if there's a simple extention to it to draw the
missing line inbetween.


Here's another solution, which is the wrong way of doing things (it's
way too slow and meant for more complex things than a simple rule, but
could be optimezed if "useMPgraphic" was replaced with "reusable" or
"unique"). Also try \showlayout and see meta-pag.tex in the ConTeXt
source.

\startuseMPgraphic{PageFrame}
  StartPage ;
  y1=y2=PaperHeight-TopSpace-HeaderHeight;

  if OnRightPage :
    x2 = BackSpace+TextWidth = x1 + LeftMarginDistance +
LeftMarginWidth + TextWidth;
  else:
    x2 = BackSpace = x1 - (RightMarginDistance + RightMarginWidth + TextWidth);
  fi;
    draw z1--z2 withpen pencircle scaled 1pt;
  StopPage;
\stopuseMPgraphic

\defineoverlay
	[PageFrame][\useMPgraphic{PageFrame}]

\setupbackgrounds
	[page]
	[background=PageFrame]


The trird solutions is probably the way to go, but it influences only
a single page and \getmarking[chapter] has no influence. I guess that
a minor modification is needed to handle both left & right page
properly and to put that layer over all pages, not only on the  first
one:

\definelayer
	[page]
	[width=\paperwidth,
	 height=\paperheight]
\setupbackgrounds
	[page]
	[background=page]
\setlayerframed
	[page]
	[voffset=\topspace,
	 hoffset=\the\dimexpr\backspace-\leftmarginwidth-\leftmargindistance\relax,
	 preset=lefttop]
	[width=\the\dimexpr\textwidth+\leftmarginwidth+\leftmargindistance\relax,
	 rulethickness=1pt,
	 frame=off,
	 bottomframe=on]
	{\pagenumber\hfill\getmarking[chapter][first]}

Hoping that someone can fix at least one of the solutions above to
work as intended,
    Mojca

  parent reply	other threads:[~2006-06-25 15:33 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-24 14:56 Thomas Moore
2006-06-24 15:46 ` Sanjoy Mahajan
2006-06-24 16:45   ` Thomas Moore
2006-06-25 16:31     ` Hans Hagen
2006-06-29 15:02       ` Thomas Moore
2006-06-24 15:57 ` Mojca Miklavec
2006-06-24 16:52   ` Thomas Moore
2006-06-24 20:57     ` Sanjoy Mahajan
2006-06-24 17:15 ` Aditya Mahajan
2006-06-25 15:33 ` Mojca Miklavec [this message]
2006-06-25 16:54   ` Hans Hagen
2006-06-28 18:36     ` Thomas Moore
2006-06-29  0:33       ` Thomas Moore
2006-06-29  1:12         ` Aditya Mahajan
2006-06-29  2:35           ` Sanjoy Mahajan
2006-06-29 15:05             ` Thomas Moore
2006-06-29 14:57           ` Thomas Moore
2006-06-27 19:53 ` Gerben Wierda
2006-06-27 20:14   ` Hans Hagen
2006-06-28 18:42   ` Thomas Moore
2011-05-31 15:38 newbie questions Sanja C.
2011-05-31 16:27 ` Marco
2011-05-31 22:07 ` Pontus Lurcock
2011-05-31 23:44 ` George N. White III
2014-05-15 13:40 Joan & Gary
2014-05-16  8:03 ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6faad9f00606250833o4bbcd54am9ea50b8e27e66d5e@mail.gmail.com \
    --to=mojca.miklavec.lists@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).