cheese: Add standard table headings to the cheese environment

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2016-02-09 20:54:31 -05:00
parent 3e88583b04
commit 8164ae505b
2 changed files with 27 additions and 16 deletions

View File

@ -7,20 +7,14 @@
\usepackage{gensymb}
\usepackage{graphicx}
\usepackage{hhline}
\usepackage{makecell}
\usepackage{multirow}
\usepackage[document]{ragged2e}
\usepackage[table]{xcolor}
% Create new table commands
\newcommand{\thickhline} { \Xhline{2\arrayrulewidth} }
\newcommand{\chline} { \hhline{|~*{7}{|-}|} }
\newcommand{\gray} { \cellcolor{gray!30} }
\newcommand{\tbhead}[1] { \bfseries\centering\arraybackslash\footnotesize{#1} }
\newcommand{\newsection}[2] { \thickhline\multirow{#2}{*}{\rotatebox{90}{\tbhead{#1}}} }
% Add a new column for centered columns of specified width
\newcolumntype{C}{>{\centering\arraybackslash}p{0.85in}}
\newcommand{\newsection}[2] { \thickline\multirow{#2}{*}{\rotatebox{90}{\tbhead{#1}}} }
% Let's make some shortcuts!
\newcommand{\tempF}[1] {#1\degree F}
@ -29,13 +23,6 @@
\begin{document}
\begin{cheese}{Cheddar}
\noindent
\setlength{\tabcolsep}{3pt}
\setlength{\extrarowheight}{4pt}
\begin{tabularx}{\textwidth}{ !{\vrule width 1pt} c !{\vrule width 1pt} c | C | C | C | C | c | X !{\vrule width 1pt} }
\thickhline
\tbhead{} & \tbhead{Operation} & \tbhead{Amount} & \tbhead{Time} & \tbhead{Goal Temp} & \tbhead{Actual Temp} & \tbhead{Ph} & \tbhead{Comments And Notes} \\
\newsection{Setup}{4}
& Prepare Milk & 2 gallons & & \gray & & & \\ \chline
@ -80,7 +67,5 @@
& Waxing & \gray & & \gray & \gray & & \\ \chline
& Aging & 3 - 12 months & & \tempF{50} - \tempF{55} & \gray & & \\
\thickhline
\end{tabularx}
\end{cheese}
\end{document}

View File

@ -3,8 +3,21 @@
%
\usepackage[landscape, top=0.8in, bottom=0.5in, left=0.7in, right=0.7in]{geometry}
\usepackage{makecell}
\usepackage{tabularx}
% Create a thick line for table borders
\newcommand{\thickline}{\Xhline{2\arrayrulewidth}}
% Set up a common table header style
\newcommand{\tbhead}[1]{\bfseries\centering\arraybackslash\footnotesize{#1}}
% Add a new column type for centered columns of specified width
\newcolumntype{C}{>{\centering\arraybackslash}p{0.85in}}
% ... and a new column type for thick vertical lines
\newcolumntype{'}{!{\vrule width 1pt}}
% Create a new environment that sets up everything we need to make cheese
\newenvironment{cheese}[1]
{
@ -19,6 +32,19 @@
& Pastuerized: ( Y / N )
& Other: \\
\end{tabularx}
\noindent
\setlength{\tabcolsep}{3pt}
\setlength{\extrarowheight}{4pt}
\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} \\
}
{
\thickline
\endtabularx
% FIXME: A newline was required for the \thickline to show up?
}