1 % Some article styles and page layout tweaks for the LaTeX Memoir
 
   4 % Copyright 2009-2018 Benjamin Mako Hill <mako@atdot.cc>
 
   5 % Copyright 2008-2009 Kieran Healy <kjhealy@soc.duke.edu>
 
   7 % Distributed as free software under the GNU GPL v3
 
   9 % This file was originally based on one by Kieran Healy
 
  10 % available here: http://github.com/kjhealy/latex-custom-kjh/
 
  12 %%% Custom styles for headers and footers
 
  15 \makepagestyle{cdsc-page}
 
  16 %\makeevenfoot{cdsc-page}{\thepage}{}{}
 
  17 %\makeoddfoot{cdsc-page}{}{}{\thepage}
 
  18 %\makeheadrule{cdsc-page}{\textwidth}{\normalrulethickness}
 
  19 \newcommand{\@cdscmarks}{%
 
  23       \ifnum \c@secnumdepth >\m@ne
 
  32 \makepsmarks{cdsc-page}{\@cdscmarks}
 
  33 \makepsmarks{cdsc-page}{}
 
  34 \makeevenhead{cdsc-page}{}{}{\scshape\thepage}
 
  35 \makeoddhead{cdsc-page}{}{}{\scshape\thepage}
 
  37 %%% version control info in footers; requires vc package 
 
  38 % Make the style for vc-git revision control headers and footers
 
  39 \makepagestyle{cdsc-page-git}
 
  40 \newcommand{\@gitmarks}{%
 
  44       \ifnum \c@secnumdepth >\m@ne
 
  53 \makepsmarks{cdsc-page-git}{\@gitmarks}
 
  54 \makeevenhead{cdsc-page-git}{}{}{\scshape\thepage}
 
  55 \makeoddhead{cdsc-page-git}{}{}{\scshape\thepage}
 
  56 \makeevenfoot{cdsc-page-git}{}{\texttt{\footnotesize{\textcolor{BrickRed}{git revision \VCRevision\ on \VCDateTEX}}}}{}
 
  57 \makeoddfoot{cdsc-page-git}{}{\texttt{\footnotesize \textcolor{BrickRed}{git revision \VCRevision\ on \VCDateTEX}}}{}
 
  59 %%% print a datestamp from ShareLaTeX
 
  60 \makepagestyle{cdsc-page-overleaf}
 
  61 \newcommand{\@slmarks}{%
 
  65       \ifnum \c@secnumdepth >\m@ne
 
  74 \makepsmarks{cdsc-page-overleaf}{\@slmarks}
 
  75 \makeevenhead{cdsc-page-overleaf}{}{}{\scshape\thepage}
 
  76 \makeoddhead{cdsc-page-overleaf}{}{}{\scshape\thepage}
 
  77 \makeevenfoot{cdsc-page-overleaf}{}{\texttt{\footnotesize{\textcolor{BrickRed}{Buildstamp/Version:~\pdfdate}}}}{}
 
  78 \makeoddfoot{cdsc-page-overleaf}{}{\texttt{\footnotesize{\textcolor{BrickRed}{Buildstamp/Version:~\pdfdate}}}}{}
 
  80 %% Create a command to make a note at the top of the first page describing the
 
  81 %% publication status of the paper. 
 
  82 \newcommand{\published}[1]{% 
 
  85    \renewcommand{\maketitlehooka}{% 
 
  86        \par\noindent\footnotesize \puB} 
 
  88 \makepagestyle{cdsc-page-memo}
 
  89 \makeevenhead{cdsc-page-memo}{}{}{}
 
  90 \makeoddhead{cdsc-page-memo}{}{}{} 
 
  91 \makeevenfoot{cdsc-page-memo}{}{\scshape \thepage/\pageref{LastPage}}{}
 
  92 \makeoddfoot{cdsc-page-memo}{}{\scshape \thepage/\pageref{LastPage}}{}
 
  98 % Use \symbolfootnote[0]{Footnote text} for a blank footnote. 
 
  99 % Useful for initial acknowledgment note.
 
 100 \long\def\symbolfootnote[#1]#2{\begingroup%
 
 101 \def\thefootnote{\fnsymbol{footnote}}\footnote[#1]{#2}\endgroup}
 
 103 % put a period after the section numbers
 
 104 \setsecnumformat{\csname the#1\endcsname.\enspace}
 
 106 % set fonts to garamond and helvetica
 
 107 \renewcommand{\rmdefault}{ugm}
 
 108 \renewcommand{\sfdefault}{phv}
 
 110 % material shared between the two modes
 
 112 \setsubsecheadstyle{\normalsize\itshape} 
 
 113 \setaftersubsubsecskip{-1em}
 
 114 \setsubsubsecheadstyle{\small\bfseries}
 
 115 \renewcommand{\printchaptername}{} 
 
 116 \renewcommand{\chapternamenum}{} 
 
 117 \renewcommand{\chapnumfont}{\chaptitlefont} 
 
 118 \renewcommand{\printchapternum}{\chapnumfont \thechapter\space} 
 
 119 \renewcommand{\afterchapternum}{} 
 
 120 \renewcommand{\printchaptername}{\secheadstyle}
 
 121 \renewcommand{\cftchapterfont}{\normalfont} 
 
 122 \renewcommand{\cftchapterpagefont}{\normalfont\scshape} 
 
 123 \renewcommand{\cftchapterpresnum}{\scshape} 
 
 124 \captiontitlefont{\small}
 
 126 % turn off chapter numbering
 
 127 \counterwithout{section}{chapter}
 
 128 \counterwithout{figure}{chapter}
 
 129 \counterwithout{table}{chapter}
 
 131 % supress chapter numbers 
 
 132 \maxsecnumdepth{chapter} 
 
 133 \setsecnumdepth{chapter}
 
 135 % for numbered sections and subsections:
 
 136 % (a) comment out the above stanza; (b) uncomment the one below
 
 137 % \maxsecnumdepth{subsection} 
 
 138 % \setsecnumdepth{subsection}
 
 140 % set name of bibliography to 'references'
 
 141 \renewcommand{\bibname}{References}
 
 144 \makechapterstyle{cdsc-article}{
 
 146   % section heading sytle
 
 147   \setsecheadstyle{\large\scshape} 
 
 149  % reduce skip after section heading
 
 150   \setaftersecskip{1.7ex}
 
 153   \pretitle{\flushleft\LARGE \itshape}
 
 154   \posttitle{\par\vskip 0.5em}
 
 155   \preauthor{\flushleft  \large \lineskip 1em}
 
 156   \postauthor{\par\lineskip 1em}
 
 157   \predate{\flushleft\footnotesize\vspace{0.65em}}
 
 158   \postdate{\par\vskip 1em}
 
 160   % 'abstract' title, bigger skip from title
 
 161   \renewcommand{\abstractname}{Abstract:}
 
 162   \renewcommand{\abstractnamefont}{\normalfont\small\bfseries}
 
 163   \renewcommand{\abstracttextfont}{\normalfont\small}
 
 164   \setlength{\absparindent}{0em}
 
 165   \setlength{\abstitleskip}{-1.5em}
 
 168   % this is the default page style for chapters
 
 169   \pagestyle{cdsc-page}
 
 174 \makechapterstyle{cdsc-memo}{
 
 176   % section heading sytle
 
 177   \setsecheadstyle{\large\sffamily\bfseries\MakeUppercase} 
 
 179   % reduce skip after section heading
 
 180   \setaftersecskip{1pt}
 
 181   \setbeforesecskip{-1em}
 
 182   \setaftersubsecskip{1pt}
 
 183   \setbeforesubsecskip{-1em}
 
 184   % \setaftersubsubsecskip{1pt}
 
 185   % \setbeforesubsubsecskip{-1em}
 
 188   % 'abstract' title, bigger skip from title
 
 189   % \renewcommand{\maketitle}{\{\preauthor \theauthor\} \hfill \thetitle}
 
 190   \renewcommand{\maketitle}{
 
 191     {\Large\sffamily\bfseries\MakeUppercase\thetitle} \hfill
 
 192     {\Large\sffamily\MakeUppercase\theauthor}
 
 194   \renewcommand{\abstractname}{\normalfont\scriptsize\noindent}
 
 195   \renewcommand{\abstracttextfont}{\normalfont\scriptsize}
 
 198   % set name of bibliography to 'references'
 
 199   \renewcommand{\bibname}{References}
 
 203   % this is the default page style for chapters
 
 204   \pagestyle{cdsc-page-memo}