
Mon Aug  1 14:09:17 MST 2005

rationalized files in recipes/Programs and recipes/Rupley/Programs

problem with use of extractor on rupley recipes
due to extractor deleting stuff including .. closing .ig at end of file
fix, add before extractor op:

	# strip comments and .ig sections
	sed -e "/^\.ig/,/^\.\./d" -e "/^\.\\\"/d" |

done for both rcbook.t.X rctypeset.X



Mon Aug  1 01:44:34 MST 2005

various changes in recipes programs over last several days;


tmac.recip:
added macro: .ds o'  -- for proper name o' in alt.gourmand 

rcbook.t.X:
added filter to convert \z\(?a to usage in jar modified rcbook.t macros
check:
	grep "\\\\\\*" Scr.troffinp |wc		159 - 11 from macros
	grep "\\\\z" ../Recipes/[a-z]* |wc	148

a few checks on Cookbook.ps seem ok

:r !diff ./tmac.recip ../RUPLEY/Programs
5d4
< .\" and a proper-name o' from alt.gourmand
24d22
< .ds o' \o'o\(aa'

:r !diff ./rcbook.t.X ../RUPLEY/Programs
381,388c381
< 	esac |
< 	# switch alt.gourmand use of .TE -> .To, to avoid table conflict
< 	awk '/^\.TE / {if (NF > 1) sub("\.TE", ".To")}; {print}' |
< 	# conversions for special French characters as in alt.gourmand
< 	# and a proper-name o' also from alt.gourmand
< 	sed	-e "s/\\\\z\\\(aae/\\\*\(e\'/g" \
< 		-e "s/\\\\z\\\(aao/\\\*\(o\'/g" \
< 		-e "s/\\\\z\\\(gaa/\\\*\(a\`/g" 
---
> 	esac

:r !diff ./configure.sh ../R*/P*
63,68c63
<     echo $j | egrep "rcbook.t|rctypeset" 1>/dev/null 2>&1
<     if [ $? -eq 0 ]
<     then
< 	echo chmod 755 $j
<         chmod 755 $j
<     fi
---
>     chmod 755 $j



:r !diff ./Makefile ../R*/P*
3d2
< # jar mod for test - Tue Jul 19 22:28:06 MST 2005
6,11c5,7
< 					#*****edit the next line
< OBJDIR=../bin
< 					#*****edit the next line
< MAN1DIR=../man/man1
< 					#*****edit the next line
< MAN5DIR=../man/man5
---
> OBJDIR=/Users/jar/bin/Recipes
> MAN1DIR=/Users/jar/man/man1
> MAN5DIR=/Users/jar/man/man5
16,19c12,13
< 					#*****edit the next line
< BOOKTITLE=Test Cookbook
< 					#*****edit the next line
< DEFDIR=../Recipes
---
> BOOKTITLE=Rupley Family Cookbook
> DEFDIR=/Users/jar/lib/Recipes
22d15
< 					#*****edit the next line
27c20
< #EXTRACTOR=1
---
> EXTRACTOR=1
29c22
< EXTRACTOR=0
---
> #EXTRACTOR=0
31,32c24
< 					#*****edit the next line
< COVERPAGE=../Programs/rcbook.cover
---
> COVERPAGE=/Users/jar/src/recipes/Programs/rcbook.cover.rupley
34c26
< #COVERPAGE=rcbook.cover.rupley
---
> #COVERPAGE=rcbook.cover






Fri Jul 29 00:35:15 MST 2005

added test on file name to last action of configure.sh:
	chmod 755 $j
so only executables are 755.

tested trial cookbook prep - ok



Tue Jul 19 23:22:28 MST 2005

formatting of altgourmand files fails as macro .TE for temperature
alternatives (F -- C) is same as end macro for a table (.TS ... .TE).
Changed .TE to .To in revised tmac.recipe.
But this fails as altgourmand did not write prospectively.
So, in rcbook.t[.X], add a filter to change .TE -> .To if more than one field
in line.



Fri Dec  3 17:15:12 MST 2004
Fri Feb 13 20:58:28 MST 2004

summary of changes made porting to macosx and cleaning up scripts:

----------------------------------------------------------------------

RCBOOK.T[.X]:

NOTE: need on PATH macosx version of ptx == gptx == gnu software


port:
to (pbg4 + gnu troff == groff + groff_man + grops conversion) 
from (sgi + att troff/man macros + dpost conversion)


strategy: 

modify software to replicate att feel using groff and groff_man macros;
only work with port to groff_man macros 
(forget about att troff/man/dpost etc, even though we have legal source
code == site license to jar/biochem);


changes:

eqn -Tps	need to specify device

TROFF="troff -b -man -C -i -rC1 -U "
	-b	traceback for errors/warnings
	-man	groff_man macros == an-old.tmac
	-C	max compatibility with att macros
	-i	read input after read command line files into formatter
	-rC1	if more than one recipe (man page), do not restart page
		numbering at 1 for each new manpage
	-U	unsafe mode - needed to allow sy == system call

nroff		***NOT SETUP FOR NROFF*** - need to specify options + ....
		TODO... [NOTE: this has been done, except for French chars]

postprocess	dpost -y-0.3 -> grops -pletter
		no need for .3i upshift of paper with grops+groff
		need to specify papersize - default id a4 == too large

STARTREC=TEMPDIR/Startrec.$$	code to terminate section and reinit pagenum
				small troff input file stored at STARTREC
				extra/dummy page - remove by hand;

PTX="gptx -G"	replace att ptx by gptx=gnu version
		need -g option to get "traditional" behavior

TODAY, YEAR, YR		set shell variables with today's date information

process tmac.recip troff commands + extra local commands added for each
specific shell script (rctypeset, rcbook.t):
cat << 'tmac.recip' | sed -e "s/REPLACE-TODAY/\"${TODAY}\"/" -e "/^[ 	]*$/d" -e '/^\.\\"./d' -e "/^\.ig/,/^\.\./d" > $TMAC
	remove blank lines - this found needed for rctypeset to avoid lead
	blank page ???
	remove comments and .ig/.. regions of code
	introduce today's date, and logo for center of page header

deleted use of tmac.tmp

remove .so == source of man macros after setup of cover page;
ok to use troff -man 

remove redefinition/voiding of macro }C

remove redefinition of macro TH = problems with old att TH resolved in new
groff_man TH

remove redefinition of footer macro }F;
TODO - may want to redo groff-man corresponding macro(s), so can get
old-style footer = page no-------date printed-------page no	

