-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6fdaab1
Showing
4 changed files
with
1,937 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
\ProvidesPackage{fix-unnumbered-sections} | ||
|
||
% This package is available at http://tex.stackexchange.com/q/33696/ | ||
% It patches the standard classes so that they treat unnumbered and numbered sections equally! (At least, I've tested it with the article class.) | ||
% As a result, even the unnumbered sections gets entries in the TOC and, when hyperref is loaded, they also get bookmarks as per the default hyperref setting for bookmarks. | ||
% Unnumbered sections can also have short titles for TOC and bookmark purposes, just like numbered sections. | ||
% | ||
% It works by pretending the unnumbered sections are deeper than \c@secnumdepth (in fact, just by assuming that they are 1000 (\@m) levels deep). | ||
% I believe there are no side effects to this... | ||
|
||
% We just pretend that \@ssect, which LaTeX uses to treat unnumbered [sub*]sections differently to (maybe) numbered ones (if they are no deeper than \c@secnumdepth levels), doesn't exist. | ||
% Instead, we always use \@sect, which LaTeX uses for numbered sections, and sections which would otherwise be numbered if they weren't deeper than \c@secnumdepth levels. | ||
|
||
|
||
\RequirePackage{etoolbox} | ||
\patchcmd{\@startsection}{\@ssect{#3}{#4}{#5}{#6}}{\@dblarg{\@sect{#1}{\@m}{#3}{#4}{#5}{#6}}}{}{\PackageError{fix-unnumbered-sections}{Unable to patch \string\@startsection; are you using a non-standard document class?}\@ehd} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
\NeedsTeXFormat{LaTeX2e} | ||
|
||
\ProvidesClass{homework}[2014/12/16 Class file for homework assignments] | ||
|
||
\LoadClassWithOptions{article} | ||
|
||
|
||
|
||
% ----- Options --------------------------------------------------------------- | ||
%\newcommand\@opnewpage{0} | ||
%\DeclareOption{newpage}{\renewcommand\@opnewpage{1}} | ||
%\newcommand\@oplargemargins{0} | ||
%\DeclareOption{largemargins}{\renewcommand\@oplargemargins{1}} | ||
%\ProcessOptions | ||
|
||
|
||
% ----- Packages -------------------------------------------------------------- | ||
|
||
% Better fonts with accents | ||
\RequirePackage[T1]{fontenc} | ||
|
||
% Required for starred commands | ||
\RequirePackage{suffix} | ||
|
||
\RequirePackage{parskip} | ||
|
||
% Math symbols | ||
\RequirePackage{amsmath} | ||
\RequirePackage{amsfonts} | ||
\RequirePackage{amsthm} | ||
\RequirePackage{amssymb} | ||
\RequirePackage{centernot} | ||
|
||
% Nice lists | ||
\RequirePackage{enumerate} | ||
\RequirePackage{enumitem} | ||
|
||
% Nice images, figures, and listings | ||
\RequirePackage{graphicx} | ||
\RequirePackage{grffile} | ||
\RequirePackage[all]{xy} | ||
\RequirePackage{wrapfig} | ||
\RequirePackage{fancyvrb} | ||
\RequirePackage{listings} | ||
|
||
% Conditionals | ||
\RequirePackage{ifthen} | ||
|
||
% Header & Page Setup | ||
\RequirePackage{fancyhdr} | ||
%\ifthenelse{\equal{\@oplargemargins}{1}}{}{\RequirePackage{fullpage}} | ||
\RequirePackage{fullpage} | ||
|
||
\RequirePackage[a4paper, | ||
hmargin=1.5cm, | ||
vmargin=1cm, | ||
includeheadfoot]{geometry} | ||
|
||
\setlength{\headheight}{12pt} | ||
\addtolength{\headsep}{0.7cm} | ||
\addtolength{\textheight}{-0.6cm} | ||
|
||
% Links | ||
\RequirePackage{hyperref} | ||
|
||
% ----- Questions ------------------------------------------------------------- | ||
\newcounter{questionCounter} | ||
\newcounter{partCounter}[questionCounter] | ||
|
||
|
||
% | ||
\WithSuffix\providecommand\assignment*{} | ||
\WithSuffix\renewcommand\assignment*[1]{% | ||
% Wrap in minipage so that we don't get a line break anywhere in between | ||
\begin{minipage}{\linewidth}% | ||
\setcounter{partCounter}{0}% | ||
\vspace{.2in}% | ||
\noindent{\bf \large Assignment #1}% | ||
\vspace{0.3em} \hrule \vspace{.1in}% | ||
\end{minipage} | ||
} | ||
|
||
|
||
|
||
% ----- Question Parts -------------------------------------------------------- | ||
|
||
\newenvironment{alphaparts}[0]{% | ||
\begin{enumerate}[label=\textbf{(\alph{partCounter})}]% | ||
}{\end{enumerate}} | ||
|
||
\newenvironment{arabicparts}[0]{% | ||
\begin{enumerate}[label=\textbf{\arabic{questionCounter}.\arabic{partCounter}})]% | ||
}{\end{enumerate}} | ||
|
||
\newcommand{\questionpart}[0]{\stepcounter{partCounter}\item} | ||
|
||
|
||
% ----- Answer Box ------------------------------------------------------------ | ||
|
||
\newcommand{\answerbox}[1]{% | ||
\begin{framed} | ||
\vspace{#1} | ||
\end{framed}} | ||
|
||
% ----- Page Setup ------------------------------------------------------------ | ||
|
||
% Use block style paragraphs | ||
\setlength{\parindent}{0pt} | ||
%\setlength{\parskip}{5pt plus 1pt} | ||
%\setlength{\parskip}{3pt plus 1pt} | ||
|
||
\def\indented#1{\list{}{}\item[]} | ||
\let\indented=\endlist | ||
|
||
% ----- Title & Header -------------------------------------------------------- | ||
% \pagestyle{empty} | ||
\pagestyle{fancy} | ||
|
||
\newcommand{\mysetupheader}{ | ||
% Setup header | ||
% \setlength{\headheight}{15.2pt} | ||
% \setlength{\headsep}{0.2in} | ||
\lhead{\hwclassshort{} -- \hwshorttitle{}}% | ||
\rhead{\hwauthor{}}% | ||
|
||
\renewcommand{\headrulewidth}{0.4pt} | ||
\renewcommand{\footrulewidth}{0.4pt} | ||
} | ||
|
||
%\if\@opanon% | ||
\renewcommand{\maketitle}[0]{% | ||
\mysetupheader | ||
|
||
% Setup hrule in header | ||
\renewcommand{\headrulewidth}{0pt} | ||
\headrule{} | ||
% Don't put header on first page | ||
\thispagestyle{plain} | ||
|
||
\begin{center} | ||
{\LARGE \hwtitle{}} | ||
|
||
{\Large \hwclass{}} | ||
|
||
Student: \hwauthor{} \hwauthorextra{} | ||
|
||
\end{center} | ||
\renewcommand{\headrulewidth}{0.4pt} | ||
} | ||
|
||
% ----- For usage with pandoc converted documents ----------------------------- | ||
|
||
\providecommand{\tightlist}{% | ||
\setlength{\itemsep}{1pt}\setlength{\parskip}{0pt}} | ||
|
||
% ----------------------------------------------------------------------------- |
Binary file not shown.
Oops, something went wrong.