Giter Club home page Giter Club logo

latex-homework's Introduction

The homework class

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.


Table of Contents

Introduction

Features

  • Simple interface for specifying homework information (e.g., name and course).
  • Environments for writing problem statements, problem parts, and solutions.
  • Automatic title creation.
  • Easy to change the font to one of eight choices.
  • Easy to change the size of the page margins.
  • Compatible with article class options.
  • Loads the AMS math packages.
  • Automatic PDF author/title/bookmark metadata creation.

Example

For examples of PDFs built using the homework class, browse the examples directory. All the PDFs there are created using example.tex by modifying the options passed to the homework class.

Getting Started

Template

template.tex is a ready-to-use homework template that uses the homework class.

Usage

  • 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 the problem environment and solutions in the solution environment (see Environments).

Documentation

Commands

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 in which 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.

  • \hwtype{<type>}: Replace <type> with the desired label for the type of homework (e.g., Assignment or Problem Set). The default is Homework.
  • \problemtitle{<title>}: Replace <title> with the desired label for problems created with the problem environment (e.g., Exercise or Question). The default is Problem.
  • \solutiontitle{<title>}: Replace <title> with the desired label for solutions created with the solution environment (e.g., Proof, Answer, or a label in another language). The default is Solution.

Environments

The following environments are provided to typeset the homework.

  • problem: wraps individual problem statements. By default, problems are numbered beginning at 1. To change the number of a given problem to n, use the command \problemnumber{n} before the problem environment.
  • solution: wraps the solution to a problem.
  • parts: enumerates parts of a multiple-part problem. New parts are declared using the \part command. The part labels can be customized by providing one of the following options to the parts environment:
    • a: (default) Lowercase letters.
    • A: Uppercase letters.
    • r: Lowercase Roman numerals.
    • R: Uppercase Roman numerals.
    • n: Numbers.

Class Options

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. The homework class accepts the following options.

Change the font

Serif fonts

  • cm: (default) Latin Modern, an enhanced version of Computer Modern.
  • palatino: Palatino.
  • times: Times.
  • utopia: Utopia Regular.

Sans-serif fonts

  • cmsans: Computer Modern Bright.
  • dejavu: DejaVu Sans Condensed.
  • helvetica: Helvetica.
  • kurier: Kurier.

Change the page margins

  • margins=<value>: <value> is the size of the left, right, top, and bottom margins. The default margin size depends on the font size of the document.

Problem/solution configuration

  • newpage: Use this option to start each problem environment on a new page.
  • noboxes: Use this option if you don't want the problem environment to put boxes surrounding problem statements.
  • hidesolutions: Use this option to hide solutions in the output. With this option enabled, you can still write solutions in the solution 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.

Use the article class options

All options of the article class may be used. For example,

  • 10pt, 11pt, 12pt: Set the font size to 10pt, 11pt, or 12pt. The default is 12pt.
  • letterpaper, a4paper, etc.: Set the paper size. The default paper size is letterpaper.
  • draft: Mark overfull lines.
  • twocolumn: Typeset the document on two columns per page.
  • titlepage: Print the title of the homework on a separate page.

License

This code is distributed under the MIT license. For more info, read the LICENSE file.

latex-homework's People

Contributors

artemmavrin avatar phijor avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.