added blank line between tmac.recipe macros - minor, but easier to read

RZ macro ==
print synopsis line for recipe == filename + short (one-line) description;
added line to bring offset back to that for page header and SH subheads,
i.e., remove indent of synopsis as in old att formatted recipes;
looks better imho.

NOTE: groff_man macros print heads in boldface == better feel imho.

nawk -> awk throughout

gptx -G  works identically (as far as I know = afaik) to att ptx

throughout removed reset of (.vs, .ps, .ll, .in) registers;
previously done at start of most events;
groff_man seems to do this with great regularity, internally;
old att macro }E *may* still work to do approx. same???

miscellaneous revisions of cover page = title, date strings, 
copyright notice

minor revision of master command at end to format and ship out a ps file,
in line with above comments == add ENDREC
also print out version of command to console

cosmetic changes detailed in file 1aNOTE

----------------------------------------------------------------------


RCTYPESET[.X]:

subset of changes above, in particular:

same changes as above in processing of tmac.recipe when read by script:
	editing out deadwood
	introducing today's date

eqn -Tps

print of formatting command - for the record

----------------------------------------------------------------------


TMAC.RECIP

in addition to changes noted above:

deleted use of tmac.tmp (generated in configure.sh)

special macros for french included in groff charset
should introduce these
did this for cedilla, for which att hack broke
for present, other french characters handled by addition to tmac.recip

removed system ident as part of config
asssumed  macosx == gnu
add placeholders for replacement by makefile variables and date variables 

added hack to RZ to remove indent

added blank lines for easier read 

since the tmac.recipe macro identifier TE conflicts with a tbl macro,
the tmac.recipe identifier TE has been changed to To

