-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathnserc-appendix.cls
executable file
·133 lines (116 loc) · 4.16 KB
/
nserc-appendix.cls
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
%% --------------------------------------
%% NSERC Appendix class
%% (C) 2011-2018 Sylvain Hallé
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is Sylvain Hallé.
%%
%% Usage notes
%% -----------
%% For instructions on how to use this class, see the file example.tex
%% provided with this package. Most of its content is self-explanatory.
%% --------------------------------------
%% ------------------------
%% Declarations
%% ------------------------
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{nserc-appendix}
[2018/12/05 v1.4 Classe annexe CRSNG par Sylvain Hallé]
%% ------------------------
%% Definition of the language parameters
%% ------------------------
\def\@langdemande{english}
\def\@inlinerefs{false}
\DeclareOption{french}{\def\@langdemande{french}}
\DeclareOption{english}{\def\@langdemande{english}}
\DeclareOption{inlinerefs}{\def\@inlinerefs{true}}
\DeclareOption*{%
\PassOptionsToClass{\CurrentOption}{article}%
}
\ProcessOptions
\ifx\pdfoutput\undefined
\LoadClass[letterpaper,onecolumn,dvips]{article}
\else
\LoadClass[letterpaper,onecolumn,pdftex]{article}
\fi
\RequirePackage[sort,square,numbers]{natbib} %% Format bibliography
\RequirePackage[utf8]{inputenc} %% Use UTF-8 in input files
\RequirePackage{lastpage} %% To get number of last page
\RequirePackage[T1]{fontenc} %% Type-1 font encoding
\RequirePackage{microtype} %% Better handling of typo
\RequirePackage{fourier} %% Sans-serif heading font
\RequirePackage{berasans} %% Serif text font
\RequirePackage{fancyhdr} %% Define header/footer
\RequirePackage{geometry} %% Change page margins
\RequirePackage{ifthen} %% Required to evaluate conditions
\RequirePackage[normalem]{ulem} %% For non-ugly underlining
\RequirePackage[calcwidth]{titlesec}
%% Prevents heading and single lines to be split across pages
\widowpenalty=1000
\clubpenalty=1000
%% Get parameters passed at package instantiation
\newcommand{\nsercname}[1]{\def\@nname{#1}}
\newcommand{\nsercpin}[1]{\def\@npin{#1}}
%% Get commands to space section titles
\def\@sectspacing{10pt}
\newcommand{\setsectionspacing}[1]{\def\@sectspacing{#1}}
\ifthenelse{\equal{\@langdemande}{french}}{%
\setlength{\parskip}{8pt}
\setlength{\parindent}{0pt}
\RequirePackage[french]{babel}
}{%
\setlength{\parskip}{0pt}
\RequirePackage[english]{babel}
}
%% Set page dimensions
\geometry{hmargin=.75in,vmargin=.75in}
%% Set interligne
\renewcommand{\baselinestretch}{1}
%% Set headers and footers
\fancypagestyle{plain}{%
\fancyhf{}
\fancyhead[L]{\footnotesize Page \thepage}%/\pageref{LastPage}}
\fancyhead[R]{\footnotesize \@nname~$\bullet$~\@npin}
\renewcommand{\footrulewidth}{0pt}
\renewcommand{\headrulewidth}{0.4pt}%
}
%% Redefine title
\renewcommand\maketitle{%
\pagestyle{plain}
{\noindent\sf\bfseries\Large\@title}
\vskip 8pt
}
%% Redefine section heading
\titleformat{\section}{\sf\bfseries}{\thesection.\quad}{0pt}{}{}
%% Redefine sub-section heading
\renewcommand\thesubsection{\alph{subsection})}
\titleformat{\subsection}[block]{}{\thesubsection}{.5em}{}[\vspace{-2em}\rule{\titlewidth}{0.75pt}]
%% Redefine paragraph
\titleformat{\paragraph}[runin]{\bfseries}{\quad}{0pt}{}{}
%% ------------------------------
%% New: subsubsubsection
%% ------------------------------
\newcommand\subsubsubsection[1]{%
\noindent{\textit{#1}}
}
%% ------------------------------
%% So that the bibliography environment in the document
%% uses the proper heading
%% ------------------------------
\renewcommand\bibsection{\section*{\refname}}
% Hack: to compress bibitems
\makeatletter
\newcommand{\oldbibitem}[2][]{}
\let\oldbibitem\bibitem
\renewcommand{\bibitem}[2][]{\oldbibitem[#1]{#2} \vskip -4pt}
\makeatother
%% :mode=latex:wrap=none: