%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Annotated example of a homework submission in LaTeX %% %% (note: LaTeX comments begin with a %) %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Build this document with %% %% pdflatex annotated_homework_example.tex %% %% or %% %% latex annotated_homework_example.tex %% dvips annotated_homework_example.dvi %% ps2pdf annotated_homework_example.ps %% %% The result will be annotated_homework_example.pdf. %% %% IMPORTANT NOTE: Because this sample uses cross references, you must %% build it *TWICE*. LaTeX finds all of the cross reference TARGETS first %% and then, on the second run, plugs them all in to the appropriate %% places. %% %% (note: any good LaTeX-friendly text editor will have these build %% lines built into it) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PREAMBLE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Every LaTeX document starts with a \documentclass line. The %% document class sets up the most prominent features of the document %% style (e.g., page styles, font, etc.). %% %% Standard document classes include article, book, and report. %% %% *) The article document class is the most commonly used for short %% documents. It provides sectioning commands and flexible titling %% options. %% %% *) The report document class gives you chapters and puts the title %% information centered on a separate unnumbered page. %% %% *) The book document class gives you the ability to make parts and %% chapters and is usually used in two-sided printing mode (e.g., %% page numbering alternates from being on the top left to top %% right of the page rather than in the bottom center). %% %% More advanced document classes include memoir, which is a drop-in %% replacement for the standard classes that has many other features as %% well. It folds in a rich feature set from some of the most popular %% packages (packages are explained below). %% %% Optional arguments to LaTeX macros come in square brackets. In this %% case, [10pt] tells the article class that we want 10 point font. \documentclass[10pt]{article} %% The default margins for article may seem large to you. They are %% designed to look pleasant on a page. To use 1 inch margins instead, %% call the geometry package with this line: \usepackage[margin=1in]{geometry} %% The enumitem package provides nicer list support to LaTeX. \usepackage[shortlabels]{enumitem} %% This setcounter line makes it so that \section commands do not have %% numbers printed in front of them. Delete this line ENTIRELY *OR* %% change the 0 to 1 or higher to make it so that \section commands %% automatically get numbered. %% %% If you do increase the 0 to a positive integer or remove this line %% entirely, later you can use \section* to get a single unnumbered %% section. \setcounter{secnumdepth}{0} %% Here, we use the fancyhdr and lastpage packages to customize the %% header and footer of each page \usepackage{fancyhdr, lastpage} \pagestyle{fancy} \fancyhf{} % %% Put your name and homework identification here \lhead{Joe Schmoe} \chead{ECE~481: \emph{Engineering Ethics}} \rhead{Homework 0} % \cfoot{Page \thepage{} of \protect\pageref{LastPage}} %% These next two lines are only used if you are going to cross %% reference equations in your submissions. They can probably be removed %% for 481 submissions. \usepackage{varioref} \labelformat{equation}{(#1)} %%%%%%%%%%%%%%%%%%%%%%%% MAIN DOCUMENT CONTENT %%%%%%%%%%%%%%%%%%%%%%%%% % We surround our main content with a ``document'' ``environment.'' This % marks the end of our LaTeX setup and the start of our document output. % % All ``environments'' are identified by \begin{...} and \end{...} % macros. \begin{document} % This is a note about running LaTeX twice. It's centered, 3/4 the width % of the printed type block, and it has a box around it. You can remove % it. \centerline{\fbox{\parbox{0.75\columnwidth}{\textbf{SPECIAL NOTE:} If you notice a few ``\textbf{??}'' in funny places in your document (e.g., the footer may say ``\textbf{Page 1 of ??}''), then run \LaTeX{} again. That information was not available in the first pass, but it will be filled in properly in the second pass.}}} % Creates a section header with ``Chapter 2 Questions'' in it \section{Chapter 2 Questions} % Creates a list \begin{itemize} % Pass optional items in square brackets to each \item macro. % Those optional items get displayed as the label for that item. \item[2.1.] Here is my answer to question~2.1 of the text of the book. This question has sub-parts, and so I use another list to answer them. % % An enumerate list will automatically count each item % for you. Pass it the type of label you want (e.g., 1. % or a) or i) or ...). See below for another example. \begin{enumerate}[a)] \item Answer to first sub-part. \item Answer to second sub-part. \end{enumerate} \item[2.7.] Here is my answer to question~2.7. It also has sub-parts, but for some reason they're given with roman numerals, and so I'll use lowercase roman numerals here too. % % Here's another example. This time we use lowercase % roman numeral counting. \begin{enumerate}[i)] \item Answer to first sub-part. \item Answer to second sub-part. \end{enumerate} \end{itemize} % Creates a section header with ``Chapter 3 Questions'' in it \section{Chapter 3 Questions} \begin{itemize} \item[3.2.] Question~3.2 asks me to list things, and so I give an unnumbered/unlettered list. % % Itemize gives us unnumbered lists. Without an optional % argument, each item displays a symbol corresponding to % how deep the current list is. \begin{itemize} \item First item in the list. \item Second item in the list. \item Third item in the list. \end{itemize} % I also say something after the list. \item[3.15.] Strangely, question~3.15 requires me to list a mathematical equation. % % Math is very nice to typeset in LaTeX. \begin{equation} \frac{\sin(2\pi T)}{2\pi} = \int_0^T \cos(2\pi t) dt \label{eq:trigcalc} \end{equation} % % You can refer to equations automatically (i.e., you % don't have to keep track of equation numbers). However, you probably don't need Equation~\ref{eq:trigcalc} in ECE~481. \end{itemize} % End the main document content \end{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%% END DOCUMENT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%