Skip to content

Instantly share code, notes, and snippets.

@shiftycow
Created September 8, 2011 16:58
Show Gist options
  • Save shiftycow/1203912 to your computer and use it in GitHub Desktop.
Save shiftycow/1203912 to your computer and use it in GitHub Desktop.
LaTeX homework template
\documentclass[11pt]{article} % I prefer "article" over "amsart" for homework. "report" also looks nice
\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper} % ... or a4paper or a5paper or ...
\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent
\usepackage{graphicx} % for graphics
\usepackage{epstopdf} % for importing PostScript graphics from GraphViz
\usepackage{amssymb} % math packages from AMS
\usepackage{amsmath}
\usepackage{amsthm} % for theorems and proofs
\usepackage{qtree} % for simple trees
\usepackage{hyperref} % for links in reports/bibliographies
\usepackage{algorithm} % for pseudocode algorithms
\usepackage{algorithmic}
\usepackage{ulem} %for squiggly lines and strikethrough
% some rules to try to control page layout
\usepackage{fullpage} % sets margins a bit smaller
\raggedbottom % prevents adding of vertical space to fill pages, which looks terrible
% set up styles for hyperlinks
\hypersetup{pdfborder = {0 0 0 0}}
% convert png/tiff filenames
\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}
% custom commands
\newcommand{\degree}{\ensuremath{^\circ}} %http://anthony.liekens.net/index.php/LaTeX/DegreesNotation
\title{CS xxx Homework n}
\author{<author>}
\date{\today}
\begin{document}
\maketitle
%theorem definitions
\newtheorem{mydef}{Definition}
\newtheorem{lemma}{Lemma}
\newtheorem{answer}{Answer}
\section*{Problem 1} Problem 1 description
\begin{answer}
Answer to problem 1
\end{answer}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment