home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sources.misc
- From: jsp@Princeton.EDU (James Plank)
- Subject: v28i075: rec - Format recipes in LaTeX, Part01/01
- Message-ID: <1992Feb26.063551.24312@sparky.imd.sterling.com>
- X-Md4-Signature: 830c2ee537d80d1ed65d7eb02fe46d1e
- Date: Wed, 26 Feb 1992 06:35:51 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: jsp@Princeton.EDU (James Plank)
- Posting-number: Volume 28, Issue 75
- Archive-name: rec/part01
- Environment: LaTeX
-
- This is a program which I've used to make cookbooks for family
- and friends. I had a spare hour, so I've bundled it up to
- post here on the net. I hope some of you can glean some use
- from it.
-
- This is a program to format recipes easily in LaTeX. The recipes have
- a simple input format which is easy to read when you're editing,
- emailing or posting (it's also an easy format from which to convert
- r.f.c postings). Then, by using this program (called "rec"), you can
- transform the recipes into LaTeX which can then be printed to make
- high-quality output on a laser printer. In this way, rec allows you
- to make your own high quality cookbooks trivially.
-
- Read the README file to make the program, and then read rec.man to find
- out how to use the program. I've included 4 sample recipes.
-
- Take it easy,
-
- Jim Plank
- jsp@princeton.edu or
- plank@cs.utk.edu
-
- CUT HERE --- CUT HERE --- CUT HERE --- CUT HERE --- CUT HERE ---
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # The tool that generated this appeared in the comp.sources.unix newsgroup;
- # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
- # Contents: README ancho_chili.rec cajun_beans.rec ind_okra1.rec
- # makefile rec.awk rec.hd rec.man rec.orig spicy_baked.rec
- # Wrapped by kent@sparky on Wed Feb 26 00:21:40 1992
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 1 (of 1)."'
- if test -f 'README' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'README'\"
- else
- echo shar: Extracting \"'README'\" \(881 characters\)
- sed "s/^X//" >'README' <<'END_OF_FILE'
- XThis is a program to format recipes easily in LaTeX. The recipes have
- Xa simple input format which is easy to read when you're editting,
- Xemailing or posting. Then, by using this program (called rec), you can
- Xtransform the recipes into LaTeX which can then be printed to make
- Xhigh-quality output on a laser printer. In this way, rec allows you
- Xto make your own high quality cookbooks trivially.
- X
- XRec is a shell script combined with an awk script, and therefore should
- Xwork on all Unix platforms. To work on non-unix platorms, you'll need
- Xthe unix tools: sh, awk, latex.
- X
- XTo make the program, type 'make'. If you can't get this to work, just
- Xread the file "makefile," and follow its instructions.
- X
- XTo use the program, read the file rec.man.
- X
- XI've included a few sample recipe files in *.rec.
- X
- XFeel free to send me comments or ask for other recipes.
- X
- XJim Plank
- Xplank@cs.utk.edu
- END_OF_FILE
- if test 881 -ne `wc -c <'README'`; then
- echo shar: \"'README'\" unpacked with wrong size!
- fi
- # end of 'README'
- fi
- if test -f 'ancho_chili.rec' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'ancho_chili.rec'\"
- else
- echo shar: Extracting \"'ancho_chili.rec'\" \(1738 characters\)
- sed "s/^X//" >'ancho_chili.rec' <<'END_OF_FILE'
- XTWO
- XTITLE
- XChunky Ancho Chili
- X
- XFROM
- X{\em Southwest Cooking} Beekman House, New York, 1990.
- X
- XHEADER
- XThis is an absolutely bizarre chili -- we cooked it with
- Xground beef and pork sausage, and it looked like ground
- Xmeat and beans swimming in meat grease. But it wasn't
- Xgrease -- it was the ancho-chili \& wine puree. It has
- Xa really distinctive flavor.
- X
- XING
- X5 dried ancho chilies
- X2 cups water
- X2T oil
- X1 large onion, chopped
- X2 cloves garlic
- X1 pound lean boneless beef, cut into 1-in cubes
- X1 pound lean boneless pork, cut into 1-in cubes
- X1-2 fresh or canned jalapeno (or serrano) peppers,
- X stemmed, seeded and minced
- X1t salt
- X1 teaspoon dried, crushed oregano
- X1 teaspoon ground cumin
- X1/2 cup dry red wine
- X1 can (15 oz) pinto beans, drained
- X1 can (15 oz) kidney beans, drained
- X
- XDIR
- XRemove the stems, seeds, and veins from the ancho chilies.
- XRinse them, then place in a 2-quart pan with water. Bring
- Xto a boil; turn off heat and let stand, covered, 30 minutes
- Xor until the chilies are soft. Pour chilies with liquid into
- Xa blender or food processor container fitted with a metal blade.
- XProcess until smooth; reserve.
- X
- XHeat the oil in a 5 quart kettle over medium heat. Add
- Xonion and garlic; cook until onion is tender. Add beef
- Xand pork; cook, stirring frequently, until meat is lightly
- Xcolored. Add jalapeno peppers, also, oregano, cumin, wine
- Xand ancho chili puree. Bring to a boil. Cover; reduce
- Xheat and simmer 1.5 to 2 hours, or until meat is very
- Xtender. Stir in beans. Simmer, uncovered, 30 minutes, or
- Xuntil chili has thickened slightly.
- X
- XCOMMENTS
- XWe've found dried anchos at the local food co-op. I'm
- Xnot sure if you can get them in normal grocery stores.
- XAlso, we drained the meat grease, as it looked like
- Xdeath otherwise.
- X
- END_OF_FILE
- if test 1738 -ne `wc -c <'ancho_chili.rec'`; then
- echo shar: \"'ancho_chili.rec'\" unpacked with wrong size!
- fi
- # end of 'ancho_chili.rec'
- fi
- if test -f 'cajun_beans.rec' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'cajun_beans.rec'\"
- else
- echo shar: Extracting \"'cajun_beans.rec'\" \(481 characters\)
- sed "s/^X//" >'cajun_beans.rec' <<'END_OF_FILE'
- XONE
- XTITLE
- XCajun BBQ Beans
- XFROM
- X{\em Barbecue Greats, Memphis Style}
- XHEADER
- XI guess this looks pretty standard / uninspiring, but
- Xit made some great beans.
- XING
- X2 15-oz cans Pork \& Beans
- X1/4 Cup Chopped Green Pepper
- X1/2 Cup Chopped Onions
- X1 Pound Pork Sausage
- X1/3 Cup Molasses
- X1/3 Cup Brown Sugar
- X2T Worcestershire Sauce
- X1/4 Cup Ketchup
- X1T Mustard
- X1T Cajun Seasoning
- XDIR
- XBrown and drain the sausage. Mix everything together, and crock-pot
- Xfor 6 hours, or bake at 350 for 1 hour.
- X
- END_OF_FILE
- if test 481 -ne `wc -c <'cajun_beans.rec'`; then
- echo shar: \"'cajun_beans.rec'\" unpacked with wrong size!
- fi
- # end of 'cajun_beans.rec'
- fi
- if test -f 'ind_okra1.rec' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'ind_okra1.rec'\"
- else
- echo shar: Extracting \"'ind_okra1.rec'\" \(1199 characters\)
- sed "s/^X//" >'ind_okra1.rec' <<'END_OF_FILE'
- XONE
- XTITLE
- XIndian Okra 1
- XFROM
- XThis recipe was given to me by N. Nandhakumar after I requested indian okra
- Xrecipes on the net.
- XING
- XAbout 30 okra
- X1 large onion
- X1x1 in. cube of ginger
- X1-2 hot green peppers
- X1 tsp. black mustard seed
- X1/2 tsp. urad dal (optional)
- X1 heaping tsp. ground coriander
- X1-2 cups shredded cilantro (optional)
- X3 tbl. vegetable oil
- X1 tsp. salt
- X2 cloves garlic, minced
- XDIR
- XWash okra and dry thoroughly. Cut off stems and slice lengthwise to
- Xform halves. Cut onions and hot peppers into small pieces. Cut 3 thin
- Xslices of ginger root and chop finely. Pour oil into wide saucepan,
- Xadd mustard seeds and heat. Just before the mustard seeds start
- Xpopping add the urad dal. When dal turns brown (in less than a
- Xminute) add the garlic and ginger and cook for a few seconds. Then
- Xadd the onions and peppers. Saute until the onions become
- Xtranslucent. Add coriander powder and stir. When spices begin to
- Xstick to the pan and are brown, add the okra and salt and mix
- Xthoroughly. Cover and cook on low heat until done. Add cilantro and
- Xheat through.
- XServes 4.
- XCOM
- XWe have never used the urad dal. Instead we add the mustard seeds
- Xto very hot oil and cook until they pop.
- X
- END_OF_FILE
- if test 1199 -ne `wc -c <'ind_okra1.rec'`; then
- echo shar: \"'ind_okra1.rec'\" unpacked with wrong size!
- fi
- # end of 'ind_okra1.rec'
- fi
- if test -f 'makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'makefile'\"
- else
- echo shar: Extracting \"'makefile'\" \(380 characters\)
- sed "s/^X//" >'makefile' <<'END_OF_FILE'
- X# All that this makefile does is make "rec" from "rec.orig".
- X# It basically copies rec.orig to rec, and then changes the
- X# line in rec containing the word "HOME" to "home=cwd" where
- X# cwd is the current directory. It then changes rec to be
- X# executable.
- X
- Xrec: rec.orig
- X pwd | sed 's@\(.*\)@s#HOME#home=\1#@' > rec.sed
- X sed -f rec.sed rec.orig > rec
- X chmod 0755 rec
- X rm rec.sed
- END_OF_FILE
- if test 380 -ne `wc -c <'makefile'`; then
- echo shar: \"'makefile'\" unpacked with wrong size!
- fi
- # end of 'makefile'
- fi
- if test -f 'rec.awk' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'rec.awk'\"
- else
- echo shar: Extracting \"'rec.awk'\" \(1284 characters\)
- sed "s/^X//" >'rec.awk' <<'END_OF_FILE'
- XBEGIN { started = 1; blank = 0; fns = 0; ing = 0; }
- X/^TWO[A-Z]*$/ { printf("\\twocolumn\n"); next }
- X/^ONE[A-Z]*$/ { printf("\\onecolumn\n"); next }
- X/^TIT[A-Z]*$/ { printf("\\section*{"); blank = 0; started = 0; next }
- X/^FROM$/ { printf("\\footnote{\n"); blank = 0; fns = 1; next }
- X/^HEAD[A-Z]*$/ {\
- X if (fns) {\
- X printf("}\n");\
- X fns = 0;\
- X }\
- X printf("}\n"); blank = 0; started = 1; next }
- X/^ING[A-Z]*$/ {\
- X if (fns) {\
- X printf("}\n");\
- X fns = 0;\
- X }\
- X if (!started) printf("}\n");\
- X started = 1;\
- X printf("\\subsection*{Ingredients}\n");\
- X printf("\\begin{list}\n");\
- X printf("{\mbox{-}}{\\setlength{\\parsep}{-4pt}");\
- X# printf("\\setlength{\\leftmargin}{0in}\n");\
- X printf("}\n");\
- X blank = 0;\
- X ing=1;\
- X next }
- X/^DIR[A-Z]*$/ {\
- X if (ing) printf("\\end{list}\n");\
- X ing = 0;
- X printf("\\subsection*{Directions}\n"); blank = 0; next }
- X/^COM[A-Z]*$/ { printf("\\subsection*{Comments}\n"); blank = 0; next }
- X
- X/^[ ]*$/ { if (blank) printf("%s\n", $0);\
- X blank = 1;\
- X next;\
- X }
- X/^[^ ]/ { if (ing) printf("\\item\n");}
- X {
- X if (blank) printf("\n");\
- X blank = 0;\
- X printf("%s\n", $0)\
- X }
- END_OF_FILE
- if test 1284 -ne `wc -c <'rec.awk'`; then
- echo shar: \"'rec.awk'\" unpacked with wrong size!
- fi
- # end of 'rec.awk'
- fi
- if test -f 'rec.hd' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'rec.hd'\"
- else
- echo shar: Extracting \"'rec.hd'\" \(190 characters\)
- sed "s/^X//" >'rec.hd' <<'END_OF_FILE'
- X%\documentstyle[twoside,twocolumn]{article}
- X\documentstyle{article}
- X\setlength{\textwidth}{5in}
- X\setlength{\textheight}{6in}
- X\setlength{\columnsep}{.3in}
- X\pagestyle{empty}
- X
- X\begin{document}
- END_OF_FILE
- if test 190 -ne `wc -c <'rec.hd'`; then
- echo shar: \"'rec.hd'\" unpacked with wrong size!
- fi
- # end of 'rec.hd'
- fi
- if test -f 'rec.man' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'rec.man'\"
- else
- echo shar: Extracting \"'rec.man'\" \(5541 characters\)
- sed "s/^X//" >'rec.man' <<'END_OF_FILE'
- XNAME
- X rec -- program for formatting recipes
- X
- XSYNTAX
- X rec filename[s]
- X
- XDESCRIPTION
- X "Rec" converts a simple description of a recipe or recipes into
- X a formatted LaTeX file on the standard output. This allows one
- X to store recipes in a form which is easy to type and view
- X as text, but which can then be formatted more nicely with LaTeX.
- X "Rec" makes the task of compiling a cookbook incredibly easy.
- X
- X Each recipe file must be in a specific format described below.
- X If more than one recipe file is specified, then each recipe will
- X go on a separate page of the standard output. Recipes can be
- X formatted in one column or two column format (two column lets
- X you fit more on one page).
- X
- X It's assumed that the user knows a little bit about LaTeX, but
- X not too much (i.e. that non-alphanumeric symbols have usually
- X have special meanings, and should be used with caution). "Rec"
- X is a shell (sh) script which calls "awk." If you're on a Unix
- X platform these will be built in. Otherwise, I can't make
- X any guarantees.
- X
- XRECIPE FILE FORMAT
- X The recipe file must fit a specific format. The file must
- X be divided into sections: A section is denoted by a keyword
- X in capitals at the beginning of a line. The rest of the section
- X is comprised of the text on the lines after the keyword.
- X The next keyword starts the next section. Certain sections
- X (like Ingredients) are mandatory, and sections must come in
- X the order described. In other words, this isn't overly
- X flexible, but it has worked well in every case I've given
- X it.
- X
- X Following are the keywords which denote a section and a
- X description of their functions. Note, the sections must
- X be in the order described:
- X
- X ONE
- X TWO
- X These go at the beginning of the recipe file. They
- X specify either one column or two column format,
- X respectively. They may be omitted, but I suggest
- X using them if you're mixing recipes with one and
- X two columns.
- X
- X TITLE
- X The text specifies the title of the recipe which will
- X be formatted in larg bold-face. The title
- X shouldn't be omitted.
- X
- X FROM
- X The text specifies a footnote whose mark goes after the
- X title and whose text goes at the bottom of the page. I
- X use this to record the source of the recipe. This section
- X can be omitted.
- X
- X HEAD
- X The text specifies a header for the recipe. This is text
- X which goes before the listing of ingredients. It's a good
- X place to put an introduction and general comments.
- X
- X ING
- X The text specifies ingredients. These will be listed with
- X bullets in front of each ingredient. Each line of the text
- X is be a new ingredient, unless the line starts with spaces
- X or a Tab character, in which case it will continue the
- X ingredient of the previous line. Ingredients cannot
- X be omitted.
- X
- X DIR
- X These are the directions. They follow the ingredients
- X and are printed as text. Leave a blank line to start
- X a new paragraph. Directions cannot be omitted.
- X
- X COM
- X These are for comments after the directions. They are
- X also printed as text. Comments can be omitted.
- X
- XBUGS, ETC
- X
- X If you have any bug reports or comments on making this work
- X on non-unix systems, send me mail at plank@cs.utk.edu. I
- X probably won't make many changes to the program which aren't
- X real bugs, since I don't really want to spend much time on
- X it.
- X
- X I have about 70 recipes on file. If you want them, let me
- X know.
- X
- XEXAMPLE
- X
- X I give an example file below which uses all of the above
- X fields. If you save it into the file "ancho.rec", then you
- X do the following to make a hard copy (again, this is for Unix
- X platforms. You might have to use some imagination to get this
- X to work on other platforms):
- X
- X rec ancho.rec > ancho.tex
- X latex ancho.tex
- X (ignore the warning messages)
- X lpr -d ancho.dvi
- X
- X Ancho.tex is as follows:
- X
- XTWO
- XTITLE
- XChunky Ancho Chili
- X
- XFROM
- X{\em Southwest Cooking} Beekman House, New York, 1990.
- X
- XHEADER
- XThis is an absolutely bizarre chili -- we cooked it with
- Xground beef and pork sausage, and it looked like ground
- Xmeat and beans swimming in meat grease. But it wasn't
- Xgrease -- it was the ancho-chili \& wine puree. It has
- Xa really distinctive flavor.
- X
- XING
- X5 dried ancho chilies
- X2 cups water
- X2T oil
- X1 large onion, chopped
- X2 cloves garlic
- X1 pound lean boneless beef, cut into 1-in cubes
- X1 pound lean boneless pork, cut into 1-in cubes
- X1-2 fresh or canned jalapeno (or serrano) peppers,
- X stemmed, seeded and minced
- X1t salt
- X1 teaspoon dried, crushed oregano
- X1 teaspoon ground cumin
- X1/2 cup dry red wine
- X1 can (15 oz) pinto beans, drained
- X1 can (15 oz) kidney beans, drained
- X
- XDIR
- XRemove the stems, seeds, and veins from the ancho chilies.
- XRinse them, then place in a 2-quart pan with water. Bring
- Xto a boil; turn off heat and let stand, covered, 30 minutes
- Xor until the chilies are soft. Pour chilies with liquid into
- Xa blender or food processor container fitted with a metal blade.
- XProcess until smooth; reserve.
- X
- XHeat the oil in a 5 quart kettle over medium heat. Add
- Xonion and garlic; cook until onion is tender. Add beef
- Xand pork; cook, stirring frequently, until meat is lightly
- Xcolored. Add jalapeno peppers, also, oregano, cumin, wine
- Xand ancho chili puree. Bring to a boil. Cover; reduce
- Xheat and simmer 1.5 to 2 hours, or until meat is very
- Xtender. Stir in beans. Simmer, uncovered, 30 minutes, or
- Xuntil chili has thickened slightly.
- X
- XCOMMENTS
- XWe've found dried anchos at the local food co-op. I'm
- Xnot sure if you can get them in normal grocery stores.
- XAlso, we drained the meat grease, as it looked like
- Xdeath otherwise.
- X
- X
- END_OF_FILE
- if test 5541 -ne `wc -c <'rec.man'`; then
- echo shar: \"'rec.man'\" unpacked with wrong size!
- fi
- # end of 'rec.man'
- fi
- if test -f 'rec.orig' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'rec.orig'\"
- else
- echo shar: Extracting \"'rec.orig'\" \(364 characters\)
- sed "s/^X//" >'rec.orig' <<'END_OF_FILE'
- X#!/bin/sh
- X
- Xif [ $# -eq 0 ]; then
- X echo 'usage: rec <recipe-file>'
- X exit 1
- Xfi
- X
- Xfor i do
- X if [ ! -f "$i" ]; then
- X echo "recipe file $i doesn't exist"
- X exit 1
- X fi
- Xdone
- X
- XHOME
- Xawkfile=$home/rec.awk
- Xheadfile=$home/rec.hd
- X
- Xcat $headfile
- X
- Xp=1
- X
- Xfor i do
- X if [ $p = 2 ]; then
- X echo "\\newpage"
- X fi
- X p=2
- X
- X awk -f $awkfile "$i"
- X
- Xdone
- X
- Xecho "\\end{document}"
- END_OF_FILE
- if test 364 -ne `wc -c <'rec.orig'`; then
- echo shar: \"'rec.orig'\" unpacked with wrong size!
- fi
- # end of 'rec.orig'
- fi
- if test -f 'spicy_baked.rec' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'spicy_baked.rec'\"
- else
- echo shar: Extracting \"'spicy_baked.rec'\" \(1913 characters\)
- sed "s/^X//" >'spicy_baked.rec' <<'END_OF_FILE'
- XTWO
- XTITLE
- XSpicy Baked Chicken
- XFROM
- X{\em Madhur Jaffrey's Indian Cooking}, Barron's, Woodbury, NY, 1983
- XHEADER
- XThis dish is incredibly simple, and really spicy. It wins.
- XING
- X1 Tablespoon ground cumin seeds
- X1 Tablespoon paprika
- X1.5 Teaspoons cayenne
- X1 Tablespoon ground turmeric
- X1.5 Teaspoons freshly ground black pepper
- X2.5 - 3 Teaspoons salt
- X3 Cloves garlic, mashed rather \\ severely
- X6 Tablespoons lemon juice
- X3.5 Pounds chicken pieces, skinned
- X3 Tablespoons oil
- XDIR
- XMix all the above ingredients except the chicken and the oil. Cut
- Xdeep gashes in the chicken. Rub the mixture over the chicken pieces,
- Xpuching the paste into the gaps and in any other flaps or openings that
- Xyou can find. Spread the chicken pieces in a shallow baking tray and
- Xset aside in a cool place for 3 hours (or longer -- if so, cover it with
- Xplastic wrap or put into a ziploc).
- X
- XPreheat the over to very how -- 400F (200C). Brush the tops of the
- Xchicken pieces with the oil. Put the chicken in the oven and bake for
- X20 minutes. Turn the chicken pieces over (use a spatula so the skin
- Xdoesn't stick to the tray) and bake another 25 minutes or until the
- Xchicken is tender. Baste the chicken pieces with the drippings. If a
- Xlot of liquid accumuates in your baking tray, remove the extra fat with
- Xa spoon. Then pour the remainng liquid into a small pot. Boil down
- Xuntil the sauce is somewhat reduced. Arrange the chicken pieces on a
- Xplatter, pour the reduced sauce over them and serve.
- XCOMMENTS
- X\begin{itemize}
- X\item
- XLetting the chicken sit overnight is better, but if you don't let it sit
- Xat all, it will be alright as well.
- X\item
- XI've never had more than 5-6 drippings come out of the chicken. Maybe
- XI've just gotten bum chicken. In any case, I've never had a "reduced
- Xsauce" to pour over the chicken. It certainly doesn't seem
- Xnecessary.
- X\item
- XThis also works well if you grill the chicken.
- X\end{itemize}
- X
- END_OF_FILE
- if test 1913 -ne `wc -c <'spicy_baked.rec'`; then
- echo shar: \"'spicy_baked.rec'\" unpacked with wrong size!
- fi
- # end of 'spicy_baked.rec'
- fi
- echo shar: End of archive 1 \(of 1\).
- cp /dev/null ark1isdone
- MISSING=""
- for I in 1 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have the archive.
- rm -f ark[1-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-