added placeholders for date and page title

< .ie n .TH \\$2 "\\$3" "" REPLACE-TODAY "REPLACE-TITLE (\\$4)"
< .el .TH \\$2 "\\$3" "" REPLACE-TODAY "REPLACE-TITLE (\\$4)"
---
> @@@USG.ie n .TH \\$2 "\\$3" "\\$4" "Rupley Cookbook"
> @@@USG.el .TH \\$2 "\\$3" "\\$4" "Rupley Family Cookbook"
> @@@BSD.ie n .TH \\$2 "\\$3" "\\$4" " " "Rupley Cookbook"
> @@@BSD.el .TH \\$2 "\\$3" "\\$4" " " "Rupley Family Cookbook"

----------------------------------------------------------------------


Makefile, configure.sh, configure-one.sh


changes needed for transfer of new variables set in makefile
	EXTRACTOR = set of VERBATIM
	BOOKTITLE = set of REPLACE-TITLE = center page header
	COVERPAGE = path to troff file for cover page

to make "room" for above, in call of configure.sh, removed/voided use of
	SYSTYPE
	NEWSDIR
	DEFPAGER

changes for convenience/consistency/logic to Makefile and configure.sh

deleted use of tmac.tmp (generated in configure.sh)

removed configure-one.sh = mod of configure.sh to allow target=specified
file(s) only

----------------------------------------------------------------------

removed these programs
	incorporated into rcbook.t
		rcextract, rcnew.t, rcindex, rcintro
	generate nroff output (which is not relevant here)
		rckeep, rckeepnew, rcnroff, rcshow, rcbook.n

----------------------------------------------------------------------


rctypeset-att-man

[all this stuff deleted]
 
att macros can be used with gnu formatter, tmac.recip macros, recipe
database, grops, etc.

above script gives very close approx of sgi-att look to recipe format

but - not portable - need att license

thus dropped this approach


tmac.an[.mod]

att man macros modified to work with gnu troff etc + recipe macros

	space down from page top

	offset from left paper edge

	correct y2k error in current date

cf tmac.an.sgi-att

----------------------------------------------------------------------


GENERAL:

for comments and output on testing for port to pbg4, see files in 
Test-dir:
	./Test-dir/1NOTE = detailed summary

----------------------------------------------------------------------


TODO:


rework page footer macro to get old recipe style:
page number		printing date		page  number


possibly format and print cookbook in parts:
	cover, intro, recipes, toc, index
[done - separated cover page, in order to accomodate different recipe sets]


GROFF REFERENCES:
[some more useful than others :-]

jar@pbg4 [23:00:41]  /Users/jar/lib/recipes (4:593)$ apropos roff | egrep
"^[^ ]roff[^ ]*([1-8])"
groff(1)                 - front-end for the groff document formatting system
groff(7)                 - a short reference for the GNU roff language
groff_char(7)            - groff character names
groff_diff(7)            - differences between GNU troff and classical troff
groff_font(5)            - format of groff device and font description files
groff_man(7)             - groff `man' macros to support generation of man
pages
groff_mdoc(7)            - reference for groff's mdoc implementation
groff_me(7)              - troff macros for formatting papers
groff_mm(7)              - groff mm macros
groff_mmse(7)            - svenska mm makro fr groff
groff_mom(7)             - groff `mom' macros
groff_ms(7)              - groff ms macros
groff_out(5)             - groff intermediate output format
groff_tmac(5)            - macro files in the roff typesetting system
groff_trace(7)           - groff macro package trace.tmac
groff_www(7)             - groff macros for authoring web pages
groffer(1)               - display groff files and man~pages on X and tty
nroff(1)                 - emulate nroff command with groff
troff(1)                 - the troff processor of the groff text formatting
				system

note: try mm macros, www = html macros 

----------------------------------------------------------------------


SCRIPTS in ~/lib/Recipes:


Mkone		works - automate use of rctypeset -> PS file of recipe

Mkone.all	should work, but not tested

****Mkpsnup2	does NOT work - files du/triplicated-concatenated 

****Spell-check	does NOT  work


----------------------------------------------------------------------
----------------------------------------------------------------------

