]> code.communitydata.science - social-media-chapter.git/blob - paper/mako-mem.sty
Testing permissions
[social-media-chapter.git] / paper / mako-mem.sty
1 % Some article styles and page layout tweaks for the LaTeX Memoir class.
2 %
3 % Copyright 2009 Benjamin Mako Hill <mako@atdot.cc>
4 % Copyright 2008-2009 Kieran Healy <kjhealy@soc.duke.edu>
5
6 % Distributed as free software under the GNU GPL v3
7
8 % This file is heavily based on one by Kieran Healy
9 % available here: http://github.com/kjhealy/latex-custom-kjh/
10
11 \usepackage{lastpage}
12 \usepackage{datetime}
13
14 % blank footnote
15 % Use \symbolfootnote[0]{Footnote text} for a blank footnote. 
16 % Useful for initial acknowledgment note.
17 \long\def\symbolfootnote[#1]#2{\begingroup%
18 \def\thefootnote{\fnsymbol{footnote}}\footnote[#1]{#2}\endgroup}
19
20 % put a period after the section numbers
21 \setsecnumformat{\csname the#1\endcsname.\enspace}
22
23 % >> article-1 << 
24 \makechapterstyle{article-1}{
25  \renewcommand{\rmdefault}{ugm}
26  \renewcommand{\sfdefault}{phv}
27
28  \setsecheadstyle{\large\scshape}
29  \setsubsecheadstyle{\normalsize\itshape}
30  \renewcommand{\printchaptername}{}
31  \renewcommand{\chapternamenum}{}
32  \renewcommand{\chapnumfont}{\chaptitlefont}
33  \renewcommand{\printchapternum}{\chapnumfont \thechapter\space}
34  \renewcommand{\afterchapternum}{}
35  \renewcommand{\printchaptername}{\secheadstyle}
36  \renewcommand{\cftchapterfont}{\normalfont}
37  \renewcommand{\cftchapterpagefont}{\normalfont\scshape}
38  \renewcommand{\cftchapterpresnum}{\scshape}
39  \captiontitlefont{\small}
40  
41  % turn off chapter numbering
42  \counterwithout{section}{chapter}
43  \counterwithout{figure}{chapter}
44  \counterwithout{table}{chapter}
45  
46  % reduce skip after section heading
47  \setaftersecskip{1.2ex}
48  
49  \pretitle{\newline\centering \LARGE\scshape \MakeLowercase }
50  \posttitle{\par\vskip 1em}
51  \predate{\footnotesize \centering}
52  \postdate{\par\vskip 1em}
53  
54  % 'abstract' title, bigger skip from title
55  \renewcommand{\abstractname}{}
56  \abstractrunin
57
58 % set name of bibliography to 'references'
59 \renewcommand{\bibname}{References}
60 }
61
62 % >> article-2 <<
63 \makechapterstyle{article-2}{
64  \renewcommand{\rmdefault}{ugm}
65  \renewcommand{\sfdefault}{phv}
66
67  \setsecheadstyle{\large\scshape} 
68  \setsubsecheadstyle{\normalsize\itshape} 
69  \setaftersubsubsecskip{-1em}
70  \setsubsubsecheadstyle{\bfseries}
71  \renewcommand{\printchaptername}{} 
72  \renewcommand{\chapternamenum}{} 
73  \renewcommand{\chapnumfont}{\chaptitlefont} 
74  \renewcommand{\printchapternum}{\chapnumfont \thechapter\space} 
75  \renewcommand{\afterchapternum}{} 
76  \renewcommand{\printchaptername}{\secheadstyle}
77  \renewcommand{\cftchapterfont}{\normalfont} 
78  \renewcommand{\cftchapterpagefont}{\normalfont\scshape} 
79  \renewcommand{\cftchapterpresnum}{\scshape} 
80  \captiontitlefont{\small}
81  
82  % turn off chapter numbering
83  \counterwithout{section}{chapter}
84  \counterwithout{figure}{chapter}
85  \counterwithout{table}{chapter}
86  
87  % supress chapter numbers 
88  \maxsecnumdepth{chapter} 
89  \setsecnumdepth{chapter}
90  
91  % for numbered sections and subsections:
92  % (a) comment out the above stanza; (b) uncomment the one below
93  % \maxsecnumdepth{subsection} 
94  % \setsecnumdepth{subsection}
95
96  % reduce skip after section heading
97  \setaftersecskip{1.7ex}
98  
99  % Title flush left
100  \pretitle{\flushleft\LARGE \itshape}
101  \posttitle{\par\vskip 0.5em}
102  \preauthor{\flushleft  \large \lineskip 1em}
103  \postauthor{\par\lineskip 1em}
104  \predate{\flushleft\footnotesize\vspace{0.65em}}
105  \postdate{\par\vskip 1em}
106  
107  % 'abstract' title, bigger skip from title
108  \renewcommand{\abstractname}{Abstract:}
109  \renewcommand{\abstractnamefont}{\normalfont\small\bfseries}
110  \renewcommand{\abstracttextfont}{\normalfont\small}
111  \setlength{\absparindent}{0em}
112  \setlength{\abstitleskip}{-1.5em}
113  \abstractrunin
114
115  % set name of bibliography to 'references'
116  \renewcommand{\bibname}{References}
117 }
118
119
120 % >> article-3 <<
121 \makechapterstyle{article-3}{
122  \renewcommand{\rmdefault}{ugm}
123  \renewcommand{\sfdefault}{phv}
124
125  \setsecheadstyle{\large\sffamily\bfseries\MakeUppercase} 
126  \setsubsecheadstyle{\normalsize\itshape} 
127  \setaftersubsubsecskip{-1em}
128  \setsubsubsecheadstyle{\small\bfseries}
129  \renewcommand{\printchaptername}{} 
130  \renewcommand{\chapternamenum}{} 
131  \renewcommand{\chapnumfont}{\chaptitlefont} 
132  \renewcommand{\printchapternum}{\chapnumfont \thechapter\space} 
133  \renewcommand{\afterchapternum}{} 
134  \renewcommand{\printchaptername}{\secheadstyle}
135  \renewcommand{\cftchapterfont}{\normalfont} 
136  \renewcommand{\cftchapterpagefont}{\normalfont\scshape} 
137  \renewcommand{\cftchapterpresnum}{\scshape} 
138  \captiontitlefont{\small}
139
140  % turn off chapter numbering
141  \counterwithout{section}{chapter}
142  \counterwithout{figure}{chapter}
143  \counterwithout{table}{chapter}
144  
145  % supress chapter numbers 
146  \maxsecnumdepth{chapter} 
147  \setsecnumdepth{chapter}
148
149  % reduce skip after section heading
150  \setaftersecskip{1pt}
151  \setbeforesecskip{-1em}
152  
153  % 'abstract' title, bigger skip from title
154  % \renewcommand{\maketitle}{\{\preauthor \theauthor\} \hfill \thetitle}
155  \renewcommand{\maketitle}{
156     {\Large\sffamily\bfseries\MakeUppercase\thetitle} \hfill
157     {\Large\sffamily\MakeUppercase\theauthor}
158     \vskip 0.7em}
159  \renewcommand{\abstractname}{\normalfont\scriptsize\noindent}
160  \renewcommand{\abstracttextfont}{\normalfont\scriptsize}
161  \abstractrunin
162
163  % set name of bibliography to 'references'
164  \renewcommand{\bibname}{References}
165
166  \parindent 0pt
167
168 }
169
170 %%% Custom styles for headers and footers
171 %%% Basic 
172 \makepagestyle{mako-mem}
173 %\makeevenfoot{mako-mem}{\thepage}{}{}
174 %\makeoddfoot{mako-mem}{}{}{\thepage}
175 %\makeheadrule{mako-mem}{\textwidth}{\normalrulethickness}
176 \newcommand{\@makomarks}{%
177   \let\@mkboth\markboth
178   \def\chaptermark##1{%
179     \markboth{%
180       \ifnum \c@secnumdepth >\m@ne
181         \if@mainmatter
182           \thechapter. \ %
183         \fi
184       \fi
185       ##1}{}}
186   \def\sectionmark##1{%
187     \markright{##1}}
188 }
189 \makepsmarks{mako-mem}{\@makomarks}
190 \makepsmarks{mako-mem}{}
191 \makeevenhead{mako-mem}{}{}{\scshape\thepage}
192 \makeoddhead{mako-mem}{}{}{\scshape\thepage}
193
194 %%% version control info in footers; requires vc package 
195 % Make the style for vc-git revision control headers and footers
196 \makepagestyle{mako-mem-git}
197 \newcommand{\@gitmarks}{%
198   \let\@mkboth\markboth
199   \def\chaptermark##1{%
200     \markboth{%
201       \ifnum \c@secnumdepth >\m@ne
202         \if@mainmatter
203           \thechapter. \ %
204         \fi
205       \fi
206       ##1}{}}
207   \def\sectionmark##1{%
208     \markright{##1}}
209 }
210 \makepsmarks{mako-mem-git}{\@gitmarks}
211 \makeevenhead{mako-mem-git}{}{}{\scshape\thepage}
212 \makeoddhead{mako-mem-git}{}{}{\scshape\thepage}
213 \makeevenfoot{mako-mem-git}{}{\texttt{\footnotesize{\textcolor{BrickRed}{git revision \VCRevision\ on \VCDateTEX}}}}{}
214 \makeoddfoot{mako-mem-git}{}{\texttt{\footnotesize \textcolor{BrickRed}{git revision \VCRevision\ on \VCDateTEX}}}{}
215
216 %%% print a datestamp from ShareLaTeX
217 \makepagestyle{mako-mem-sharelatex}
218 \newcommand{\@slmarks}{%
219   \let\@mkboth\markboth
220   \def\chaptermark##1{%
221     \markboth{%
222       \ifnum \c@secnumdepth >\m@ne
223         \if@mainmatter
224           \thechapter. \ %
225         \fi
226       \fi
227       ##1}{}}
228   \def\sectionmark##1{%
229     \markright{##1}}
230 }
231 \makepsmarks{mako-mem-sharelatex}{\@slmarks}
232 \makeevenhead{mako-mem-sharelatex}{}{}{\scshape\thepage}
233 \makeoddhead{mako-mem-sharelatex}{}{}{\scshape\thepage}
234 \makeevenfoot{mako-mem-sharelatex}{}{\texttt{\footnotesize{\textcolor{BrickRed}{Buildstamp/Version:~\pdfdate}}}}{}
235 \makeoddfoot{mako-mem-sharelatex}{}{\texttt{\footnotesize{\textcolor{BrickRed}{Buildstamp/Version:~\pdfdate}}}}{}
236
237 %% Create a command to make a note at the top of the first page describing the
238 %% publication status of the paper. 
239 \newcommand{\published}[1]{% 
240    \gdef\puB{#1}} 
241    \newcommand{\puB}{} 
242    \renewcommand{\maketitlehooka}{% 
243        \par\noindent\footnotesize \puB} 
244
245 \makepagestyle{memo}
246 \makeevenhead{memo}{}{}{}
247 \makeoddhead{memo}{}{}{}
248
249 \makeevenfoot{memo}{}{\scshape \thepage/\pageref{LastPage}}{}
250 \makeoddfoot{memo}{}{\scshape \thepage/\pageref{LastPage}}{}
251
252
253 \endinput
254

Community Data Science Collective || Want to submit a patch?