%%% This is the style file for Full Circle publications by Open Court
%%% (c) Dirk Schlimm

%%% Current version: 2.0 (12/28/07)

%%% Changes:
%%% o 2.0 (12/28/07) Added some documentation, \chapterverso, \titlepage, etc.
%%% o 1.6  (9/24/07) Adjusted footnotes
%%% o 1.5b (9/22/07) Added some documentation
%%% o 1.5  (9/11/07) Index makes entry in toc
%%% o 1.4b (6/04/07) New toc commands for sections
%%% o 1.3 (1/02-05/06) Added facing pages mode
%%% o 1.2  (9/24/05) TrOrg footnote (TrEd might have to be changed, too!)
%%% o 1.1  (9/18/05) Enable language selectors
%%% o 1.0  (6/10/05)
%%% o 0.1  (4/26/05) Start

%%% Do not edit this file without renaming it!
%%%
%%% If you need to make changes for a particular publication make a
%%% copy of this file and rename it, e.g., fullcircle_CarnapVol3.sty

%%% This package is organized as follows:
%%%
%%%  1. Inclusion of additional packages 
%%%  2. Page layout
%%%  3. Chapter and section formatting
%%%  4. Commands for font selection
%%%  5. Footnotes
%%%  6. Header and footer
%%%  7. Bibliography commands
%%%  8. Two columns
%%%  9. Facing pages mode
%%% 10. Multilingual support
%%% 11. Index
%%% 12. Additional environments
%%%     - Quote, Epigraph

%
%%
%%% 1. Inclusion of additional packages =======================================
%%
%

\NeedsTeXFormat{LaTeX2e}[1999/12/01]

\let\oldpageref=\pageref

\ProvidesPackage{fullcircle}[2007/12/28 v2.0 a]

% Bibliography styles

\RequirePackage{natbib}            % For cite commands
\RequirePackage{bibunits}          % For chapter bibliographies (after natbib)

% Load multilanguage package for German and English
% Default language is the last one loaded (English)

\RequirePackage[german,french,english]{babel}

% This allows for hyphenation of German words with umlauts
\RequirePackage[T1]{fontenc}

% Other packages:

\RequirePackage{bodoni12gillsans}  % Bodoni12 and GillSans as default rm and sf
\RequirePackage{ifthen}            % For definition of: \ruledsec
\RequirePackage{multicol}          % For two column text

%\RequirePackage[splitrule]{footmisc}   % For footnotes

%
%%
%%% 2. Page layout ============================================================
%%
%

%
%% a) Dimensions and lengths --------------------------------------------------
%


%%% Set size of trimmed page {height}{width}{ratio}:

\settrimmedsize{9in}{6in}{*} % Grandits (6/07/05)

%%% Set size of type block {textheight}{textwidth}{ratio}:

\settypeblocksize{44pc}{28pc}{*} % Grandits (6/07/05): 45pc

%% Set spine margin {spine}{edge}{ratio}:

\setlrmargins{3pc}{*}{*} % Grandits (6/07/05): 3pc
% This seems a bit small to me, I had measured: 15mm

%% Set upper margin (trimtop to textbox)

\setulmargins{17.5mm}{*}{*} % Measured from CBH book.

%%% Set distances of header and footer:

\setheaderspaces{32pt}{*}{*} % Parameters: headdrop, headsep, ratio
% Grandits (6/07/05): 3pc(=36pt) to top of header. I had measured: 11.5mm

%\setheadfoot{\onelineskip}{3\onelineskip}

%%% Set size of margin notes:
%\setmarginnotes{17pt}{51pt}{\onelineskip}

%%% Positioning of trimmed page on stock:

% Set top of trimmed edge 1in from top of stock:

\setlength{\trimtop}{1in}

% Center page horizontally on stock:

\setlength{\trimedge}{\stockwidth}
\addtolength{\trimedge}{-\paperwidth}
\setlength{\trimedge}{.5\trimedge} 

\checkandfixthelayout

%% Set paragraph indentation

\setlength{\parindent}{20pt}

%
%% b) Title page --------------------------------------------------------------
%

% Parameters: Title, subtitle, author/editor information, extra info.

\newcommand{\titlepage}[4]{%
{% Begin local environment for title page. For: \parindent

\setlength{\parindent}{0pt}
\cleardoublepage\thispagestyle{empty}

%%%% Title box
\parbox[b][168pt]{\linewidth}{% was: 130pt
\BodoniFortyeight
#1
\BodoniThirty 
#2
}% End Title box
\vspace{4.5pt} %was: 12pt
\longrule
%%%% Author box
%\parbox[b][95pt]{\linewidth}{\GillSansEightteen\raggedright% was: 108pt
\parbox[b][108pt]{\linewidth}{\GillSansEightteen\raggedright% was: 195pt
#3\phantom{p}}% End Author box
\vspace{4pt}
\longrule
%%%% Extra box
\par\vspace{20pt}
\parbox[t][100pt]{\linewidth}
{\GillSansFourteen\raggedright
\phantom{a} % Need at least one thing here.
#4}%
%%%% Publisher
\vfill
\leavevmode
\hspace{8pt}
\includegraphicscn[width=49pt]{house.eps}\par
\vspace{5pt}
{\logonamefont Open Court}\par
\vspace{5pt}
{\logoaddrfont Chicago and LaSalle, Illinois}%
}% End local environment for titlepage

\newpage
}

% Sample:

% \titlepage{% Title
% The Concept of\\[2pt]
% Probability\\[2pt]}{% Subtitle
% in the Mathematical\\[-4pt]
% Representation of Reality}{% Author/editor info
% Hans Reichenbach\\
% \ \\
% \textit{Translated and edited by}\\
% Frederick Eberhardt and Clark Glymour
% }{% Extra info
% }


%
%%
%%% 3. Chapter and section formatting =========================================
%%
%

%
%% a) Numbering ---------------------------------------------------------------
%

\setcounter{secnumdepth}{4} % numbering depth for sections

%-1 -> empty
% 0 -> chapters
% 1 -> sections
% 2 -> subsections
% 3 -> subsubsections

%
%% b) Chapters ----------------------------------------------------------------
%

%% Define command for long rule under chapter headings

\newlength{\extendline} 
\setlength{\extendline}{\textwidth}
\addtolength{\extendline}{\oddsidemargin} % Exact length to margin
\addtolength{\extendline}{.125in}         % plus 1/8 inch

\newcommand{\longrule}{\hrule height 2pt width \extendline\relax}

%% Set chapter number (to be used before \chapter command)

\newcommand{\setchapternumber}[1]{%
\setcounter{chapter}{#1}\addtocounter{chapter}{-1}}

%% Redefine chapter command from memoir.cls to include boolean
%% variable strchp for starred version (used in chapter style numbered)

\newboolean{strchp}

\renewcommand\chapter{%
  \ifartopt\else
    \clearforchapter
    \thispagestyle{chapter}
    \global\@topnum\z@
  \fi
  \@afterindentfalse
  \@ifstar{\setboolean{strchp}{true}\@m@mschapter}{\setboolean{strchp}{false}\@m@mchapter}}

%% Defined and set global lengths (to be used in chapter styles)

\newlength{\chapterbox}\setlength{\chapterbox}{38mm} % was 41mm
\newlength{\chapterbeforeline}\setlength{\chapterbeforeline}{0pt}
\newlength{\chapterafterline}\setlength{\chapterafterline}{9pt}

%% Chaptersytle: unnumbered ----------

\makechapterstyle{unnumbered}{%
\renewcommand{\printchaptertitle}[1]{% From Guldo K, comp.text.tex
  \parbox[b][\chapterbox]{\linewidth}{\chaptitlefont ##1}%
\newline%
}

\setlength{\beforechapskip}{0pt}
\setlength{\midchapskip}{0pt}
\setlength{\afterchapskip}{0pt}

\renewcommand{\printchaptername}{}
\renewcommand{\printchapternum}{}
\renewcommand{\chapterheadstart}{}

% Chapter titles are set ragged right in
\renewcommand{\chaptitlefont}{\raggedright\chapterfont}

\renewcommand{\afterchaptertitle}{%
\vspace{\chapterbeforeline}
\longrule
\par\nointerlineskip\vskip 5pt\relax\par
\vspace{\chapterafterline}}

\makeevenfoot{plain}{}{\footerfont \thepage}{} % Footer on chapter page
\makeoddfoot{plain}{}{\footerfont \thepage}{} % Footer on chapter page

\makeatletter
\renewcommand*\thesection {\@arabic\c@section} % Without chapter number
\makeatother

}% End of \makechapterstyle{unnumbered}

%% Chaptersytle: numbered ----------

% Use of parbox, thanks to Guldo K, comp.text.tex

\makechapterstyle{numbered}{%
\makeatletter
\renewcommand{\printchaptertitle}[1]{% 
\ifthenelse{\boolean{strchp}}{% Starred version of chapter command
  \parbox[b][\chapterbox]{\linewidth}{\chaptitlefont ##1}%
\newline}{% Unstarred version of chapter command
  \parbox[b][\chapterbox]{\linewidth}{{\chapnamefont \@chapapp~\thechapter}\par
\vspace{\baselineskip}\chaptitlefont ##1}%
\newline}% End of \ifthenelse
}% End of \printchaptertitle
\makeatother

\setlength{\beforechapskip}{0pt}
\setlength{\midchapskip}{0pt}
\setlength{\afterchapskip}{0pt}

\renewcommand{\printchaptername}{}
\renewcommand{\printchapternum}{}
\renewcommand{\chapterheadstart}{}

\renewcommand{\chapnamefont}{\chapterfont}

% Chapter titles are set ragged right
\renewcommand{\chaptitlefont}{\raggedright\chapterfont}

\renewcommand{\afterchaptertitle}{%
\vspace{\chapterbeforeline}
\longrule
\par\nointerlineskip\vskip 5pt\relax\par
\vspace{\chapterafterline}}

\makeevenfoot{plain}{}{\footerfont \thepage}{} % Footer on chapter page
\makeoddfoot{plain}{}{\footerfont \thepage}{} % Footer on chapter page

\makeatletter
\renewcommand*\thesection {\thechapter.\@arabic\c@section} % With ch number
\makeatother

}% End of \makechapterstyle{numbered}

%% Chapter author

\newlength{\afterchapauthor}

\newcommand{\chapterauthor}[1]{%
\markright{#1}%
\parbox[t][20mm]{\textwidth}{\authorfont #1}%
% To see size of parbox, put \fbox around it.
}


%% Chapters on even pages --------------

% Define command for long rule under chapter headings

\newlength{\extension}
\setlength{\extension}{\oddsidemargin}
\addtolength{\extension}{.125in}

%\newlength{\extendline} 
\setlength{\extendline}{\textwidth}
\addtolength{\extendline}{\extension}
%\addtolength{\extendline}{\oddsidemargin} % Exact length to margin
%\addtolength{\extendline}{.125in}         % plus 1/8 inch
\newcommand{\longVrule}{\vrule height 2pt width \extendline\relax}

\newcommand{\chapteronverso}{% Change position of line under heading
\renewcommand{\afterchaptertitle}{%
\vspace{\chapterbeforeline}
\hspace{-\extension}\raise -2pt \hbox{\longVrule}
\par\nointerlineskip\vskip 5pt\relax\par
\vspace{\chapterafterline}}%
}

\newcommand{\chapteronrecto}{% Default
\renewcommand{\afterchaptertitle}{%
\vspace{\chapterbeforeline}
\longrule
\par\nointerlineskip\vskip 5pt\relax\par
\vspace{\chapterafterline}}%
}

%% c) Sections ----------------------------------------------------------------
%

%% Section numbers without chapter number

\setsecnumformat{\csname the#1\endcsname .\quad}


%% For sections:

\setsecindent{0pt} % No indentation of sections

\newlength{\sectitlen} % Variable used for length of rule over sections

\setbeforesecskip{-4.5ex plus -1ex minus -.2ex} % Original: -3.5ex

% \snugbox is by Victor Eijhout, eijkhout@cs.utk.edu, TUGboat 13, 1, 1992.
% It sets a box containing paragraphs as wide ``as it really is''
% The suggestion to use it here was by Piet van Oostrum (5/3/05)
\makeatletter
\def\snugbox{\hbox\bgroup\setbox\z@\vbox\bgroup
    \leftskip\z@
    \bgroup\aftergroup\make@snug
    \let\next=}
\def\make@snug{\par\sn@gify\egroup \box\z@\egroup}
\def\sn@gify
   {\skip\z@=\lastskip \unskip
    \advance\skip\z@\lastskip \unskip
    \unpenalty
    \setbox\z@\lastbox
    \ifvoid\z@ \nointerlineskip \else {\sn@gify} \fi
    \hbox{\unhbox\z@}\nointerlineskip
    \vskip\skip\z@
    }
\makeatother

\newcommand{\ruledsec}[1]{%
\settowidth{\sectitlen}{\sectionfont\snugbox{\raggedright #1}}% determ. length
\ifthenelse{\lengthtest\sectitlen<10pt}{\setlength{\sectitlen}{10pc}}{}
\ifthenelse{\lengthtest\sectitlen>\textwidth}{\setlength{\sectitlen}{10pc}}{}
% if the width is less than 10pt, make the rule 10pc wide
% if the width is more than the width of the text, ...  (???)
\noindent\parbox{\textwidth}{%
\hrule width \sectitlen height 2pt\relax\vspace{7pt}% Rule and dist. to heading
\sectionfont\raggedright #1}% End of \parbox
}
% Note: Without the \parbox a page break can occur between rule and title

\setsecheadstyle{\ruledsec} % Section style


%% For first section, without overline, use \firstsection 
%%                                       or \firstsection*

\newcommand{\norulesec}[1]{%
\vspace{-18pt}\sectionfont\raggedright #1}

\makeatletter
\newcommand{\firstsection}{\@ifstar{\@fsecstar}{\@fsec}}

\newcommand{\@fsec}[1]{%
\setsecheadstyle{\norulesec}% Set first section style
\section{#1}
\setsecheadstyle{\ruledsec}% Revert to default section style
}

\newcommand{\@fsecstar}[1]{%
\setsecheadstyle{\norulesec}% Set first section style
\section*{#1}
\setsecheadstyle{\ruledsec}% Revert to default section style
}
\makeatother


%
%% d) Subsections -------------------------------------------------------------
%

% Section numbers have trailing period, but subsection numbers don't

\setsechook{\dotaftersecnumformat}
\setsubsechook{\nodotaftersecnumformat}

\newcommand{\nodotaftersecnumformat}{%
  \setsecnumformat{\csname the##1\endcsname\quad}}

\newcommand{\dotaftersecnumformat}{%
  \setsecnumformat{\csname the##1\endcsname.\quad}}

% (2 Head)
\newcommand{\fcsubsec}[1]{%
% Subsection numbers without trailing period
\bfseries #1\newline
}

\setsubsecheadstyle{\fcsubsec}
\setaftersubsecskip{0pt}

% (2a Head)

\newcommand{\fcsubseconlynumber}[1]{%
\bfseries #1}

\newcommand{\subsectiononlynumber}{%
  \setsubsecheadstyle{\fcsubseconlynumber}%
  \subsection{}
}

% Revert to default subsections (2 Head). 
% Must be called after \subsectiononlynumber

\newcommand{\subsectionsnormal}{%
  \setsubsecheadstyle{\fcsubsec}
}

%
%% e) Subsubsections ----------------------------------------------------------
%

% (3b Head)
\newcommand{\fcsubsubsec}[1]{%
\scshape #1\quad\mbox{}} 
% The \mbox command is necessary here to have trailing space.

\setsubsubsecheadstyle{\fcsubsubsec}
\setaftersubsubsecskip{0pt}

%
%% f) Paragraphs --------------------------------------------------------------
%

% (3 Head)

\newcommand{\fcpara}[1]{%
\indent\bfseries\itshape #1}

\setparaheadstyle{\fcpara}
\setaftersubsubsecskip{0pt}

%
%% g) Table of contents -------------------------------------------------------
%

%% Set text for ToC headings

\renewcommand{\tocmark}{\markboth{\contentsname}{\contentsname}}

%% Commands for writing in the table of contents

% Disable default toc entries
\setcounter{tocdepth}{-1} % -1 stands for no entries

\newcommand{\tocchapter}[1]{%
  \addtocontents{toc}{\bigskip\noindent{\Large #1}\par}}
\newcommand{\tocchapterpage}[1]{%
  \addtocontents{toc}{\bigskip\noindent{\Large #1\hfill\thepage}\par}}

\newcommand{\tocauthor}[1]{%
  \addtocontents{toc}{\nobreak\noindent #1\par\medskip}}
\newcommand{\tocauthorpage}[1]{%
  \addtocontents{toc}{\nobreak\noindent #1\hfill{\Large\thepage}\par}}

% Disable Full Circle toc commands: for chapters and authors
\newcommand{\notocchaptercommands}{% 
  \renewcommand{\tocchapter}[1]{}
  \renewcommand{\tocchapterpage}[1]{}}

\newcommand{\notocauthorcommands}{% 
  \renewcommand{\tocauthor}[1]{}
  \renewcommand{\tocauthorpage}[1]{}}

% No numbering of chapters in toc
\renewcommand{\chapternumberline}[1]{}

% Set width of page numbers in toc
\setpnumwidth{3em}

% Set font of chapters in toc
\renewcommand{\cftchapterfont}{\normalfont\Large}
\renewcommand{\cftchapterpagefont}{\normalfont\Large}

\renewcommand{\cftchapterindent}{0pt}
\renewcommand{\cftchapternumwidth}{0pt}

% Sections in toc: no dots, spacing, . after section number

\renewcommand{\cftsectiondotsep}{\cftnodots}
\cftsetindents{section}{1em}{1.5em} % Indent, numwidth
\renewcommand{\cftsectionaftersnum}{.}

%
%%
%%% 4. Commands for font selection ============================================
%%
%

% Default font families (can be changed using \useComputerModernFont)

\newcommand{\ibxfamily}{\fontencoding{T1}\fontfamily{ibx}}
\newcommand{\ibdfamily}{\fontencoding{T1}\fontfamily{ibd}} % \rmdefault
\newcommand{\ibyfamily}{\fontencoding{T1}\fontfamily{iby}}

% Global labels (these are to be used in the new command definitions!)

% The code after the command corresponds to the code in the
% Typographic Spec Sheet (10/13/04)

\newcommand{\chapterfont}{\GillSansEightteenEightteen} % CH
\newcommand{\authorfont}{\GillSansFourteenEightteen}  % CA
\newcommand{\sectionfont}{\GillSansTwelveTwelve} % 1
\newcommand{\footerfont}{\GillSansTen}
\newcommand{\headerfont}{\GillSansNine}

\newcommand{\introductionfont}{\GillSansTen} % (facing pages intro)

\newcommand{\footnotefont}{\BodoniEight} % FTN
\newcommand{\epigraphfont}{\BodoniNine}

\newcommand{\logonamefont}{\BodoniFourteenEightteen}
\newcommand{\logoaddrfont}{\BodoniTwelveFourteen}

\newcommand{\bastardsubtitlefont}{\BodoniEightteen} % Not in specs

\newcommand{\indexfont}{\BodoniNineEleven}

%

\newcommand{\useComputerModernFont}{%
  \renewcommand*{\rmdefault}{cmr} % Select Computer Modern as rm default
  \renewcommand\sfdefault{phv}    % Select Helvetica as sf default
  \renewcommand{\ibxfamily}{\rmfamily}
  \renewcommand{\ibyfamily}{\rmfamily}
}

% GillSans 
% (mgs is selected as sfdefault in bodoni12gillsans.sty)

%\renewcommand\sfdefault{phv}  % Select Helvetica as sf default
%\renewcommand\sfdefault{mgs}  % Select GillSans as sf default

%\newcommand{\GillSans}[1]{\textsf{\Huge #1}}

\newcommand{\GillSansNine}{\sffamily\small}
\newcommand{\GillSansTen}{\sffamily\normalsize}
\newcommand{\GillSansTwelve}{\sffamily\large}
\newcommand{\GillSansElevenFourteen}{\sffamily\fontsize{11}{14pt}\selectfont}
\newcommand{\GillSansTwelveTwelve}{\sffamily\fontsize{12}{12pt}\selectfont}
\newcommand{\GillSansThirteen}{\sffamily\fontsize{13}{15pt}\selectfont}
\newcommand{\GillSansFourteen}{\sffamily\fontsize{14}{16pt}\selectfont}
%\sffamily\Large}
\newcommand{\GillSansFourteenEightteen}{\sffamily\fontsize{14}{18pt}\selectfont}
\newcommand{\GillSansSixteen}{\sffamily\fontsize{16}{20pt}\selectfont}
\newcommand{\GillSansEightteen}{\sffamily\fontsize{18}{20pt}\selectfont}
\newcommand{\GillSansEightteenEightteen}{\sffamily\fontsize{18}{18pt}\selectfont}
%\LARGE}

% Bodoni Six

\newcommand{\BodoniEight}{\ibxfamily\fontsize{8}{9pt}\selectfont}

% Bodoni Twelve (\rmdefault is \ibdfamily)

\newcommand{\BodoniEightTen}{\rmfamily\fontsize{8}{10pt}\selectfont}
\newcommand{\BodoniNine}{\rmfamily\fontsize{9}{10pt}\selectfont}
\newcommand{\BodoniNineEleven}{\rmfamily\fontsize{9}{11pt}\selectfont}
\newcommand{\BodoniThirteen}{\rmfamily\fontsize{13}{15pt}\selectfont} % Eds
%\newcommand{\BodoniFourteen}{\rmfamily\fontsize{14}{16pt}\selectfont}

% Bodoni Seventytwo

\newcommand{\BodoniTwelveFourteen}{%
\ibyfamily\fontsize{12}{14pt}\selectfont} % For logo on titlepage

\newcommand{\BodoniFourteenEightteen}{%
\ibyfamily\fontsize{14}{18pt}\selectfont} % For logo on titlepage

\newcommand{\BodoniEightteen}{%
\ibyfamily\fontsize{18}{18pt}\selectfont} % For subtitle on bastard title

\newcommand{\BodoniFortyeight}{\ibyfamily\fontsize{48}{48pt}\selectfont}

\newcommand{\BodoniThirty}{\ibyfamily\fontsize{30}{34pt}\selectfont}

% For compatibility reasons (do not use!)
\newcommand{\BdFourteen}{\rmfamily\Large}
\newcommand{\BdFortyeight}{\ibyfamily\fontsize{48}{48pt}\selectfont}
\newcommand{\BdThirty}{\ibyfamily\fontsize{30}{34pt}\selectfont}

%
%% 
%%% 5. Footnotes ==============================================================
%%
%

%
%% a) Appearance of default footnotes -----------------------------------------
%

% \pagefootnoterule, \mpfootnoterule, and \splitfootnoterule
% are provided by \RequirePackage[splitfootnotes]{footmisc}
% For split footnote, see CBH, 268

% Lengths regarding footnotes
% - the following three are defined in memoir, but overwritten by footmisc!

\setlength{\footmarkwidth}{0pt} % Set footnote indentation to 0pt
\setlength{\footmarksep}{0pt}   % Set footnote indentation to 0pt
\setlength{\footparindent}{0pt} % Set paragraph indentation to 0pt

\setlength{\skip\footins}{12pt} % Set distance bw. main text and footnotes

% Footnote text

\renewcommand{\foottextfont}{\footnotefont}%\footnotesize}

% Marker
% - the following is defined in memoir, but overwritten by footmisc!

\footmarkstyle{#1.\ }
%\renewcommand{\footnoterule}{}
% Hint from c.t.t. 2007/09/24:
% \setfootnoterule[\vfill]{3pt}{0.4\columnwidth}{\normalrulethickness} 
\setfootnoterule[\vfill]{3pt}{0pt}{0pt} 

%
%% b) New kinds of footnotes --------------------------------------------------
%

\newcommand{\editorialfootnotemark}{E}

\newfootnoteseries{Ed}
\renewcommand{\thefootnoteEd}{\editorialfootnotemark\arabic{footnoteEd}}
\footmarkstyleEd{#1.\ }

\newfootnoteseries{Org}
\renewcommand{\thefootnoteOrg}{\arabic{footnoteOrg}}
\footmarkstyleOrg{#1.\ }

\newfootnoteseries{OrgEd}
\renewcommand{\thefootnoteOrgEd}{\editorialfootnotemark\arabic{footnoteOrgEd}}
\footmarkstyleOrgEd{#1.\ }

\newfootnoteseries{Tr}
\renewcommand{\thefootnoteTr}{\arabic{footnoteTr}}
\footmarkstyleTr{#1.\ }

\newfootnoteseries{TrEd}
\renewcommand{\thefootnoteTrEd}{\editorialfootnotemark\arabic{footnoteTrEd}}
\footmarkstyleTrEd{#1.\ }


%
%%
%%% 6. Header and footer ======================================================
%%
%

% See TLC2, 218-219 for \markboth

%% Pagestyle: collection (e.g., "Carnap Brought Home") ----------

% Header of even pages: pagenumber ... chapter author (if one is defined)
% Header on odd pages:  [Optional] Chapter title ... pagenumber

\makepagestyle{collection}

\makeheadposition{collection}{flushright}{flushleft}{}{}
\makeevenhead{collection}{\headerfont\thepage}{}{\headerfont\rightmark}{}
\makeoddhead{collection}{\headerfont\leftmark}{}{\headerfont\thepage}{}
\makepsmarks{collection}{%
 \renewcommand{\chaptermark}[1]{\markboth{##1}{}}
 \renewcommand{\sectionmark}[1]{}
}
% Note: need the ##1 instead of #1
% Alternatively: \def\chaptermark##1{\markboth{##1}{}}
% Alternatively: \def\sectionmark##1{}

%% Pagestyle: chapsec ----------

% Header of even pages: pagenumber   ..  . chapter title
% Header on odd pages:  current section title ... pagenumber

\makepagestyle{chapsec}

\makeheadposition{chapsec}{flushright}{flushleft}{}{}
\makeevenhead{chapsec}{\headerfont\thepage}{}{\headerfont\leftmark}{}
\makeoddhead{chapsec}{\headerfont\rightmark}{}{\headerfont\thepage}{}
\makepsmarks{chapsec}{%
 \renewcommand{\chaptermark}[1]{\markboth{##1}{}}
 \renewcommand{\sectionmark}[1]{\markright{##1}}
}

%% Generic commands ----------

\newcommand{\headerleft}[1]{\markboth{#1}{}}
\newcommand{\headerright}[1]{\markright{#1}}

%
%%
%%% 7. Bibliography commands ==================================================
%%
%

%
%% a) Appearance of bibliography ----------------------------------------------
%

% No point between author and year (5th nonopt. parameter)
% See: natnotes.dvi

\bibpunct[, ]{(}{)}{;}{a}{}{;}    % natbib

% Set length of hanging of bibliography entries

\setlength{\bibhang}{\parindent}  % natbib was: {1.5\parindent}

% Set vertical spacing between bibliography entries

\setlength{\bibsep}{\itemsep} % \itemsep (natbib) or 0pt

% To change font of bibliography  use
% \newcommand{\bibfont}{\indexfont} % natbib

%
%% b) Bibliography styles: chapter, volume ------------------------------------
%

% Set defaults for chapter bibliography style and files

\newcommand{\bibostyle}{fullcircle}
\newcommand{\bibofiles}{}

% Change defaults for chapter bibliography style and files

\newcommand{\setbibstyle}[1]{\renewcommand{\bibostyle}{#1}}
\newcommand{\setbibfiles}[1]{\renewcommand{\bibofiles}{#1}}

% Command to create a bibliography at the end of a chapter

\newcommand{\chapterbib}{{\putbib}} % two braces are necessary
\newcommand{\volumebib}{}

% Modified from: bibunits.sty
% Appearance of bibliography is a section rather than a separate chapter

% This is only needed if \volumebib is used after \chapterbib to
% restore the original definition of \thebibliography
 \let\origthebibliography\thebibliography
 
\newcommand{\setbib}[1]{%
\ifthenelse{\equal{#1}{chapter}}{% Argument is: chapter
  \let\stdthebibliography\thebibliography
  \def\thebibliography{%
    \let\chapter\section
    \stdthebibliography}
  \bibliographyunit[\chapter]             
  \defaultbibliographystyle{\bibostyle}
  \defaultbibliography{\bibofiles}
  \renewcommand{\bibmark}{\markright{\bibname}} % Overwrite memoir.cls def
}{% Argument is something else (default is: volume)
  \bibliographyunit
  \renewcommand{\chapterbib}{} 
  \renewcommand{\volumebib}{%
    \let\thebibliography\origthebibliography
    \bibliographystyle{\bibostyle}
    \bibliography{\bibofiles}} 
  \renewcommand{\bibmark}{\markboth{\bibname}{\bibname}} % Overwr memoir.cls
  \renewcommand{\prebibhook}{\chapterauthor{}}  % Set space after rule
 } 
}% End of \setbib


%
%%
%%% 8. Two column mode ========================================================
%%
%

\newcommand{\startTwoColumns}{\begin{multicols}{2}}
\newcommand{\finishTwoColumns}{\end{multicols}}

%
%%
%%% 9. Facing pages mode ======================================================
%%
%

%
%% a) Sectioning commands -----------------------------------------------------
%

% This command continues the current line and then breaks the page.
%   Use this to adjust the pages of the facing English translation.
\newcommand{\cutpageline}{\vadjust{\newpage}}

% This command ends a page directly where the command occurs.
%   Should be used only rarely, since it can introduce excessive spacing
%   between words.
%\raggedbottom\renewcommand{\cutpage}{\pagebreak}
\def\cutpagehere{{\parfillskip0pt\relax\par}\newpage\noindent}

% The following commands are for breaking up an introduction so that
% it covers only the upper part of facing pages (see maintext.tex)
\newcommand{\cutintro}{{\parfillskip0pt\relax\par}}
\newcommand{\introlineright}{\par\hfill\rule{.5\textwidth}{.4pt}\par}
\newcommand{\introlineleft}{\par\noindent\rule{.5\textwidth}{.4pt}\par}
\newcommand{\introline}{\par\noindent\hfill\rule{.5\textwidth}{.4pt}\hfill\hbox{}\par}


%
%% b) Page numbering ----------------------------------------------------------
%

% Based upon: changepagenumbering.sty (Version 1.0, 9/24/05, Dirk Schlimm)

% Provides commands:
%
% \incrementpagebyone
% \incrementpagebytwo

\makeatletter

% Save \@outputpage macro

\let\mytempoutputpage\@outputpage

% Change page numbering to double counting

\newcommand{\incrementpagebytwo}{\g@addto@macro\@outputpage{\stepcounter{page}}}

% Reset page numbering 

\newcommand{\incrementpagebyone}{\let\@outputpage\mytempoutputpage}

\makeatother

%
%%
%%% 10. Multilingual support ==================================================
%%
%


% Language switches (courtesy of Bernd Buldt)

\newcommand{\slE}{\selectlanguage{english}}
\newcommand{\slG}{\selectlanguage{german}}
\newcommand{\slF}{\selectlanguage{french}}

\newcommand{\slGE}[1]{\slG{#1}\slE}
\newcommand{\slFE}[1]{\slF{#1}\slE}

\newcommand{\slEG}[1]{\slE{#1}\slG}

%
%%
%%% 11. Index =================================================================
%%
%

% Use \renewcommand{\indexname}{NewName} in the document to change the
% name of the index.

\makeindex % Generate .idx file. This must be converted into an .ind file
           % by makeindex. The index is printed in the text with \printindex

% Write index into table of contents and set space before index entries
\renewcommand{\preindexhook}{\chapterauthor{}} %\vspace{\afterchapauthor}}

%\showindexmarktrue % List index arguments in the margin of the text.

\onecolindexfalse % Two column index (default)
\indexintoc       % Index entry in table of contents (default)

% Set gutter between the two index columns
\setlength{\indexcolsep}{2pc} 

%% From memoir.cls (with changes!)

\makeatletter
\renewenvironment{theindex}{%
  \if@twocolumn
    \@restonecolfalse
  \else
    \@restonecoltrue
  \fi
  \ifonecolindex
    \onecolumn
    \chapter*{\indexname}
    \preindexhook
  \else
    \chapterstyle{unnumbered}% Added by ds
    \setlength{\columnsep}{\indexcolsep} % Must be here! ds
    \twocolumn[\@makeschapterhead{\indexname}
               \preindexhook]%
  \fi
  %\indexmark % Commented out by ds
  \markboth{\indexname}{\indexname}% Added by ds
  \setlength{\columnseprule}{\indexrule}
  \ifnoindexintoc\else
    \phantomsection
    %\addcontentsline{toc}{chapter}{\indexname} % Commented out by ds
                                                % Commented in by ds 9/11/07
    \tocchapterpage{\indexname}
  \fi
  \thispagestyle{chapter}\parindent\z@
  \parskip\z@ \@plus .3\p@\relax
  %\setlength{\columnsep}{-3cm}%{\indexcolsep}
  \let\item\@idxitem}
  {\if@restonecol\onecolumn\else\twocolumn\fi}
\makeatother

%
%%
%%% 12. Additional environments ===============================================
%%
%

%
%% a) Quote/quotation ---------------------------------------------------------
%

\renewenvironment{quote}%
{\begin{list}{}
  {\setlength{\leftmargin}{\parindent}
   \setlength{\rightmargin}{\parindent}
   \setlength{\topsep}{6pt}}
  \raggedright\item\relax}
{\end{list}}

\makeatletter
\renewenvironment{quotation}%
{\begin{list}{}
  {\setlength{\leftmargin}{\parindent}%
   \setlength{\rightmargin}{\parindent}%
   \setlength{\topsep}{6pt}%
   \setlength{\listparindent}{1.5em}%
   \setlength{\itemindent}{1.5em}%
   \setlength{\parsep}{\z@ \@plus\p@}\raggedright}%
   \item\relax}
{\end{list}}
\makeatother

% The following two environments oldquote and oldquotation are defined
% as the oringinal quote and quotation (from: article.cls).
% See TLC, p.145 for lists.

\makeatletter
\newenvironment{oldquotation}
               {\list{}{\listparindent 1.5em%
                        \itemindent    \listparindent
                        \rightmargin   \leftmargin
                        \parsep        \z@ \@plus\p@}%
                \item\relax}
               {\endlist}
\makeatother

\newenvironment{oldquote}
               {\list{}{\rightmargin\leftmargin}%
                \item\relax}
               {\endlist}


%
%% b) Epigraph ----------------------------------------------------------------
%

\setlength{\epigraphwidth}{.5\textwidth} % No rule between text and source
\setlength{\epigraphrule}{0pt} % No rule between text and source
\epigraphfontsize{\epigraphfont}

% Text is set by default ragged right.

% Use \textit{...} or \itshape to change shape to italics (this is not
% done by default, otherwise the source would be by default in
% italics, too).

%------------------------------------------------------------------------------
