12 February 2014

Doing your homework in latex.

It is a common occurrence for other students to comment on my homework whenever I turn it in for one of my classes.

The complete LaTeX file (and the pdf output) can be found in my repository, latex-homework-template .

Below are a few screenshots of problems that I’ve done in the past:

Cover page

If I didn’t know how easy it was and the benefits that I get from typesetting my homework, I’d probably ask as well. However, I’d argue that using LaTeX to type up homework has made me a far better student than when I used to handwrite my homeworks.

And that is something that I care a lot about.

The Benefits

I can summarize the benefits like so:

It can be kept in Source Control. Handwriting can’t be stored in a version control system; once you erase something, it’s gone.

You can see your homework materialize in front of you. Seeing the results and the equations in their complete LaTeX-glory is a very powerful way to conceptualize things. There’s just something different about the way things look so perfect that makes the subject easier to understand.

You’ll do better in your classes. This one goes with the previous point, but having the ability to see your homework helps you understand it. By understanding it well, you’ll do better on tests. You will maximize how much you can learn as well as maximize your grade (if that matters to you).

It’s very neat & tidy. Although my handwriting has improved quite a bit, I still find myself slipping back into a rushed, messy script from the past. LaTeX gives zero doubt that the professor/TA will be able to read my solutions.

About LaTeX

A very short history.

Donald Knuth , a legendary Computer Scientist as well as one of my favorites, is well known for the system that he created called just TeX .

It is a piece of typesetting software that aids in writing documents and formulas. The power comes from the fact that the document that you write is plain source code.

The code that you write is then “typeset” into the final document in whatever form you wish.

Here’s an example of some basic LaTeX code:

With the output looking like below:

Example output

Using the Template

I’ve created a GitHub repository, latex-homework-template , just for my homework template that I’ve been using ever since I started. I found it online and used it as a base to start my template.

To use it, just download the homework.tex file and start editing. Once you need to typeset it, you’ll need LaTeX here .

After that, you just need to compile it and you’ll get your output. There are tons of different resources that I’ve found useful in learning LaTeX:

TeX StackExchange

LaTeX Wikibook

Effect on Performance

I have a solid set of anecdotal evidence in favor of using LaTeX for writing up my homework.

In all the classes that I’ve used LaTeX, I’ve come out of the class with a very strong understanding of the material as well as a good grade. Although I’m not a big fan of grades (like at all), I know it matters to some people.

This might have to do with the fact that doing the homework in LaTeX takes longer. It might have to do with the fact that I perfect the appearance and spend a lot more time looking at the subject.

The most likely reason is a combination of all that I previously mentioned plus other factors. I’m usually one to always want to quantify something, but in this case, I know it helps; that’s all I need.

Learning Curve

There definitely is a learning curve when it comes to trying to use LaTeX for homework. I felt that it was definitely worth the effort unlike how it might seem to some students.

I reasoned that when I go to graduate school, I will want to use it there. I also know how pervasive it is in textbooks. Since I love to read textbooks so much, I wanted to see what it took to write them so elegantly. I may even want to write one in the future; we’ll have to see =]

To me it seemed like a small tradeoff for the great benefits that it provided.

I cannot recommend using LaTeX for your homework enough.

The benefits go a long way. It helps you learn the material and in a way that isn’t as easily achieved when just using pencil and paper.

LaTeX is also widely used in academia and learning about the tool is almost essential if you wish to go to graduate school.

Once I graduate from university, I plan on releasing all my code for the last three semesters as open source. It includes all my LaTeX code which has really accumulated over the last year. It should provide a nice resource for others.

In the meantime, hopefully if you start using LaTeX for your homework, you won’t be able to resist doing it early because of how fun it is. Well, at least it was fun for me =]

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

How do I create a simple page of homework in LaTeX?

I've been frustrated with using Microsoft Word for typing out equations, so I've decided to switch over to LaTeX to write all of my homework with. I've never used LaTeX before to typeset anything, so I'm a little overwhelmed right now.

At the moment, all I need to do is make a simple document that has the following format:

My Name My ID Number Class Name Document Title Multiple paragraphs of double-spaced text will go here. Another paragraph of text.

How can I typeset this simple document in LaTeX?

