Provides the LaTeX class homework.cls for typesetting homework in a straightforward problem-solution format. Designed to avoid this mistake.
Read on for a description of the homework
class.
- Simple interface for specifying homework information (e.g., name and course).
- Environments for writing problem statements, problem parts, and solutions.
- Automatic title creation.
- Compatible with
article
class options. - Loads the AMS math packages.
- Automatic PDF author/title/bookmark metadata creation.
For an examples of homework solutions created using the homework
class,
see example.tex and the resulting PDF.
template.tex is a ready-to-use homework template that uses the
homework
class.
- Download
homework.cls
and save it in the same directory as your homework.tex
file (alternatively, see this question to learn where to put.cls
files to be globally available to TeX) - At the top of the homework
.tex
file, put\documentclass{homework}
. - In the preamble, specify the homework information using the commands listed in the Commands section.
- In the document, begin writing problems in
problem
environments and solutions insolution
environments (see Environments).
The following commands should be used in the preamble of the homework .tex
file.
If these are not used, you will get an error.
\name{<name>}
: Replace<name>
with your name.\course{<course>}
: Replace<course>
with the name of the course.\term{<term>}
: Replace<term>
with the term when the course is held.\hwnum{<number>}
: Replace<number>
with the number of the homework.
Thus, at a minimum, your preamble must contain
\documentclass{homework}
\name{<name>}
\course{<course>}
\term{<term>}
\hwnum{<hwnum>}
You can also change the default text of various labels that appear on the document by using the following commands.
\hwname{<name>}
: Replace<name>
with the desired label for the type of homework (e.g., Assignment or Problem Set). The default is Homework.\problemname{<name>}
: Replace<name>
with the desired label for problems created with theproblem
environment (e.g., Exercise or Question). The default is Problem.\solutionname{<name>}
: Replace<name>
with the desired label for solutions created with thesolution
environment (e.g., Proof, Answer, or a label in another language). The default is Solution.
The following environments are provided to typeset the homework.
-
problem
: wraps individual problem statements. By default, problems are numbered beginning at1
. To change the number of a given problem ton
, use the command\problemnumber{n}
before theproblem
environment. -
solution
: wraps the solution to a problem. -
parts
: enumerates parts of a multiple-part problem. If multipleparts
environments are used in a singleproblem
environment, labels will resume unless you use the\unresume
command right after the beginning of eachparts
environment. New parts are declared using the\part
command. The part labels can be customized by providing one of the following options to theparts
environment:a
: (default) Lowercase letters.A
: Uppercase letters.r
: Lowercase Roman numerals.R
: Uppercase Roman numerals.n
: Numbers.
To specify your own labels to
parts
(for example, to only list partsb
,d
ande
) use the custom label as parameter as in\part[b)]
. -
claim
,lemma
,propostion
,theorem
,corollary
,proof
: organize claims made in a solution (and prove these claims). The 'claim' environment takes an optional argument that labels the claim (e.g.,\begin{claim}[Conjecture]
will make the claim be labelled "Conjecture"). The other listed environments are derived from the 'claim' environment.
To use a class option, write
\documentclass[<options>]{homework}
at the beginning of your homework file, where <options>
is a comma-separated
list of the options that you wish to use.
All the options of the article
class may be used.
In addition, the homework
class provides the following options.
boxes
: Use this option if you want theproblem
environment to enclose problem statements in boxes.hidesolutions
: Use this option to hide solutions in the output. With this option enabled, you can still write solutions in thesolution
environment, but these solutions will not show up in the final document.qed
: Use this option if you want an end-of-proof symbol printed at the end of solutions.
This code is distributed under the MIT license. For more info, read the LICENSE file.