cheese/cheese.cls

155 lines
4.3 KiB
TeX

%
% 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{\third} {\(\frac{1}{3}\)}
\newcommand{\quarter} {\(\frac{1}{4}\)}
\newcommand{\threequarter} {\(\frac{3}{4}\)}
\newcommand{\eighth} {\(\frac{1}{8}\)}
\newcommand{\sixteenth} {\(\frac{1}{16}\)}
% 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{\simplebrine} {simple brine\footnote{1\half teaspoons salt in 1 cup water.}}
\newcommand{\wash}[1] {Slowly add \ftemp{#1} water. Stir continuously}
% Are we using cheese color or a secondary culture?
\newif\ifcolor
\colorfalse
\newif\ifsecondary
\secondaryfalse
\newcounter{cheese@acid}
\stepcounter{cheese@acid}
\stepcounter{cheese@acid}
% Macros for setting cheese variables
\newcommand{\cheeseName}[1]{\def\cheese@name{#1}}
\newcommand{\cheeseCulture}[3]
{
\def\cheese@culture{#1}
\def\cheese@cultureTemp{\ftemp{#3}}
\def\cheese@cultureAmount{#2}
}
\newcommand{\cheeseSecondary}[3]
{
\secondarytrue
\def\cheese@secondary{#1}
\def\cheese@secondaryTemp{\ftemp{#3}}
\def\cheese@secondaryAmount{#2}
\stepcounter{cheese@acid}
}
\newcommand{\cheeseRipening}[2]
{
\def\cheese@ripening{#1/\ftemp{#2}}
}
\newcommand{\cheeseColor}
{
\colortrue
\stepcounter{cheese@acid}
}
\newcommand{\cheeseRennet}[3]
{
\def\cheese@rennet{#1}
\def\cheese@setting{#2}
\def\cheese@flocculation{#3}
}
\renewcommand{\_}{ \\ \hhline{|~*{6}{|-}|}}
\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}}}
}
% Extend the \begin{document} command
\AtBeginDocument
{
\setlength{\extrarowheight}{2pt}
\begin{tabularx}{\textwidth}{ p{2.5in}lllX }
Cheese: \textbf{\cheese@name} & Flavors: \hfill & Date: & Yield: & 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|X' }
\thickline
\tbhead{} & \tbhead{Operation} & \tbhead{Amount} & \tbhead{Time}
& \tbhead{Goal Temp} & \tbhead{Actual Temp}
& \tbhead{Comments And Notes} \\
\section{Setup}{3}
\cheeseStepTemp{Prepare Milk }{ }{\gray}{ }
\cheeseStepNoTemp{Begin Heating }{ }{ }
\cheeseStepTemp{Remove from Heat}{\gray}{ }
\section{Acid}{\thecheese@acid}
\cheeseStepTemp{\cheese@culture}{ }{\cheese@cultureTemp}
{(Optional for raw milk) \cheese@cultureAmount.}
\ifsecondary
\cheeseStepTemp{\cheese@secondary}{ }{\cheese@secondaryTemp}
{\cheese@secondaryAmount.}
\fi
\cheeseStepTemp{Ripening}{ }{ }
{Natural: 1 hour/\ftemp{90}, \cheese@culture: \cheese@ripening.}
\ifcolor
\cheeseStepNoTemp{Cheese Color}{ }{(Optional) Follow directions on bottle.}
\fi
\section{Gel Devel}{4}
\cheeseStepTemp{Rennet }{ }{\gray}{\cheese@rennet. Stir 1 minute.}
\cheeseStepNoTemp{Setting }{ }{Natural: 1 hour, \cheese@culture: \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?
}