Add new documentclass for cheeses

I think this will work out easier than creating a custum package.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2016-07-05 10:43:29 -04:00
parent 8a9f93cd68
commit cf13cb3071
1 changed files with 123 additions and 0 deletions

123
cheese.cls Normal file
View File

@ -0,0 +1,123 @@
%
% Copyright 2016 (c) Anna Schumaker.
%
\ProvidesClass{cheese}
\RequirePackage{kvoptions}
\DeclareStringOption[10pt]{rowheight}
\ProcessKeyvalOptions*
\LoadClass[letterpaper]{letter}
\RequirePackage{gensymb}
\RequirePackage[landscape,top=0.8in,bottom=0.5in,left=0.7in,right=0.7in]{geometry}
\RequirePackage{graphicx}
\RequirePackage{hhline}
\RequirePackage{ifthen}
\RequirePackage{makecell}
\RequirePackage{multirow}
\RequirePackage{tabularx}
\RequirePackage[table]{xcolor}
\pagestyle{empty}
% Preformat some fractions
\newcommand{\half} {\(\frac{1}{2}\)}
\newcommand{\quarter} {\(\frac{1}{4}\)}
\newcommand{\eighth} {\(\frac{1}{8}\)}
% Format a Fahrenheit temperature
\newcommand{\ftemp}[1] {#1\degree F}
% Make reusable messages for the notes section
\newcommand{\diluted} {Diluted in \quarter cup distilled water}
\newcommand{\dilutemilk} {Diluted in \quarter cup cheese milk}
\newcommand{\packettsp} {1 packet = \quarter teaspoon}
% Macros for setting cheese variables
\newcommand{\cheeseName}[1]{\def\cheese@name{#1}}
\newcommand{\cheeseMilk}[1]{\def\cheese@milk{#1}}
\newcommand{\cheeseCaCl}[1]{\def\cheese@CaCl{#1}}
\newcommand{\cheeseCulture}[4]
{
\def\cheese@culture{#1}
\def\cheese@cultureAmt{#2}
\def\cheese@cultureTemp{\ftemp{#3}}
\def\cheese@cultureNote{#4}
}
\newcommand{\cheeseRipening}[2]
{
\def\cheese@ripening{#1}
\def\cheese@ripeningTemp{\ftemp{#2}}
}
\newcommand{\cheeseRennet}[1]{\def\cheese@rennet{#1}}
\newcommand{\cheeseSetting}[1]{\def\cheese@setting{#1}}
\newcommand{\cheeseFlocculation}[1]{\def\cheese@flocculation{#1}}
\renewcommand{\_}{ \\ \hhline{|~*{7}{|-}|}}
\newcommand{\cheeseStep}[5] { & #1 & #2 & & #3 & #4 & & #5 \_ }
\newcommand{\cheeseStepTemp}[4] { & #1 & #2 & & #3 & & & #4 \_ }
\newcommand{\cheeseStepNoTemp}[3] { & #1 & #2 & & \gray & \gray & & #3 \_ }
% Create some useful table formatting macros
\newcommand{\thickline}{\Xhline{2\arrayrulewidth}}
\newcommand{\tbhead}[1]{\bfseries\centering\arraybackslash\footnotesize{#1}}
\newcommand{\gray}{\cellcolor{gray!30}}
\newcolumntype{C}{>{\centering\arraybackslash}p{0.85in}}
\newcolumntype{'}{!{\vrule width 1pt}}
\newcommand{\section}[2]
{
\thickline\multirow{#2}{*}{\rotatebox{90}{\tbhead{#1}}}
%\global\setboolean{cheeseFirstStep}{true}
}
% Extend the \begin{document} command
\AtBeginDocument
{
\setlength{\extrarowheight}{2pt}
\begin{tabularx}{\textwidth}{ p{2.5in}lllX }
Cheese: \textbf{\cheese@name} & Flavors: \hfill & & Date: & Age Until: \\
Milk Brand: \hfill & Type: ( Whole / \hspace{0.5in} )
& Homogenized: ( Y / N )
& Pastuerized: ( Y / N )
& Milked On: \\
\end{tabularx}
}
\newenvironment{cheese}
{
\setlength{\tabcolsep}{3pt}
\setlength{\extrarowheight}{\cheese@rowheight}
\tabularx{\textwidth}{ 'c'c|C|C|C|C|c|X' }
\thickline
\tbhead{} & \tbhead{Operation} & \tbhead{Amount} & \tbhead{Time}
& \tbhead{Goal Temp} & \tbhead{Actual Temp}
& \tbhead{\ pH\ } & \tbhead{Comments And Notes} \\
\section{Setup}{4}
\cheeseStepTemp{Prepare Milk }{\cheese@milk}{\gray}{ }
\cheeseStepNoTemp{Calcium Chloride}{\cheese@CaCl}{(Optional) \diluted.}
\cheeseStepNoTemp{Begin Heating }{ }{ }
\cheeseStepTemp{Remove from Heat}{\gray}{ }
\section{Acid}{2}
\cheeseStepTemp{\cheese@culture }{\cheese@cultureAmt}
{\cheese@cultureTemp}{\cheese@cultureNote}
\cheeseStepTemp{Ripening}{\cheese@ripening}{\cheese@ripeningTemp}{ }
\section{Gel Devel}{4}
\cheeseStepTemp{Rennet }{\cheese@rennet }{\gray}{\diluted. Stir 1 minute.}
\cheeseStepNoTemp{Setting }{\cheese@setting}{ }
\cheeseStepNoTemp{Onset of Flocculation}{\cheese@flocculation}{ }
\cheeseStepNoTemp{Clean Break}{\gray}{ }
}
{
\thickline
\endtabularx
% FIXME: A newline was required for the \thickline to show up?
}