Home > Software > A LaTeX wrapper for homework

A LaTeX wrapper for homework

April 1st, 2009

Apropos of nothing… here are two examples of empty LaTeX files suitable for everyday use (e.g. homework). These templates don’t necessarily conform to any particular standard, but I think they are reasonable.

\documentclass{article}
\usepackage{amsmath, amsthm, amssymb}
\usepackage{listings}
\usepackage{graphicx}
\usepackage{float}
\usepackage{enumerate}
\usepackage{fancyhdr}
\usepackage[left=0.75in, top=1in, right=0.75in, bottom=1in]{geometry}
\pagestyle{plain}
\begin{document}
    \rhead{Student Name\\School 101: Homework 1}
    \thispagestyle{fancy}
 
    % The list environment is just to get some vertical spacing
    \list{} \item \endlist
 
    % Let the homework begin!
    \section*{Question 1}
    \subsection*{Part (a)}
    Yes
    \subsection*{Part (b)}
    No
 
    \section*{Question 2}
    Maybe
\end{document}

Looks like this,

A variation with a simpler header,

\documentclass{article}
\usepackage{amsmath, amsthm, amssymb}
\usepackage{listings}
\usepackage{graphicx}
\usepackage{float}
\usepackage[left=1in, top=1in, right=1in, bottom=1in]{geometry}
\pagestyle{plain}
\newtheorem{theorem}{Theorem}%[section]
 
\begin{document}
    \begin{flushright}
    Student Name\\School 101
    \end{flushright}
 
    \section*{Exercise 42}
    Eureka!
 
    \begin{theorem}
        \textit{(A useful equivalence)}\\
        $P = NP$
    \end{theorem}
    \begin{proof}
        By inspection.
    \end{proof}
\end{document}

looks like this,

Enjoy!

Anthony Software

Comments are closed.