EARLIER CHANGES


cut most of the header information, given here for the record

----------------------------------------------------------------------

# rcbook.t - make a cookbook with nroff or the typesetter
#   linked to rcbook.n
#
# Brian Reid, November 1985
# Copyright (C) USENET Community Trust
#
# Modified by:  David Messer, Febuary 1987
#
# Modified by:  John Rupley, November 1995
#	removed use of rcintro and rcindex, by incorporating the
#		code into this now freestanding program;
#		(the logic for doing this is simply greater convenience
#		for me, in editing and debugging  -- I don't mind long scripts)
#	read in man macros at a point controlled by this program,
#		so cover page is not formatted under man macros
#	redefined TH of man macros to allow consecutive page numbering
#		when formatting a group of man pages == recipes;
#		this allows the TOC and index to point straightforwardly 
#		to a recipe;
#		also changed position of define of footer trap, so no
#		footer until have first man page formatted
#	redefined == null'ed }C of man macros to remove cut lines
#	redefined RZ of recipe macros to allow sending of index and
#		table of contents information to stderr, for capture
#		and processing and later importation back into the troff run
#	modified this program to produce TOC and ptx-style permuted index
#		by constructing filters to process captured RZ output (above)
#		and adding troff commands to run filters and import
#		results;
#		modified the format of the ptx output (->95 char) and
#		of the index input to the troff formatter (more information,
#		different tabbing of index items, different point size)
#	made more use of temp files
#	added more bad words and punc char
#	add -p and -P options to control postprocessing, through dpost, etc.
#		and the file for output
#	added -O option so can include ptx options as was allowed in rcindex
#	added -N option for update, based on modif. time of $PWD/Last.update,
#		generating Update.ps
#	constructed the file of recipe texts by use of pipes and a do while
#		loop, so as not to blow any sh/ksh buffers with a too long 
#		argument list of files
#	preprocess troff input with tbl and eqn
#	pipe troff output into dpost to get *.ps file directly, with dpost
#		option for y axis offset to match local printer configuration
#	modified troff command line to take all above into account
#
#	some changes in tmac.recip cannot be done within this program, 
#	because the macros are also used by rctypeset, etc.:
#		added strings for French stuff (a`, etc.) to tmac.recip
#		since the tmac.recipe macro identifier TE conflicts 
#			with a tbl macro, edited the recipe identifier TE to To
#
#	at the end of processing the $TOC information file is moved to 
#	file Scr.toc in the working directory, for later use in whatever 
#	other manipulations of Cookbook.ps
#
# Modified by:  John Rupley, May 1999
#	changed .RZ macro to allow more than 2 fields:
#		$1 is as before = name
#		$2 is description, with ${3-5} continuation fields to 
#			handle a total of ~ 4*256 characters (must split
#			description into <256 char blocks)
#	above change in .RZ required changes in processing of TOC for
#		index and table of contents, to read continuation lines,
#		which are blank (newlines only) if not filled.

----------------------------------------------------------------------

also cut unused (with groff_man) changes in att man macros 

.ig	stuff not needed with groff man macros
.\" read in man macros after format cover page
.\" so page numbers and footer start with Introduction
.\" .so /usr1/addon/usr/lib/macros/an

.\" get rid of cut lines put above each page and below last, in man macros
.\" (these man macros are old; }C is revised in newer man macros;
.\" cannot switch without renaming internals in tmac.recipe)
.\" .de}C
.\" ..

.\" redefine .TH macro, to _not_ restart page no's at 1 for each new man page
.\" 	and to not print footer until have first man page formatted 
.\" .deTH
.\" .PD
.\" .nrIN \\n()Mu
.\" .ift .ds ]E \\$1\^(\^\\$2\^)
.\" .ifn .ds ]E \\$1(\\$2)
.\" .if\\n()s .ds ]D
.\" .if\\n()t .ds ]D UNIX System V
.\" .ifn .ds ]D UNIX System V
.\" .ds]P
.\" .if!\\$3 .ds ]P (\^\\$3\^)
.\" .if!\\$4 .ds ]D \\$4
.\" .wh0 }H
.\" .\".wh-\\n(:mu }F	\" move set of footer trap to after first bp
.\" .em}M
.\" .\" change man macros to _not_ restart page no's at 1 for each new man page
.\" .if\\n(nl .bp		\" original line: .if\\n(nl .bp 1
.\" .wh-\\n(:mu }F	\" no footer until have first man page formatted
.\" .nr)I \\n()Mu
.\" .nr)R 0
.\" .}E
.\" .DT
.\" .ifn \{.na
.\" .nh\}
.\" .ift \{.bd S 3 3
.\" .hy14 \}
.\" ..