Community's user avatar

  • 3 Relatively recently I was exactly like you. There is already an answer below, but I'll try to predict what is going to happen very soon: you will find yourself frustrated and looking for ways to create tables, add (and trim, and scale, and rotate) images, set up multiple columns and variety of other customizations and tweaks. So to avoid all this I started with "LaTeX Beginners guide" by Stefan Kottwiz (no need to read thoroughly, just things related to your work area) and "The TEXbook" by Donald Knuth is another excellent example. –  Pranasas Commented Mar 30, 2013 at 17:39
  • 1 Check out this link: en.wikibooks.org/wiki/LaTeX ... It's a huge help on your everyday work with LaTeX –  Oliver Commented Mar 30, 2013 at 17:41
  • 3 I would suggest you to start with a basic introduction to LaTeX; perhaps the lshort document. –  Gonzalo Medina Commented Mar 30, 2013 at 17:41
  • Another good option to read is "LATEX for Word Processor Users" . –  kiss my armpit Commented Mar 30, 2013 at 20:18

2 Answers 2

David Carlisle's user avatar

  • I'm accepting this answer because it looks more straightforward and does not have as many advanced features that I don't really understand yet. –  Peter Olson Commented Mar 30, 2013 at 17:51
  • 2 @user1494845 ` \\ ` should never be used unless absolutely necessary. I suggest you look into \Author The OP will not have to go through hbox error in the future, if they do not use ` \\ ` –  Jeel Shah Commented Mar 30, 2013 at 18:07

Here's one possibility:

The first page of the resulting document:

enter image description here

I defined some commands \idnumber and \classname for the ID number and the class name; the \makeheader command typesets the information for these two commands and \author , \title with the desired formatting.

The setspace package was used to change the interline spacing.

The lipsum package was only used to generate text for the example.

Moriambar's user avatar

You must log in to answer this question.

Not the answer you're looking for browse other questions tagged formatting ..

  • The Overflow Blog
  • At scale, anything that could fail definitely will
  • Featured on Meta
  • Announcing a change to the data-dump process
  • Bringing clarity to status tag usage on meta sites

Hot Network Questions

  • What would happen if the voltage dropped below one volt and the button was not hit?
  • What happens to entropy during compression?
  • How to substitute URLs?
  • How do I keep my tikz drawing on the page?
  • Hip pain when cycling (experienced cyclist)
  • Could an empire rise by economic power?
  • When was EDH key exchange introduced to SSL/TLS?
  • Flight delayed, risk of missing connection, can I cancel and get refund?
  • What would happen if someone were to wear a breathing restriction mask when sleeping over several nights to acclimatize for mountaineering?
  • Nearly stalled on takeoff after just 3 hours training on a PPL. Is this normal?
  • How to reconcile the effect of my time magic spell with my timeline
  • Whats the safest way to store a password in database?
  • 5 deep Apex soql: System.QueryException: SOQL statements cannot query aggregate relationships more than 1 level away from the root entity object
  • diagonal argument in latex
  • How to survive 40c while golfing
  • Admissibility of withdrawn confession
  • Why does each state get two Senators?
  • Hardware debouncing of 3.3V high signal for an ESP32 turned on via optocoupler
  • Do eternal ordinances such as the festival of unleavened bread pose a biblical contradiction?
  • Second Derivative for Non standard Calculus
  • How to prevent my frozen dessert from going solid?
  • If a Palestinian converts to Judaism, can they get Israeli citizenship?
  • Why is the stall speed of an aircraft a specific speed?
  • How to find the x-coordinate of the point circled(non-differentiable points) in this trigonometric function graph?

write homework in latex

02 Using LaTeX for Homework

I hope that you will use the LaTeX typesetting system to write your homework solutions for this course. (See the guide to submitting homework.) It might look daunting at first, if you haven't used LaTeX before, but you won't have to learn LaTeX in depth. You just have to fill in answers to exercises, so you won't need to deal with the complexities of writing complete documents. You will mainly need to know how to express mathematics in LaTeX. Unfortunately, matrices and systems of linear equations are among the more difficult things to write. Fortunately, you will have examples that you can imitate. What follows here is some basic information to get you oriented.

Using LaTeX is something like programming: You write "source code" in plain text, which is "compiled" to produce the actual document. Perhaps the first thing to know is that to start a new paragraph, you need to leave a blank line. Other than that, carriage returns are ignored. Also, multiple consecutive spaces are treated as a single space.

To Include mathematics in a document, you type the LaTeX source code for the math between dollar signs. For example, $ax^2+bx+c=0$ will be typeset as \(ax^2+bx+c=0\). If you enclose the code between double dollar signs, the math will be displayed on on line by itself. (This is called "displayed math.") For example, $ $ax^2+bx+c=0$ $ will be typeset as \[ax^2+bx+c=0\] Some things look different as displayed math. For example, compare \(\lim_{n\to\infty}\sum_{k=1}^n\frac{1}{2^n}=1\) to \[\lim_{n\to\infty}\sum_{k=1}^n\frac{1}{2^n}=1\] If case you are wondering, the LaTeX code for that is \lim_{n\to\infty}\sum_{k=1}^n\frac{1}{2^n}=1 . Remember that it has to be enclosed between either single or double dollar signs. Stuff that is between dollar signs is said to be in math mode , as opposed to the regular "text mode."

In the source code, certain characters have special meaning: $ \ { } ^ _ & ~ # % . We have seen that $ is used to surround math code.

The backslash character, \ , is used for LaTeX commands, and braces, { and } , are used to enclose the parameters to which a command applies. For example, in \sqrt{b^2-4ac} , the command is \sqrt , the parameter is b^2-4ac , and the typeset result is \(\sqrt{b^2-4ac}\). The \frac command is used to make a fraction, and it has two parameters, so \frac{n!}{k!(n-k)!} is typeset as \(\frac{n!}{k!(n-k)!}\). Some commands don't have parameters. For example, \infty represents the infinity symbol, \(\infty\), and \to produces a right arrow, \(\to\). Note that you might need to leave a space after a command like \to to mark the end of the command word. For example, use f\colon X\to Y to get \(f\colon X\to Y\). Typing \colonX instead of \colon X will just get you an error.

The special characters caret, ^ , and underscore,  _ , are used for exponents and subscripts in math mode. Note that if an exponent or subscript is more than one character or command, it must be enclosed in braces, so you need f^{-1}(x_i) to get \(f^{-1}(x_i)\). Some similar things, such as the upper and lower limits on a sum ( \sum_{n=1}^\infty for \(\sum_{n-1}^\infty\)) and the thing that goes below "lim" ( \lim_{x\to a} for \(\lim_{x\to a}\)). By the way, in display math, that would look like \(\displaystyle\lim_{x\to a}\). If you want to force some math into display style, use the command \displaystyle in regular math mode: $\displaystyle\lim_{x\to a}$ .

We will see that the amphersand, & , is used similarly to a tab character in tables and matrices. The other three special characters probably won't come up in your writing for this course. (A  ~ represents a non-breaking space, #  is used when defining new commands, and %  marks the start of a comment that ends at the end of the same line. Comments are ignored by LaTeX.) Most of the special characters can be output to the typeset document by preceding the character by a backslash in the source code. For example, type  \{ for \(\{\). However, this does not work for the backslash character; \\ is used to force a line break in the output. It also does not work for \^  or  \~ (which are used for making accented characters). I also note that | , < , and  > work in math mode but give funny results if used outside of math mode.

Some LeTeX code uses environments . Environments are coded using \begin and \end , which take the name of the environment as parameter. For example, you will write your solution to exercises in this course using my " answer " environment. That means that you will write your solution between \begin{answer} and \end{answer} . Similarly, I will write the problem text between \begin{problem} and \end{\problem} . (These two environments are not built into LaTeX. It is possible to define new environments and new commands in a document. The LaTeX source files that I give you will already define any extra commands and environments that you need.)

If you are going to use LaTeX in this course, you need to learn about matrix environments. To produce a matrix enclosed in parentheses, use the pmatrix environment. The rows of the matrix are separated by \\ . In each row, the elements of that row are separated by  & . All of that goes between \begin{pmatrix} and \end{pmatrix} , and it must all be in math mode or displayed math mode. LaTeX ignores end-of-lines in math mode, but it's a good idea to lay out the matrix in the source code similarly to how it looks when typeset (except I don't always do that for simple column vectors, which have just one element per row). For example,

will produce this in the typeset document: \[\begin{pmatrix} 3 & -10 & 2 \\ -1 & 7 & 4 \\ 5 & 0 & 1 \end{pmatrix} \begin{pmatrix} x\\ y\\ z \end{pmatrix} = \begin{pmatrix} 3x-10y+2z \\ -x+7y+4z \\ 5x+z \end{pmatrix}\]

Later, we will use the vmatrix environment to make matrices that are enclosed between vertical bars instead of between parentheses. There is a plain matrix environment for typesetting the elements of the matrix with nothing enclosing them. I use the matrix environment to typeset systems of linear equations, where each equation is one row in the matrix. Each term in an equation is one element of the row. The equal sign and the right-hand side of the equation are also elements. A column can be left empty—two & 's in a row—if a term is missing from the equation. For example:

gives \[ \begin{matrix} 3x_1 & -2x_2 & +x_3 & -x_4 & = & 7\\ -x_1 & & -5x_3 & +2x_4 & = & 2\\ & x_2 & +2x_3 & & = & 0\\ 2x_1 & +3x_2 & & -5x_4 & = & -1 \end{matrix} \]

Unfortunately, there is no simple environment for making augmented matrices. I use a pattern based on the array environment, which makes it possible to put lines between columns of the array and to say whether you want the columns to be centered, left justified, or right justified. This is specified in an extra parameter that comes after \begin{array} . For example, \begin{array}{cccc|c} is used for an array with five centered columns and a line between the fourth and fifth columns; you can use r and l instead of c to get right-justified or left-justified columns. Since the array environment does not include parentheses, I have to add them myself: \left( and \right) add appropriately sized parentheses around whatever is put between them. Here's the augmented matrix that represents the above linear system:

giving \[\left( \begin{array}{cccc|c} 3 & -2 & 1 & -1 & 7\\ -1 & 0 & -5 & 2 & 2\\ 0 & 1 & 2 & 0 & 0\\ -2 & 3 & 0 & -5 & -1 \end{array} \right) \]

The only other environment that is really essential is align* . This environment is unusual in that it is used for mathematics, but it has to be used in regular text mode, not inside math mode. Its purpose is to vertically align a sequence of rows. Rows are separated by \\ , and the position in each row that is to be aligned is marked with a  & . Often, a row is an equation or inequality (or just the operator and the right half of an equation/inequality), with the operators vertically aligned. Here is an example:

which is typeset as

\(\begin{align*} \frac{d}{dx}(x\sin(x^2)) &= x\frac{d}{dx}(\sin(x^2)) + \sin(x^2)\frac{d}{dx}(x) \\ &= x\cos(x^2)\frac{d}{dx}(x^2) + \sin(x^2)\\ &= x\cos(x^2)2x + \sin(x^2)\\ &= 2x^2\cos(x^2) + \sin(x^2) \end{align*}\)

For showing a series of row reductions applied to a matrix or linear system, you might use array or matrix environments inside an align* environment. This can get complicated, but an example is given in the first homework assignment. I have defined the command \rowop for making the arrows that go between the steps of a row reduction. The parameter to \rowop is either a single row operation or several operations separated by  \\ . For example, \rowop{\rho_2\leftrightarrow\rho_3} and \rowop{2\rho_1+\rho_2\\-3\rho_1+\rho_3} for \(\rowop{\rho_2\leftrightarrow\rho_3}\) and \(\rowop{2\rho_1+\rho_2\\-3\rho_1+\rho_3}\)

You can find lists of other LaTeX command elsewhere, and you will find examples in the documents that I give you. Here are a few more that you might use in this course. Most of these are used only in math mode, and a few of them require some preliminary configuration in the LaTeX file.

, ,
\( \subset, \subseteq, \supset,\supseteq\)
\(\{, \}, \in, \notin, \cup, \cap,\varnothing \)
\(\le,\ge,\ne,\approx \)
\(\forall,\exists,\therefore\)
\(\cdot, \dots, \cdots, \vdots, \ddots \)
\( \alpha, \beta, \gamma, \rho, \dots\)
\(\mathbb{R}, \mathbb{Q}, \mathbb{N} \)
\(\mathscr{A}, \mathscr{B}, \dots \)
\( \mathcal{A}, \mathcal{B}, \dots \)
\(f\colon A\to B \)
\(\bigcup_{n=1}^\infty, \bigcap_{\alpha\in A} \)
\(\rightarrow,\Rightarrow,\longrightarrow \)
\( \leftrightarrow,\Leftrightarrow\)

(back to contents)

Robert J. Won

Department of Mathematics, The George Washington University

How to TeX your homework

The TeX template used in the video is included at the bottom of this post. You can paste this into a .tex file locally, or into Overleaf.

  • If you’re just starting out, I recommend using  Overleaf  as your TeX editor.
  • You can use  Detexify  to hand-draw a symbol to find the LaTeX command for it.
  • There is also a nice  WikiBook  on LaTeXing mathematics.
  • When in doubt, Google is your friend!

You will frequently have problems with TeX which will make the document unable to compile. You should remember to compile often so that you can pinpoint your errors. Here are some things to check.

  • Remember to place math within dollar signs, so $x^2$ typesets as  x 2 .
  • Make sure you have started and ended all environments in the appropriate spots.
  • Make sure you have closed all of your curly braces { }.
  • Check to see if you used a new command that requires a new package.

Leave a Reply Cancel reply

Save my name, email, and website in this browser for the next time I comment.

