previous up next print clean
Next: INTRODUCTION TO INTERACTION Up: Claerbout and Karrenbach: Cake Previous: Duplicate targets


You don't need to know how SEP.idoc.rules works, but it might help you to know. Burning figures regularly leads to the proof that you can rebuild them. This is done by the following line found in SEP.idoc.rules

        burn&:     [[ sub -i X X.burn  FIGLIST ]]

Reading man cake you see that this line, along with our earlier definition of FIGLIST will expand to

        burn&:     data.burn  spectrum.burn

which means that cake burn done in this directory is equivalent to cake data.burn spectrum.burn which are the ``targets'' that can be built by the following idoc rule

                -/bin/rm  -f FIGDIR/
                -/bin/rm  -f FIGDIR/%.v

To understand this rule, you need to know that in cakefiles, ``%'' is a wildcard like ``*'' in command shells.

We have a special category of figure types that cannot be easily rebuilt so they should not be burned. This is because they are scanned, prepared manually, with exotic hardware, excessive computer time, or because of any other difficulty. (Martin Karrenbach's latex environment marks such figures NR denoting ``non reproducible'' Karrenbach and Nichols (1990).) To save such files from burning, we give them names of the form and From time-to-time we redesign the vplot to postscript program (paper printing is usually black and white, but electronic documents use color) and then we want to burn all the postscript files that can be rebuilt from vplot. Here are the rules we are using now:

        %.burnps& : if not exist FIGDIR/
                -/bin/rm  -f FIGDIR/

        %.burnps& : if     exist FIGDIR/
                -/bin/rm  -f FIGDIR/

Thus cake burnps will not burn your precious plot files if you have no way to rebuild them. (While we are writing this, we are wondering if we should change these rules to something with the cando construction.)

Now let us do something constructive. To build all the figures in any of our books or documents, we have a shell that passes over all the cakefiles in the document tree and executes cake figures. That evokes the rules below from SEP.idoc.rules

        figures&:  [[ sub -i X X.figure        FIGLIST ]]

        %.figure&:  FIGDIR/        if     exist FIGDIR/

        %.figure&:  FIGDIR/             if not exist FIGDIR/

These rules say that a postscript file must be created for every name in FIGLIST, either FIGDIR/ or FIGDIR/ How the figures are created is determined by the following rules:

        #ifndef PSARGS
        #    ifdef HARDCOPY
        #       define PSARGS color=n fat=1 fatmult=1.5
        #    else
        #       define PSARGS color=y
        #    endif

        #define PSTEXPEN(A,B) pstexpen FIGDIR/A FIGDIR/B  PSARGS
        FIGDIR/ : FIGDIR/

        FIGDIR/ : FIGDIR/%.v

A few weeks before report generation, we insert in SEP.defs a line #define HARDCOPY (which you can do anytime in any of your cakefiles), burn all the postscript files, build the paper document, send it to the printer, then remove the line #define HARDCOPY, burn all the postscript files and rebuild them again for our electronic documents.

Recall, we said that cake tube will take the user through a tube view of all the plot files. The tube program will interpret single frame pictures (NAME.v) or multiple frame movies (NAME.v3). Paper documents can only cope with NAME.v files.

        #define TUBEMOVIE ( cando FIGDIR/%.v3 or exist FIGDIR/ ) %.tube1        if not TUBEMOVIE
        %.tube3        if     TUBEMOVIE
These rules choose the movie file if a movie exists or can be made. If a movie cannot be made, the target becomes %.tube1 and is interpreted by
        %.tube1&:    FIGDIR/%.v       if     cando FIGDIR/%.v
                TUBE FIGDIR/%.v
        %.tube1&:    FIGDIR/  if exist FIGDIR/ and  \
                                     not cando FIGDIR/%.v
                TUBE FIGDIR/
These rules say to show the file NAME.v if it can be made, and if it cannot, then show the file, if it exists. (Technically, an error condition arises for a few handmade postscript files for which tube cannot be used. We should eliminate this error message by including a do-nothing rule, or by calling a postscript previewer where possible.) The rules for tube3 are like the rules for tube1.

previous up next print clean
Next: INTRODUCTION TO INTERACTION Up: Claerbout and Karrenbach: Cake Previous: Duplicate targets
Stanford Exploration Project