LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Custom Environment for special Recipe Layout

Information and discussion about graphics, figures & tables in LaTeX documents.
professorbell
Posts: 6
Joined: Fri Apr 12, 2013 4:46 am

Custom Environment for special Recipe Layout

There is a pretty nice website called "Cooking for Engineers". That formats recipes as follows.

recipe-sample.png (45.91 KiB) Viewed 1994 times

I personally think that this style is excellent, and like to store my own kitchen and lab related recipes in the same format. I usually just draw out the table by hand in a notebook but this is time consuming and annoying when one decides to make modifications after the fact. I would prefer to use \LaTeX to compile a PDF with all of my recipes nicely organized and sectioned.

The solution using the {tabular} environment is passable but clunky and unintuitive (i.e. hard to just sit down and type...) and it feels a bit like a hack:
\subsection*{Crepes} %ingredients \begin{tabular}{|l|l|l|c|c|c|c|}\hline1-2		&	Oz		&	Baileys				&	Consume Copiously		& \multirow{6}{*}{Whisk}	& \multirow{8}{*}{Combine Slowly}	& 	\multirow{9}{*}{\parbox{4cm}{Ladle 2-3 Oz of batter into pan and tilt pan to spread evenly (1/8 in. layer, if thicker, add water, mix, and repeat).}}		\\ \cline{1-4}2 		&			& 	egg (whole) 		&	\multicolumn{1}{c}{ }	& 							&									&										\\2 		&			&	egg (yolk)			&	\multicolumn{1}{c}{ }	& 							&									&										\\1/2 	&	c 		&	water				&	\multicolumn{1}{c}{ }	& 							&									&										\\1/2		&	c		&	milk				&	\multicolumn{1}{c}{ }	& 							&									&										\\2		&	T		&	butter(liquid)		&	\multicolumn{1}{c}{ }	& 							&									&										\\	\cline{1-5}1 		&	c 		& 	flour 				&	\multicolumn{3}{c|}{ }																	&										\\1/4		&	t		&	salt				&	\multicolumn{3}{c|}{ }																	&										\\	\cline{1-6}1		&	T		&	Olive Oil or Butter	&	\multicolumn{3}{c|}{Apply thin coating to nonstick pan}									&										\\\hline\end{tabular}

recipe-example.png (47.32 KiB) Viewed 1994 times

Is there a better way to do this? How hard would it be to write an environment specifically for this?
Last edited by localghost on Sun Aug 04, 2013 12:16 pm, edited 1 time in total.
Reason: Preferably no external links (see Board Rules). Attachments go onto the forum server where possible.

Tags:

professorbell
Posts: 6
Joined: Fri Apr 12, 2013 4:46 am
So a year later, I have gotten pretty comfortable working with the regular tabular environment for recipes in this format, mainly through use of conventions in my code to keep the table structure clear (this is almost impossible without a very wide monitor, as lines tend to stretch...if somebody can come up with a cool way to do it in a narrow (say 77 char width) emacs window I'd be interested):

\documentclass[8pt]{extarticle} \usepackage[letterpaper,landscape]{geometry}\usepackage{fullpage}\usepackage{xcolor}\usepackage{graphics}\usepackage{multirow}% http://ctan.org/pkg/multirow\usepackage{hhline}% http://ctan.org/pkg/hhline\usepackage{pbox} \begin{document} \begin{tabular}{|l|l|l|l|l|l|l|}\hline1  	& Whole		& Andoulle sausage		& Fry and set aside							& \multirow{8}{*}{\pbox{20cm}{Add to main pot, \\maintain heat\\ until shrimp turn orange}}							& \multirow{13}{*}{\pbox{20cm}{Add to main pot and\\ cook at med for\\ \textcolor{red}{10 minutes}}}.							& \multirow{15}{*}{\pbox{20cm}{Stir in Rice and add\\ water. Cover and simmer\\ on low for ~25 minutes.}} \\ \cline{1-4}2  	& T		& Olive Oil			& \multirow{5}{*}{\pbox{20cm}{Saute on med-hi until\\ onions transulcent/browned\\ (add garlic last!)}} & & & \\1.5  	& C		& chopped onions		& & & & \\0.5  	& C		& chopped bell peppers		& & & & \\0.5  	& C		& chopped celery		& & & & \\1  	& T		& chopped garlic		& & & & \\\cline{1-4}1  	& lb.		& peeled \& de-veined shrimp	& \multicolumn{1}{c}{}& & & \\4  	& Whole		& bay leaf			& \multicolumn{1}{c}{}& & & \\ \cline{1-5}1  	& 28 Oz. Can	& whole tomatoes (with juice)	& \multicolumn{2}{c}{}& & \\1  	& t		& salt				& \multicolumn{2}{c}{}& & \\0.5  	& t		& cayenne pepper		& \multicolumn{2}{c}{}& & \\0.025  	& t		& black pepper			& \multicolumn{2}{c}{}& & \\0.025  	& t		& dried thyme			& \multicolumn{2}{c}{}& & \\ \cline{1-6}1  	& C		& long grain white rice		& \multicolumn{3}{c}{}& \\0.75  	& C		& water				& \multicolumn{3}{c}{}& \\\hline\end{tabular}\end{document}

which produces the attached. I have gotten fast enough at doing this by hand that I don't think it's worth the time to automate the process.
Attachments
jamb.png (48.2 KiB) Viewed 1535 times