This site uses cookies to offer you a better browsing experience. Visit GW’s Website Privacy Notice to learn more about how GW uses cookies.

  • Starting out with T e X...
  • CTAN Background
  • T e X user groups
  • Upload basics
  • Upload addendum
  • T e X Directory Structure
  • T e X Archive
  • Contributors

Announcements

  • Extended search
  • File search

homework – A L a T e X class for writing your homework

The current document class is for writing homework. It has the following features.

  • Simple and clear interface.
  • Built-in support for many theorem-type environments, already configured and ready to use.
  • Multilingual support.
  • Page numbers are of the form “Page [current] of [total]”, which can help you ensure that there are no missing pages when you print your homework for submission.
  • Support writing problem statements and solutions (or proofs) in different colors.
  • Every statement and solution has its own QED symbol, in hollow or solid shape, respectively.
  • You can mark the unfinished parts, and a report shall be generated at the end of your document for reminding.
Sources
Documentation
Repository
Version 2024-02-21
Licenses TeX Project Public License 1.3c
Copyright2023–2024 Jinwen XU
Maintainer
Contained in X Live as homework
X as homework
Topics


TeX3

Download the contents of this package in one zip archive (540.1k).

Community Comments

  • 2024-02-22 CTAN update: homework
  • 2023-10-16 CTAN update: homework
  • 2023-10-04 CTAN update: homework

Suggestions

Maybe you are interested in the following packages as well.

  • assignment: A class file for typesetting homework and lab assignments
  • q-and-a: Typesetting Q&A-style conversation made easier
  • beaulivre: Write your books in a colorful way
  • se2thesis: A Thesis Class for the Chair of Software Engineering II at the University of Passau, Germany

Package Links

  • Scholarship Overview
  • Academic Writing
  • Undergraduate Research
  • Book: Intro to Proof via IBL
  • Teaching Tidbits
  • Teaching Resources
  • Letters of Recommendation
  • Free and Open-Source Textbooks
  • Inquiry-Based Learning
  • Quick LaTeX Guide
  • Problem of the Week
  • NAU Mathematics & Statistics
  • Department Seminars
  • ACGT Seminar
  • Academy of Inquiry-Based Learning
  • Mathematics Learning by Inquiry
  • Four Corners COMMIT
  • MAA Teaching Tidbits
  • MathBlogging.org
  • Booles' Rings
  • Mathematical Association of America
  • American Mathematical Society
  • American Institute of Mathematics
  • Project NExT
  • Math Ed Matters

LaTeX Homework Template

  • Aug 20, 2012

For most of my inquiry-based learning (IBL) proof-based courses, I typically assign two types of homework assignments:

Daily Homework

Weekly homework.

I’ll briefly explain each of these.

The Daily Homework is assigned each class meeting, and students are expected to complete (or try their best to complete) each assignment before walking into the next class period. All assignments should be carefully, clearly, and cleanly written. Among other things, this means that the work should include proper grammar, punctuation, and spelling. However, the work done on these assignments is not intended to be perfect. The Daily Homework generally consists of tasks (e.g., completing exercises, proving theorems) from the course notes. On the day that a homework assignment is due, the majority of the class period is devoted to students presenting some subset (maybe all) of their proposed solutions/proofs to the tasks that are due that day. Students are allowed (in fact, strongly encouraged!) to modify their written work in light of presentations made in class; however, they are required to use a felt tip pen, which I provide at the beginning of each class. Students can annotate their work as much as they like and there is no penalty for using the felt tip pen. Students submit their their work at the end of class and the assignment is graded on a $\checkmark$-system. Whether the student receives a $\checkmark-$, $\checkmark$, or $\checkmark+$ depends on how much work they had completed before they walked in the room. The felt tip pen strategy works amazingly well.

In addition to the Daily Homework, students are also required to submit two formally-written proofs each week. During week $n$, students submit any two problems marked with a $\star$ that were turned in during week $n-1$ for the Daily Homework. The $\star$-problems are typically a subset of the medium to difficult proofs. The students are required to submit a PDF of their write-ups, and in general, the Weekly Homework assignments are due on a non-class session day (so that they don’t interfere with the Daily Homework). One huge advantage of this approach is that students are forced to reflect on the previous week’s work and it allows them another opportunity to learn the material if they didn’t master it the firs time.

If you’d like to know more about my approach to Daily and Weekly Homework, as well as the felt tip pens, check out the slides for this talk . In the future, I plan to write a more extensive blog post about the advantages of the felt tip pens and the multiple rounds of revision that the Weekly Homework promotes.

Using LaTeX for the Weekly Homework

