Proceedings style

From Wiki
Revision as of 15:36, 30 April 2008 by Hraban (talk | contribs) (→‎Product)
Jump to navigation Jump to search

I made this in 2008 for some political seminary proceedings (Klingberger Reihe Nr.5, Verlag Deutsche Unitarier). Every chapter is by an other author, and the author must show up in the table of contents, so there's a special handling of chapter titles using newish and undocumented \startsectionworld - thanks to Wolfgang Schuster!

This one works only with XeTeX/LuaTeX. Use UTF-8 encoding!

--Hraban 22:24, 28 April 2008 (CEST)

Environment

\startenvironment env_proceedings
\project project_proceedings

\version		[final] % final, temporary, concept
\mainlanguage		[de]

\setuptolerance		[{verytolerant, verystrict}] % page breaking

%% Fonts

\starttypescript	[fiee]	[gyr-mix]
	\definetypeface	[gyr-mix]	[rm]	[serif]	[schola]	[default]
	\definetypeface	[gyr-mix]	[ss]	[sans]	[heros]	[default] 
\stoptypescript
\usetypescript		[fiee][gyr-mix]
\setupbodyfont		[gyr-mix,rm,8pt]
\setupbodyfontenvironment	[default][em=italic] % use italic as em, not slanted

% some shortcuts
\def\TextBig{\switchtobodyfont[gyr-mix, rm, 10pt]}
\def\TextNormal{\switchtobodyfont[gyr-mix, rm, 8pt]}
\def\TextSmall{\switchtobodyfont[gyr-mix, rm, 6pt]}
\def\TextSmallSans{\switchtobodyfont[gyr-mix, ss, 6pt]}


%% Layout

\setuppapersize		[A5][A5]
% for imposition use:
%\setuppapersize		[A5][A4,landscape]
%\setuparranging		[2UP]

\setuplayout		[location=middle,
			alternative=doublesided,
			grid=yes,
			backspace=15mm,
			leftmargin=5mm, leftmargindistance=0mm,
			rightmargin=18mm, rightmargindistance=0mm,
			topspace=8mm, header=10mm, 
			footer=10mm,
			width=115mm, height=192mm
			]

\setupindenting[yes, small, next]

% Pagination
\setuppagenumbering[
	alternative=doublesided,
	location={header,right},
	style={\ss\tfx},
	way=bypart,
	sectionnumber=no,
	strut=yes, state=stop]

\setupsectionblock[frontpart][page=no, number=no]
\setupsectionblock[bodypart][page=yes]
%\setupsectionblock[appendix][page=no]
\setupsectionblock[backpart][page=yes]

%% Chapter Titling

% with help from Wolfgang Schuster et.al., 2008-04-15
% start WS
\unprotect

\resetvalue{\??sw\v!chapter}

\startsetups chapter:list

\def\\{{\nomarking{\unskip\nolist\crlf}}}

  \doiftextelse{\sectionworldparameter\c!author}
    {\expanded{\writetolist[\v!chapter]
      {\sectionworldparameter\c!author:\space
       \sectionworldparameter\c!text}{}}}
    {\expanded{\writetolist[\v!chapter]
      {\sectionworldparameter\c!text}{}}}

  \def\ChapterAuthor{%
  	\doiftextelse%
  	{\sectionworldparameter\c!author}%
  	{\ss\tf\sectionworldparameter\c!author\crlf\vskip0.25em}
  	{}%
  }
  \def\ChapterTitle{{\ss\bfb\sectionworldparameter\c!text}}
  \def\ChapterSubTitle{%
  	\doiftextelse%
  	{\sectionworldparameter\c!subtitle}%
  	{\crlf\vskip0.2em\ss\bf\sectionworldparameter\c!subtitle}%
  	{}%
  }

\stopsetups

\setupsectionworld
  [chapter]
  [setups={chapter:list},
   author=]

\def\ChapterCommand#1#2%
  {\vbox{\ChapterAuthor\ChapterTitle\ChapterSubTitle}}

\let\ChapterAuthor\relax
\let\ChapterTitle\relax
\let\ChapterSubTitle\relax

\protect
% stop WS

\setuphead % unsure if we need this at all...
  [chapter]
  [incrementnumber=no,
   command=\ChapterCommand, 
   page=yes, 
   number=no, 
   align={flushleft,nothyphenated,verytolerant}, 
   style=,
   ]

\def\MyChapter#1#2#3{\startsectionworld[chapter][author={#1}, text={#2}, subtitle={#3}]}

