-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle.sty
133 lines (111 loc) · 2.65 KB
/
style.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
\ifpdf % We're generating a pdf
\usepackage[pdftex]{color,graphicx}
\pdfpagewidth=\paperwidth
\pdfpageheight=\paperheight
\usepackage{thumbpdf}
%\pdfcompresslevel=9
\else
\usepackage[dvips]{graphicx}
\fi
\usepackage{times}
%
% fixes headings
%
\pagestyle{headings}
%
% correct page size
%
\setlength{\paperheight}{11in}
\setlength{\paperwidth}{8.5in}
\setlength{\textwidth}{6.5in}
\setlength{\textheight}{9in}
\setlength{\footskip}{40pt}
%
% One inch borders
%
\setlength{\hoffset}{0in}
\setlength{\voffset}{-1in}
%
% eliminates margin notes
%
\setlength{\oddsidemargin}{0in}
\setlength{\evensidemargin}{0in}
\setlength{\marginparwidth}{0in}
\setlength{\marginparpush}{0in}
\setlength{\marginparsep}{0in}
%
% Double space
%
\linespread{2}
%
% Places heading 1/2 inch from top of page
%
\setlength{\topmargin}{.5in}
\setlength{\headsep}{18pt}
%
% Last name and page number on every page
%
\usepackage{fancyhdr}
\fancypagestyle{norule}{ %
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}
\fancyhf{}
\pagestyle{headings}
\pagestyle{norule}
\newcommand{\headr}[1]{
\pagenumbering{arabic}
\fancyhead[RO]{#1 \ \thepage}
}
%%works cited
\newcommand{\bibent}{\noindent \hangindent 40pt}
\newenvironment{workscited}{\newpage {\centering Works Cited\\}}{\newpage}
%%title page
\newcommand{\titlep}[4]{
\pagebreak
\hspace{0pt}
\vfill
\centering #1 \\ \centering #2 \\ \centering #3 \\ \centering #4
\vfill
\hspace{0pt}
\pagebreak
}
%%sections
\newcommand{\sect}[1]{
\vspace{30pt} \noindent \textbf{#1} \vspace{30pt}
}
%===========python insert==========================
% Default fixed font does not support bold face
\DeclareFixedFont{\ttb}{T1}{txtt}{bx}{n}{12} % for bold
\DeclareFixedFont{\ttm}{T1}{txtt}{m}{n}{12} % for normal
% Custom colors
\usepackage{color}
\definecolor{deepblue}{rgb}{0,0,0.5}
\definecolor{deepred}{rgb}{0.6,0,0}
\definecolor{deepgreen}{rgb}{0,0.5,0}
\usepackage{listings}
% Python style for highlighting
\newcommand\pythonstyle{\lstset{
language=Python,
basicstyle=\ttm\linespread{1}\small,
otherkeywords={self}, % Add keywords here
keywordstyle=\ttb\color{deepblue}\small,
emph={MyClass,svmReg}, % Custom highlighting
emphstyle=\ttb\color{deepred}\small, % Custom highlighting style
stringstyle=\color{deepgreen}\small,
frame=tb, % Any extra options here
showstringspaces=false %
}}
% Python environment
\lstnewenvironment{python}[1][]
{
\pythonstyle
\lstset{#1}
}
{}
% Python for external files
\newcommand\pythonexternal[2][]{{
\pythonstyle
\lstinputlisting[#1]{#2}}}
% Python for inline
\newcommand\pythoninline[1]{{\pythonstyle\lstinline!#1!}}