I either require or strongly encourage my students to type up their Weekly Homework assignments using LaTeX . In case you don’t already know, LaTeX (pronounced “lay-tech”, or sometimes “la-tech”) is a markup language that is the standard for typesetting mathematics (and other technical fields). Most people find it difficult to get started with LaTeX and my students are no exception. To minimize some of the initial difficulties, I encourage them to use Overleaf , which is an awesome and free online LaTeX editor. This way students do not need to worry about installing the LaTeX backend and an editor. One advantage to Overleaf is that my students can easily share their source documents with me. Whenever they are having difficulty, I can just take a look at their file and either make a comment right in the file or do a quick debug. Another way that I try to reduce the LaTeX start-up cost is by providing my students with a LaTeX Homework Template (see below).

This template is set up exactly how I want the Weekly Homework to look. I also provide a minimal amount of guidance, as well as some examples in the template. Using the template in Overleaf is as easy as clicking the link below. Try it!

Feel free to use the template and if you have ideas for improvements, I’d love to hear about them. Lastly, I’ve written a Quick LaTeX Guide to help my students get started with the actual writing of LaTeX.

Update June 2013: I originally encouraged my students to use ScribTeX , which seems to have joined forces with ShareLaTeX . However, I now have my students use Overleaf , which my students and I have been very happy with. I modified my original post to reflect my current use of Overleaf.

Dana C. Ernst

Mathematics & Teaching

  Northern Arizona University   Flagstaff, AZ   Website   928.523.6852   Twitter   Instagram   Facebook   Strava   GitHub   arXiv   ResearchGate   Academia.edu -->   LinkedIn   Mendeley   Google Scholar   Impact Story   ORCID

Current Courses

  MAT 226: Discrete Math   MAT 526: Combinatorics

About This Site

  This website was created using GitHub Pages and Jekyll together with Twitter Bootstrap .

  Unless stated otherwise, content on this site is licensed under a Creative Commons Attribution-Share Alike 4.0 International License .

  The views expressed on this site are my own and are not necessarily shared by my employer Northern Arizona University .

  The source code is on GitHub.

Land Acknowledgement

  Flagstaff and NAU sit at the base of the San Francisco Peaks , on homelands sacred to Native Americans throughout the region. The Peaks, which includes Humphreys Peak (12,633 feet), the highest point in Arizona, have religious significance to several Native American tribes. In particular, the Peaks form the Diné (Navajo) sacred mountain of the west, called Dook'o'oosłííd, which means "the summit that never melts". The Hopi name for the Peaks is Nuva'tukya'ovi, which translates to "place-of-snow-on-the-very-top". The land in the area surrounding Flagstaff is the ancestral homeland of the Hopi , Ndee/Nnēē (Western Apache), Yavapai , A:shiwi (Zuni Pueblo), and Diné (Navajo). We honor their past, present, and future generations, who have lived here for millennia and will forever call this place home.

  All work is licensed under the Creative Commons BY-SA 4.0 License .

The LaTeX homework Document Class

January 10, 2015

There are LaTeX document classes for typesetting books, articles, exams, presentations, and more. Now, there’s one for homework assignments, too.

Check out and download the source on GitHub .

This is a LaTeX document class. That means you use it with \documentclass{homework} at the top of the document. It provides a document layout and some helper commands that make working with questions easy.

Installation

Certainly the easiest way to start using this template is to copy the .cls file to your computer in the same directory as your LaTeX project directory.

A better way to install this template is to fork the above repository and then clone that fork to a particular folder on your computer:

Then, whenever you need to use the template, you can copy the template wherever. Also, if there are ever any updates, you can simply run

to update the template.

Preferred Installation

The best way to install this file is to follow the instructions here , keeping in mind that you’re trying to install a .cls file instead of three .sty files.

See the homework.tex file for an exhaustive list of usage examples. There are also comments explaining features for which there are no examples given.

The result is the following:

The class file also has a bunch of helper \usepackage s that you might want to take a look at in homework.cls .

For your convenience, the file template.tex is a nearly-empty LaTeX file that contains the bare essentials to get started using the homework class.

To start a question, just type \question . It will add the text “Question #” with a line underneath to the document. If you’d like to change “Question” to something else, use

Similarly, if you ever need to skip numbers, you can do

So, to skip to the 10th question, <target number - 1> = 9.

See homework.tex for more.

