Fairy style

From ConTeXt wiki

< Sample documents

This is the setup for a book of fairy tales. It works with MkIV from 2011-12.

The actual book is scheduled for printing in spring 2012, so some details aren’t fixed yet.


Environment

\startenvironment env_fairy
\project project_fairy

% Language
\mainlanguage		[de]

% Fonts & Typography
\setupbodyfontenvironment	[default][em=italic]

\definefontfeature	[default][default][protrusion=quality,expansion=quality]
\setupalign[hz,hanging]

\definefontsynonym [WieynkInitialen]   [file:WieynkFraktur-Initialen.otf]   [features=default]
% free Fraktur initials, e.g. from here: http://fontpark.net/de/schriftart/wieynk-fraktur-initialen/

\usetypescript[antykwa-torunska]
\setupbodyfont[antykwa,rm,10pt]

\setupinitial[color=Sonder,font=WieynkInitialen at 34pt,distance=3pt] % state,location,n,distance,command,font
% use with \placeinitial

% Page Layout
\setuppapersize[A5][A5] % we didn’t decice yet on the actual page size
\setuplayout[%
	location=middle,marking=on,%
	grid=yes
]
\setuppagenumbering[
	alternative=doublesided,
	location={footer,right},
	sectionnumber=no,
	strut=yes, state=start]

% Text
\setuptolerance[vertical,verystrict]
\setuptolerance[horizontal,verytolerant]
\clubpenalty=10000 % keine Schusterjungen / no clubs
\widowpenalty=10000 % keine Hurenkinder / no widows
\setbreakpoints[compound] % Bindestrich immer als Trennstelle bevorzugen / prefer hyphen as hyphenation point
\setupindenting[yes, medium]

\setuplines[before={}, after={}, indenting=no, space=no] % for poems/spells etc.
\setupblank[big]

% Headers and Footers
\setupheader[text][state=stop, location=high]
\setupnote[footnote][way=bypage]

% Titling
\definefont[PartStyle][Serif at 48pt]

\setupheads	[align={right,nothyphenated}, tolerance=verytolerant,
		before=\startlinecorrection,
		after=\stoplinecorrection, number=no]
\setuphead[part][page=right, placehead=yes, style=PartStyle]
\setuphead[chapter][page=yes, style={\tfc}]
\setuphead[section][page=no, style={\tfa\it}]

% Register
\setuplist[part][label=no]
\setupregister[content][
chapternumber=no,
alternative=A,
criterium=all
]

% Pictures and colors
\setupexternalfigures[directory={img},width=\textwidth]
\setupfloats[indentnext=no]

\definecolor[Sonder][k=.6,c=0] % doesn’t work without "c"; we don’t yet know if we will print in color

% Misc
\def\Source#1{\vfill\startlinecorrection\noindent{\tfx\em #1}\stoplinecorrection}
\def\Author#1{{\hfill\em #1}}

\usemodule[fancybreak] % by Wolfgang, from https://bitbucket.org/wolfs/fancybreak/
\setupfancybreak[indentnext=no]

\def\Gap{\fancybreak{\strut}} % We didn’t yet decide on a divison symbol (e.g. English line)

\stopenvironment

Project

\startproject project_fairy
\environment env_fairy
	\product prd_fairy
\stopproject

Product

\startproduct prd_fairy
\project project_fairy

\startfrontmatter

\title{Inhalt}

\placecontent

\stopfrontmatter

%\startbodymatter % doesn’t work
	\component c_preface

\part{Fairies}

	\component fairies/c_fee
	% etc.

\part{Elvenkind}

	\component elves/c_taco
	% etc.

%\stopbodymatter

\startbackmatter

	\chapter{Quellen}

	\chapter{Zum Weiterlesen}

\stopbackmatter

\stopproduct

Component

\startcomponent c_fee
\project project_fairy
\product prd_fairy

\startchapter[title={Die Fee}]

\placeinitial Es war einmal… \input knuth

\Gap

\input tufte

\Source{The \TEX book}

\stopchapter

\stopcomponent