From 8164ae505b3ed8552365c2193618d27dcf94568a Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Tue, 9 Feb 2016 20:54:31 -0500 Subject: [PATCH] cheese: Add standard table headings to the cheese environment Signed-off-by: Anna Schumaker --- cheddar.tex | 17 +---------------- cheese.sty | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/cheddar.tex b/cheddar.tex index 1b38d2c..f75731c 100644 --- a/cheddar.tex +++ b/cheddar.tex @@ -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} diff --git a/cheese.sty b/cheese.sty index 6ec678f..5ebae05 100644 --- a/cheese.sty +++ b/cheese.sty @@ -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? }