Last active
July 25, 2017 01:49
-
-
Save balos1/3e364dccded3b75c4cad5e8c8f898958 to your computer and use it in GitHub Desktop.
LaTex package for creating beautiful homework.
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
\NeedsTeXFormat{LaTeX2e}[] | |
\ProvidesPackage{homework}[2017/03/07 Homework] | |
\RequirePackage{amsmath} | |
\RequirePackage{extramarks} | |
\RequirePackage{stackengine} | |
%% 'sans serif' option | |
\DeclareOption{sans}{ | |
\renewcommand{\familydefault}{\sfdefault} | |
} | |
%% 'roman' option | |
\DeclareOption{roman}{ | |
\renewcommand{\familydefault}{\rmdefault} | |
} | |
%% Global indentation option | |
\newif\if@neverindent\@neverindentfalse | |
\DeclareOption{neverindent}{ | |
\@neverindenttrue | |
} | |
\ExecuteOptions{roman} | |
\ProcessOptions\relax | |
% | |
% Create Problem Sections | |
% | |
\newcommand{\enterProblemHeader}[1]{ | |
\nobreak\extramarks{}{Problem \arabic{#1} continued on next page\ldots}\nobreak{} | |
\nobreak\extramarks{Problem \arabic{#1} (continued)}{Problem \arabic{#1} continued on next page\ldots}\nobreak{} | |
} | |
\newcommand{\exitProblemHeader}[1]{ | |
\nobreak\extramarks{Problem \arabic{#1} (continued)}{Problem \arabic{#1} continued on next page\ldots}\nobreak{} | |
\stepcounter{#1} | |
\nobreak\extramarks{Problem \arabic{#1}}{}\nobreak{} | |
} | |
\setcounter{secnumdepth}{0} | |
\newcounter{hmwkProblemCounter} | |
\setcounter{hmwkProblemCounter}{1} | |
\nobreak\extramarks{Problem \arabic{hmwkProblemCounter}}{}\nobreak{} | |
% Homework Problem Environment | |
% | |
% This environment takes an optional argument. When given, it will adjust the | |
% problem counter. This is useful for when the problems given for your | |
% assignment aren't sequential. See the last 3 problems of this template for an | |
% example. | |
% | |
\newenvironment{hmwkProblem}[1][-1]{ | |
\ifnum#1>0 | |
\setcounter{hmwkProblemCounter}{#1} | |
\fi | |
\subsection{Problem \arabic{hmwkProblemCounter}} | |
\enterProblemHeader{hmwkProblemCounter} | |
}{ | |
\exitProblemHeader{hmwkProblemCounter} | |
} | |
% Aliases | |
\newcommand{\hmwkApproach}{\subsubsection*{Approach}} | |
\newcommand{\hmwkSolution}{\subsubsection*{Solution}} | |
\newcommand{\hmwkVerification}{\subsubsection*{Verification}} | |
\newcommand{\hmwkJustification}{\subsubsection*{Explanation}} | |
\newcommand{\hmwkExplanation}{\subsubsection*{Explanation}} | |
\newcommand{\hmwkObservation}{\subsubsection*{Thoughts \& Observations}} | |
\usepackage{changepage} | |
\usepackage{hyperref} | |
\usepackage{fancyhdr} | |
\usepackage{chngcntr} | |
\usepackage{float} | |
\usepackage{graphicx} | |
\usepackage{caption} | |
\usepackage{xcolor} | |
\usepackage{tikz} | |
\usepackage{mathtools,amssymb,amsthm} | |
% | |
% Document setup. | |
% | |
\topmargin=-0.45in | |
\evensidemargin=0in | |
\oddsidemargin=0in | |
\textwidth=6.5in | |
\textheight=9.0in | |
\headsep=0.25in | |
\linespread{1.1} | |
\pagestyle{fancy} | |
\lhead{\hmwkAuthorName} | |
\chead{\hmwkClass\ (\hmwkClassInstructor,\ \hmwkSemester)} | |
\rhead{\hmwkTitle} | |
\cfoot{\thepage} | |
\renewcommand\headrulewidth{0.4pt} | |
\renewcommand\footrulewidth{0.4pt} | |
\setlength{\parindent}{0pt} | |
\setlength{\headheight}{15pt} | |
\hypersetup{ | |
colorlinks, | |
citecolor=black, | |
filecolor=black, | |
linkcolor=black, | |
urlcolor=black | |
} | |
\endinput |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment