LaTeX class for lecture notes

In the last post I wrote about how to take notes with LaTeX; that post focused on speed, and there were a sty file with the macros defined for that purpose. Here I won’t speak about speed, but style.

To begin, LaTeX class file for lecture notes you can find the class file I wrote for my notes. Just put it in you LaTeX tree (or in the directory of your document), with the sty file, and write a document with the following structure.

\documentclass[OPTIONS]{Notes}

\title{TITLE}
\subject{SUBJECT}
\author{AUTHOR}
\email{EMAIL}
\speaker{SPEAKER}
\date{DD}{MM}{YYYY}
\dateend{DD}{MM}{YYYY}
\place{PLACE}

\begin{document}

\end{document}

Obviously you have to replace the values, or, when appropriate, delete some line. Note that “author” and “email” are name and e-mail of the notes taker. The options (see the first line) are these:

  • english or italian: the document’s language;
  • course, seminar or talk: a course is a medium-length document structured in sections, subsections and paragraphs; a seminar is a short document without structure or with subsections; a talk is the sheets you take with you when you give a seminar.

The second option defines the style of the document; if you want to tweak some parameters, there are also these fine-tuning options:

  • headertitle, headersection, headersubsection or headerno: what to display on the top of the pages;
  • theoremnosection, theoremsection or theoremsubsection: numbering of theorems, definitions, etc.;
  • cleardoublepage or nocleardoublepage: whether we want empty double pages after a section ending;
  • oneside or twoside: margins and headers optimized for one-sided or two-sided printing;
  • onecolumn or twocolumn: how many columns per page.

The class defines also some commands:

  • for course, the command \lecture{duration}{dd}{mm}{yyyy} which writes on the margin information about the lesson’s number, duration and date;
  • for talk, the commands \separator, which simply draws a horizontal line, and \tosay{message} which prints the message inside a box (useful to remember things you don’t have to write on the blackboard);
  • \mymarginpar{message}, which behaves like a regular \marginpar but with a custom style.

Two words on what you get with this class file: the main difference is the font (Palatino instead of Computer Modern); the second main difference is the use of small-caps instead of boldface. I have to say I needed these modifications because I was very tired of the standard, omnipresent LaTeX style. Other small notable differences are the centered titles—because I’m not writing a book—and the theorem numbers placed before the word “theorem”—to make easier searching for them. If you want to see an example, download a recent document from my lecture notes page.

Let’s give a look on the packages this class requires, at least the ones you should use in your everyday documents.

  • hyperref: many PDF on the web doesn’t have hyperlinks, from the table of contents to the sections, to an equation from where they refer to it, etc. With this package you can have automatically all these links and also tweak PDF metadatas.
  • mathtools: enhancements of the standard AMS-LaTeX packages; the documentation is an inspiring source of tips for beautiful typesetting.
  • booktabs: standard LaTeX tables look poorer than they should; learn why reading booktabs’ documentation.
  • multirow: tables with cells spanning multiple rows.
  • fancyhdr: to customize the content of headers and footers.
  • mparhack: workaround for a bug on LaTeX \marginpar.
  • tikz: it’s a high-level drawing language, designed by Till Tantau (you can remember him for software like latex-beamer); you can see a gallery with examples here.
  • mathdots: redefines \dots and its friends so that they change size when appropriate.
  • xfrac: to typeset nice inline fractions, as in ½.
  • faktor: same as before, but without shrinking denominator’s and numerator’s size; useful for quotients.
  • cancel: to draw diagonal bars above terms in an equation.

Please note that my class is not licensed in any way. If you want to use it, you’re free to do anything you want with them. Anyway, I will be happy if you just drop me a line telling me you’re using it.

8 thoughts on “LaTeX class for lecture notes

  1. Adam

    Seems like this doesn’t work. I get an error:

    ! LaTeX Error: File `Notes.cls’ not found.

    I changed the file to Notes.cls (from notes.cls) but then get more errors:

    This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)
    entering extended mode
    (/home/amg81/Documents/UW/Stat 581/.algebraic_stacks.tex.swp
    LaTeX2e
    Babel and hyphenation patterns for english, usenglishmax, dumylang, noh
    yphenation, loaded.
    (./Notes.cls
    Document Class: Notes
    (/usr/share/texmf-texlive/tex/latex/base/ifthen.sty)
    (/usr/share/texmf-texlive/tex/latex/datetime/datetime.sty
    (/usr/share/texmf-texlive/tex/latex/fmtcount/fmtcount.sty
    (/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty)
    (/usr/share/texmf-texlive/tex/latex/amsmath/amsgen.sty)
    (/usr/share/texmf-texlive/tex/latex/fmtcount/fc-english.def)
    (/usr/share/texmf-texlive/tex/latex/fmtcount/fc-USenglish.def)
    No configuration file fmtcount.cfg found.
    )) (/usr/share/texmf-texlive/tex/latex/base/article.cls
    Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
    (/usr/share/texmf-texlive/tex/latex/base/size10.clo))
    (/usr/share/texmf-texlive/tex/generic/babel/babel.sty
    (/usr/share/texmf-texlive/tex/generic/babel/english.ldf
    (/usr/share/texmf-texlive/tex/generic/babel/babel.def)
    /usr/share/texmf-texlive/tex/generic/babel/english.ldf:106: Missing number, tre
    ated as zero.

    \l@british
    l.106 \adddialect\l@australian\l@british

    /usr/share/texmf-texlive/tex/generic/babel/english.ldf:106: ==> Fatal error oc
    curred, no output PDF file produced!
    Transcript written on /tmp/.algebraic_stacks.tex.log.

  2. Stefano Post author

    Adam: this is not a problem of my class (or, more precisely, probably I could avoid this problem but I haven’t time to do it). To look at more people having this problem, you can google it. An example is this.

    To fix this (in a non-particularly-elegant way), you can comment out those lines 106-110 in /tex\generic\babel\english.ldf.

    A more elegant, but maybe not working, way is to install the language UKenglish on your system (for example the package texlive-lang-ukenglish on Ubuntu).

  3. Christopher

    So, just letting you know that I have found this class file immensely useful in graduate school and use it daily for everything from lecture notes to preparing my own notes. Awesome design.

Leave a Reply