Willipedia is now back online as of 5/5/2019 |
It has been several years since Willipedia closed. Please help get it updated! |
Go to the Willipedia 2.0 Project to learn more. |
Difference between revisions of "LaTeX Problem Set Template"
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
[[Category:Computers]] | [[Category:Computers]] | ||
[[Category:LaTeX]] | [[Category:LaTeX]] | ||
+ | [[Category:How-To]] | ||
Here's a basic template that makes typesetting those problem sets in LaTeX a breeze. Comes with a "problem" environment with section dividers. Nothing fancy but it is not too difficult to customize. | Here's a basic template that makes typesetting those problem sets in LaTeX a breeze. Comes with a "problem" environment with section dividers. Nothing fancy but it is not too difficult to customize. | ||
− | + | == Problem Set Template == | |
− | + | ||
− | |||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
%%%This is a science homework template. Modify the preamble to suit your needs. | %%%This is a science homework template. Modify the preamble to suit your needs. | ||
Line 13: | Line 13: | ||
\documentclass[12pt]{article} | \documentclass[12pt]{article} | ||
− | + | ||
− | |||
%AMS-TeX packages | %AMS-TeX packages | ||
\usepackage{amssymb,amsmath,amsthm} | \usepackage{amssymb,amsmath,amsthm} | ||
− | |||
%geometry (sets margin) and other useful packages | %geometry (sets margin) and other useful packages | ||
\usepackage[margin=1.25in]{geometry} | \usepackage[margin=1.25in]{geometry} | ||
\usepackage{graphicx,ctable,booktabs} | \usepackage{graphicx,ctable,booktabs} | ||
− | + | ||
− | + | ||
% | % | ||
%Redefining sections as problems | %Redefining sections as problems | ||
Line 40: | Line 38: | ||
\begin{center}\large\bf \ldots\ldots\ldots\end{center}} | \begin{center}\large\bf \ldots\ldots\ldots\end{center}} | ||
\makeatother | \makeatother | ||
− | + | ||
− | + | ||
% | % | ||
%Fancy-header package to modify header/page numbering | %Fancy-header package to modify header/page numbering | ||
Line 59: | Line 57: | ||
\setlength\voffset{-0.25in} | \setlength\voffset{-0.25in} | ||
\setlength\textheight{648pt} | \setlength\textheight{648pt} | ||
− | + | ||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
− | + | ||
% | % | ||
%Contents of problem set | %Contents of problem set | ||
% | % | ||
\begin{document} | \begin{document} | ||
− | + | ||
\title{Course Name: Problem Set/Homework \#} | \title{Course Name: Problem Set/Homework \#} | ||
\author{Author} | \author{Author} | ||
\date{date} | \date{date} | ||
− | + | ||
\maketitle | \maketitle | ||
− | + | ||
\thispagestyle{empty} | \thispagestyle{empty} | ||
− | + | ||
%Example problems | %Example problems | ||
\begin{problem}{\it Gravity} | \begin{problem}{\it Gravity} | ||
Line 108: | Line 106: | ||
\end{problem} | \end{problem} | ||
− | + | ||
\begin{problem}{} | \begin{problem}{} | ||
\end{problem} | \end{problem} | ||
− | + | ||
\end{document} | \end{document} |
Latest revision as of 14:19, July 23, 2011
Here's a basic template that makes typesetting those problem sets in LaTeX a breeze. Comes with a "problem" environment with section dividers. Nothing fancy but it is not too difficult to customize.
Problem Set Template
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%This is a science homework template. Modify the preamble to suit your needs. %The junk text is there for you to immediately see how the headers/footers look at first %typesetting. \documentclass[12pt]{article} %AMS-TeX packages \usepackage{amssymb,amsmath,amsthm} %geometry (sets margin) and other useful packages \usepackage[margin=1.25in]{geometry} \usepackage{graphicx,ctable,booktabs} % %Redefining sections as problems % \makeatletter \newenvironment{problem}{\@startsection {section} {1} {-.2em} {-3.5ex plus -1ex minus -.2ex} {2.3ex plus .2ex} {\pagebreak[3]%forces pagebreak when space is small; use \eject for better results \large\bf\noindent{Problem } } } {%\vspace{1ex}\begin{center} \rule{0.3\linewidth}{.3pt}\end{center}} \begin{center}\large\bf \ldots\ldots\ldots\end{center}} \makeatother % %Fancy-header package to modify header/page numbering % \usepackage{fancyhdr} \pagestyle{fancy} %\addtolength{\headwidth}{\marginparsep} %these change header-rule width %\addtolength{\headwidth}{\marginparwidth} \lhead{Problem \thesection} \chead{} \rhead{\thepage} \lfoot{\small\scshape course name} \cfoot{} \rfoot{\footnotesize PS \#} \renewcommand{\headrulewidth}{.3pt} \renewcommand{\footrulewidth}{.3pt} \setlength\voffset{-0.25in} \setlength\textheight{648pt} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %Contents of problem set % \begin{document} \title{Course Name: Problem Set/Homework \#} \author{Author} \date{date} \maketitle \thispagestyle{empty} %Example problems \begin{problem}{\it Gravity} my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set my problem set \end{problem} \begin{problem}{} \end{problem} \end{document}