Some classes like to give their homework questions fancy names. If this is the case, you can use \question*{The Question's Name} to make a named question.

Question Parts

Another common thing on homework assignments is to have multi-part questions. To deal with these, use the form

Induction Proofs

In math classes, induction proofs come up a lot, and they almost always have the same form: base case, induction hypothesis, and induction step.

One of my favorite features of this document class is that it redefines the \section macros. This means you can use tools like Markdown, which have a concise syntax, together with a tool like pandoc to convert Markdown into LaTeX. As an example, consider that we have the Markdown:

Running pandoc -f markdown -t latex my-homework.md will output

And since \section is the same thing as , we’re golden, and this compiles as we’d want it to. Throw it into the blank template.tex file included in the repo, and you’ve got yourself a typeset homework.

I’ve make a lot of other LaTeX-related posts. Be sure to check them out as well! My hope is that you find something that makes developing LaTeX just that much easier.

Assignments

Assignments, also known as homework, are usually given to school or university students to reinforce their knowledge of a subject and aid in learning. They are typically structured in question and answer form to be completed by the student consecutively.

write homework in latex

fphw Assignment

This template is for formatting assignments or homework in a clear and simple way. The title section at the top of the first page clearly displays the assignment, student and class information. This information also appears in the headers and footers of subsequent pages. Questions in the assignment are clearly demarcated and appear inside boxes to focus attention. The template features examples of including images, tables, equations and code listings for covering virtually all common assignment information. Multi-part questions and answers are shown for more complex questions.

  • View Template Information

Wenneker Assignment

This template can be used by teachers or students for school or university assignments. It contains a clear title section at the start to specify the assignment class, title, date and teacher/student name. The template supports up to 4 levels of sections to structure the assignment into sections, questions, subquestions and bonus content. Examples of common assignment content are included: figure, equations, lists, table, code and paragraphs of text.

Lachaise Assignment

This template is for teachers/instructors/educators to create assignments/homework for their students. It includes a clear title on the first page for the course, assignment and teacher’s name, as well as the institution and date. Sets of questions can be grouped by headings and the template includes examples of unnumbered and numbered sections, and numbered subsections (for longer assignments). Amongst the description text for each question, examples are provided for virtually any subject matter, including: equations, algorithms, code and command line outputs.

Cleese Assignment

This template comes in two versions, one for teachers/instructors/educators to create assignments/homework for their students to fill out by hand, and another for students proficient in LaTeX to answer questions posed to them at school or university/college. Both versions contain simple environments for each question and subquestion within, and allow answer boxes to be created with either an answer or blank for space to write an answer. Sets of questions can be grouped by headings and the template includes examples of including an image, table, equation and code within questions.

write homework in latex

LaTeX Templates Information

General enquiries [email protected]

Most templates licensed under CC BY-NC-SA 4.0

LaTeX Templates is developed in New Zealand

© Creodocs Limited. All Rights Reserved.

Navigation Menu

Search code, repositories, users, issues, pull requests..., provide feedback.

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly.

To see all available qualifiers, see our documentation .

  • Notifications You must be signed in to change notification settings

LaTeX class and template for typesetting math homework

artemmavrin/latex-homework

Folders and files.

NameName
215 Commits

Repository files navigation

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

Environments, class options, introduction.

  • 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 .

Getting Started

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 in solution environments (see Environments ).

Documentation

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

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 the problem environment (e.g., Exercise or Question ). The default is Problem .
  • \solutionname{<name>} : Replace <name> 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 .

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. If multiple parts environments are used in a single problem environment, labels will resume unless you use the \unresume command right after the beginning of each parts environment. 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.

To specify your own labels to parts (for example, to only list parts b , d and e ) 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

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 the problem 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 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.

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

Contributors 4

@artemmavrin

  • Makefile 1.6%

Gallery — Homework Assignment

Gallery Items tagged Homework Assignment

Show all Gallery Items

Here we provide a selection of homework assignments templates and examples for school, college and university use. These often include a question and answer section already set out, along with space for the student name, course title, date and any other required information. Teachers and lecturers may also find these templates useful for preparing material for their classes.

Description of the Assignment

Related Tags

Get in touch.

Have you checked our knowledge base ?

Message sent! Our team will review it and reply by email.

Email: 

IMAGES

  1. Latex Homework Template

    write homework in latex

  2. Writing Homework In Latex

    write homework in latex

  3. GitHub

    write homework in latex

  4. How to write your homework using LaTeX

    write homework in latex

  5. Latex Template For Homework

    write homework in latex

  6. Latex Homework Template Stanford

    write homework in latex

VIDEO

  1. How to Set Up and Use LaTeX For Writing Homework/Math/Science

  2. ForAll in latex

  3. What is Latex? [Bagian Ketiga]

  4. Latex for teachers #latex #maths #study #teacher #teachers #teaching #lehrer #education

  5. Introduction to LaTeX Part 1 of 3 (the basics)

  6. An efficient and effective publication process

COMMENTS

  1. Doing Your Homework in LaTeX

    Using LaTeX to write up your homework for university isn't as hard as some people think. In fact it has quite a few benefits, I discuss them here.

  2. How to write your homework using LaTeX

    How to write your homework using LaTeX Dr. Trefor Bazett 414K subscribers 4.7K 113K views 7 months ago

  3. How do I create a simple page of homework in LaTeX?

    Here's one possibility: The first page of the resulting document: I defined some commands \idnumber and \classname for the ID number and the class name; the \makeheader command typesets the information for these two commands and \author, \title with the desired formatting.

  4. Writing Math Homework in LaTeX

    In this video I demonstrate how I write my homework in LaTeX. LaTeX is a text setting language which allows you to format text and math equations using a computer.

  5. 02 Using LaTeX for Homework

    02 Using LaTeX for Homework I hope that you will use the LaTeX typesetting system to write your homework solutions for this course. (See the guide to submitting homework.) It might look daunting at first, if you haven't used LaTeX before, but you won't have to learn LaTeX in depth.

  6. How to TeX your homework

    The TeX template used in the video is included at the bottom of this post. You can paste this into a .tex file locally, or into Overleaf. If you're just starting out, I recommend using&nbsp;Overleaf&nbsp;as your TeX editor. You can use&nbsp;Detexify&nbsp;to hand-draw a symbol to find the LaTeX command for it. There is also a [&hellip;]

  7. Templates

    Here we provide a selection of homework assignments templates and examples for school, college and university use. These often include a question and answer section already set out, along with space for the student name, course title, date and any other required information. Teachers and lecturers may also find these templates useful for ...

  8. CTAN: Package homework

    T. X. class for writing your homework. The current document class is for writing homework. It has the following features. Simple and clear interface. Built-in support for many theorem-type environments, already configured and ready to use. Multilingual support. Page numbers are of the form "Page [current] of [total]", which can help you ...

  9. Homework Template with Samples

    This is a template for completing homework assignments. It includes examples of how to use the template and how to type up various types of assignments.

  10. Example math homework (with solutions)

    An online LaTeX editor that's easy to use. No installation, real-time collaboration, version control, hundreds of LaTeX templates, and more.

  11. A LaTeX Homework Template

    Writing a LaTeX document from scratch for every assignment is tedious. Especially for homework assignments, a lot of the structure is repetitive. Read on to learn about the homework template I've adapted for use in all my technical classes.

  12. GitHub

    The current document class is for writing homework or assignment. It has the following features. Simple and clear interface. Built-in support for many theorem-type environments, already configured and ready to use (in the mean time also very customizable, via \SetTheorem ), with clever referencing supported.

  13. LaTeX Homework Template

    Using LaTeX for the Weekly Homework I either require or strongly encourage my students to type up their Weekly Homework assignments using LaTeX. In case you don't already know, LaTeX (pronounced "lay-tech", or sometimes "la-tech") is a markup language that is the standard for typesetting mathematics (and other technical fields).

  14. The LaTeX homework Document Class

    What This is a LaTeX document class. That means you use it with \documentclass {homework} at the top of the document. It provides a document layout and some helper commands that make working with questions easy.

  15. How I Format My Homeworks in LaTex

    I've been doing all my homework in LaTex, and figured I'd show you how I format the homework. Pretty straight forward, as I said I'm sure there's better ways...

  16. Learn LaTeX in 30 minutes

    Learn LaTeX in 30 minutes This introductory tutorial does not assume any prior experience of LaTeX but, hopefully, by the time you are finished, you will not only have written your first LaTeX document but also acquired sufficient knowledge and confidence to take the next steps toward LaTeX proficiency.

  17. LaTeX Templates

    Lachaise Assignment. This template is for teachers/instructors/educators to create assignments/homework for their students. It includes a clear title on the first page for the course, assignment and teacher's name, as well as the institution and date. Sets of questions can be grouped by headings and the template includes examples of ...

  18. Doing My Homework in LaTex

    Last week I mentioned that I wanted to start doing my homework in LaTex. Today I talk about how it's going with respect to my classical mechanics homework.

  19. GitHub

    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 in solution environments (see Environments ).

  20. Simple Math Homework Template

    An online LaTeX editor that's easy to use. No installation, real-time collaboration, version control, hundreds of LaTeX templates, and more.

  21. Gallery

    Here we provide a selection of homework assignments templates and examples for school, college and university use. These often include a question and answer section already set out, along with space for the student name, course title, date and any other required information. Teachers and lecturers may also find these templates useful for ...