\setuphead[section][
	page=no, 
	number=no, 
	align={flushleft,nothyphenated,verytolerant}, 
	style={\ss\bf}, 
	before={\blank}, after={\blank}]

\setuphead[subsection][
	page=no, 
	number=no, 
	align={flushleft,nothyphenated,verytolerant}, 
	style={\ss\tf}, 
	before={\blank}, after={\vskip0.5em}]


%% ToC
\definecombinedlist	[inhalt]
				[chapter]
				[level=chapter, placehead=no, 
				criterium=all,
				alternative=b,
				offset=none]
\setupcombinedlist  [inhalt] [partnumber=no]


%% Index

\def\Tindex#1{\index{#1}#1}

\def\MyIndexLine#1{#1\hfill}
\setupregister[index][n=2, balance=no, indicator=no, pagestyle=normal, textcommand=\MyIndexLine]


%% Misc

\def\dots{\thinspace.\thinspace.\thinspace.\thinspace}


% Header
\setupheader[text][state=stop, style={\ss\tfx}, frame=off, bottomframe=on]
\setupheadertexts[text][chapter][pagenumber]
\setupmarking[chapter][limittext={}]	

% Color
\setupinteraction[state=start, color=black, style={\tf}]
\setupcolors[state=start, rgb=no, cmyk=no]
\definecolor[grau][k=.1]
\setupbackground[
	background=screen, color=grau, 
	leftoffset=1em, rightoffset=1em,
	topoffset=0.5em, bottomoffset=0.5em]

% Tables and Lists
\setupTABLE[frame=off, split=yes, distance=1em]
\setuptabulate[indentnext=no, align=right]
\setupitemgroup[itemize][packed][indentnext=no]

\setupfootnotes[way=bypage, conversion=set 2] % use asterisk, dagger etc. for footnotes per page

\setupexternalfigures[directory={img}] % all figures are in ./img


\stopenvironment

Product

\startproduct prd_KR05
\project project_proceedings

%% PDF Setup

\input spec-tst
\setupinteraction[state=start,
	author={Hraban},
	title={Sample Proceedings},
	subtitle={}
]

%% Vorspann

\startfrontmatter
	\component c_00_titlepage
	\component c_00_imprint
\stopfrontmatter

%% Inhalt

\startbodymatter

	\setuppagenumbering[state=start]
% ToC
	{
	\setuppagenumbering[location=] % sswitch off page numbering on ToC page

	% neither chapter nor title seems to work here, same with \completeinhalt	
	{\noindent\ss\bfb Inhalt}
	\blank[3*big]
	
	\placeinhalt % ToC

	\page[left]
	}

	\setupheader[text][state=start]

	% each component is one chapter
	\component c_01_vorwort
	\component c_02_programm
	\component c_03_freiheit
	% etc.
\stopbodymatter

%% Appendix

\startbackmatter
	%\completeindex
	\component c_99_advertising
\stopbackmatter
\stopproduct

Sample Components

Chapter

\startcomponent c_00_sample
\product prd_KR05
\project project_proceedings

\language[en]

\MyChapter%
{Author}%
{Sample title \\with second line}%
{and subtitle}

\input tufte

\stopsectionworld % \start... is contained by \MyChapter
\stopcomponent

Title page

\startcomponent c_00_titlepage
\product prd_KR05
\project project_proceedings


\TextBig
\setuppagenumbering[state=stop]

\framed[height=\textheight, width=\textwidth, frame=on, align=center]{%
\startlines

{\sc Klingberger Reihe Nr.\,}5

\vfill

{\bfa Wertekonsens in Europa}

Die grundgesetzliche Behinderung
der Integration in Deutschland

\blank

{\bfa Consensus on Values in Europe}

The Constitutional Obstruction
of Integration in Germany

\vfill

\vfill

\framed[frame=off, width=\textwidth, align=middle]{\externalfigure[JBK_logo.pdf][width=30mm]}

Jugend- und Bildungsstätte Klingberg

\stoplines
}
\stopcomponent

Imprint

\startcomponent c_00_imprint
\product prd_KR05
\project project_proceedings

\page
	\TextNormal

{\tfx
\startlines
Dedication, Funding
\stoplines
}

\strut\vfill
\framed[frame=off, align=bottom]{
\startlines

{\sc Klingberger Reihe Nr.\,}5

{\tfx
Publisher

Copyright

typeset by {\it fiëé visuëlle} using open source software (\TEX, \CONTEXT)

printed in Germany

ISBN 978-3-
} % tfx
\stoplines
} % framed

\stopcomponent