| 1 |
\documentclass{willowtreebook} |
| 2 |
\Title{The Willow Tree Book Class 1.03} |
| 3 |
\Author{Benjamin \scotsMc{}Kay} |
| 4 |
\Colophon{Released under the \LaTeX{} Public Project License 1.3c} |
| 5 |
\BibliographyFile{willowtreebook} |
| 6 |
\usepackage{fancyvrb} |
| 7 |
\usepackage{inconsolata} |
| 8 |
\begin{document} |
| 9 |
\includegraphics[width=\textwidth]{willow-2.jpg}% |
| 10 |
\chapter{Preface} |
| 11 |
The Willow Tree Book class is a simplified derivative of the \verb!memoir! book class. |
| 12 |
I use it for my lecture notes. |
| 13 |
The document you are reading is in the Willow Tree Book class. |
| 14 |
\afterpreface |
| 15 |
\chapter{Use} |
| 16 |
Here is a typical book using the Willow Tree Book class: |
| 17 |
\begin{Verbatim}[frame=leftline] |
| 18 |
\documentclass{willowtreebook} |
| 19 |
\Title{Odyssey} |
| 20 |
\Author{Homer} |
| 21 |
\BibliographyFile{odyssey} |
| 22 |
% The name of the .bib file, without file extension. |
| 23 |
\begin{document} |
| 24 |
\chapter{Preface} |
| 25 |
This is the preface to my book. |
| 26 |
\afterpreface |
| 27 |
\chapter{We meet Odysseus} |
| 28 |
Tell me, O muse, of that ingenious hero |
| 29 |
% The rest of the text goes here. |
| 30 |
Thus spoke Minerva, and Ulysses obeyed her gladly. Then Minerva assumed |
| 31 |
the form and voice of Mentor, and presently made a covenant of peace |
| 32 |
between the two contending parties. |
| 33 |
\par\bigskip\noindent |
| 34 |
THE END |
| 35 |
% End the document without loading the bibliography |
| 36 |
% or the index, or the list of notation. |
| 37 |
\end{document} |
| 38 |
\end{Verbatim} |
| 39 |
Compile with \verb!latex! or \verb!pdflatex!. |
| 40 |
\chapter{Definitions, Problems and Theorems} |
| 41 |
\section{Definitions} |
| 42 |
We can define a term like \emph{hamster}\define{hamster}, or say that the term hamster\SubIndex{hamster} appears again later. |
| 43 |
\begin{Verbatim}[frame=leftline] |
| 44 |
\chapter{Definitions, Problems and Theorems} |
| 45 |
\section{Definitions} |
| 46 |
We can define a term like \emph{hamster}\define{hamster}, |
| 47 |
or say that the term hamster\SubIndex{hamster} appears again later. |
| 48 |
\end{Verbatim} |
| 49 |
Compile, for a book called \verb!filename.tex!, with |
| 50 |
\begin{Verbatim}[frame=leftline] |
| 51 |
makeindex filename |
| 52 |
\end{Verbatim} |
| 53 |
We add notation like when we use a variable called \(\omega\), |
| 54 |
we put it in the list of notation.% |
| 55 |
\Notation{omega}{\omega}{A variable called $\omega$} |
| 56 |
\begin{Verbatim} |
| 57 |
We add notation like when we use a variable called \(\omega\), |
| 58 |
we put it in the list of notation.% |
| 59 |
\Notation{omega}{\omega}{A variable called $\omega$} |
| 60 |
\end{Verbatim} |
| 61 |
If you use notation, compile with |
| 62 |
\begin{Verbatim}[frame=leftline] |
| 63 |
makeindex -s notation.gst -o not.gls not.glo |
| 64 |
\end{Verbatim} |
| 65 |
\section{Problems} |
| 66 |
\begin{problem}{label.for.the.first.problem} |
| 67 |
What is the point of your life? |
| 68 |
\end{problem} |
| 69 |
\begin{answer}{label.for.the.first.problem} |
| 70 |
Your life is pointless. |
| 71 |
\end{answer} |
| 72 |
In problem~\ref{problem:label.for.the.first.problem}, we can clearly see ... |
| 73 |
\begin{Verbatim}[frame=leftline] |
| 74 |
% We add problems by: |
| 75 |
\begin{problem}{label.for.the.first.problem} |
| 76 |
What is the point of your life? |
| 77 |
\end{problem} |
| 78 |
% and answers by: |
| 79 |
\begin{answer}{label.for.the.first.problem} |
| 80 |
Your life is pointless. |
| 81 |
\end{answer} |
| 82 |
In problem~\ref{problem:label.for.the.first.problem}, we can clearly see ... |
| 83 |
\end{Verbatim} |
| 84 |
\chapter{Citations} |
| 85 |
Our bibliography file looks like |
| 86 |
\VerbatimInput[frame=leftline]{willowtreebook.bib} |
| 87 |
We can cite works from the bibliography, like Homer~\cite{Homer:Iliad}, p. 12. |
| 88 |
\begin{Verbatim}[frame=leftline] |
| 89 |
We can cite works from the bibliography, like Homer~\cite{Homer:Iliad}, p. 12. |
| 90 |
\end{Verbatim} |
| 91 |
Compile with \verb!bibtex!. |
| 92 |
\section{Theorems} |
| 93 |
You have the usual theorem environments, like \texttt{amsthm}. |
| 94 |
\begin{theorem}[Pythagoras] |
| 95 |
In any triangle with sides of lengths \(a,b,c\), \(a^2+b^2=c^2\) just when the angle opposite the side of length \(c\) is a right angle. |
| 96 |
\end{theorem} |
| 97 |
\begin{Verbatim}[frame=leftline] |
| 98 |
\begin{theorem}[Pythagoras] |
| 99 |
In any triangle with sides of lengths \(a,b,c\), |
| 100 |
\(a^2+b^2=c^2\) just when the angle opposite the |
| 101 |
side of length \(c\) is a right angle. |
| 102 |
\end{theorem} |
| 103 |
\end{Verbatim} |
| 104 |
\newpage |
| 105 |
\section{Examples} |
| 106 |
I often want to present an example, and make clear where it starts and stops. |
| 107 |
\begin{example} |
| 108 |
The integral |
| 109 |
\[ |
| 110 |
\int e^{x^2}x\,dx |
| 111 |
\] |
| 112 |
is evaluated by substituting \(u=x^2\), so |
| 113 |
\[ |
| 114 |
\int e^{x^2}x\,dx=\int e^u \frac{du}{2}. |
| 115 |
\] |
| 116 |
\end{example} |
| 117 |
\begin{Verbatim}[frame=leftline] |
| 118 |
\begin{example} |
| 119 |
The integral |
| 120 |
\[ |
| 121 |
\int e^{x^2}x\,dx |
| 122 |
\] |
| 123 |
is evaluated by substituting \(u=x^2\), so |
| 124 |
\[ |
| 125 |
\int e^{x^2}x\,dx=\int e^u \frac{du}{2}. |
| 126 |
\] |
| 127 |
\end{example} |
| 128 |
\end{Verbatim} |
| 129 |
\section{Preambles} |
| 130 |
We can put some \LaTeX{} code before the hints: |
| 131 |
\begin{Verbatim}[frame=leftline] |
| 132 |
\RenewDocumentCommand\hintsPreamble{}{ |
| 133 |
\par\noindent{} |
| 134 |
\textit{When you are describing, \\ |
| 135 |
A shape, or sound, or tint; \\ |
| 136 |
Don't state the matter plainly, \\ |
| 137 |
But put it in a hint; \\ |
| 138 |
And learn to look at all things, \\ |
| 139 |
With a sort of mental squint.} |
| 140 |
\par\noindent{}---\ {Lewis Carroll}} |
| 141 |
\end{Verbatim} |
| 142 |
\RenewDocumentCommand\hintsPreamble{}{\par\noindent{}\textit{When you are describing, \\ A shape, or sound, or tint; \\ Don't state the matter plainly, \\ But put it in a hint; \\\ And learn to look at all things, \\ With a sort of mental squint.}\par\noindent{}---\ {Lewis Carroll}} |
| 143 |
or before the bibliography: |
| 144 |
\begin{Verbatim}[frame=leftline] |
| 145 |
\RenewDocumentCommand\bibliographyPreamble{}{ |
| 146 |
\par\noindent |
| 147 |
\textit{If those books are in agreement with the Quran, |
| 148 |
we have no need of them; |
| 149 |
and if these are opposed to the Quran, |
| 150 |
destroy them.} |
| 151 |
\par\noindent{}---\ {Omar}} |
| 152 |
\end{Verbatim} |
| 153 |
\RenewDocumentCommand\bibliographyPreamble{}{\par\noindent\textit{If those books are in agreement with the Quran, we have no need of them; and if these are opposed to the Quran, destroy them.}\par\noindent{}---\ {Omar}} |
| 154 |
\end{document} |