ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Willi Egger <context@boede.nl>
To: NTG-Context ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Placing marks at edge.
Date: Wed, 5 Mar 2014 20:49:03 +0100	[thread overview]
Message-ID: <4119DDC4-850F-41DC-A39A-25C8449C93AF@boede.nl> (raw)
In-Reply-To: <20140305104330.2184f680@localb.wexfordpress.net>

[-- Attachment #1: Type: text/plain, Size: 145 bytes --]

Hello John,

I was busy to make this some time ago. May that the attached file is a base for what you want to achieve.

Kind regards

Willi

[-- Attachment #2: Thumbnails-MKIV.tex --]
[-- Type: application/octet-stream, Size: 2499 bytes --]

% Context file
% Filename: untitled.tex
% 
% 28-02-2011
% Copyright (c) 2011 BOEDE. All rights reserved.

\usetypescriptfile[type-seravek]
\usetypescript[Seravek]
\setupbodyfont[Seravek,ss,12pt]
\setuppagenumbering[location=]
\setuplayout
	[topspace=2.5cm,
	backspace=1.5cm,
	header=0pt,
	footer=0pt,
	height=middle,
	width=middle]
\mainlanguage[nl]

%\showframe
\setuppapersize[A4][A4,oversized]

\setuplayout
  [width=middle,
   % margin=\dimexpr\backspace-\margindistance\relax
   location=middle]

\definecolor[chap_frame][g=1,t=1,a=12]
\definecolor[sect_frame][b=1,t=1,a=12]
\definecolor[textcolor] [r=1,t=1,a=12]

\startuseMPgraphic{chapter thumb}
  path chap_frame, sect_frame ;  pair pos,a,b ;  picture text ;

  if  \somenamedheadnumber{chapter}{current} > 0 :
	curr_chap := \somenamedheadnumber{chapter}{current} ; 
  else :
	curr_chap := 1 ;
  fi;
  if \somenamedheadnumber{chapter}{last} > 0 :
   	last_chap := \somenamedheadnumber{chapter}{last} ;
  else :
  	last_chap := 1 ;
	  fi;
	  if \somenamedheadnumber{section}{current} > 0 : 
	curr_sect := \somenamedheadnumber{section}{current} ; 
	  else: 
  	curr_sect := 1 ;
  fi;
  if \somenamedheadnumber{section}{last} > 0 :
  	last_sect := \somenamedheadnumber{section}{last};
  else:
	last_sect := 1;
  fi;
  skip   := TextHeight * (curr_chap-1)/last_chap ;
  height := TextHeight/last_chap ;
  sskip  := height*curr_sect/last_sect ;
 
  text   := textext("\ssbfb\textcolor Chapter\enspace\getmarking[chapternumber]");

  StartPage ;
    chap_frame := fullsquare xyscaled(RightMarginWidth,height) ;

    a := ulcorner chap_frame ;
    b := urcorner chap_frame ;

    sect_frame := a--b--(xpart b,ypart b-sskip)--(xpart a,ypart a-sskip)--cycle;

    pos := urcorner Field[Text][RightMarginSeparator] -
           ulcorner chap_frame - (0,skip);

    fill chap_frame shifted pos withcolor \MPcolor{chap_frame};
    unfill sect_frame shifted pos withcolor white ;
    fill sect_frame shifted pos withcolor \MPcolor{sect_frame};
    draw text rotated 90 shifted pos ;
  StopPage ;
\stopuseMPgraphic


\defineoverlay[chapter thumb][\useMPgraphic{chapter thumb}]

\setupbackgrounds[page][background=chapter thumb]


\starttext  \showframe
\dorecurse{6}{\chapter{Test Chapter #1}
  Chapter \headnumber[chapter][current] of
  \headnumber[chapter][last]
  \dorecurse{9}{\section{Test Section}
    Section \headnumber[section][current] of
    \headnumber[section][last] \blank
    \input tufte \par \input knuth \par
  }
}
\chapter 1
\stoptext

[-- Attachment #3: Type: text/plain, Size: 2163 bytes --]


On 5 mrt. 2014, at 16:43, john Culleton <John@wexfordpress.com> wrote:

> You have seen them in books from O'Reilly and
> even in books like "TeX for the Impatient":
> markings on the outer edge of each odd page that
> bleed past the page edge indicating a particular
> chapter. In the last named they are a simple 
> box with very fine horizontal black lines. In some
> O'Reilly books like "Web Design in a Nutshell"
> they are a black box with the chapter name
> (possibly abbreviated) rotated 90 degrees in
> small white text. 
> 
> No doubt I can do this in Context. The question
> is what is the simplest and most foolproof way
> home.
> 
> Of course the page size will be made larger by
> 0.125 inch on all sides except the spine edge to
> provide a trim. The marker box I describe
> protrudes into the trim area. And its location
> and the text  change for each chapter of
> course. 
> 
> It is very hard in this country to get a book
> review by the important pre-publication
> reviewers like Booklist and Library Journal. But
> that review is the key to among other things
> library sales and academic sales. Edge markings
> like I discuss above will immediately separate my
> books from those slapped together in MSWord etc. 
> 
> I am just trying to get my books past the clerk in
> the mail room who has orders to discard anything
> that looks self-published.  
> 
> -- 
> John Culleton
> Wexford Press
> Free list of books for self-publishers:
> http://wexfordpress.net/shortlist.html
> PDF e-book: "Create Book Covers with Scribus"
> available at
> http://www.booklocker.com/books/4055.html
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________


[-- Attachment #4: Type: text/plain, Size: 485 bytes --]

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

  reply	other threads:[~2014-03-05 19:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-05 15:43 john Culleton
2014-03-05 19:49 ` Willi Egger [this message]
2014-03-05 23:50   ` john Culleton

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=4119DDC4-850F-41DC-A39A-25C8449C93AF@boede.nl \
    --to=context@boede.nl \
    --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).