Graphics, Figures & TablesCustom Environment for special Recipe Layout

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

Custom Environment for special Recipe Layout

Post by professorbell »

There is a pretty nice website called "Cooking for Engineers". That formats recipes as follows.
recipe-sample.png
recipe-sample.png (45.91 KiB) Viewed 4244 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:

Code: Select all

\subsection*{Crepes}

%ingredients

\begin{tabular}{|l|l|l|c|c|c|c|}
\hline
1-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
recipe-example.png (47.32 KiB) Viewed 4244 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.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

professorbell
Posts: 7
Joined: Fri Apr 12, 2013 4:46 am

Custom Environment for special Recipe Layout

Post by professorbell »

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):

Code: Select all

\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|}
\hline
1  	& 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
jamb.png (48.2 KiB) Viewed 3785 times
Post Reply