Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/recipe-books.git
example-recipe.tex
\begin{document}
-
-\tableofcontents
+\tableofcontents*
\begin{recipe}{Pizza Dough}
recipe-book.cls
\ProvidesClass{recipe-book}[2013/01/14]
-\LoadClass[twoside]{article}
-\RequirePackage[letterpaper]{geometry}
+\LoadClass[twoside,article]{memoir}
+\setstocksize{10in}{8in}
-\RequirePackage{ifxetex,ifpdf}
+%%%% We'll need these packages most probably
+\RequirePackage[xcolornames,svgnames,dvipsnames]{xcolor}
\RequirePackage{enumitem}
-\setlist{leftmargin=*}
+\RequirePackage{etoolbox}
+%%%% Will we allow xetex? Beautiful OTF fonts are all very well and fine, but licensing concerns?
+\RequirePackage{ifxetex,ifpdf}
+
+%\setlist{leftmargin=*}
\setcounter{secnumdepth}{0}
\setcounter{tocdepth}{1}
%%%% TODO cooking time, preparation time, portion... "atomic" fields
-%%%% TODO Define colour and font variables
-% primary colour 1, primary colour 2, primary colour 3, highlight, text colour
-% serif, sans serif, flourish
+\newcommand{\maintextcolor}{black}
+\newcommand{\primarycolor}{blue}
+\newcommand{\secondarycolor}{blue!80}
+\newcommand{\tertiarycolor}{blue!60}
+\newcommand{\darkhighlight}{red!80!black}
+\newcommand{\brighthighlight}{red}
+\newcommand{\highlightcolor}{\darkhighlight}
+
+\newcommand{\scriptdefault}{pzc}
+\newcommand{\scriptfamily}{\fontfamily{\scriptdefault}\selectfont}
+
+\newcommand{\recipecolor}{\highlightcolor}
+\newcommand{\recipefamily}{\sffamily}
+\newcommand{\recipesize}{\LARGE}
+\newcommand{\recipestyle}{\bfseries}
+\newcommand{\recipefont}{\recipefamily\recipesize\color{\recipecolor}\recipestyle}
+
+\newcommand{\headingcolor}{\primarycolor}
+\newcommand{\headingfamily}{\sffamily}
+\newcommand{\headingsize}{\large}
+\newcommand{\headingstyle}{\itshape}
+\newcommand{\headingfont}{\headingfamily\headingsize\color{\headingcolor}\headingstyle}
+
+\setsecheadstyle{\recipefont}
+\setsubsecheadstyle{\headingfont}
+
+\newcommand{\equipmentstyle}{leftmargin=*}
+\newcommand{\ingredientsstyle}{label=\textbullet,leftmargin=*}
+\newcommand{\instructionsstyle}{label={\arabic*. },leftmargin=*}
+
%%%% list styles are layout
%%%% Basic structures, redefine as needed in theme files using titlesec and enumitem.
-\newenvironment{recipe}[1]
-{\clearpage\section{#1}}
-{}
+\newenvironment{recipe}[1]{%
+ \clearpage%
+ \color{\maintextcolor}%
+ \section{#1}
+}{}
\newenvironment{equipment}[1][Equipment]{%
\subsection{#1}
+ \expandafter\setlist\expandafter{\equipmentstyle}%
\begin{description}
}{%
\end{description}
}
\newenvironment{ingredients}[1][Ingredients]{%
- \subsection{#1}
+ \subsection{#1}%
+ \expandafter\setlist\expandafter{\ingredientsstyle}%
\begin{itemize}
}{%
\end{itemize}
}
\newenvironment{instructions}[1][Cooking Instructions]{%
\subsection{#1}
+ \expandafter\setlist\expandafter{\instructionsstyle}%
\begin{enumerate}
}{

Barebones skeleton recipe-book.cls with most theme hooks in place.

Author liantze <email>
Date 2013-01-14 15:47:27 GMT+0800
Commit 17c7899c48c55c748a890a90ea41daf13664690a
Parent 3b94356
Delta 49 lines added, 13 lines removed, 36-line increase