LaTeX homework template

A LaTeX homework template for the problem sets and exercise sheets a math or science course hands out.

First page of the Homework template

Open in LaTeX.to Download all files (zip)

Files:
main.tex

Download main.tex

\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}

\theoremstyle{definition}
\newtheorem{problem}{Problem}
\newenvironment{solution}{\begin{proof}[Solution]}{\end{proof}}

\title{Problem Set 1}
\author{Your Name}
\date{\today}

\begin{document}
\maketitle

\begin{problem}
Show that the sum of the first $n$ positive integers is $\frac{n(n+1)}{2}$.
\end{problem}

\begin{solution}
Pairing the first and last terms gives $n/2$ pairs, each summing to $n+1$, so
\[
  \sum_{k=1}^{n} k = \frac{n(n+1)}{2} .
\]
\end{solution}

\begin{problem}
Prove that $\sqrt{2}$ is irrational.
\end{problem}

\begin{solution}
Suppose $\sqrt{2} = p/q$ in lowest terms. Then $p^2 = 2q^2$, so $p$ is even;
writing $p = 2r$ gives $q^2 = 2r^2$, so $q$ is even too, contradicting the
assumption that $p/q$ was in lowest terms.
\end{solution}

\end{document}

How to use this template

Everything runs in your browser: nothing to install, no login, no compile timeout.

How to add a problem

Problems number themselves in the order they appear in the file.

How to start from a different number

A problem set often picks exercises from a textbook, and the numbers should match it.

More templates: Cheat sheet, Lab report, Report and all templates.