forked from pibook/styles
-
Notifications
You must be signed in to change notification settings - Fork 4
/
bringhurstA5.sty
141 lines (121 loc) · 5.25 KB
/
bringhurstA5.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
%% Bringhurst book style "the elements of typographic style"
% define book layout:
\setstocksize{22cm}{15cm}
\settrimmedsize{21cm}{14cm}{*}
\settypeblocksize{36\onelineskip}{23pc}{*}
%\setlength{\trimtop}{0pt}
\setlength{\trimtop}{0.5cm}
\setlength{\trimedge}{0.5cm}
%\setlength{\trimedge}{\stockwidth}
%\addtolength{\trimedge}{-\paperwidth}
\setlrmargins{*}{3.3cm}{*}
\setulmargins{3\onelineskip}{*}{*}
\setheadfoot{\onelineskip}{2\onelineskip}
\setheaderspaces{\onelineskip}{*}{*}
\setmarginnotes{20pt}{53pt}{\onelineskip}
\checkandfixthelayout[lines]
%% Bringhurst chapter style
\makechapterstyle{bringhurst}{%
\renewcommand{\chapterheadstart}{}
\renewcommand{\printchaptername}{}
\renewcommand{\chapternamenum}{}
\renewcommand{\printchapternum}{}
\renewcommand{\afterchapternum}{}
\renewcommand{\printchaptertitle}[1]{%
\raggedright\Large\scshape\MakeLowercase{##1}}
\renewcommand{\afterchaptertitle}{%
\vskip\onelineskip \hrule\vskip\onelineskip}
}
%% Section title style
\setsecheadstyle{\raggedright\scshape\MakeLowercase}%
\setbeforesecskip{-\onelineskip}%
\setaftersecskip{\onelineskip}%
%% Subsection title style
\setsubsecheadstyle{\sethangfrom{\noindent ##1}\raggedright\itshape}%
\setbeforesubsecskip{-\onelineskip}%
\setaftersubsecskip{\onelineskip}%
%% %% Bringhurst page style
\makepagestyle{bringhurst}%
\makeevenfoot{bringhurst}{\thepage}{}{}%
\makeoddfoot{bringhurst}{}{}{\thepage}%
%% The following makes titles align with any marginal notes,
\newlength{\pwlayi}
\setlength{\pwlayi}{\headsep}%
\addtolength{\pwlayi}{\topskip}%
\addtolength{\pwlayi}{7.3\onelineskip}%
%% The following new macro \bringpicr{text} puts text into a minipage of width
%% \marginparwidth, typeset raggedright in an italic font, and puts
%% the top left of the Captions minipage at the position (\marginparsep, -\pwlayi)
%% in a zero width picture.
\newcommand{\bringpicr}[1]{%
\setlength{\unitlength}{1pt}%
\begin{picture}(0,0)%
\put(\strip@pt\marginparsep, -\strip@pt\pwlayi){%
\begin{minipage}[t]{\marginparwidth}%
\raggedright\itshape #1%
\end{minipage}}%
\end{picture}%
}%
%%% However, we need a different picture for the left as the text needs
%% to be typeset raggedleft with the right of the text 17pt from the left of
%% the typeblock. I will use the length \pwlayii to calculate the sum of
%% \marginparsep and \marginparwidth. Hence the following macros:
%% The new macro \bringpicl{text} puts text into a minipage of width
%% \marginparwidth, typeset raggedleft in an italic font, and puts the top left of
%% the minipage at the position (-(\marginparsep + \marginparwidth), -\pwlayi)
%% in a zero width picture.
\newlength{\pwlayii}
\setlength{\pwlayii}{\marginparsep}%
\addtolength{\pwlayii}{\marginparwidth}%
\newcommand{\bringpicl}[1]{%
\setlength{\unitlength}{1pt}%
\begin{picture}(0,0)%
\put(-\strip@pt\pwlayii, -\strip@pt\pwlayi){%
\begin{minipage}[t]{\marginparwidth}%
\raggedleft\itshape #1%
\end{minipage}}%
\end{picture}%
}%
%% Now we can proceed with the remainder of the pagestyle specification.
%% The next bit puts the chapter and section titles into the \...mark macros.
\makepsmarks{bringhurst}{%
\def\chaptermark##1{\markboth{##1}{##1}}%
\def\sectionmark##1{\markright{##1}}%
}%
%% Finally, specify the evenhead using \bringpicl with the section title as its
%% argument, and the oddhead using \bringpicr with the chapter title as its argument.
\makeevenhead{bringhurst}{\bringpicl{\rightmark}}{}{}%
\makeoddhead{bringhurst}{}{}{\bringpicr{\leftmark}}%
%% The captions to figures and tables are set in a small sans font and are
%% neither named nor numbered, and there is no LoF or LoT. Setting the caption
%% titles in the desired font is simple:
%% \captiontitlefont{\small\sffamily}%
%% There are two options regarding table and figure captioning: either use the \legend
%% command (which produces an anonymous unnumbered title) instead of the \caption
%% command, or use the \caption command with a modified definition. Just in case the
%% design might change at a later date to required numbered captions, it’s probably best to
%% use a modified version of \caption. In this case this is simple, just give the \caption
%% command the same definition as the \legend command.
%% \let\caption\legend
%% For fine typesetting you may wish to change the style of particular captions.
%% The default style for a single line caption works well, but for a caption with
%% two or three lines either the centering or centerlastline style might look better.
%% A very long caption is again probably best done in a block paragraph style. Something like:
%%
%%
%% \begin{figure*}
%% \captiontitlefont{\small\sffamily}
%% \captionstyle{\centerlastline}
%% ...
%% \legend{...} \label{...}
%% \end{figure*}
%%
%%
%% The ToC is typeset raggedright with no leaders and the page numbers
%% coming immediately after the chapter title. This is specified via:
\renewcommand{\cftchapterfont}{\normalfont}%
\renewcommand{\cftchapterpagefont}{\normalfont}%
\renewcommand{\cftchapterpresnum}{\bfseries}%
\renewcommand{\cftchapterleader}{}%
\renewcommand{\cftchapterafterpnum}{\cftparfillskip}%
\endinput