.\" .\" redefine footer macro to put page number on left and right bottom of page
.\" .de}F
.\" .ev1
.\" .}E
.\" .if\\n()s 'sp |\\n(.pu-1v-1p
.\" .if\\n()t 'sp |\\n(.pu-3v
.\" .ifn 'sp |\\n(.pu-4v
.\" .ifn .tl Page %\\*(]T
.\" .if\\n()s .tl - % -
.\" .if\\n()t .tl Page %\\*(]TPage %
.\" 'bp
.\" .ev
.\" ..

.\" edit tmac.recip -> tmac.tmp, then read in tmac.tmp; equivalent to:
.\" .so /usr/people/jar/src/recipes/Rupley/tmac.tmp \"after tmac.recip -> tmac.tmp
..


----------------------------------------------------------------------


README	from alt.gourmand distribution, ~1988


This is the distribution of programs that work with alt.gourmand
files, to make the USENET cookbook.

	If you are not a programmer, but want to use this
	software, and can't enlist the help of a
	programmer, please read the file "Novice". It
	contains simplified instructions, and can lead
	you through the installation procedure even if
	you have never installed software before.

	Ignore the rest of this file if you decide to use
	the Novice instructions.

To install the recipe software at your site, copy either Makefile.bsd or
Makefile.sysv over to be named "Makefile", then edit it per the instructions
in the beginning. If you are running any non-BSD Unix, such as Sys III or
Venix, then you want to use Makefile.sysv even though you don't have sysv.

If you have the "less" program, you will probably want to use it instead of
"more".

You may find that the best version of troff at your site is called "ptroff"
or "dtroff" or "itroff" or "qtroff" or whatever--the first letter tends to
correspond to the manufacturer of the machine for which that troff is
targeted.

Once you have edited your Makefile, type
	make configure
This will produce configured executable versions of the cookbook software in
your current directory. Once you have satisfied yourself that it is not a
trojan horse, type
	make install
which will copy the executable programs to the directory you have chosen for
them (we put them in /usr/local/bin) and copy the manual pages to
/usr/man/man1 and /usr/man/man5. You needn't be root to install, you only
need to be a user who has write permission in the bin and man directories.

Once you've done that, go read the man pages, then go play with "rn" and have
fun printing cookbooks. This will also work with readnews; I don't know from
notesfiles, and I have never tried it with vnews or yarn or any of those
other programs.

Here are the program names and what they do:

rcbook.t	make a cookbook with troff
rcnew.t		make a cookbook update with troff
rcextract	extract a recipe from a news article (called by rctypeset)
rcindex		produce an index of saved recipes (called by rcbook)
rcintro		generate the introduction to the cookbook (called by rcbook)
rckeep		keep a recipe
rckeepnew	keep all new recipes (new since last rckeepnew run)
rcnroff		run one recipe through nroff
rcshow		show one recipe on the screen
rctypeset	run one recipe through troff
rcbook.n	nroff version of rcbook.t
rcnew.n		nroff version of rcnew.t

The troff and nroff macros use the manual macros /usr/lib/tmac/tmac.an as a
subroutine. If your site has changed those manual page macros significantly
from the original AT&T or Berkeley distribution, then things might not work.
In particular, the macros distributed by DEC with Ultrix are not
compatible (they assume the wrong paper size).

	Brian Reid
	DEC Western Research Laboratory
	Palo Alto, California
	{ucbvax,decvax,sun,pyramid,hplabs,ames}!decwrl!reid
		-or-	reid@decwrl.DEC.COM


