%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% CSC 208 Homework Style File
% Peter-Michael Osera
% osera@cs.grinnell.edu
% Cyrus Liu
% liuyaun@cs.grinnell.edu
%
% Style file used for the homework.  To use this, place this .sty file in the
% same directory as your .tex source file and ensure that the command:
%
%   \usepackage{csc208}
%
% is included at the top of the file.  Also make sure that you define the
% \theauthor and \thedocument macros in your source file.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{csc208hw}[%
  2024/01/23 CSC 208-01 Homework Style File
]

%%%%% Document Information Macros %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\textmacro}[1]{#1\xspace}
\newcommand{\theclassnumber}{\textmacro{CSC 208-01}}
\newcommand{\thesemester}{\textmacro{24sp}}
\newcommand{\theclasstitle}{\textmacro{Discrete Structures}}
\newcommand{\theinstructor}{\textmacro{Cyrus Liu}}
\newcommand{\thedoctitle}{\theclassnumber{} (\thesemester{})---\thedocument{}}

%%%%% General Packages %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{enumitem}
\usepackage{microtype}
\usepackage{MnSymbol}
\usepackage{xspace}

%%%%% Page Formatting %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage[
  top=1in,
  bottom=1in,
  left=1in,
  right=1in,
  includefoot,
  paperwidth=8.5in,
  paperheight=11in
]{geometry}

\usepackage{fancyhdr}
\setlength{\headheight}{15.2pt}
\pagestyle{fancy}

\fancyhf{}
\fancyhead[l]{\emph{\thedoctitle{}}}
\fancyhead[r]{\emph{\theauthor{}}}
\fancyfoot[c]{\small\thepage}

%%%%% PDF Metadata %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage[pdftex]{hyperref}
\hypersetup{%
  pdftitle={\thedoctitle{}},
  pdfauthor={\theauthor{}},
  bookmarksnumbered=true,
  bookmarksopen=true,
  bookmarksopenlevel=1,
  hidelinks,
  naturalnames=true,
  pdfstartview=Fit,
  pdfpagemode=UseOutlines,
  pdfpagelayout=TwoPageRight,
  unicode=true
}

%%%%% Basic Macros %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\eg}{\emph{e.g.}\@\xspace}
\newcommand{\ie}{\emph{i.e.}\@\xspace}
\newcommand{\etc}{\emph{etc.}\@\xspace}
\newcommand{\etal}{\emph{et\ al.}\@\xspace}

\newcommand{\hint}[1]{(\emph{Hint}: #1)}

\newtheorem{claim}{Claim}
\newtheorem{invariant}{Invariant}
\newtheorem{defn}{Definition}

\newcounter{ProblemCounter}
\newcommand{\problem}[1]{%
  \stepcounter{ProblemCounter}\paragraph{Problem \theProblemCounter{} (#1)}
}

\newcommand{\answerbelow}{\vspace{1em}\hrule}

%%%%% Title Page Macro %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newenvironment{titlepagecontent}{
  \begin{center}
    \textbf{\thedoctitle{}} \\
    \theauthor{} \\
    \vspace{1in}

    \begin{minipage}{0.75\textwidth}
}{
    \end{minipage}
  \end{center}
}
