-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgectools.sty
87 lines (63 loc) · 2.25 KB
/
gectools.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
\RequirePackage{amsthm,amsmath, amssymb}
\RequirePackage{etoolbox}
\RequirePackage[breaklinks]{hyperref}
\RequirePackage{color}
\newtoggle{draft}
\DeclareOption{draft}{\toggletrue{draft}}
\DeclareOption{final}{\togglefalse{draft}}
\ExecuteOptions{draft} % Default
\ProcessOptions\relax
\newcommand{\secref}[1]{(\S\ref{#1})}
\newcommand{\doi}[1]{\href{http://dx.doi.org/#1}{doi:#1}} % Possibly update as in fftbib
\newcommand{\newevenside}{
\ifthenelse{\isodd{\thepage}}{\newpage}{
\newpage
\phantom{placeholder} % doesn't appear on page
\thispagestyle{empty} % if want no header/footer
\newpage
}
}
\newcommand{\isodate}[3]{%[year][month][day]
\number#1-%
\ifcase#2\or
01\or 02\or 03\or 04\or 05\or 06\or
07\or 08\or 09\or 10\or 11\or 12\fi -%
\ifcase#3\or
01\or 02\or 03\or 04\or 05\or 06\or 07\or 08\or 09\or 10\or
11\or 12\or 13\or 14\or 15\or 16\or 17\or 18\or 19\or 20\or
21\or 22\or 23\or 24\or 25\or 26\or 27\or 28\or 29\or 30\or
31\fi}
\newcommand{\isotoday}{\isodate{\year}{\month}{\day}}
% Working annotations
\newcommand{\note}[1]{[{\color{blue}#1}]}
\newcommand{\todo}[1]{\note{To do: #1}}
\newcommand{\checked}{\ensuremath{{{}^{\color{blue}\checkmark}}}}
\newcommand{\error}{{\ensuremath{{}^{\color{red}\times}}}}
\newcommand{\verify}{{\ensuremath{{}^{\color{red}?}}}}
\newcommand{\hidenotes}{
\renewcommand{\note}[1]{}
\renewcommand{\todo}[1]{}
\renewcommand{\checked}{}
\renewcommand{\error}{}
\renewcommand{\verify}{}
}
% Handy macro for empty title and other bibtex fields.
% Suppreses warnings and period (Because not empty and looks like punctuation)
\def\emptyfield?{}
\newcommand{\addcitationneeded}{
\makeatletter
\apptocmd{\thebibliography}{{\global\c@NAT@ctr -1\relax}}{}{}
\AtBeginDocument{\nocite{???}}
\makeatother
}
\makeatletter
\usepackage{etoolbox}
\newcommand{\citem}[1]{%
\def\nextitem{\def\nextitem{, }}% Separator
\renewcommand*{\do}[1]{\nextitem\citeauthor{##1} (\citeyear{##1})\,{\cite{##1}}}% How to process each item
\docsvlist{#1}% Process list
}
% Makes natbib not link names or years.
%http://tex.stackexchange.com/questions/67423/how-to-force-hyperref-to-reference-only-cite-and-not-citeauthor-or-citeyear
\pretocmd{\NAT@citexnum}{\@ifnum{\NAT@ctype>\z@}{\let\NAT@hyper@\relax}{}}{}{}
\endinput