[Tex/LaTex] Document class for writing class note

document-classestemplates

I would like to know the document class to write my lecture notes and assignments questions which I will be using for a course I am teaching.

I want your valuable suggestions in this regard.

Best Answer

It depends what you want your lecture notes to look like! Usually, I use the article document class with amsthm and other AMS-packages. When I type up notes I took from someone else's lectures, I also add the following macros to my document header:

\documentclass{article}
\usepackage{amsthm}

\makeatletter
\def\lecture{\@ifnextchar[{\@lectureWith}{\@lectureWithout}}
\def\@lectureWith[#1]{\medbreak\refstepcounter{section}%
  \renewcommand{\leftmark}{Lecture \thesection}
  \noindent{\addcontentsline{toc}{section}{Lecture \thesection: #1\@addpunct{.}}%
  \sectionfont Lecture \thesection. #1\@addpunct{.}}\medbreak}
\def\@lectureWithout{\medbreak\refstepcounter{section}%
  \renewcommand{\leftmark}{Lecture \thesection}
  \noindent{\addcontentsline{toc}{section}{Lecture \thesection.}%
  \sectionfont Lecture \thesection.}\medbreak}
\makeatother

\title{Long Boring Lectures on 0-dimensional Manifolds}
\author{Alex Nelson}
\begin{document}
\maketitle

\lecture % it's ok for it to not take any arguments
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod 
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, 
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo 
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse 
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat 
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

\lecture[I'M BRILLIANT] % It can also take an argument
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis 
praesentium voluptatum deleniti atque corrupti quos dolores et quas 
molestias excepturi sint occaecati cupiditate non provident, similique sunt in 
culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et 
harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum 
soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime 
placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.
 Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus 
saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. 
Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis 
voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
\end{document}

enter image description here

Addendum on Exercises

These macros I'm going to share aren't the best, but it's the best I have thanks to the laziness I possess.

I use exercises and problems throughout my notes. "Problems" are usually "Motivating questions I ask myself to induce the reader to want to get to the next section, but first attempt to derive something themselves" --- kind of like an exercise with a "spoiler alert" that its solution will follow.

These I just use amsthm for:

\theoremstyle{theorem}
\newtheorem{xca}{Exercise}
\theoremstyle{definition}
\newtheorem{prob}{Problem}

I sometimes use Donald Knuth's macros, or adapt them to LaTeX, for exercises (which you may want). The following supposes you want to keep your answers together and shown at the end (if at all). Just add to your pre-amble:

\makeatletter
%%%%%%%%%%
% Exercise Macros
%%%%%%%%%%
\def\textindent#1{\indent \llap {#1\enspace }\ignorespaces}
\newcounter{exercise}[section]
\def\exercise [#1]{\refstepcounter{exercise}%
  \ifnum\value{exercise}>1 \smallbreak\fi
  \textindent{\textbf{\theexercise.}}[\textit{#1\/}]\kern6pt}
\def\suggestedExercise [#1]{\refstepcounter{exercise}%
  \ifnum\value{exercise}>1 \smallbreak\fi
  \textindent{\llap{\manual x\hskip3pt}\bf{\hbox to
     \ifnum \value{exercise}>99 1.5em\else 1em\fi%
     {\hfil\theexercise}}.}[\textit{#1\/}]\kern6pt}

\def\HM{H\kern-.1em M} % used for "higher math" exercise ratings
\def\MN{M\kern-.1em N} % used in Section 4.3.1 when $MN$ appears frequently

\newenvironment{exercises}{\medskip\noindent\ignorespaces\section*{Exercises}%
        \parindent=0pt}{}

\newwrite\ans%
\immediate\openout\ans=tex/answers % file for answers to exercises
\def\loadAnswers{\immediate\closeout\ans
  \input{tex/answers}}
\def\ansSec#1{\immediate\write\ans{\detokenize{\section*}{#1}}}
\def\ansno#1:{\smallbreak\textindent{\textbf{#1.\enspace}}}
\newenvironment{answer}%
 {\par\medbreak
    \immediate\write\ans{}%
    \immediate\write\ans{\string\ansno\arabic{exercise}:}%
  \@bsphack
  \let\do\@makeother\dospecials\catcode`\^^M\active
  \def\verbatim@processline{%
    \immediate\write\ans{\the\verbatim@line}}%
  \verbatim@start}%
 {\@esphack} 

%% Sometimes there's an alternate way to solve the problem
%% TODO: Make this include an optional argument specifying how it
%%       was done, so one can use the following code snippet
%% \begin{altAns}[Using Complex Analysis]
%% ...
%% \end{altAns}
\newenvironment{altAns}%
 {\par\medbreak
    \immediate\write\ans{}%
    \immediate\write\ans{\string\ansno\theexercise (Alternate):}%
  \@bsphack
  \let\do\@makeother\dospecials\catcode`\^^M\active
  \def\verbatim@processline{%
    \immediate\write\ans{\the\verbatim@line}}%
  \verbatim@start}%
 {\@esphack} 
\makeatother

How to use them? Well, for example:

\begin{exercises}
\suggestedExercise [01\M] What's $\sqrt{2}$ to 12 digits?
\begin{answer}
We have $\sqrt{2}\approx 1.41421356237...$
\end{answer}
\exercise [45\HM] Solve the Riemann conjecture.
\end{exercises}

The "suggested exercise" has a triangle in the left margin pointing to it, just as Knuth has in his TeXbook. To load the solutions, you just need to call the \loadAnswers{} macro.