-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathusfassignment.sty
More file actions
167 lines (146 loc) · 6.15 KB
/
usfassignment.sty
File metadata and controls
167 lines (146 loc) · 6.15 KB
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
\ProvidesPackage{usfassignment}[2013/09/13 USF Assignment Templates]
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\usepackage{fourier} % Use the Adobe Utopia font for the document - comment this line to return to the LaTeX default
\usepackage[english]{babel} % English language/hyphenation
\usepackage{amsmath,amsfonts,amsthm,amssymb} % Math packages
\usepackage{siunitx} % SI Unit package
\usepackage{graphicx}
\usepackage{booktabs} % tables rules
\usepackage{multirow} % table multirows
\usepackage{float} % Use [H] to force figure not float
\usepackage[section]{placeins} % prevent figures to appear in another section
\usepackage[vlined,lined,boxed,commentsnumbered]{algorithm2e}
\usepackage{sectsty} % Allows customizing section commands
\allsectionsfont{\centering \normalfont\scshape} % Make all sections centered, the default font and small caps
%\setlength\parindent{0pt} % Removes all indentation from paragraphs - comment this line for an assignment with lots of text
% Font Setting
% \usepackage{fontspec}
% \setmainfont{Times New Roman}
% \setmainfont{STIXGeneral}
% \setsansfont{Arial}
% \setmonofont{Courier New}
% -----------------------------------------------------------------------------
% TITLE SECTION
% -----------------------------------------------------------------------------
\newcommand{\horrule}[1]{\rule{\linewidth}{#1}} % Create horizontal rule command with 1 argument of height
% Write
\newcommand{\settitle}[1]{
\gdef\@thetitle{#1}
\title{
\horrule{0.5pt} \\[0.4cm] % Thin top horizontal rule
\huge #1 \\ % The assignment title
\horrule{2pt} \\[1.0cm] % Thick bottom horizontal rule
}
}
\newcommand{\setauthor}[1]{
\gdef\@theauthor{#1}
\author{#1}
}
\newcommand{\setcourse}[1]{\gdef\@thecourse{#1}}
% Read
\makeatletter
\def\gettitle{\@thetitle}
\def\getauthor{\@theauthor}
\def\getcourse{\@thecourse}
\makeatother
\date{\normalsize\today} % Today's date or a custom date
% --------------------
% Quote Style
% --------------------
\usepackage{tikz}
\usetikzlibrary{backgrounds}
\makeatletter
\tikzset{%
fancy quotes/.style={
text width=\fq@width pt,
align=justify,
inner sep=.2em,
anchor=north west,
minimum width=\textwidth,
},
fancy quotes width/.initial={.8\textwidth},
fancy quotes marks/.style={
scale=2,
text=white,
inner sep=0pt,
},
fancy quotes opening/.style={
fancy quotes marks,
},
fancy quotes closing/.style={
fancy quotes marks,
},
fancy quotes background/.style={
show background rectangle,
inner frame xsep=0pt,
background rectangle/.style={
fill=gray!25,
rounded corners,
},
}
}
\newenvironment{fancyquotes}[1][]{%
\noindent
\tikzpicture[fancy quotes background]
\node[fancy quotes opening,anchor=north west] (fq@ul) at (0,0) {$``$};
\tikz@scan@one@point\pgfutil@firstofone(fq@ul.east)
\pgfmathsetmacro{\fq@width}{\textwidth - 2*\pgf@x}
\node[fancy quotes,#1] (fq@txt) at (fq@ul.north west) \bgroup}
{\egroup;
\node[overlay,fancy quotes closing,anchor=east] at (fq@txt.south east) {''};
\endtikzpicture}
\makeatother
% --------------------
% Header and Footer
% --------------------
\usepackage{fancyhdr} % Custom headers and footers
\pagestyle{fancyplain} % Makes all pages in the document conform to the custom headers and footers
\fancyhead[L]{\normalfont\normalsize\textsc{\getcourse}} % Class
\fancyhead[R]{\normalfont\normalsize\textsc{\getauthor}} % Author
\fancyfoot[L]{} % Empty left footer
\fancyfoot[C]{} % Empty center footer
\fancyfoot[R]{\thepage} % Page numbering for right footer
\renewcommand{\headrulewidth}{0pt} % Remove header underlines
\renewcommand{\footrulewidth}{0pt} % Remove footer underlines
\setlength{\headheight}{13.6pt} % Customize the height of the header
\numberwithin{equation}{section} % Number equations within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
\numberwithin{figure}{section} % Number figures within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
\numberwithin{table}{section} % Number tables within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
% --------------------
% Code
% --------------------
\usepackage{listings}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{CommentGreen}{rgb}{0,.6,0}
\definecolor{mauve}{rgb}{0.58,0,0.82}
\lstset{
escapechar=@, % include LaTeX code between `@' characters
keepspaces, % needed to preserve spacing with lstinline
showstringspaces=false,
basicstyle=\footnotesize\ttfamily\bfseries,
showspaces=false, % show spaces adding particular underscores
showstringspaces=false, % underline spaces within strings
showtabs=false, % show tabs within strings adding particular underscores
frame=single, % adds a frame around the code
tabsize=4, % sets default tabsize to 2 spaces
captionpos=b, % sets the caption-position to bottom
breaklines=true, % sets automatic line breaking
breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
title=\lstname, % show the filename of files included with \lstinputlisting;
% also try caption instead of title
numbers=left, % where to put the line-numbers
numberstyle=\tiny\color{gray}, % the style that is used for the line-numbers
stepnumber=1, % the step between two line-numbers. If it's 1, each line
% will be numbered
numbersep=5pt, % how far the line-numbers are from the code
backgroundcolor=\color{white}, % choose the background color. You must add \usepackage{color}
rulecolor=\color{black}, % if not set, the frame-color may be changed on line-breaks within
% not-black text (e.g. commens (green here))
keywordstyle=\color{blue}, % keyword style
keywordstyle=[1]\color{blue}, % instructions
keywordstyle=[2]\color{magenta}, % directives
keywordstyle=[3]\color{red}, % registers
commentstyle=\color{CommentGreen},
stringstyle=\color{mauve}, % string literal style
}
\endinput