/[dtapublic]/pubs/books/ucbka/trunk/scripts/cp_script.tcl
ViewVC logotype

Diff of /pubs/books/ucbka/trunk/scripts/cp_script.tcl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4 by dashley, Thu Oct 6 03:15:02 2016 UTC revision 273 by dashley, Sun Aug 11 21:24:46 2019 UTC
# Line 1  Line 1 
1  #----------------------------------------------------------------------------------------  #----------------------------------------------------------------------------------------
2  #$Header: /home/dashley/cvsrep/e3ft_gpl01/e3ft_gpl01/dtaipubs/esrgubka/scripts/cp_script.tcl,v 1.40 2009/08/14 03:38:57 dashley Exp $  #$Header$
3  #----------------------------------------------------------------------------------------  #----------------------------------------------------------------------------------------
4  # Dave Ashley  # David T. Ashley (DASHLEY@GMAIL.COM)
5  # DAVEASHLEY@DAVEASHLEY.COM  #----------------------------------------------------------------------------------------
6  # DTASHLEY@AOL.COM  # Tcl script (using Tk extensions, so it must be run under Tk/Wish) to build and package
7  #----------------------------------------------------------------------------------------  # both Dave Ashley's microcontroller software book, and the associated ESRG Tool set.  This
8  # Tcl script (using Tk extensions, so it must be run under Tk/Wish) to build and package  # script is also included with the source code of either so that the script can be used
9  # both Dave Ashley's microcontroller software book, and the associated ESRG Tool set.  This  # by those who have purchased or otherwise obtained the LaTeX source for the book or the
10  # script is also included with the source code of either so that the script can be used  # source for the ESRG Tool Set to do the build.
11  # by those who have purchased or otherwise obtained the LaTeX source for the book or the  #----------------------------------------------------------------------------------------
12  # source for the ESRG Tool Set to do the build.  #The version control information below is extracted by this Tcl script and incorporated
13  #----------------------------------------------------------------------------------------  #into the back of the title page.  This takes the place of the "main .TEX file" information
14  #The version control information below is extracted by this Tcl script and incorporated  #that was there previously.  Since the main files are now generated on the fly by the Tcl
15  #into the back of the title page.  This takes the place of the "main .TEX file" information  #script, this is the logical replacement.  Version control information is included so
16  #that was there previously.  Since the main files are now generated on the fly by the Tcl  #that if anything goes awry, the origin and what was being used can be tracked down.
17  #script, this is the logical replacement.  Version control information is included so  #
18  #that if anything goes awry, the origin and what was being used can be tracked down.  #AUTOMATIC MARKER:  BEGIN SCRIPT VERSION CONTROL INFORMATION
19  #  #$HeadURL$
20  #AUTOMATIC MARKER:  BEGIN SCRIPT VERSION CONTROL INFORMATION  #$Revision$
21  #$RCSfile: cp_script.tcl,v $  #$Date$
22  #$Source: /home/dashley/cvsrep/e3ft_gpl01/e3ft_gpl01/dtaipubs/esrgubka/scripts/cp_script.tcl,v $  #$Author$
23  #$Revision: 1.40 $  #AUTOMATIC MARKER:  END SCRIPT VERSION CONTROL INFORMATION
24  #$Author: dashley $  #
25  #$Date: 2009/08/14 03:38:57 $  #****************************************************************************************
26  #AUTOMATIC MARKER:  END SCRIPT VERSION CONTROL INFORMATION  #****************************************************************************************
27  #  #****    U T I L I T Y    F U N C T I O N S    ******************************************
28  #****************************************************************************************  #****************************************************************************************
29  #****************************************************************************************  #****************************************************************************************
30  #****    U T I L I T Y    F U N C T I O N S    ******************************************  # Exit procedure.  Exits unconditionally.  Clicked in response
31  #****************************************************************************************  # to the button marked EXIT.
32  #****************************************************************************************  #
33  # Exit procedure.  Exits unconditionally.  Clicked in response  proc exitProc { } { \
34  # to the button marked EXIT.     global buildlogfilehandle
35  #  
36  proc exitProc { } { \     #Put the system date and time into the build log and on the console.
37     global buildlogfilehandle     set buildendtimestamp [clock seconds]
38       set s0 [clock format $buildendtimestamp -format "Execution ending at: %A, %B %d, %Y; %I:%M:%S %p."]
39     #Put the system date and time into the build log and on the console.     outboth $s0
40     set buildendtimestamp [clock seconds]     thickhlineboth
41     set s0 [clock format $buildendtimestamp -format "Execution ending at: %A, %B %d, %Y; %I:%M:%S %p."]     close $buildlogfilehandle
42     outboth $s0     exit 0
43     thickhlineboth     }
44     close $buildlogfilehandle  
45     exit 0  #-----------------------------------------------------------------------------
46     }  #Writes a contiguous group of a number of characters (or strings) to a stream,
47    #without a terminating newline.
48  #-----------------------------------------------------------------------------  
49  #Writes a contiguous group of a number of characters (or strings) to a stream,  proc contiggrouptostream { thestream thechar howmany } {
50  #without a terminating newline.     for {set i 0} {$i < $howmany} {incr i} {
51          puts -nonewline $thestream $thechar
52  proc contiggrouptostream { thestream thechar howmany } {        }
53     for {set i 0} {$i < $howmany} {incr i} {        
54        puts -nonewline $thestream $thechar     return
55        }     }
56          
57     return  #----------------------------------------------------------------------------------------
58     }  #Copies (binary) from src to dest, destroying dest in advance.
59    proc destructive_binary_copy { src dest } {
60  #----------------------------------------------------------------------------------------     #Delete dest, if it exists.
61  #Copies (binary) from src to dest, destroying dest in advance.     file delete $dest
62  proc destructive_binary_copy { src dest } {    
63     #Delete dest, if it exists.     set srchandle [open $src  "r"]
64     file delete $dest     set dsthandle [open $dest "w"]  
65      
66     set srchandle [open $src  "r"]     fconfigure $srchandle -translation binary
67     set dsthandle [open $dest "w"]       fconfigure $dsthandle -translation binary
68      
69     fconfigure $srchandle -translation binary     fcopy $srchandle $dsthandle
70     fconfigure $dsthandle -translation binary    
71         close $srchandle
72     fcopy $srchandle $dsthandle     close $dsthandle
73        
74     close $srchandle     return
75     close $dsthandle     }
76      
77     return  #****************************************************************************************
78     }  #****************************************************************************************
79    #****    N U M B E R I N G    F U N C T I O N S    **************************************
80  #****************************************************************************************  #****************************************************************************************
81  #****************************************************************************************  #****************************************************************************************
82  #****    N U M B E R I N G    F U N C T I O N S    **************************************  # Each function here has to do with numbering parts, chapters, etc.
83  #****************************************************************************************  #
84  #****************************************************************************************  # Returns the lower-case string corresponding to a digit.
85  # Each function here has to do with numbering parts, chapters, etc.  proc lower_case_number_string { arg } { \
86  #     switch -exact $arg {
87  # Returns the lower-case string corresponding to a digit.        "0"     { return zero                        }
88  proc lower_case_number_string { arg } { \        "1"     { return one                         }
89     switch -exact $arg {        "2"     { return two                         }
90        "0"     { return zero                        }        "3"     { return three                       }
91        "1"     { return one                         }        "4"     { return four                        }
92        "2"     { return two                         }        "5"     { return five                        }
93        "3"     { return three                       }        "6"     { return six                         }
94        "4"     { return four                        }        "7"     { return seven                       }
95        "5"     { return five                        }        "8"     { return eight                       }
96        "6"     { return six                         }        "9"     { return nine                        }
97        "7"     { return seven                       }        default { return INTERNAL_FUNCTION_PAR_ERROR }
98        "8"     { return eight                       }        }
99        "9"     { return nine                        }     }
100        default { return INTERNAL_FUNCTION_PAR_ERROR }  
101        }  
102     }  # Returns the upper-case string corresponding to the
103    # roman numerals of a decimal number.  Algorithm is simple
104    # case because numbers won't get large enough to prevent
105  # Returns the upper-case string corresponding to the  # enumeration.
106  # roman numerals of a decimal number.  Algorithm is simple  proc upper_case_roman_numeral_string { arg } { \
107  # case because numbers won't get large enough to prevent     switch -exact $arg {
108  # enumeration.        "0"     { return ZERO_NOT_SUPPORTED_ROMAN    }
109  proc upper_case_roman_numeral_string { arg } { \        "1"     { return I                           }
110     switch -exact $arg {        "2"     { return II                          }
111        "0"     { return ZERO_NOT_SUPPORTED_ROMAN    }        "3"     { return III                         }
112        "1"     { return I                           }        "4"     { return IV                          }
113        "2"     { return II                          }        "5"     { return V                           }
114        "3"     { return III                         }        "6"     { return VI                          }
115        "4"     { return IV                          }        "7"     { return VII                         }
116        "5"     { return V                           }        "8"     { return VIII                        }
117        "6"     { return VI                          }        "9"     { return IX                          }
118        "7"     { return VII                         }       "10"     { return X                           }
119        "8"     { return VIII                        }       "11"     { return XI                          }
120        "9"     { return IX                          }       "12"     { return XII                         }
121       "10"     { return X                           }       "13"     { return XIII                        }
122       "11"     { return XI                          }       "14"     { return XIV                         }
123       "12"     { return XII                         }       "15"     { return XV                          }
124       "13"     { return XIII                        }       "16"     { return XVI                         }
125       "14"     { return XIV                         }       "17"     { return XVII                        }
126       "15"     { return XV                          }       "18"     { return XVIII                       }
127       "16"     { return XVI                         }       "19"     { return XIX                         }
128       "17"     { return XVII                        }       "20"     { return XX                          }
129       "18"     { return XVIII                       }       "21"     { return XXI                         }
130       "19"     { return XIX                         }       "22"     { return XXII                        }
131       "20"     { return XX                          }       "23"     { return XXIII                       }
132       "21"     { return XXI                         }       "24"     { return XXIV                        }
133       "22"     { return XXII                        }       "25"     { return XXV                         }
134       "23"     { return XXIII                       }       "26"     { return XXVI                        }
135       "24"     { return XXIV                        }       "27"     { return XXVII                       }
136       "25"     { return XXV                         }       "28"     { return XXVIII                      }
137       "26"     { return XXVI                        }       "29"     { return XXIX                        }
138       "27"     { return XXVII                       }       "30"     { return XXX                         }
139       "28"     { return XXVIII                      }       "31"     { return XXXI                        }
140       "29"     { return XXIX                        }       "32"     { return XXXII                       }
141       "30"     { return XXX                         }       "33"     { return XXXIII                      }
142       "31"     { return XXXI                        }       "34"     { return XXXIV                       }
143       "32"     { return XXXII                       }       "35"     { return XXXV                        }
144       "33"     { return XXXIII                      }       "36"     { return XXXVI                       }
145       "34"     { return XXXIV                       }       "37"     { return XXXVII                      }
146       "35"     { return XXXV                        }       "38"     { return XXXVIII                     }
147       "36"     { return XXXVI                       }       "39"     { return XXXIX                       }
148       "37"     { return XXXVII                      }       "40"     { return XXXX                        }
149       "38"     { return XXXVIII                     }       "41"     { return XXXXI                       }
150       "39"     { return XXXIX                       }       "42"     { return XXXXII                      }
151       "40"     { return XXXX                        }       "43"     { return XXXXIII                     }
152       "41"     { return XXXXI                       }       "44"     { return XXXXIV                      }
153       "42"     { return XXXXII                      }       "45"     { return XXXXV                       }
154       "43"     { return XXXXIII                     }       "46"     { return XXXXVI                      }
155       "44"     { return XXXXIV                      }       "47"     { return XXXXVII                     }
156       "45"     { return XXXXV                       }       "48"     { return XXXXVIII                    }
157       "46"     { return XXXXVI                      }       "49"     { return IL                          }
158       "47"     { return XXXXVII                     }        default { return INTERNAL_FUNCTION_PAR_ERROR }
159       "48"     { return XXXXVIII                    }        }
160       "49"     { return IL                          }     }
161        default { return INTERNAL_FUNCTION_PAR_ERROR }  
162        }  #****************************************************************************************
163     }  #****************************************************************************************
164    #****    T E X T    M A N I P U L A T I O N    F U N C T I O N S    *********************
165  #****************************************************************************************  #****************************************************************************************
166  #****************************************************************************************  #****************************************************************************************
167  #****    T E X T    M A N I P U L A T I O N    F U N C T I O N S    *********************  #
168  #****************************************************************************************  # Replaces all digits in a string with their textual strings.  This is used to form
169  #****************************************************************************************  # commands whose names the LaTeX compiler will accept.
170  #  proc replace_digits_with_alphas { arg } { \
171  # Replaces all digits in a string with their textual strings.  This is used to form     set result ""
172  # commands whose names the LaTeX compiler will accept.     set N [string length $arg]
173  proc replace_digits_with_alphas { arg } { \  
174     set result ""     for {set i 0} {$i < $N} {incr i} { \
175     set N [string length $arg]        set c [string index $arg $i]
176    
177     for {set i 0} {$i < $N} {incr i} { \        if {[string first $c "0123456789"] == -1} { \
178        set c [string index $arg $i]           #Isn't a digit, just append.
179             append result $c
180        if {[string first $c "0123456789"] == -1} { \           } \
181           #Isn't a digit, just append.        else {
182           append result $c           #Is a digit, must expand and append.
183           } \           append result [lower_case_number_string $c]
184        else {           }
185           #Is a digit, must expand and append.        }
186           append result [lower_case_number_string $c]  
187           }     return $result
188        }     }
189    
190     return $result  #Replaces any spaces in a string with the HTML code %20.  This is necessary to
191     }  #to achieve the proper HTML syntax when putting filenames in in come contexts.
192    #
193  #Replaces any spaces in a string with the HTML code %20.  This is necessary to  proc replace_spaces_with_HTML_codes { tgt } { \
194  #to achieve the proper HTML syntax when putting filenames in in come contexts.     set tgt [string map {" " "%20"} $tgt]
195  #     return $tgt
196  proc replace_spaces_with_HTML_codes { tgt } { \     }
197     set tgt [string map {" " "%20"} $tgt]  
198     return $tgt  
199     }  #****************************************************************************************
200    #****************************************************************************************
201    #****    V E R S I O N    C O N T R O L    E X T R A C T I O N    F U N C T I O N S    **
202  #****************************************************************************************  #****************************************************************************************
203  #****************************************************************************************  #****************************************************************************************
204  #****    V E R S I O N    C O N T R O L    E X T R A C T I O N    F U N C T I O N S    **  #Extracts the version control information lines (marked automatically above) from this
205  #****************************************************************************************  #file and returns them as a string.  The string includes all newline characters.
206  #****************************************************************************************  
207  #Extracts the version control information lines (marked automatically above) from this  proc extract_this_scripts_version_control_information { } { \
208  #file and returns them as a string.  The string includes all newline characters.     #Define the strings that we'll accept as beginning the
209       #block of version control information and the strings
210  proc extract_this_scripts_version_control_information { } { \     #that we'll accept as terminating it.
211     #Define the strings that we'll accept as beginning the     set begin_string "AUTOMATIC MARKER:  BEGIN SCRIPT VERSION CONTROL INFORMATION"
212     #block of version control information and the strings     set end_string   "AUTOMATIC MARKER:  END SCRIPT VERSION CONTROL INFORMATION"
213     #that we'll accept as terminating it.  
214     set begin_string "AUTOMATIC MARKER:  BEGIN SCRIPT VERSION CONTROL INFORMATION"     #Initialize our return value to nothing so far.
215     set end_string   "AUTOMATIC MARKER:  END SCRIPT VERSION CONTROL INFORMATION"     set rv ""
216    
217     #Initialize our return value to nothing so far.     #Open the script for extraction.
218     set rv ""     set script_handle [open scripts/cp_script.tcl r]
219    
220     #Open the script for extraction.     #Leaf through the file until we hit the end of file or else the beginning string.
221     set script_handle [open scripts/cp_script.tcl r]     set eof_found 0
222       set beginstring_found 0
223     #Leaf through the file until we hit the end of file or else the beginning string.     while {!$eof_found && !$beginstring_found} { \
224     set eof_found 0        set current_line [gets $script_handle]
225     set beginstring_found 0        set beginstring_found_index [string first $begin_string $current_line]
226     while {!$eof_found && !$beginstring_found} { \        set beginstring_found [expr $beginstring_found_index >= 0]
227        set current_line [gets $script_handle]        set eof_found [eof $script_handle]
228        set beginstring_found_index [string first $begin_string $current_line]        }
229        set beginstring_found [expr $beginstring_found_index >= 0]  
230        set eof_found [eof $script_handle]     if {!$eof_found} { \
231        }        #If we're here, we got the begin string we were looking for.  Copy over
232          #until the end string is encountered or until end of file.
233     if {!$eof_found} { \        set endstring_found 0
234        #If we're here, we got the begin string we were looking for.  Copy over        while {!$eof_found && !$endstring_found} { \
235        #until the end string is encountered or until end of file.           set current_line [gets $script_handle]
236        set endstring_found 0  
237        while {!$eof_found && !$endstring_found} { \           #If the first character of the line is a Tcl comment delimieter (which it
238           set current_line [gets $script_handle]           #most likely is), trash it.
239             set current_line [string trimleft $current_line "#"]
240           #If the first character of the line is a Tcl comment delimieter (which it  
241           #most likely is), trash it.           set endstring_found_index [string first $end_string $current_line]
242           set current_line [string trimleft $current_line "#"]           set endstring_found [expr $endstring_found_index >= 0]
243             set eof_found [eof $script_handle]
244           set endstring_found_index [string first $end_string $current_line]           if {!$endstring_found} { \
245           set endstring_found [expr $endstring_found_index >= 0]              append rv $current_line "\n"
246           set eof_found [eof $script_handle]              }
247           if {!$endstring_found} { \           }
248              append rv $current_line "\n"        }
249              }  
250           }     #Close the script file.
251        }     close $script_handle
252    
253     #Close the script file.     #Return the extracted version control information.
254     close $script_handle     return $rv
255       }
256     #Return the extracted version control information.  
257     return $rv  #****************************************************************************************
258     }  #****************************************************************************************
259    #****    L O G G I N G    F U N C T I O N S    ******************************************
260  #****************************************************************************************  #****************************************************************************************
261  #****************************************************************************************  #****************************************************************************************
262  #****    L O G G I N G    F U N C T I O N S    ******************************************  # Each function in this category is called as an aid in maintaing a log file and a
263  #****************************************************************************************  # console display which say exactly the same thing.
264  #****************************************************************************************  #----------------------------------------------------------------------------------------
265  # Each function in this category is called as an aid in maintaing a log file and a  #Writes a contiguous group of a number of characters to the standard output,
266  # console display which say exactly the same thing.  #plus to the build log file.
267  #----------------------------------------------------------------------------------------  
268  #Writes a contiguous group of a number of characters to the standard output,  proc contiggrouptoboth { thechar howmany } {
269  #plus to the build log file.     global buildlogfilehandle
270      
271  proc contiggrouptoboth { thechar howmany } {     contiggrouptostream $buildlogfilehandle $thechar  $howmany
272     global buildlogfilehandle     contiggrouptostream stdout              $thechar  $howmany
273            
274     contiggrouptostream $buildlogfilehandle $thechar  $howmany     return
275     contiggrouptostream stdout              $thechar  $howmany     }
276          
277     return  #-----------------------------------------------------------------------------
278     }  #Writes a line of $loglinelength hyphens followed by a newline to only the
279    #console, but not the build log file.
280  #-----------------------------------------------------------------------------  
281  #Writes a line of $loglinelength hyphens followed by a newline to only the  proc hlineconsole {} {
282  #console, but not the build log file.     global loglinelength
283      
284  proc hlineconsole {} {     contiggrouptostream stdout - $loglinelength
285     global loglinelength     puts ""
286        
287     contiggrouptostream stdout - $loglinelength     return
288     puts ""     }
289      
290     return  #-----------------------------------------------------------------------------
291     }  #Writes a line of $loglinelength hyphens followed by a newline to both the
292    #console and the build log file.
293  #-----------------------------------------------------------------------------  
294  #Writes a line of $loglinelength hyphens followed by a newline to both the  proc hlineboth {} {
295  #console and the build log file.     global loglinelength
296       global buildlogfilehandle
297  proc hlineboth {} {    
298     global loglinelength     contiggrouptoboth - $loglinelength
299     global buildlogfilehandle     puts $buildlogfilehandle ""
300         puts ""
301     contiggrouptoboth - $loglinelength    
302     puts $buildlogfilehandle ""     return
303     puts ""     }
304      
305     return  #-----------------------------------------------------------------------------
306     }  #Writes a line of $loglinelength "=" chars followed by a newline to only the
307    #console but not the build log file.
308  #-----------------------------------------------------------------------------  
309  #Writes a line of $loglinelength "=" chars followed by a newline to only the  proc thickhlineconsole {} {
310  #console but not the build log file.     global loglinelength
311      
312  proc thickhlineconsole {} {     contiggrouptostream stdout = $loglinelength
313     global loglinelength     puts ""
314        
315     contiggrouptostream stdout = $loglinelength     return
316     puts ""     }
317      
318     return  #-----------------------------------------------------------------------------
319     }  #Writes a line of $loglinelength "=" chars followed by a newline to both the
320    #console and the build log file.
321  #-----------------------------------------------------------------------------  
322  #Writes a line of $loglinelength "=" chars followed by a newline to both the  proc thickhlineboth {} {
323  #console and the build log file.     global loglinelength
324       global buildlogfilehandle
325  proc thickhlineboth {} {    
326     global loglinelength     contiggrouptoboth = $loglinelength
327     global buildlogfilehandle     puts $buildlogfilehandle ""
328         puts ""
329     contiggrouptoboth = $loglinelength    
330     puts $buildlogfilehandle ""     return
331     puts ""     }
332      
333     return  #-----------------------------------------------------------------------------
334     }  #Dumps output to both the console and the log file, with newline attached.
335    proc outboth { arg } {
336  #-----------------------------------------------------------------------------     global buildlogfilehandle
337  #Dumps output to both the console and the log file, with newline attached.    
338  proc outboth { arg } {     puts $buildlogfilehandle $arg
339     global buildlogfilehandle     puts $arg
340        
341     puts $buildlogfilehandle $arg     return  
342     puts $arg     }  
343      
344     return    #-----------------------------------------------------------------------------
345     }    #Dumps output to both the console and the log file, without newline attached.
346    proc outbothnonl { arg } {
347  #-----------------------------------------------------------------------------     global buildlogfilehandle
348  #Dumps output to both the console and the log file, without newline attached.    
349  proc outbothnonl { arg } {     puts -nonewline $buildlogfilehandle $arg
350     global buildlogfilehandle     puts -nonewline $arg
351        
352     puts -nonewline $buildlogfilehandle $arg     return  
353     puts -nonewline $arg     }  
354      
355     return    #-----------------------------------------------------------------------------
356     }    #Prints a banner to the passed stream indicating success or failure of a build
357    #script.  The two messages are "*OK*" and "FAIL".  The failflag, if 0, means
358  #-----------------------------------------------------------------------------  #success, or if non-zero, means failure.  The banner will be centered
359  #Prints a banner to the passed stream indicating success or failure of a build  #in the output.  $nearpadchar and $farpadchar are the characters used to pad
360  #script.  The two messages are "*OK*" and "FAIL".  The failflag, if 0, means  #the centering near the banner letters and farther away.  $nearfarmargin is
361  #success, or if non-zero, means failure.  The banner will be centered  #the number of characters for which the near characters extend.  
362  #in the output.  $nearpadchar and $farpadchar are the characters used to pad  proc passfailbannertostream { thestream passfailflag nearpadchar farpadchar nearfarmargin} {
363  #the centering near the banner letters and farther away.  $nearfarmargin is  
364  #the number of characters for which the near characters extend.        global loglinelength
365  proc passfailbannertostream { thestream passfailflag nearpadchar farpadchar nearfarmargin} {      
366        set passbanner {
367      global loglinelength         " OOOOO   K     K" \
368               "O     O  K   K  " \
369      set passbanner {         "O     O  K K    " \
370         " OOOOO   K     K" \         "O     O  KK     " \
371         "O     O  K   K  " \         "O     O  K K    " \
372         "O     O  K K    " \         "O     O  K  K   " \
373         "O     O  KK     " \         "O     O  K   K  " \
374         "O     O  K K    " \         "O     O  K    K " \
375         "O     O  K  K   " \         " OOOOO   K     K" \
376         "O     O  K   K  " \         }
377         "O     O  K    K " \      set failbanner {
378         " OOOOO   K     K" \         "FFFFFFF    AAA      III    L      " \
379         }         "F         A   A      I     L      " \
380      set failbanner {         "F        A     A     I     L      " \
381         "FFFFFFF    AAA      III    L      " \         "F        A     A     I     L      " \
382         "F         A   A      I     L      " \         "FFFFFF   AAAAAAA     I     L      " \
383         "F        A     A     I     L      " \         "F        A     A     I     L      " \
384         "F        A     A     I     L      " \         "F        A     A     I     L      " \
385         "FFFFFF   AAAAAAA     I     L      " \         "F        A     A     I     L      " \
386         "F        A     A     I     L      " \         "F        A     A    III    LLLLLLL" \
387         "F        A     A     I     L      " \         }
388         "F        A     A     I     L      " \  
389         "F        A     A    III    LLLLLLL" \     #First we need to calculate the number of chars on the left with which
390         }     #to pad the the result.
391      
392     #First we need to calculate the number of chars on the left with which     if {$passfailflag != 0} {
393     #to pad the the result.        #Fail
394            set banner $failbanner
395     if {$passfailflag != 0} {        } \
396        #Fail     else {
397        set banner $failbanner        #Pass
398        } \        set banner $passbanner
399     else {        }
400        #Pass        
401        set banner $passbanner     #Determine the width of the banner which applies.
402        }     set bannerwidth [string length [lindex $banner 0] ]
403            
404     #Determine the width of the banner which applies.     #Calculate the size in chars to use for the far padding.
405     set bannerwidth [string length [lindex $banner 0] ]     set farpadwidth [expr "($loglinelength - $bannerwidth - (2 * $nearfarmargin ) ) >> 1"]    
406        
407     #Calculate the size in chars to use for the far padding.     #If by poor choice of all values we ended up with a negative number, clip it to zero.
408     set farpadwidth [expr "($loglinelength - $bannerwidth - (2 * $nearfarmargin ) ) >> 1"]         if {$farpadwidth < 0} {
409            set farpadwidth 0
410     #If by poor choice of all values we ended up with a negative number, clip it to zero.        }
411     if {$farpadwidth < 0} {        
412        set farpadwidth 0     #Iterate to output the lines of the banner.
413        }     foreach curline $banner {
414                for {set i 0} {$i < $farpadwidth} {incr i} {
415     #Iterate to output the lines of the banner.           puts -nonewline $thestream $farpadchar
416     foreach curline $banner {           }
417        for {set i 0} {$i < $farpadwidth} {incr i} {          
418           puts -nonewline $thestream $farpadchar        for {set i 0} {$i < $nearfarmargin} {incr i} {
419           }           puts -nonewline $thestream $nearpadchar
420                     }
421        for {set i 0} {$i < $nearfarmargin} {incr i} {          
422           puts -nonewline $thestream $nearpadchar        puts -nonewline $thestream $curline
423           }        
424                  for {set i 0} {$i < $nearfarmargin} {incr i} {
425        puts -nonewline $thestream $curline           puts -nonewline $thestream $nearpadchar
426                   }
427        for {set i 0} {$i < $nearfarmargin} {incr i} {  
428           puts -nonewline $thestream $nearpadchar        for {set i 0} {$i < $farpadwidth} {incr i} {
429           }           puts -nonewline $thestream $farpadchar
430             }
431        for {set i 0} {$i < $farpadwidth} {incr i} {  
432           puts -nonewline $thestream $farpadchar        puts $thestream ""              
433           }        }
434              
435        puts $thestream ""                   return  
436        }     }  
437              
438     return    #****************************************************************************************
439     }    #****************************************************************************************
440    #****    D A T A    S T R U C T U R E    U T I L I T Y    F U N C T I O N S    **********
441  #****************************************************************************************  #****************************************************************************************
442  #****************************************************************************************  #****************************************************************************************
443  #****    D A T A    S T R U C T U R E    U T I L I T Y    F U N C T I O N S    **********  # Each function in this category provides a function related to the data structures
444  #****************************************************************************************  # embedded in the script.  Generally, errors are all fatal.
445  #****************************************************************************************  #----------------------------------------------------------------------------------------
446  # Each function in this category provides a function related to the data structures  # Indexes the volume list by the 4-letter tag.  This is done for lookup speed.
447  # embedded in the script.  Generally, errors are all fatal.  proc IndexVolumeList { } { \
448  #----------------------------------------------------------------------------------------     global bookVolumeList
449  # Indexes the volume list by the 4-letter tag.  This is done for lookup speed.     global bookVolumeListStructSize
450  proc IndexVolumeList { } { \     global bookVolumeListIndex
451     global bookVolumeList  
452     global bookVolumeListStructSize     outboth "Indexing volume list."
453     global bookVolumeListIndex  
454       set N [llength $bookVolumeList]
455     outboth "Indexing volume list."  
456       for {set i 0} {$i < $N} {incr i $bookVolumeListStructSize} { \
457     set N [llength $bookVolumeList]        set elem [lindex $bookVolumeList $i]
458    
459     for {set i 0} {$i < $N} {incr i $bookVolumeListStructSize} { \        set bookVolumeListIndex($elem) $i
460        set elem [lindex $bookVolumeList $i]  
461          outboth "   bookVolumeList($elem) = $i"
462        set bookVolumeListIndex($elem) $i        }
463    
464        outboth "   bookVolumeList($elem) = $i"     hlineboth
465        }     }
466    
467     hlineboth  #----------------------------------------------------------------------------------------
468     }  # Indexes the chapter list by the 4-letter tag.  This is done for lookup speed.
469    proc IndexChapterList { } { \
470  #----------------------------------------------------------------------------------------     global chapterList
471  # Indexes the chapter list by the 4-letter tag.  This is done for lookup speed.     global chapterListStructSize
472  proc IndexChapterList { } { \     global chapterListIndex
473     global chapterList  
474     global chapterListStructSize     outboth "Indexing chapter list."
475     global chapterListIndex  
476       set N [llength $chapterList]
477     outboth "Indexing chapter list."  
478       for {set i 0} {$i < $N} {incr i $chapterListStructSize} { \
479     set N [llength $chapterList]        set elem [lindex $chapterList $i]
480    
481     for {set i 0} {$i < $N} {incr i $chapterListStructSize} { \        set chapterListIndex($elem) $i
482        set elem [lindex $chapterList $i]  
483          outboth "   chapterList($elem) = $i"
484        set chapterListIndex($elem) $i        }
485    
486        outboth "   chapterList($elem) = $i"     hlineboth
487        }     }
488    
489     hlineboth  #****************************************************************************************
490     }  #****************************************************************************************
491    #****    C H A P T E R    T A B L E    L O O K U P    F U N C T I O N S    **************
492  #****************************************************************************************  #****************************************************************************************
493  #****************************************************************************************  #****************************************************************************************
494  #****    C H A P T E R    T A B L E    L O O K U P    F U N C T I O N S    **************  # Functions which look up chapter table information.
495  #****************************************************************************************  #----------------------------------------------------------------------------------------
496  #****************************************************************************************  #
497  # Functions which look up chapter table information.  # Returns the single-volume long title for a chapter.  Input is the 4-character
498  #----------------------------------------------------------------------------------------  # chapter tag.  Chapter table must have been indexed in advance.
499  #  proc get_chap_long_single_volume_title { ctag } { \
500  # Returns the single-volume long title for a chapter.  Input is the 4-character     global chapterList
501  # chapter tag.  Chapter table must have been indexed in advance.     global chapterListIndex
502  proc get_chap_long_single_volume_title { ctag } { \  
503     global chapterList     set i $chapterListIndex($ctag)
504     global chapterListIndex  
505       return [lindex $chapterList [expr $i + 1]]
506     set i $chapterListIndex($ctag)     }
507    
508     return [lindex $chapterList [expr $i + 1]]  # Returns the single-volume short title for a chapter.  Input is the 4-character
509     }  # chapter tag.  Chapter table must have been indexed in advance.
510    proc get_chap_short_single_volume_title { ctag } { \
511  # Returns the single-volume short title for a chapter.  Input is the 4-character     global chapterList
512  # chapter tag.  Chapter table must have been indexed in advance.     global chapterListIndex
513  proc get_chap_short_single_volume_title { ctag } { \  
514     global chapterList     set i $chapterListIndex($ctag)
515     global chapterListIndex  
516       return [lindex $chapterList [expr $i + 2]]
517     set i $chapterListIndex($ctag)     }
518    
519     return [lindex $chapterList [expr $i + 2]]  #Mark an individual chapter (by tag) used.
520     }  proc mark_chapter_used { ctag } { \
521       global chapterList
522  #Mark an individual chapter (by tag) used.     global chapterListIndex
523  proc mark_chapter_used { ctag } { \  
524     global chapterList     #outboth "Inside chapter marking function, ctag is : $ctag"
525     global chapterListIndex  
526       set i $chapterListIndex($ctag)
527     #outboth "Inside chapter marking function, ctag is : $ctag"  
528       set i [expr $i + 7]
529     set i $chapterListIndex($ctag)  
530       #outboth "Element selected for marking is : $i"
531     set i [expr $i + 7]  
532       #outboth "Current value is: [lindex $chapterList $i]"
533     #outboth "Element selected for marking is : $i"  
534       set chapterList [lreplace $chapterList $i $i 1]
535     #outboth "Current value is: [lindex $chapterList $i]"  
536       #outboth "New value is: [lindex $chapterList $i]"
537     set chapterList [lreplace $chapterList $i $i 1]     }
538    
539     #outboth "New value is: [lindex $chapterList $i]"  
540     }  #Inquire if a given chapter (by tag) has its used flag set.
541    #Result is "1" if used, "0" otherwise.
542    proc get_chap_used_flag { ctag } { \
543  #Inquire if a given chapter (by tag) has its used flag set.     global chapterList
544  #Result is "1" if used, "0" otherwise.     global chapterListStructSize
545  proc get_chap_used_flag { ctag } { \     global chapterListIndex
546     global chapterList  
547     global chapterListStructSize     set i $chapterListIndex($ctag)
548     global chapterListIndex  
549       set i [expr $i + 7]
550     set i $chapterListIndex($ctag)  
551       return [lindex $chapterList $i]
552     set i [expr $i + 7]     }
553    
554     return [lindex $chapterList $i]  
555     }  #Marks each of the chapters as unused (resets all of the "used" flags to zero).
556    proc mark_all_chaps_unused { } { \
557       global chapterList
558  #Marks each of the chapters as unused (resets all of the "used" flags to zero).     global chapterListStructSize
559  proc mark_all_chaps_unused { } { \  
560     global chapterList     set N [llength $chapterList]
561     global chapterListStructSize  
562       for {set i 0} {$i < $N} {incr i $chapterListStructSize} { \
563     set N [llength $chapterList]        set j [expr $i + 7]
564    
565     for {set i 0} {$i < $N} {incr i $chapterListStructSize} { \        set chapterList [lreplace $chapterList $j $j 0]
566        set j [expr $i + 7]        }
567       }
568        set chapterList [lreplace $chapterList $j $j 0]  
569        }  #****************************************************************************************
570     }  #****************************************************************************************
571    #****    V O L U M E    T A B L E    L O O K U P    F U N C T I O N S    ****************
572  #****************************************************************************************  #****************************************************************************************
573  #****************************************************************************************  #****************************************************************************************
574  #****    V O L U M E    T A B L E    L O O K U P    F U N C T I O N S    ****************  # Functions which lookup volume table information.
575  #****************************************************************************************  #----------------------------------------------------------------------------------------
576  #****************************************************************************************  # Returns the part string associated with a volume record in the volume table.  
577  # Functions which lookup volume table information.  # Input is the 4-character volume tag.  Volume table must have been indexed in advance.
578  #----------------------------------------------------------------------------------------  proc get_vol_part_title { vtag } { \
579  # Returns the part string associated with a volume record in the volume table.       global bookVolumeList
580  # Input is the 4-character volume tag.  Volume table must have been indexed in advance.     global bookVolumeListIndex
581  proc get_vol_part_title { vtag } { \  
582     global bookVolumeList     set i $bookVolumeListIndex($vtag)
583     global bookVolumeListIndex  
584       return [lindex $bookVolumeList [expr $i + 3]]
585     set i $bookVolumeListIndex($vtag)     }
586    
587     return [lindex $bookVolumeList [expr $i + 3]]  # Returns the multiple-volume long title associated with a volume.                
588     }  # Input is the 4-character volume tag.  Volume table must have been indexed in advance.
589    proc get_multi_vol_long_title { vtag } { \
590  # Returns the multiple-volume long title associated with a volume.                     global bookVolumeList
591  # Input is the 4-character volume tag.  Volume table must have been indexed in advance.     global bookVolumeListIndex
592  proc get_multi_vol_long_title { vtag } { \  
593     global bookVolumeList     set i $bookVolumeListIndex($vtag)
594     global bookVolumeListIndex  
595       return [lindex $bookVolumeList [expr $i + 4]]
596     set i $bookVolumeListIndex($vtag)     }
597    
598     return [lindex $bookVolumeList [expr $i + 4]]  #Marks each of the volumes as unused (resets all of the "used" flags to zero).
599     }  proc mark_all_volumes_unused { } { \
600       global bookVolumeList
601  #Marks each of the volumes as unused (resets all of the "used" flags to zero).     global bookVolumeListStructSize
602  proc mark_all_volumes_unused { } { \  
603     global bookVolumeList     set N [llength $bookVolumeList]
604     global bookVolumeListStructSize  
605       for {set i 0} {$i < $N} {incr i $bookVolumeListStructSize} { \
606     set N [llength $bookVolumeList]        set j [expr $i + 7]
607    
608     for {set i 0} {$i < $N} {incr i $bookVolumeListStructSize} { \        set bookVolumeList [lreplace $bookVolumeList $j $j 0]
609        set j [expr $i + 7]        }
610       }
611        set bookVolumeList [lreplace $bookVolumeList $j $j 0]  
612        }  #Mark an individual volume (by tag) used.
613     }  proc mark_volume_used { vtag } { \
614       global bookVolumeList
615  #Mark an individual volume (by tag) used.     global bookVolumeListIndex
616  proc mark_volume_used { vtag } { \  
617     global bookVolumeList     set i $bookVolumeListIndex($vtag)
618     global bookVolumeListIndex  
619       set i [expr $i + 7]
620     set i $bookVolumeListIndex($vtag)  
621       set bookVolumeList [lreplace $bookVolumeList $i $i 1]
622     set i [expr $i + 7]     }
623    
624     set bookVolumeList [lreplace $bookVolumeList $i $i 1]  
625     }  #Inquire if a given volume (by tag) has its used flag set.
626    #Result is "1" if used, "0" otherwise.
627    proc get_volume_used_flag { vtag } { \
628  #Inquire if a given volume (by tag) has its used flag set.     global bookVolumeList
629  #Result is "1" if used, "0" otherwise.     global bookVolumeListStructSize
630  proc get_volume_used_flag { vtag } { \     global bookVolumeListIndex
631     global bookVolumeList  
632     global bookVolumeListStructSize     set i $bookVolumeListIndex($vtag)
633     global bookVolumeListIndex  
634       set i [expr $i + 7]
635     set i $bookVolumeListIndex($vtag)  
636       return [lindex $bookVolumeList $i]
637     set i [expr $i + 7]     }
638    
639     return [lindex $bookVolumeList $i]  
640     }  #****************************************************************************************
641    #****************************************************************************************
642    #****    L A T E X    C O M P I L E    F U N C T I O N S    *****************************
643  #****************************************************************************************  #****************************************************************************************
644  #****************************************************************************************  #****************************************************************************************
645  #****    L A T E X    C O M P I L E    F U N C T I O N S    *****************************  # Each function in this category performs a function related to LaTeX compilation or
646  #****************************************************************************************  # indexing.                        
647  #****************************************************************************************  #----------------------------------------------------------------------------------------
648  # Each function in this category performs a function related to LaTeX compilation or  # Performs the LaTeX compile of the passed filename, in the "root" directory of the book.
649  # indexing.                          # Any errors will cause the script to terminate.  It gets more attention that way, when
650  #----------------------------------------------------------------------------------------  # an error kills the script.
651  # Performs the LaTeX compile of the passed filename, in the "root" directory of the book.  #
652  # Any errors will cause the script to terminate.  It gets more attention that way, when  proc LatexCompileFile { filename } { \
653  # an error kills the script.     global execLatexCompiler
654  #     global errorCode
655  proc LatexCompileFile { filename } { \  
656     global execLatexCompiler     #The error-handling strategy taken in this function is to terminate with a log file
657     global errorCode     #entry if the LaTeX compiler chokes.  First of all, generally the LaTeX code is
658       #debugged in the 4AllTex GUI, so we shouldn't be compiling bad LaTeX code here.
659     #The error-handling strategy taken in this function is to terminate with a log file     #Second, this is a utility script, and not required to be graceful.  Third,
660     #entry if the LaTeX compiler chokes.  First of all, generally the LaTeX code is     #terminating the program will definitely get the user's attention, whereas any
661     #debugged in the 4AllTex GUI, so we shouldn't be compiling bad LaTeX code here.     #lesser approach might not.
662     #Second, this is a utility script, and not required to be graceful.  Third,     outbothnonl "Using LaTeX to compile: $filename"
663     #terminating the program will definitely get the user's attention, whereas any     outboth .
664     #lesser approach might not.     hlineboth
665     outbothnonl "Using LaTeX to compile: $filename"  
666     outboth .     #The full path to the LaTeX compiler has already been calculated for us at
667     hlineboth     #script startup.
668    
669     #The full path to the LaTeX compiler has already been calculated for us at     #Delete existing intermediate files if they exist.
670     #script startup.     file delete tcl00out.txt
671       file delete tcl00err.txt
672     #Delete existing intermediate files if they exist.                
673     file delete tcl00out.txt     #Open the intermediate files for writing.
674     file delete tcl00err.txt     set stdouthandle [open "tcl00out.txt" "w"]
675                     set stderrhandle [open "tcl00err.txt" "w"]
676     #Open the intermediate files for writing.  
677     set stdouthandle [open "tcl00out.txt" "w"]     #Execute exec and suppress errors.
678     set stderrhandle [open "tcl00err.txt" "w"]     set catchreturncode 0
679       set catchreturncode [catch {exec -- $execLatexCompiler -progname=latex &latex $filename >@ $stdouthandle 2>@ $stderrhandle}]
680     #Execute exec and suppress errors.     set catcherrorcode $errorCode
681     set catchreturncode 0  
682     set catchreturncode [catch {exec -- $execLatexCompiler -progname=latex &latex $filename >@ $stdouthandle 2>@ $stderrhandle}]     #Close both open files.
683     set catcherrorcode $errorCode     close $stderrhandle
684       close $stdouthandle
685     #Close both open files.          
686     close $stderrhandle     if {$catchreturncode} {
687     close $stdouthandle        outbothnonl "$execLatexCompiler generated errors (information follows): $catchreturncode $catcherrorcode"
688                  outboth "."
689     if {$catchreturncode} {        outboth "The build must be aborted."
690        outbothnonl "$execLatexCompiler generated errors (information follows): $catchreturncode $catcherrorcode"        set compilefailed 1
691        outboth "."        hlineboth
692        outboth "The build must be aborted."        } \
693        set compilefailed 1     else {
694        hlineboth        outboth "$execLatexCompiler did not generate errors."
695        } \        set compilefailed 0
696     else {        hlineboth
697        outboth "$execLatexCompiler did not generate errors."        }
698        set compilefailed 0  
699        hlineboth     set stdouthandle [open "tcl00out.txt" "r"]
700        }     set stderrhandle [open "tcl00err.txt" "r"]
701       set stdoutoutput [read $stdouthandle]
702     set stdouthandle [open "tcl00out.txt" "r"]     set stderroutput [read $stderrhandle]
703     set stderrhandle [open "tcl00err.txt" "r"]     close $stdouthandle
704     set stdoutoutput [read $stdouthandle]     close $stderrhandle
705     set stderroutput [read $stderrhandle]  
706     close $stdouthandle     #Delete existing intermediate files if they exist.
707     close $stderrhandle     file delete tcl00out.txt
708       file delete tcl00err.txt
709     #Delete existing intermediate files if they exist.          
710     file delete tcl00out.txt     outboth "Standard output stream from $execLatexCompiler invocation:"
711     file delete tcl00err.txt     hlineboth
712               outboth $stdoutoutput
713     outboth "Standard output stream from $execLatexCompiler invocation:"     hlineboth
714     hlineboth     outboth "Standard error stream from $execLatexCompiler invocation:"
715     outboth $stdoutoutput     hlineboth
716     hlineboth     outboth $stderroutput
717     outboth "Standard error stream from $execLatexCompiler invocation:"     hlineboth
718     hlineboth  
719     outboth $stderroutput     if {$compilefailed} { \
720     hlineboth        outboth "Compile has failed.  Must abort script."
721          exitProc
722     if {$compilefailed} { \        }
723        outboth "Compile has failed.  Must abort script."  
724        exitProc     update
725        }     }
726    
727     update  #----------------------------------------------------------------------------------------
728     }  # Runs the MAKEINDEX program for a file located in the root directory of the book.
729    # File parameter passed is just the "base" file name.
730  #----------------------------------------------------------------------------------------  #
731  # Runs the MAKEINDEX program for a file located in the root directory of the book.  proc MakeOrdinaryIndexFile { filename } { \
732  # File parameter passed is just the "base" file name.     global execMakeindex
733  #     global errorCode
734  proc MakeOrdinaryIndexFile { filename } { \  
735     global execMakeindex     #The error-handling strategy taken in this function is to terminate with a log file
736     global errorCode     #entry if the Makeindex utility chokes.  First of all, generally the LaTeX code is
737       #debugged in the 4AllTex GUI, so we shouldn't be compiling bad LaTeX code here.
738     #The error-handling strategy taken in this function is to terminate with a log file     #Second, this is a utility script, and not required to be graceful.  Third,
739     #entry if the Makeindex utility chokes.  First of all, generally the LaTeX code is     #terminating the program will definitely get the user's attention, whereas any
740     #debugged in the 4AllTex GUI, so we shouldn't be compiling bad LaTeX code here.     #lesser approach might not.
741     #Second, this is a utility script, and not required to be graceful.  Third,     outbothnonl "Using MAKEINDEX to process: $filename"
742     #terminating the program will definitely get the user's attention, whereas any     outboth .
743     #lesser approach might not.     hlineboth
744     outbothnonl "Using MAKEINDEX to process: $filename"  
745     outboth .     #The full path to the MAKEINDEX utility has already been calculated for us at
746     hlineboth     #script startup.
747    
748     #The full path to the MAKEINDEX utility has already been calculated for us at     #Delete existing intermediate files if they exist.
749     #script startup.     file delete tcl00out.txt
750       file delete tcl00err.txt
751     #Delete existing intermediate files if they exist.                
752     file delete tcl00out.txt     #Open the intermediate files for writing.
753     file delete tcl00err.txt     set stdouthandle [open "tcl00out.txt" "w"]
754                     set stderrhandle [open "tcl00err.txt" "w"]
755     #Open the intermediate files for writing.  
756     set stdouthandle [open "tcl00out.txt" "w"]     #Execute exec and suppress errors.
757     set stderrhandle [open "tcl00err.txt" "w"]     set catchreturncode 0
758       set catchreturncode [catch {exec -- $execMakeindex $filename >@ $stdouthandle 2>@ $stderrhandle}]
759     #Execute exec and suppress errors.     set catcherrorcode $errorCode
760     set catchreturncode 0  
761     set catchreturncode [catch {exec -- $execMakeindex $filename >@ $stdouthandle 2>@ $stderrhandle}]     #Close both open files.
762     set catcherrorcode $errorCode     close $stderrhandle
763       close $stdouthandle
764     #Close both open files.          
765     close $stderrhandle     if {$catchreturncode} {
766     close $stdouthandle        outbothnonl "$execMakeindex generated errors (information follows): $catchreturncode $catcherrorcode"
767                  outboth "."
768     if {$catchreturncode} {        outboth "The build must be aborted."
769        outbothnonl "$execMakeindex generated errors (information follows): $catchreturncode $catcherrorcode"        set compilefailed 1
770        outboth "."        hlineboth
771        outboth "The build must be aborted."        } \
772        set compilefailed 1     else {
773        hlineboth        outboth "$execMakeindex did not generate errors."
774        } \        set compilefailed 0
775     else {        hlineboth
776        outboth "$execMakeindex did not generate errors."        }
777        set compilefailed 0  
778        hlineboth     set stdouthandle [open "tcl00out.txt" "r"]
779        }     set stderrhandle [open "tcl00err.txt" "r"]
780       set stdoutoutput [read $stdouthandle]
781     set stdouthandle [open "tcl00out.txt" "r"]     set stderroutput [read $stderrhandle]
782     set stderrhandle [open "tcl00err.txt" "r"]     close $stdouthandle
783     set stdoutoutput [read $stdouthandle]     close $stderrhandle
784     set stderroutput [read $stderrhandle]  
785     close $stdouthandle     #Delete existing intermediate files if they exist.
786     close $stderrhandle     file delete tcl00out.txt
787       file delete tcl00err.txt
788     #Delete existing intermediate files if they exist.          
789     file delete tcl00out.txt     outboth "Standard output stream from $execMakeindex invocation:"
790     file delete tcl00err.txt     hlineboth
791               outboth $stdoutoutput
792     outboth "Standard output stream from $execMakeindex invocation:"     hlineboth
793     hlineboth     outboth "Standard error stream from $execMakeindex invocation:"
794     outboth $stdoutoutput     hlineboth
795     hlineboth     outboth $stderroutput
796     outboth "Standard error stream from $execMakeindex invocation:"     hlineboth
797     hlineboth  
798     outboth $stderroutput     if {$compilefailed} { \
799     hlineboth        outboth "$execMakeindex has failed.  Must abort script."
800          exitProc
801     if {$compilefailed} { \        }
802        outboth "$execMakeindex has failed.  Must abort script."  
803        exitProc     update
804        }     }
805    
806     update  #----------------------------------------------------------------------------------------
807     }  # Runs the DVIPS program to generate postscript output for a file located in the root
808    # directory of the book.  File parameter passed is just the "base" file name.
809  #----------------------------------------------------------------------------------------  #
810  # Runs the DVIPS program to generate postscript output for a file located in the root  proc RunDvipsToGenPsOutput { filename } { \
811  # directory of the book.  File parameter passed is just the "base" file name.     global execDvips
812  #     global errorCode
813  proc RunDvipsToGenPsOutput { filename } { \     global pathUcBookA
814     global execDvips  
815     global errorCode     #The error-handling strategy taken in this function is to terminate with a log file
816     global pathUcBookA     #entry if the DVIPS utility chokes.  First of all, generally the LaTeX code is
817       #debugged in the 4AllTex GUI, so we shouldn't be compiling bad LaTeX code here.
818     #The error-handling strategy taken in this function is to terminate with a log file     #Second, this is a utility script, and not required to be graceful.  Third,
819     #entry if the DVIPS utility chokes.  First of all, generally the LaTeX code is     #terminating the program will definitely get the user's attention, whereas any
820     #debugged in the 4AllTex GUI, so we shouldn't be compiling bad LaTeX code here.     #lesser approach might not.
821     #Second, this is a utility script, and not required to be graceful.  Third,     outbothnonl "Using DVIPS to process: $filename"
822     #terminating the program will definitely get the user's attention, whereas any     outboth .
823     #lesser approach might not.     hlineboth
824     outbothnonl "Using DVIPS to process: $filename"  
825     outboth .     #The full path to the DVIPS utility has already been calculated for us at
826     hlineboth     #script startup.
827    
828     #The full path to the DVIPS utility has already been calculated for us at     #Delete existing intermediate files if they exist.
829     #script startup.     file delete tcl00out.txt
830       file delete tcl00err.txt
831     #Delete existing intermediate files if they exist.                
832     file delete tcl00out.txt     #Open the intermediate files for writing.
833     file delete tcl00err.txt     set stdouthandle [open "tcl00out.txt" "w"]
834                     set stderrhandle [open "tcl00err.txt" "w"]
835     #Open the intermediate files for writing.  
836     set stdouthandle [open "tcl00out.txt" "w"]     #Generate the full path names of interest.  We need to convert the forward slashes
837     set stderrhandle [open "tcl00err.txt" "w"]     #in both names to backslashes because DVIPS accepts the file name and opens the file
838       #itself.
839     #Generate the full path names of interest.  We need to convert the forward slashes     set dvips_input ""
840     #in both names to backslashes because DVIPS accepts the file name and opens the file     append dvips_input $pathUcBookA / $filename .dvi
841     #itself.     set dvips_input [string map {/ \\} $dvips_input]
842     set dvips_input ""     set dvips_output ""
843     append dvips_input $pathUcBookA / $filename .dvi     append dvips_output $pathUcBookA / $filename .ps
844     set dvips_input [string map {/ \\} $dvips_input]     set dvips_output [string map {/ \\} $dvips_output]
845     set dvips_output ""  
846     append dvips_output $pathUcBookA / $filename .ps     #outboth $dvips_input
847     set dvips_output [string map {/ \\} $dvips_output]     #outboth $dvips_output
848    
849     #outboth $dvips_input     #d:\4tex5.0\bin\win32\dvips.exe -P ljfive -o"c:\esrgubka\llr0.ps" "c:\esrgubka\llr0.dvi"
850     #outboth $dvips_output  
851       #Execute exec and suppress errors.
852     #d:\4tex5.0\bin\win32\dvips.exe -P ljfive -o"c:\esrgubka\llr0.ps" "c:\esrgubka\llr0.dvi"     set catchreturncode 0
853       set catchreturncode [catch {exec -- $execDvips -T 8.5in,11in -o$dvips_output $dvips_input >@ $stdouthandle 2>@ $stderrhandle}]
854     #Execute exec and suppress errors.     set catcherrorcode $errorCode
855     set catchreturncode 0  
856     set catchreturncode [catch {exec -- $execDvips -T 8.5in,11in -o$dvips_output $dvips_input >@ $stdouthandle 2>@ $stderrhandle}]     #Close both open files.
857     set catcherrorcode $errorCode     close $stderrhandle
858       close $stdouthandle
859     #Close both open files.          
860     close $stderrhandle     if {$catchreturncode} {
861     close $stdouthandle        outbothnonl "$execDvips generated errors (information follows): $catchreturncode $catcherrorcode"
862                  outboth "."
863     if {$catchreturncode} {        outboth "The build must be aborted."
864        outbothnonl "$execDvips generated errors (information follows): $catchreturncode $catcherrorcode"        set compilefailed 1
865        outboth "."        hlineboth
866        outboth "The build must be aborted."        } \
867        set compilefailed 1     else {
868        hlineboth        outboth "$execDvips did not generate errors."
869        } \        set compilefailed 0
870     else {        hlineboth
871        outboth "$execDvips did not generate errors."        }
872        set compilefailed 0  
873        hlineboth     set stdouthandle [open "tcl00out.txt" "r"]
874        }     set stderrhandle [open "tcl00err.txt" "r"]
875       set stdoutoutput [read $stdouthandle]
876     set stdouthandle [open "tcl00out.txt" "r"]     set stderroutput [read $stderrhandle]
877     set stderrhandle [open "tcl00err.txt" "r"]     close $stdouthandle
878     set stdoutoutput [read $stdouthandle]     close $stderrhandle
879     set stderroutput [read $stderrhandle]  
880     close $stdouthandle     #Delete existing intermediate files if they exist.
881     close $stderrhandle     file delete tcl00out.txt
882       file delete tcl00err.txt
883     #Delete existing intermediate files if they exist.          
884     file delete tcl00out.txt     outboth "Standard output stream from $execDvips invocation:"
885     file delete tcl00err.txt     hlineboth
886               outboth $stdoutoutput
887     outboth "Standard output stream from $execDvips invocation:"     hlineboth
888     hlineboth     outboth "Standard error stream from $execDvips invocation:"
889     outboth $stdoutoutput     hlineboth
890     hlineboth     outboth $stderroutput
891     outboth "Standard error stream from $execDvips invocation:"     hlineboth
892     hlineboth  
893     outboth $stderroutput     if {$compilefailed} { \
894     hlineboth        outboth "$execDvips has failed.  Must abort script."
895          exitProc
896     if {$compilefailed} { \        }
897        outboth "$execDvips has failed.  Must abort script."  
898        exitProc     update
899        }     }
900    
901     update  #----------------------------------------------------------------------------------------
902     }  # Modifies a PS file generated by DVIPS to be duplex.  This is done in a very crude way,
903    # by inserting PostScript.  It can probably be done more elegantly by using the configuration
904  #----------------------------------------------------------------------------------------  # and startup files of DVIPS
905  # Modifies a PS file generated by DVIPS to be duplex.  This is done in a very crude way,  #
906  # by inserting PostScript.  It can probably be done more elegantly by using the configuration  proc ModifyPsToDuplex { filebasename } { \
907  # and startup files of DVIPS     global errorCode
908  #     global pathUcBookA
909  proc ModifyPsToDuplex { filebasename } { \  
910     global errorCode     outbothnonl "Modifying postscript to get duplex form of: $filebasename"
911     global pathUcBookA     outboth .
912       update
913     outbothnonl "Modifying postscript to get duplex form of: $filebasename"  
914     outboth .     #Form the full path of both file names.
915     update     set mod_input  ""
916       set mod_output ""
917     #Form the full path of both file names.     append mod_input  $pathUcBookA / $filebasename .ps
918     set mod_input  ""     append mod_output $pathUcBookA / $filebasename _duplex.ps
919     set mod_output ""  
920     append mod_input  $pathUcBookA / $filebasename .ps     set inhandle  [open $mod_input  "r"]
921     append mod_output $pathUcBookA / $filebasename _duplex.ps     set outhandle [open $mod_output "w"]
922    
923     set inhandle  [open $mod_input  "r"]     #Set larger buffers to speed the I/O operations.
924     set outhandle [open $mod_output "w"]     fconfigure $inhandle  -buffering full -buffersize 200000
925       fconfigure $outhandle -buffering full -buffersize 200000
926     #Set larger buffers to speed the I/O operations.  
927     fconfigure $inhandle  -buffering full -buffersize 200000     set oneshot 0
928     fconfigure $outhandle -buffering full -buffersize 200000  
929       while {! [eof $inhandle] } { \
930     set oneshot 0        set line [gets $inhandle]
931          puts $outhandle $line
932     while {! [eof $inhandle] } { \  
933        set line [gets $inhandle]        if { ! $oneshot } { \
934        puts $outhandle $line               if { [string match "*DVIPSSource*" $line] } { \
935                        puts $outhandle "<< /Duplex true >> setpagedevice"
936        if { ! $oneshot } { \                          set oneshot 1
937               if { [string match "*DVIPSSource*" $line] } { \                      }
938                      puts $outhandle "<< /Duplex true >> setpagedevice"               }
939                          set oneshot 1        }
940                      }  
941               }     #Close both open files.
942        }     close $inhandle
943       close $outhandle
944     #Close both open files.  
945     close $inhandle     hlineboth
946     close $outhandle  
947       update
948     hlineboth     }
949    
950     update  
951     }  #****************************************************************************************
952    #****************************************************************************************
953    #****    L A T E X    S O U R C E    F I L E    G E N E R A T I O N    ******************
954  #****************************************************************************************  #****************************************************************************************
955  #****************************************************************************************  #****************************************************************************************
956  #****    L A T E X    S O U R C E    F I L E    G E N E R A T I O N    ******************  #Outputs the file title line of a LaTeX book source file.
957  #****************************************************************************************  #
958  #****************************************************************************************  proc output_title_line { handle filename desc} { \
959  #Outputs the file title line of a LaTeX book source file.     puts $handle "%[string toupper $filename]:  $desc"
960  #     puts $handle "%"
961  proc output_title_line { handle filename desc} { \  
962     puts $handle "%[string toupper $filename]:  $desc"     set preamble {
963     puts $handle "%"        "%-----------------------------------------------------------------------------------"                   \
964          "%This is an automatically generated file and not version-controlled.  This file is"                     \
965     set preamble {        "%generated by the script CP_SCRIPT.TCL."                                                                \
966        "%-----------------------------------------------------------------------------------"                   \        "%-----------------------------------------------------------------------------------"                   \
967        "%This is an automatically generated file and not version-controlled.  This file is"                     \        "%"                                                                                                      \
968        "%generated by the script CP_SCRIPT.TCL."                                                                \        }
969        "%-----------------------------------------------------------------------------------"                   \  
970        "%"                                                                                                      \     for {set i 0} {$i < [llength $preamble]} {incr i} { \
971        }        puts $handle [lindex $preamble $i]
972          }
973     for {set i 0} {$i < [llength $preamble]} {incr i} { \     }
974        puts $handle [lindex $preamble $i]  
975        }  #Outputs the LaTeX document class and package includes.
976     }  #
977    proc output_doc_class_and_package_includes { handle } { \
978  #Outputs the LaTeX document class and package includes.     set preamble {
979  #        "\\documentclass[letterpaper,10pt,titlepage]\{custbook\}"                                                \
980  proc output_doc_class_and_package_includes { handle } { \        "%"                                                                                                      \
981     set preamble {        "\\pagestyle\{headings\}"                                                                                \
982        "\\documentclass[letterpaper,10pt,titlepage]\{custbook\}"                                                \        "%"                                                                                                      \
983        "%"                                                                                                      \        "\\usepackage\{amsmath\}"                                                                                \
984        "\\pagestyle\{headings\}"                                                                                \        "\\usepackage\{amsfonts\}"                                                                               \
985        "%"                                                                                                      \        "\\usepackage\{amssymb\}"                                                                                \
986        "\\usepackage\{amsmath\}"                                                                                \        "\\usepackage[ansinew]\{inputenc\}"                                                                      \
987        "\\usepackage\{amsfonts\}"                                                                               \        "\\usepackage[OT1]\{fontenc\}"                                                                           \
988        "\\usepackage\{amssymb\}"                                                                                \        "\\usepackage\{graphicx\}"                                                                               \
989        "\\usepackage[ansinew]\{inputenc\}"                                                                      \        "\\usepackage\{makeidx\}"                                                                                \
990        "\\usepackage[OT1]\{fontenc\}"                                                                           \        "%"                                                                                                      \
991        "\\usepackage\{graphicx\}"                                                                               \        }
992        "\\usepackage\{makeidx\}"                                                                                \  
993        "%"                                                                                                      \     for {set i 0} {$i < [llength $preamble]} {incr i} { \
994        }        puts $handle [lindex $preamble $i]
995          }
996     for {set i 0} {$i < [llength $preamble]} {incr i} { \     }
997        puts $handle [lindex $preamble $i]  
998        }  
999     }  #Outputs the final matter in both types of volumes.  The "final matter" is the
1000    #stuff after the chapter includes up until but not including final
1001    #file annunciator.
1002  #Outputs the final matter in both types of volumes.  The "final matter" is the  #
1003  #stuff after the chapter includes up until but not including final  proc output_tex_volume_final_matter { handle } { \
1004  #file annunciator.     set final_matter {
1005  #        "%Glossary Of Terms"                                                                                     \
1006  proc output_tex_volume_final_matter { handle } { \        "\\cleardoublepage"                                                                                      \
1007     set final_matter {        "\\addcontentsline\{toc\}\{chapter\}\{Glossary Of Terms\}"                                               \
1008        "%Glossary Of Terms"                                                                                     \        "\\input\{c_glo0/c_glo0\}"                                                                               \
1009        "\\cleardoublepage"                                                                                      \        "%"                                                                                                      \
1010        "\\addcontentsline\{toc\}\{chapter\}\{Glossary Of Terms\}"                                               \        "%Glossary Of Mathematical Notation"                                                                     \
1011        "\\input\{c_glo0/c_glo0\}"                                                                               \        "\\cleardoublepage"                                                                                      \
1012        "%"                                                                                                      \        "\\addcontentsline\{toc\}\{chapter\}\{Glossary Of Mathematical Notation\}"                               \
1013        "%Glossary Of Mathematical Notation"                                                                     \        "\\input\{c_glo1/c_glo1\}"                                                                               \
1014        "\\cleardoublepage"                                                                                      \        "%"                                                                                                      \
1015        "\\addcontentsline\{toc\}\{chapter\}\{Glossary Of Mathematical Notation\}"                               \        "%Bibliography"                                                                                          \
1016        "\\input\{c_glo1/c_glo1\}"                                                                               \        "\\cleardoublepage"                                                                                      \
1017        "%"                                                                                                      \        "\\addcontentsline\{toc\}\{chapter\}\{Bibliography\}"                                                    \
1018        "%Bibliography"                                                                                          \        "\\input\{volshare/workbibl\}"                                                                           \
1019        "\\cleardoublepage"                                                                                      \        "%"                                                                                                      \
1020        "\\addcontentsline\{toc\}\{chapter\}\{Bibliography\}"                                                    \        "%Index Must Be Formed At This Directory Level"                                                          \
1021        "\\input\{volshare/workbibl\}"                                                                           \        "\\cleardoublepage"                                                                                      \
1022        "%"                                                                                                      \        "\\addcontentsline\{toc\}\{chapter\}\{Index\}"                                                           \
1023        "%Index Must Be Formed At This Directory Level"                                                          \        "\\printindex"                                                                                           \
1024        "\\cleardoublepage"                                                                                      \        "%"                                                                                                      \
1025        "\\addcontentsline\{toc\}\{chapter\}\{Index\}"                                                           \        "\\end\{document\}"                                                                                      \
1026        "\\printindex"                                                                                           \        "%"                                                                                                      \
1027        "%"                                                                                                      \        }
1028        "\\end\{document\}"                                                                                      \  
1029        "%"                                                                                                      \     for {set i 0} {$i < [llength $final_matter]} {incr i} { \
1030        }        puts $handle [lindex $final_matter $i]
1031          }
1032     for {set i 0} {$i < [llength $final_matter]} {incr i} { \     }
1033        puts $handle [lindex $final_matter $i]  
1034        }  
1035     }  #Marks the end of a TEX volume file, for aesthetics.
1036    proc mark_end_of_tex_volume_files_for_aesthetics { handle filename } { \
1037       puts $handle "%End of file [string toupper $filename]."
1038  #Marks the end of a TEX volume file, for aesthetics.     }
1039  proc mark_end_of_tex_volume_files_for_aesthetics { handle filename } { \  
1040     puts $handle "%End of file [string toupper $filename]."  
1041     }  #Output code to import the external document labels, used for cross-referencing
1042    #This is a bit tricky because don't want to include ourselves.  This applies
1043    #to the multi-volume work only.  For the single-volume work, all reference are
1044  #Output code to import the external document labels, used for cross-referencing  #internal.
1045  #This is a bit tricky because don't want to include ourselves.  This applies  proc output_external_document_symbol_imports { handle vtag }  { \
1046  #to the multi-volume work only.  For the single-volume work, all reference are     global bookVolumeList
1047  #internal.     global bookVolumeListStructSize
1048  proc output_external_document_symbol_imports { handle vtag }  { \  
1049     global bookVolumeList     puts $handle "%External document symbol imports.  These imports allow one volume"
1050     global bookVolumeListStructSize     puts $handle "%to cross-reference to another, and create one large namespace for"
1051       puts $handle "%LaTeX symbols."
1052     puts $handle "%External document symbol imports.  These imports allow one volume"  
1053     puts $handle "%to cross-reference to another, and create one large namespace for"     set N [llength $bookVolumeList]
1054     puts $handle "%LaTeX symbols."  
1055       #Iterate through the list.  Everything gets output unless
1056     set N [llength $bookVolumeList]     #it is our tag name.
1057       for {set i 0} {$i < $N} {incr i $bookVolumeListStructSize} { \
1058     #Iterate through the list.  Everything gets output unless        if {[get_volume_used_flag [lindex $bookVolumeList $i]]} { \
1059     #it is our tag name.           set iter_vtag [lindex $bookVolumeList $i]
1060     for {set i 0} {$i < $N} {incr i $bookVolumeListStructSize} { \           if {[string compare $iter_vtag $vtag]} { \
1061        if {[get_volume_used_flag [lindex $bookVolumeList $i]]} { \              set lineout \\externaldocument\{$iter_vtag\}
1062           set iter_vtag [lindex $bookVolumeList $i]              puts $handle $lineout
1063           if {[string compare $iter_vtag $vtag]} { \              }
1064              set lineout \\externaldocument\{$iter_vtag\}           }
1065              puts $handle $lineout        }
1066              }  
1067           }     puts $handle "%"
1068        }     }
1069    
1070     puts $handle "%"  #Outputs the common things in a document, from the "\makeindex" command
1071     }  #through the "\begin{document}" command.
1072    #
1073  #Outputs the common things in a document, from the "\makeindex" command  proc output_common_lines_through_begindoc { handle } { \
1074  #through the "\begin{document}" command.     set preamble {
1075  #        "%Embarrassingly, I've forgotten why \"makeindex\" is necessary ..."                                     \
1076  proc output_common_lines_through_begindoc { handle } { \        "\\makeindex"                                                                                            \
1077     set preamble {        "%"                                                                                                      \
1078        "%Embarrassingly, I've forgotten why \"makeindex\" is necessary ..."                                     \        "%Shared mathematical definitions"                                                                       \
1079        "\\makeindex"                                                                                            \        "\\input\{volshare/workmdef\}"                                                                           \
1080        "%"                                                                                                      \        "%"                                                                                                      \
1081        "%Shared mathematical definitions"                                                                       \        "%Hyphenation exceptions"                                                                                \
1082        "\\input\{volshare/workmdef\}"                                                                           \        "\\input\{volshare/workhxcp\}"                                                                           \
1083        "%"                                                                                                      \        "%"                                                                                                      \
1084        "%Hyphenation exceptions"                                                                                \        "%New environments, etc."                                                                                \
1085        "\\input\{volshare/workhxcp\}"                                                                           \        "\\input\{volshare/worknenv\}"                                                                           \
1086        "%"                                                                                                      \        "%"                                                                                                      \
1087        "%New environments, etc."                                                                                \        "\\begin\{document\}"                                                                                    \
1088        "\\input\{volshare/worknenv\}"                                                                           \        "%"                                                                                                      \
1089        "%"                                                                                                      \        "%Index \"see\" definitions"                                                                             \
1090        "\\begin\{document\}"                                                                                    \        "\\input\{volshare/workidxs\}"                                                                           \
1091        "%"                                                                                                      \        "%"                                                                                                      \
1092        "%Index \"see\" definitions"                                                                             \        }
1093        "\\input\{volshare/workidxs\}"                                                                           \  
1094        "%"                                                                                                      \     for {set i 0} {$i < [llength $preamble]} {incr i} { \
1095        }        puts $handle [lindex $preamble $i]
1096          }
1097     for {set i 0} {$i < [llength $preamble]} {incr i} { \     }
1098        puts $handle [lindex $preamble $i]  
1099        }  #Outputs multi-volume volume and chapter definitions for a specific
1100     }  #volume.
1101    #
1102  #Outputs multi-volume volume and chapter definitions for a specific  #Inputs:
1103  #volume.  #  handle : File handle to write to.
1104  #  #  vtag   : Volume tag of the volume whose master file is being formed.
1105  #Inputs:  #  volnum : The ordinal number of the volume, as a decimal integer.
1106  #  handle : File handle to write to.  #           This is used to create ordinary numbers, roman numbers,
1107  #  vtag   : Volume tag of the volume whose master file is being formed.  #           etc.
1108  #  volnum : The ordinal number of the volume, as a decimal integer.  #  
1109  #           This is used to create ordinary numbers, roman numbers,  proc output_multi_volume_volume_and_chapter_definitions { handle vtag volnum } { \
1110  #           etc.     global bookVolumeList
1111  #       global bookVolumeListStructSize
1112  proc output_multi_volume_volume_and_chapter_definitions { handle vtag volnum } { \     global mcl
1113     global bookVolumeList  
1114     global bookVolumeListStructSize     #Get the roman-numeral representation of the volume.
1115     global mcl     set volnum_roman [upper_case_roman_numeral_string $volnum]
1116    
1117     #Get the roman-numeral representation of the volume.     #Get the long title of the volume.
1118     set volnum_roman [upper_case_roman_numeral_string $volnum]     set vol_long_title [get_multi_vol_long_title $vtag]
1119    
1120     #Get the long title of the volume.     #Output the "current volume" LaTeX commands.
1121     set vol_long_title [get_multi_vol_long_title $vtag]     puts $handle "%Constants for the current volume."
1122       puts $handle "\\newcommand\\curvolarabic\{$volnum\}"
1123     #Output the "current volume" LaTeX commands.     puts $handle "\\newcommand\\curvolroman\{$volnum_roman\}"
1124     puts $handle "%Constants for the current volume."     puts $handle "\\newcommand\\curvoltitle\{$vol_long_title\}"
1125     puts $handle "\\newcommand\\curvolarabic\{$volnum\}"     puts $handle "\\newcommand\\curvoltitlepagesep\{:  \}"
1126     puts $handle "\\newcommand\\curvolroman\{$volnum_roman\}"     puts $handle "\\newcommand\\curvoltitlepageprefix\{Volume \}"
1127     puts $handle "\\newcommand\\curvoltitle\{$vol_long_title\}"     puts $handle "%"
1128     puts $handle "\\newcommand\\curvoltitlepagesep\{:  \}"  
1129     puts $handle "\\newcommand\\curvoltitlepageprefix\{Volume \}"     #Output definitions for all volumes.  There is no need to exclude the
1130     puts $handle "%"     #current volume, as this could just as well be cited in this framework.
1131       puts $handle "%Constants for all volumes."
1132     #Output definitions for all volumes.  There is no need to exclude the     puts $handle "%"
1133     #current volume, as this could just as well be cited in this framework.     set temp_ordinal_volume_number 0
1134     puts $handle "%Constants for all volumes."     set N [llength $bookVolumeList]
1135     puts $handle "%"     for {set i 0} {$i < $N} {incr i $bookVolumeListStructSize} { \
1136     set temp_ordinal_volume_number 0        set cur_iter_volume [lindex $bookVolumeList $i]
1137     set N [llength $bookVolumeList]  
1138     for {set i 0} {$i < $N} {incr i $bookVolumeListStructSize} { \        if {[get_volume_used_flag [lindex $bookVolumeList $i]]} { \
1139        set cur_iter_volume [lindex $bookVolumeList $i]           incr temp_ordinal_volume_number
1140             puts $handle "%%%% [string toupper [lindex $bookVolumeList $i]]:  Volume $temp_ordinal_volume_number:  [get_multi_vol_long_title [lindex $bookVolumeList $i]] %%%%"
1141        if {[get_volume_used_flag [lindex $bookVolumeList $i]]} { \           puts $handle "\\newcommand\\v[replace_digits_with_alphas [lindex $bookVolumeList $i]]arabic\{$temp_ordinal_volume_number\}"
1142           incr temp_ordinal_volume_number           puts $handle "\\newcommand\\v[replace_digits_with_alphas [lindex $bookVolumeList $i]]roman\{[upper_case_roman_numeral_string $temp_ordinal_volume_number]\}"
1143           puts $handle "%%%% [string toupper [lindex $bookVolumeList $i]]:  Volume $temp_ordinal_volume_number:  [get_multi_vol_long_title [lindex $bookVolumeList $i]] %%%%"           puts $handle "\\newcommand\\v[replace_digits_with_alphas [lindex $bookVolumeList $i]]title\{[get_multi_vol_long_title [lindex $bookVolumeList $i]]\}"
1144           puts $handle "\\newcommand\\v[replace_digits_with_alphas [lindex $bookVolumeList $i]]arabic\{$temp_ordinal_volume_number\}"           puts $handle "\\newcommand\\v[replace_digits_with_alphas [lindex $bookVolumeList $i]]citecomma\{[string toupper [lindex $bookVolumeList $i]], \}"
1145           puts $handle "\\newcommand\\v[replace_digits_with_alphas [lindex $bookVolumeList $i]]roman\{[upper_case_roman_numeral_string $temp_ordinal_volume_number]\}"           puts $handle "\\newcommand\\v[replace_digits_with_alphas [lindex $bookVolumeList $i]]citehyphen\{[string toupper [lindex $bookVolumeList $i]]-\}"
1146           puts $handle "\\newcommand\\v[replace_digits_with_alphas [lindex $bookVolumeList $i]]title\{[get_multi_vol_long_title [lindex $bookVolumeList $i]]\}"           puts $handle "%"        
1147           puts $handle "\\newcommand\\v[replace_digits_with_alphas [lindex $bookVolumeList $i]]citecomma\{[string toupper [lindex $bookVolumeList $i]], \}"  
1148           puts $handle "\\newcommand\\v[replace_digits_with_alphas [lindex $bookVolumeList $i]]citehyphen\{[string toupper [lindex $bookVolumeList $i]]-\}"           #Output definitions for all chapters which are enclosed by the current volume.  This is a bit tricky
1149           puts $handle "%"                   #because must traverse the mcl table and pick out the right portion.
1150             set state 0
1151           #Output definitions for all chapters which are enclosed by the current volume.  This is a bit tricky              #"state" is a state variable which keeps track of where we are parsing the mcl table.
1152           #because must traverse the mcl table and pick out the right portion.              #State values are as follows:
1153           set state 0              #  0 -- have not yet found the right volume.
1154              #"state" is a state variable which keeps track of where we are parsing the mcl table.              #  1 -- are in the midst of the right volume.
1155              #State values are as follows:              #  2 -- are into subsequent volumes.
1156              #  0 -- have not yet found the right volume.  
1157              #  1 -- are in the midst of the right volume.           set cur_vol ""
1158              #  2 -- are into subsequent volumes.           set chapter_or_appendix ""
1159    
1160           set cur_vol ""           for {set j 0} {$j < [llength $mcl]} {incr j 4} { \
1161           set chapter_or_appendix ""              set rectype [lindex $mcl [expr $j + 0]]
1162                set par1    [lindex $mcl [expr $j + 1]]
1163           for {set j 0} {$j < [llength $mcl]} {incr j 4} { \              set par2    [lindex $mcl [expr $j + 2]]
1164              set rectype [lindex $mcl [expr $j + 0]]              set par3    [lindex $mcl [expr $j + 3]]
1165              set par1    [lindex $mcl [expr $j + 1]]          
1166              set par2    [lindex $mcl [expr $j + 2]]              if {$state == 0} { \
1167              set par3    [lindex $mcl [expr $j + 3]]                 if {! [string compare $rectype v] || ! [string compare $rectype w]} { \
1168                              #This is a volume record that has meaning for us.  In either case,
1169              if {$state == 0} { \                    #the vtag comes from par1.
1170                 if {! [string compare $rectype v] || ! [string compare $rectype w]} { \  
1171                    #This is a volume record that has meaning for us.  In either case,                    #Have not yet encountered our volume of interest.  If this is
1172                    #the vtag comes from par1.                    #it, record and change state.
1173                      if {![string compare $cur_iter_volume $par1]} { \
1174                    #Have not yet encountered our volume of interest.  If this is                       set cur_vol $par1
1175                    #it, record and change state.                       set chapter_or_appendix "Chapter"
1176                    if {![string compare $cur_iter_volume $par1]} { \                       set state 1
1177                       set cur_vol $par1                       }
1178                       set chapter_or_appendix "Chapter"                    }
1179                       set state 1                 } \
1180                       }              elseif {$state == 1} { \
1181                    }                 #We are within the volume of interest.  Looking for chapter records.
1182                 } \                 if {! [string compare $rectype c] || ! [string compare $rectype e]} { \
1183              elseif {$state == 1} { \                    set cur_chap_lc $par1
1184                 #We are within the volume of interest.  Looking for chapter records.                    set cur_chap_uc [string toupper $cur_chap_lc]
1185                 if {! [string compare $rectype c] || ! [string compare $rectype e]} { \                    set cur_chap_idstring [replace_digits_with_alphas $cur_chap_lc]
1186                    set cur_chap_lc $par1                    set cur_chap_short_title [get_chap_short_single_volume_title $cur_chap_lc]
1187                    set cur_chap_uc [string toupper $cur_chap_lc]                    set cur_chap_long_title [get_chap_long_single_volume_title $cur_chap_lc]
1188                    set cur_chap_idstring [replace_digits_with_alphas $cur_chap_lc]                    set cur_chap_vol_arabic $temp_ordinal_volume_number
1189                    set cur_chap_short_title [get_chap_short_single_volume_title $cur_chap_lc]                    set cur_chap_vol_roman [upper_case_roman_numeral_string $temp_ordinal_volume_number]
1190                    set cur_chap_long_title [get_chap_long_single_volume_title $cur_chap_lc]                    set cur_chap_vol_title [get_multi_vol_long_title [lindex $bookVolumeList $i]]
1191                    set cur_chap_vol_arabic $temp_ordinal_volume_number  
1192                    set cur_chap_vol_roman [upper_case_roman_numeral_string $temp_ordinal_volume_number]                    puts $handle "%%%% Chapter C$cur_chap_uc:  $cur_chap_long_title %%%%"
1193                    set cur_chap_vol_title [get_multi_vol_long_title [lindex $bookVolumeList $i]]                    puts -nonewline $handle "\\newcommand\\c$cur_chap_idstring"
1194                      puts $handle "volarabic\{$cur_chap_vol_arabic\}"
1195                    puts $handle "%%%% Chapter C$cur_chap_uc:  $cur_chap_long_title %%%%"                    puts -nonewline $handle "\\newcommand\\c$cur_chap_idstring"
1196                    puts -nonewline $handle "\\newcommand\\c$cur_chap_idstring"                    puts $handle "volroman\{$cur_chap_vol_roman\}"
1197                    puts $handle "volarabic\{$cur_chap_vol_arabic\}"                    puts -nonewline $handle "\\newcommand\\c$cur_chap_idstring"
1198                    puts -nonewline $handle "\\newcommand\\c$cur_chap_idstring"                    puts $handle "voltitle\{$cur_chap_vol_title\}"
1199                    puts $handle "volroman\{$cur_chap_vol_roman\}"                    puts -nonewline $handle "\\newcommand\\c$cur_chap_idstring"
1200                    puts -nonewline $handle "\\newcommand\\c$cur_chap_idstring"                    puts $handle "shorttitle\{$cur_chap_short_title\}"
1201                    puts $handle "voltitle\{$cur_chap_vol_title\}"                    puts -nonewline $handle "\\newcommand\\c$cur_chap_idstring"
1202                    puts -nonewline $handle "\\newcommand\\c$cur_chap_idstring"                    puts $handle "title\{$cur_chap_long_title\}"
1203                    puts $handle "shorttitle\{$cur_chap_short_title\}"                    puts -nonewline $handle "\\newcommand\\c$cur_chap_idstring"
1204                    puts -nonewline $handle "\\newcommand\\c$cur_chap_idstring"                    puts $handle "longtitle\{$cur_chap_long_title\}"
1205                    puts $handle "title\{$cur_chap_long_title\}"  
1206                    puts -nonewline $handle "\\newcommand\\c$cur_chap_idstring"                    puts -nonewline $handle "\\newcommand\\c$cur_chap_idstring"
1207                    puts $handle "longtitle\{$cur_chap_long_title\}"  
1208                      #For the cite, there are two cases to cover.  If the chapter is in the
1209                    puts -nonewline $handle "\\newcommand\\c$cur_chap_idstring"                    #volume we're doing, the cite is the empty string.  Otherwise, it
1210                      #is the volume tag.
1211                    #For the cite, there are two cases to cover.  If the chapter is in the                    if {![string compare $vtag $cur_iter_volume]} { \
1212                    #volume we're doing, the cite is the empty string.  Otherwise, it                       set cur_chap_xref_cite ""
1213                    #is the volume tag.                       } \
1214                    if {![string compare $vtag $cur_iter_volume]} { \                    else {
1215                       set cur_chap_xref_cite ""                       set cur_chap_xref_cite "[string toupper [lindex $bookVolumeList $i]]"
1216                       } \                       }
1217                    else {  
1218                       set cur_chap_xref_cite "[string toupper [lindex $bookVolumeList $i]]"                    if {[string length $cur_chap_xref_cite]} { \
1219                       }                       puts $handle "xrefhyphen\{$cur_chap_xref_cite-\}"
1220                                         } \
1221                    if {[string length $cur_chap_xref_cite]} { \                                    else {
1222                       puts $handle "xrefhyphen\{$cur_chap_xref_cite-\}"                       puts $handle "xrefhyphen\{\}"
1223                                       } \                                       }
1224                                    else {  
1225                       puts $handle "xrefhyphen\{\}"                    puts -nonewline $handle "\\newcommand\\c$cur_chap_idstring"
1226                                       }  
1227                      if {[string length $cur_chap_xref_cite]} { \
1228                    puts -nonewline $handle "\\newcommand\\c$cur_chap_idstring"                       puts $handle "xrefcomma\{$cur_chap_xref_cite, \}"
1229                                         } \
1230                    if {[string length $cur_chap_xref_cite]} { \                                    else {
1231                       puts $handle "xrefcomma\{$cur_chap_xref_cite, \}"                       puts $handle "xrefcomma\{\}"
1232                                       } \                                       }
1233                                    else {  
1234                       puts $handle "xrefcomma\{\}"                    puts -nonewline $handle "\\newcommand\\c$cur_chap_idstring"
1235                                       }                    puts $handle "mcclass\{$chapter_or_appendix\}"
1236                      puts -nonewline $handle "\\newcommand\\c$cur_chap_idstring"
1237                    puts -nonewline $handle "\\newcommand\\c$cur_chap_idstring"                    puts $handle "ucclass\{[string toupper $chapter_or_appendix]\}"
1238                    puts $handle "mcclass\{$chapter_or_appendix\}"                    puts -nonewline $handle "\\newcommand\\c$cur_chap_idstring"
1239                    puts -nonewline $handle "\\newcommand\\c$cur_chap_idstring"                    puts $handle "lcclass\{[string tolower $chapter_or_appendix]\}"
1240                    puts $handle "ucclass\{[string toupper $chapter_or_appendix]\}"                    puts $handle "%"
1241                    puts -nonewline $handle "\\newcommand\\c$cur_chap_idstring"                    } \
1242                    puts $handle "lcclass\{[string tolower $chapter_or_appendix]\}"                 elseif {! [string compare $rectype y]} { \
1243                    puts $handle "%"                    #This is the beginning of the appendix material for a multi-volume work.
1244                    } \                    set chapter_or_appendix "Appendix"
1245                 elseif {! [string compare $rectype y]} { \                    } \
1246                    #This is the beginning of the appendix material for a multi-volume work.                 elseif {! [string compare $rectype v] || ! [string compare $rectype w]} { \
1247                    set chapter_or_appendix "Appendix"                    set state 2
1248                    } \                    }
1249                 elseif {! [string compare $rectype v] || ! [string compare $rectype w]} { \                 } \
1250                    set state 2              elseif {$state == 2} { \
1251                    }                 #Do nothing.  We are in the parsing state where we have done the volume of interest
1252                 } \                 #and can't do more.
1253              elseif {$state == 2} { \                 } \
1254                 #Do nothing.  We are in the parsing state where we have done the volume of interest              else {
1255                 #and can't do more.                 error "Bad state variable."
1256                 } \                 }
1257              else {              }
1258                 error "Bad state variable."           }
1259                 }        }
1260              }     }
1261           }  
1262        }  
1263     }  #Outputs the matter between the volume and chapter definitions and
1264    #the chapters.
1265    proc output_matter_between_chapter_defs_and_chapters { handle vtag script_vcinfo sv_or_mv} { \
1266  #Outputs the matter between the volume and chapter definitions and     puts $handle "%Title page(s)"
1267  #the chapters.     puts $handle "\\input\{volshare/workttla\}"
1268  proc output_matter_between_chapter_defs_and_chapters { handle vtag script_vcinfo sv_or_mv} { \     puts $handle "%"
1269     puts $handle "%Title page(s)"     puts $handle "\\vspace\{-0.45in\}"
1270     puts $handle "\\input\{volshare/workttla\}"     puts $handle "%"
1271     puts $handle "%"     puts $handle "%Version control information for this script."
1272     puts $handle "\\vspace\{-0.45in\}"     puts $handle "\\noindent\\begin\{minipage\}\{\\textwidth\}"
1273     puts $handle "%"     puts $handle "\\noindent\\rule\[-0.25in\]\{\\textwidth\}\{1pt\}"
1274     puts $handle "%Version control information for this script."     puts $handle "\\begin\{tiny\}"
1275     puts $handle "\\noindent\\begin\{minipage\}\{\\textwidth\}"     puts $handle "\\begin\{verbatim\}"
1276     puts $handle "\\noindent\\rule\[-0.25in\]\{\\textwidth\}\{1pt\}"     puts -nonewline $handle $script_vcinfo
1277     puts $handle "\\begin\{tiny\}"     puts $handle "\\end\{verbatim\}"
1278     puts $handle "\\begin\{verbatim\}"     puts $handle "\\end\{tiny\}"
1279     puts -nonewline $handle $script_vcinfo     puts $handle "\\noindent\\rule\[0.25in\]\{\\textwidth\}\{1pt\}"
1280     puts $handle "\\end\{verbatim\}"     puts $handle "\\end\{minipage\}"
1281     puts $handle "\\end\{tiny\}"     puts $handle "%"
1282     puts $handle "\\noindent\\rule\[0.25in\]\{\\textwidth\}\{1pt\}"     puts $handle "%Declare this as frontmatter, the front portion before the meat"
1283     puts $handle "\\end\{minipage\}"     puts $handle "%of the book."
1284     puts $handle "%"     puts $handle "\\frontmatter\{\}"
1285     puts $handle "%Declare this as frontmatter, the front portion before the meat"     puts $handle "%"
1286     puts $handle "%of the book."     puts $handle "%Preface"
1287     puts $handle "\\frontmatter\{\}"  
1288     puts $handle "%"     copy_preface_to_stream $handle $sv_or_mv
1289     puts $handle "%Preface"  
1290       puts $handle "%"
1291     copy_preface_to_stream $handle $sv_or_mv     puts $handle "%Acknowledgements"
1292       puts $handle "\\input\{volshare/workacks\}"
1293     puts $handle "%"     puts $handle "%"
1294     puts $handle "%Acknowledgements"     puts $handle "%Table of contents"
1295     puts $handle "\\input\{volshare/workacks\}"     puts $handle "\\tableofcontents"
1296     puts $handle "%"     puts $handle "%"
1297     puts $handle "%Table of contents"     puts $handle "%List of tables"
1298     puts $handle "\\tableofcontents"     puts $handle "\\listoftables"
1299     puts $handle "%"     puts $handle "%"
1300     puts $handle "%List of tables"     puts $handle "%List of figures"
1301     puts $handle "\\listoftables"     puts $handle "\\listoffigures"
1302     puts $handle "%"     puts $handle "%"
1303     puts $handle "%List of figures"     puts $handle "%List of algorithms"
1304     puts $handle "\\listoffigures"     puts $handle "\\listofalgorithms"
1305     puts $handle "%"     puts $handle "%"
1306     puts $handle "%List of algorithms"     puts $handle "%Everything after this is the main matter, the \"meat\""
1307     puts $handle "\\listofalgorithms"     puts $handle "%of the book."
1308     puts $handle "%"     puts $handle "\\mainmatter\{\}"
1309     puts $handle "%Everything after this is the main matter, the \"meat\""     puts $handle "%"
1310     puts $handle "%of the book."     }
1311     puts $handle "\\mainmatter\{\}"  
1312     puts $handle "%"  #Copies the contents of the preface to the master file being formed.  To accomodate
1313     }  #single-volume versus multi-volume builds, the two tags "<sv>" and "<mv>", which
1314    #must occur starting in column 1, are supported.  These two tags indicate that the
1315  #Copies the contents of the preface to the master file being formed.  To accomodate  #line goes only to the single-volume build or the multi-volume build files.
1316  #single-volume versus multi-volume builds, the two tags "<sv>" and "<mv>", which  #The paramter sv or mv must be "s" or "m" for single or multi.
1317  #must occur starting in column 1, are supported.  These two tags indicate that the  #
1318  #line goes only to the single-volume build or the multi-volume build files.  proc copy_preface_to_stream { handle sv_or_mv } { \
1319  #The paramter sv or mv must be "s" or "m" for single or multi.     #Set the compare tag based on the input parameter.
1320  #     if {![string compare $sv_or_mv "s"]} { \
1321  proc copy_preface_to_stream { handle sv_or_mv } { \        set compare_tag "<sv>"
1322     #Set the compare tag based on the input parameter.        } \
1323     if {![string compare $sv_or_mv "s"]} { \     elseif {![string compare $sv_or_mv "m"]} {
1324        set compare_tag "<sv>"        set compare_tag "<mv>"
1325        } \        } \
1326     elseif {![string compare $sv_or_mv "m"]} {     else {
1327        set compare_tag "<mv>"        error
1328        } \        }
1329     else {  
1330        error     #Open the preface for processing.
1331        }     set phandle [open volshare/workprfa.tex r]
1332    
1333     #Open the preface for processing.     #For each line, just copy it in, discarding lines with the wrong tag.
1334     set phandle [open volshare/workprfa.tex r]     set eof_found 0
1335       while {!$eof_found} { \
1336     #For each line, just copy it in, discarding lines with the wrong tag.        #Grab a line.
1337     set eof_found 0        set line_in [gets $phandle]
1338     while {!$eof_found} { \  
1339        #Grab a line.        #Set a boolean if it contains a tag of any sort.  Remove the tag from the line.
1340        set line_in [gets $phandle]        set tag ""
1341          set tag_found 0
1342        #Set a boolean if it contains a tag of any sort.  Remove the tag from the line.        set sf_result_1 [string first "<" $line_in]
1343        set tag ""        set sf_result_2 [string first ">" $line_in]
1344        set tag_found 0        set sf_result_3 [string first $compare_tag $line_in]
1345        set sf_result_1 [string first "<" $line_in]        if {( $sf_result_1 == 0 ) && ( $sf_result_2 == 3 ) } { \
1346        set sf_result_2 [string first ">" $line_in]           set tag_found 1
1347        set sf_result_3 [string first $compare_tag $line_in]           }
1348        if {( $sf_result_1 == 0 ) && ( $sf_result_2 == 3 ) } { \  
1349           set tag_found 1        if {$tag_found && ! ($sf_result_3 == 0)} { \
1350           }           #There was a tag, but it is not for us.  Discard the line.
1351             } \
1352        if {$tag_found && ! ($sf_result_3 == 0)} { \        elseif {$tag_found && ($sf_result_3 == 0)} {
1353           #There was a tag, but it is not for us.  Discard the line.           #The tag was found, and it is for us.  Remove the tag from the line and
1354           } \           #put the line to the output.
1355        elseif {$tag_found && ($sf_result_3 == 0)} {           set line_in [string range $line_in 4 end]
1356           #The tag was found, and it is for us.  Remove the tag from the line and           puts $handle $line_in
1357           #put the line to the output.           } \
1358           set line_in [string range $line_in 4 end]        else {
1359           puts $handle $line_in           #There was no tag found.  Just pass the line through.
1360           } \           puts $handle $line_in
1361        else {           }
1362           #There was no tag found.  Just pass the line through.  
1363           puts $handle $line_in        set eof_found [eof $phandle]      
1364           }        }
1365    
1366        set eof_found [eof $phandle]           #Close the preface, we are done with it.
1367        }     close $phandle
1368       }
1369     #Close the preface, we are done with it.  
1370     close $phandle  
1371     }  #Outputs the chapter and appendix includes for one volume of a multi-volume work
1372    #
1373    proc output_multi_volume_chapter_and_appendix_includes { handle vtag } { \
1374  #Outputs the chapter and appendix includes for one volume of a multi-volume work     global mcl
1375  #  
1376  proc output_multi_volume_chapter_and_appendix_includes { handle vtag } { \     #Output definitions for all chapters which are enclosed by the current volume.  This is a bit tricky
1377     global mcl     #because must traverse the mcl table and pick out the right portion.
1378       set state 0
1379     #Output definitions for all chapters which are enclosed by the current volume.  This is a bit tricky        #"state" is a state variable which keeps track of where we are parsing the mcl table.
1380     #because must traverse the mcl table and pick out the right portion.        #State values are as follows:
1381     set state 0        #  0 -- have not yet found the right volume.
1382        #"state" is a state variable which keeps track of where we are parsing the mcl table.        #  1 -- are in the midst of the right volume.
1383        #State values are as follows:        #  2 -- are into subsequent volumes.
1384        #  0 -- have not yet found the right volume.  
1385        #  1 -- are in the midst of the right volume.     for {set i 0} {$i < [llength $mcl]} {incr i 4} { \
1386        #  2 -- are into subsequent volumes.        set rectype [lindex $mcl [expr $i + 0]]
1387          set par1    [lindex $mcl [expr $i + 1]]
1388     for {set i 0} {$i < [llength $mcl]} {incr i 4} { \        set par2    [lindex $mcl [expr $i + 2]]
1389        set rectype [lindex $mcl [expr $i + 0]]        set par3    [lindex $mcl [expr $i + 3]]
1390        set par1    [lindex $mcl [expr $i + 1]]          
1391        set par2    [lindex $mcl [expr $i + 2]]        if {$state == 0} { \
1392        set par3    [lindex $mcl [expr $i + 3]]           if {! [string compare $rectype v] || ! [string compare $rectype w]} { \
1393                        #This is a volume record that has meaning for us.  In either case,
1394        if {$state == 0} { \              #the vtag comes from par1.
1395           if {! [string compare $rectype v] || ! [string compare $rectype w]} { \  
1396              #This is a volume record that has meaning for us.  In either case,              #Have not yet encountered our volume of interest.  If this is
1397              #the vtag comes from par1.              #it, record and change state.
1398                if {![string compare $vtag $par1]} { \
1399              #Have not yet encountered our volume of interest.  If this is                 set cur_vol $par1
1400              #it, record and change state.                 set chapter_or_appendix "Chapter"
1401              if {![string compare $vtag $par1]} { \                 set state 1
1402                 set cur_vol $par1                 }
1403                 set chapter_or_appendix "Chapter"              }
1404                 set state 1           } \
1405                 }        elseif {$state == 1} { \
1406              }           #We are within the volume of interest.  Looking for chapter records.
1407           } \           if {! [string compare $rectype c] || ! [string compare $rectype e]} { \
1408        elseif {$state == 1} { \              set cur_chap_lc $par1
1409           #We are within the volume of interest.  Looking for chapter records.              set cur_chap_uc [string toupper $cur_chap_lc]
1410           if {! [string compare $rectype c] || ! [string compare $rectype e]} { \              set cur_chap_idstring [replace_digits_with_alphas $cur_chap_lc]
1411              set cur_chap_lc $par1              set cur_chap_short_title [get_chap_short_single_volume_title $cur_chap_lc]
1412              set cur_chap_uc [string toupper $cur_chap_lc]              set cur_chap_long_title [get_chap_long_single_volume_title $cur_chap_lc]
1413              set cur_chap_idstring [replace_digits_with_alphas $cur_chap_lc]  
1414              set cur_chap_short_title [get_chap_short_single_volume_title $cur_chap_lc]              puts $handle "%%%% $chapter_or_appendix C$cur_chap_uc:  $cur_chap_long_title %%%%"
1415              set cur_chap_long_title [get_chap_long_single_volume_title $cur_chap_lc]              puts $handle "\\input\{c_$cur_chap_lc/c_$cur_chap_lc\}"
1416                puts $handle "%"
1417              puts $handle "%%%% $chapter_or_appendix C$cur_chap_uc:  $cur_chap_long_title %%%%"              } \
1418              puts $handle "\\input\{c_$cur_chap_lc/c_$cur_chap_lc\}"           elseif {! [string compare $rectype y]} { \
1419              puts $handle "%"              #This is the beginning of the appendix material for a multi-volume work.
1420              } \              set chapter_or_appendix "Appendix"
1421           elseif {! [string compare $rectype y]} { \              puts $handle "\\appendix"
1422              #This is the beginning of the appendix material for a multi-volume work.              puts $handle "%"
1423              set chapter_or_appendix "Appendix"              } \
1424              puts $handle "\\appendix"           elseif {! [string compare $rectype v] || ! [string compare $rectype w]} { \
1425              puts $handle "%"              set state 2
1426              } \              }
1427           elseif {! [string compare $rectype v] || ! [string compare $rectype w]} { \           } \
1428              set state 2        elseif {$state == 2} { \
1429              }           #Do nothing.  We are in the parsing state where we have done the volume of interest
1430           } \           #and can't do more.
1431        elseif {$state == 2} { \           } \
1432           #Do nothing.  We are in the parsing state where we have done the volume of interest        else {
1433           #and can't do more.           error "Bad state variable."
1434           } \           }
1435        else {        }
1436           error "Bad state variable."     }
1437           }  
1438        }  
1439     }  #Builds one volume of a multi-volume work, passed the volume tag and the volume
1440    #number.  The volume number is an ordinal number, and is used for normal
1441    #and roman numerals and stuff.
1442  #Builds one volume of a multi-volume work, passed the volume tag and the volume  #
1443  #number.  The volume number is an ordinal number, and is used for normal  proc createMultiVolumeWork { vtag volume_number script_vcinfo } { \
1444  #and roman numerals and stuff.     #Form the filename, based on the input tag.  All that is required is a .TEX
1445  #     #suffix.
1446  proc createMultiVolumeWork { vtag volume_number script_vcinfo } { \     set filename $vtag
1447     #Form the filename, based on the input tag.  All that is required is a .TEX     append filename .tex
1448     #suffix.  
1449     set filename $vtag     #Open the file for writing.
1450     append filename .tex     set handle [open $filename w]
1451    
1452     #Open the file for writing.     #Insert the title line.
1453     set handle [open $filename w]     output_title_line $handle $filename "Volume of multi-volume work."
1454    
1455     #Insert the title line.     #Insert the document class and package includes.
1456     output_title_line $handle $filename "Volume of multi-volume work."     output_doc_class_and_package_includes $handle
1457    
1458     #Insert the document class and package includes.     #For the multi-volume only, use the "XR" package.
1459     output_doc_class_and_package_includes $handle     puts $handle "%Must use \"xr\" package to import symbols from other volumes."
1460       puts $handle "\\usepackage\{xr\}"
1461     #For the multi-volume only, use the "XR" package.     puts $handle "%"
1462     puts $handle "%Must use \"xr\" package to import symbols from other volumes."  
1463     puts $handle "\\usepackage\{xr\}"     #Insert the external document symbol imports.
1464     puts $handle "%"     output_external_document_symbol_imports $handle $vtag
1465    
1466     #Insert the external document symbol imports.     #Insert common lines through the begindoc.
1467     output_external_document_symbol_imports $handle $vtag     output_common_lines_through_begindoc $handle
1468    
1469     #Insert common lines through the begindoc.     #Insert the volume and chapter definitions.
1470     output_common_lines_through_begindoc $handle     output_multi_volume_volume_and_chapter_definitions $handle $vtag $volume_number
1471    
1472     #Insert the volume and chapter definitions.     #Insert the matter after the volume and chapter definitions but before
1473     output_multi_volume_volume_and_chapter_definitions $handle $vtag $volume_number     #the chapters and appendices.
1474       output_matter_between_chapter_defs_and_chapters $handle $vtag $script_vcinfo m
1475     #Insert the matter after the volume and chapter definitions but before  
1476     #the chapters and appendices.     #Insert the chapter and appendix includes.
1477     output_matter_between_chapter_defs_and_chapters $handle $vtag $script_vcinfo m     output_multi_volume_chapter_and_appendix_includes $handle $vtag
1478    
1479     #Insert the chapter and appendix includes.     #Output the final matter.
1480     output_multi_volume_chapter_and_appendix_includes $handle $vtag     output_tex_volume_final_matter $handle
1481    
1482     #Output the final matter.     #Output the final line of the file, with the file name, for aesthetics.
1483     output_tex_volume_final_matter $handle     mark_end_of_tex_volume_files_for_aesthetics $handle $filename
1484    
1485     #Output the final line of the file, with the file name, for aesthetics.     #Close the file.
1486     mark_end_of_tex_volume_files_for_aesthetics $handle $filename     close $handle
1487       }
1488     #Close the file.  
1489     close $handle  #
1490     }  # Builds the two single-volume works (the two source files SVF.TEX and SVD.TEX).  These
1491    # are quite a bit simpler than the multi-volume generations.
1492  #  #
1493  # Builds the two single-volume works (the two source files SVF.TEX and SVD.TEX).  These  proc createSingleVolumeWorks { script_vcinfo } { \
1494  # are quite a bit simpler than the multi-volume generations.     global mcl
1495  #  
1496  proc createSingleVolumeWorks { script_vcinfo } { \     #Define the preamble number 1 for both of the files.  This is text up until the chapter
1497     global mcl     #definitions.
1498       set preamble1 {
1499     #Define the preamble number 1 for both of the files.  This is text up until the chapter        "%Definitions For Chapter Citations"                                                                     \
1500     #definitions.        "%--------------------------------------------------------------"                                        \
1501     set preamble1 {        "%These definitions are created automatically by the Wish Script"                                        \
1502        "%Definitions For Chapter Citations"                                                                     \        "%\"CP_SCRIPT.TCL\"."                                                                                    \
1503        "%--------------------------------------------------------------"                                        \        "%--------------------------------------------------------------"                                        \
1504        "%These definitions are created automatically by the Wish Script"                                        \        "%Note that for the single-volume works, there is no concept of"                                         \
1505        "%\"CP_SCRIPT.TCL\"."                                                                                    \        "%the \"xref\" prefix, as everything is in the same volume."                                             \
1506        "%--------------------------------------------------------------"                                        \        "%That is why this prefix is set to the empty string in all"                                             \
1507        "%Note that for the single-volume works, there is no concept of"                                         \        "%cases."                                                                                                \
1508        "%the \"xref\" prefix, as everything is in the same volume."                                             \        "%--------------------------------------------------------------"                                        \
1509        "%That is why this prefix is set to the empty string in all"                                             \        }
1510        "%cases."                                                                                                \  
1511        "%--------------------------------------------------------------"                                        \     #Define the matter between the chapter constants and the start of the version control information
1512        }     #for this script.
1513       set midamble1 {
1514     #Define the matter between the chapter constants and the start of the version control information        "\\newcommand\\curvoltitle\{\Full Edition (All Content)\}"                                               \
1515     #for this script.        "\\newcommand\\curvolroman\{\}"                                                                          \
1516     set midamble1 {        "\\newcommand\\curvoltitlepagesep\{\}"                                                                   \
1517        "\\newcommand\\curvoltitle\{\Full Edition (All Content)\}"                                               \        "\\newcommand\\curvoltitlepageprefix\{\}"                                                                \
1518        "\\newcommand\\curvolroman\{\}"                                                                          \        ""                                                                                                       \
1519        "\\newcommand\\curvoltitlepagesep\{\}"                                                                   \        }
1520        "\\newcommand\\curvoltitlepageprefix\{\}"                                                                \  
1521        ""                                                                                                       \     #Define the matter between the main volume's version control information and the start of the chapter
1522        }     #includes.
1523       set midamble2 {
1524     #Define the matter between the main volume's version control information and the start of the chapter        ""                                                                                                       \
1525     #includes.        }
1526     set midamble2 {  
1527        ""                                                                                                       \     #outboth "Generating single-volume work main TEX source files (SVF.TEX, SVD.TEX)."
1528        }     outboth "Generating single-volume work main TEX source file (SVF.TEX)."
1529    
1530     #outboth "Generating single-volume work main TEX source files (SVF.TEX, SVD.TEX)."     #Open the two files we want to write.
1531     outboth "Generating single-volume work main TEX source file (SVF.TEX)."     set fhandle [open svf.tex w]
1532    
1533     #Open the two files we want to write.     #Output the title and descriptions for the files.
1534     set fhandle [open svf.tex w]     output_title_line $fhandle SVF.TEX "Final Version Of Single-Volume Work"
1535    
1536     #Output the title and descriptions for the files.     #Insert the document class and package includes.
1537     output_title_line $fhandle SVF.TEX "Final Version Of Single-Volume Work"     output_doc_class_and_package_includes $fhandle
1538    
1539     #Insert the document class and package includes.     #Output common things through "begindoc"
1540     output_doc_class_and_package_includes $fhandle     output_common_lines_through_begindoc $fhandle
1541    
1542     #Output common things through "begindoc"     #Output the first preamble to the files.
1543     output_common_lines_through_begindoc $fhandle     for {set i 0} {$i < [llength $preamble1]} {incr i} { \
1544          #puts $dhandle [lindex $preamble1 $i]
1545     #Output the first preamble to the files.        puts $fhandle [lindex $preamble1 $i]
1546     for {set i 0} {$i < [llength $preamble1]} {incr i} { \        }
1547        #puts $dhandle [lindex $preamble1 $i]  
1548        puts $fhandle [lindex $preamble1 $i]     #Remembers whether the fundamental unit (the chapter) is a chapter or an
1549        }     #appendix.  After the LaTeX "appendix" mark, everything gets numbered as
1550       #an appendix (A, B, C, etc.).  This is included because if one Chapter or
1551     #Remembers whether the fundamental unit (the chapter) is a chapter or an     #Appendix needs to refer to another one symbolically (or to itself for that
1552     #appendix.  After the LaTeX "appendix" mark, everything gets numbered as     #matter) it needs to know if it is a chapter or appendix.  This preserves
1553     #an appendix (A, B, C, etc.).  This is included because if one Chapter or     #the ability to have something be an appendix in one compilation and a chapter
1554     #Appendix needs to refer to another one symbolically (or to itself for that     #in another compilation.
1555     #matter) it needs to know if it is a chapter or appendix.  This preserves     set chapter_or_appendix Chapter
1556     #the ability to have something be an appendix in one compilation and a chapter  
1557     #in another compilation.     #Output the chapter citations for the files.  The chapter citations are how one
1558     set chapter_or_appendix Chapter     #chapter refers to another.  For the "single-volume" works, there is no concept
1559       #of volume (there is only one), so the cites are just straight chapter cites.
1560     #Output the chapter citations for the files.  The chapter citations are how one     for {set i 0} {$i < [llength $mcl]} {incr i 4} { \
1561     #chapter refers to another.  For the "single-volume" works, there is no concept        set rectype [lindex $mcl $i]
1562     #of volume (there is only one), so the cites are just straight chapter cites.          
1563     for {set i 0} {$i < [llength $mcl]} {incr i 4} { \        if {! [string compare $rectype d] || ! [string compare $rectype e]} { \
1564        set rectype [lindex $mcl $i]           #This is a chapter record that we need to be concerned with.
1565                          
1566        if {! [string compare $rectype d] || ! [string compare $rectype e]} { \           #Get the chapter tag.
1567           #This is a chapter record that we need to be concerned with.           set ctag [lindex $mcl [expr $i + 1]]
1568                  
1569           #Get the chapter tag.           #Output a header line to both files indicating which chapter.
1570           set ctag [lindex $mcl [expr $i + 1]]           #puts -nonewline $dhandle %C
1571             puts -nonewline $fhandle %C
1572           #Output a header line to both files indicating which chapter.           set ucctag [string toupper $ctag]
1573           #puts -nonewline $dhandle %C           #puts -nonewline $dhandle $ucctag
1574           puts -nonewline $fhandle %C           puts -nonewline $fhandle $ucctag
1575           set ucctag [string toupper $ctag]           #puts -nonewline $dhandle ": "
1576           #puts -nonewline $dhandle $ucctag           puts -nonewline $fhandle ": "
1577           puts -nonewline $fhandle $ucctag           #puts $dhandle [get_chap_long_single_volume_title $ctag]
1578           #puts -nonewline $dhandle ": "           puts $fhandle [get_chap_long_single_volume_title $ctag]
1579           puts -nonewline $fhandle ": "                    
1580           #puts $dhandle [get_chap_long_single_volume_title $ctag]           #Output the data for the chapter, as LaTeX commands.
1581           puts $fhandle [get_chap_long_single_volume_title $ctag]           set textag [replace_digits_with_alphas $ctag]
1582                      
1583           #Output the data for the chapter, as LaTeX commands.           #xref command.  This is how one chapter refers to another (the
1584           set textag [replace_digits_with_alphas $ctag]           #prefix).  Set constant empty here, because no prefix required.
1585             set linebuf ""
1586           #xref command.  This is how one chapter refers to another (the           append linebuf \\newcommand \\ c $textag xrefhyphen \{ \}
1587           #prefix).  Set constant empty here, because no prefix required.           #puts $dhandle $linebuf
1588           set linebuf ""           puts $fhandle $linebuf
1589           append linebuf \\newcommand \\ c $textag xrefhyphen \{ \}           set linebuf ""
1590           #puts $dhandle $linebuf           append linebuf \\newcommand \\ c $textag xrefcomma \{ \}
1591           puts $fhandle $linebuf           #puts $dhandle $linebuf
1592           set linebuf ""           puts $fhandle $linebuf
1593           append linebuf \\newcommand \\ c $textag xrefcomma \{ \}  
1594           #puts $dhandle $linebuf           #Long title.  This is normally used for the chapter unless there
1595           puts $fhandle $linebuf           #are space constraints, such as would occur on page headers.
1596             set linebuf ""
1597           #Long title.  This is normally used for the chapter unless there           append linebuf \\newcommand \\ c $textag longtitle \{ [get_chap_long_single_volume_title $ctag] \}
1598           #are space constraints, such as would occur on page headers.           #puts $dhandle $linebuf
1599           set linebuf ""           puts $fhandle $linebuf
1600           append linebuf \\newcommand \\ c $textag longtitle \{ [get_chap_long_single_volume_title $ctag] \}  
1601           #puts $dhandle $linebuf           #Title (same as long title).
1602           puts $fhandle $linebuf           set linebuf ""
1603             append linebuf \\newcommand \\ c $textag title \{ [get_chap_long_single_volume_title $ctag] \}
1604           #Title (same as long title).           #puts $dhandle $linebuf
1605           set linebuf ""           puts $fhandle $linebuf
1606           append linebuf \\newcommand \\ c $textag title \{ [get_chap_long_single_volume_title $ctag] \}          
1607           #puts $dhandle $linebuf           #Short title.  This is used in confined areas, such as on page headers.
1608           puts $fhandle $linebuf           set linebuf ""
1609                     append linebuf \\newcommand \\ c $textag shorttitle \{ [get_chap_short_single_volume_title $ctag] \}
1610           #Short title.  This is used in confined areas, such as on page headers.           #puts $dhandle $linebuf
1611           set linebuf ""           puts $fhandle $linebuf
1612           append linebuf \\newcommand \\ c $textag shorttitle \{ [get_chap_short_single_volume_title $ctag] \}  
1613           #puts $dhandle $linebuf           #Fill in the "Class", whether this is a chapter or an appendix.
1614           puts $fhandle $linebuf           set linebuf ""
1615             append linebuf \\newcommand \\ c $textag mcclass \{ $chapter_or_appendix \}
1616           #Fill in the "Class", whether this is a chapter or an appendix.           puts $fhandle $linebuf
1617           set linebuf ""           set linebuf ""
1618           append linebuf \\newcommand \\ c $textag mcclass \{ $chapter_or_appendix \}           append linebuf \\newcommand \\ c $textag ucclass \{ [string toupper $chapter_or_appendix] \}
1619           puts $fhandle $linebuf           puts $fhandle $linebuf
1620           set linebuf ""           set linebuf ""
1621           append linebuf \\newcommand \\ c $textag ucclass \{ [string toupper $chapter_or_appendix] \}           append linebuf \\newcommand \\ c $textag lcclass \{ [string tolower $chapter_or_appendix] \}
1622           puts $fhandle $linebuf           puts $fhandle $linebuf
1623           set linebuf ""  
1624           append linebuf \\newcommand \\ c $textag lcclass \{ [string tolower $chapter_or_appendix] \}           #Put in a blank line for aesthetics
1625           puts $fhandle $linebuf           #puts $dhandle ""
1626             puts $fhandle ""
1627           #Put in a blank line for aesthetics           } \
1628           #puts $dhandle ""        elseif {! [string compare $rectype z]} {
1629           puts $fhandle ""           #This tag indicates the location of the beginning of the appendices.  We
1630           } \           #need to switch from chapter to appendix.
1631        elseif {! [string compare $rectype z]} {           set chapter_or_appendix Appendix
1632           #This tag indicates the location of the beginning of the appendices.  We           }
1633           #need to switch from chapter to appendix.        }
1634           set chapter_or_appendix Appendix  
1635           }     #Put in the "midamble" before the version control information.
1636        }     for {set i 0} {$i < [llength $midamble1]} {incr i} { \
1637          #puts $dhandle [lindex $midamble1 $i]
1638     #Put in the "midamble" before the version control information.        puts $fhandle [lindex $midamble1 $i]
1639     for {set i 0} {$i < [llength $midamble1]} {incr i} { \        }
1640        #puts $dhandle [lindex $midamble1 $i]  
1641        puts $fhandle [lindex $midamble1 $i]     #Put in matter including title page and version control information.
1642        }     output_matter_between_chapter_defs_and_chapters $fhandle "" $script_vcinfo s
1643    
1644     #Put in matter including title page and version control information.     #Put in the "midamble" until the chapter includes.
1645     output_matter_between_chapter_defs_and_chapters $fhandle "" $script_vcinfo s     for {set i 0} {$i < [llength $midamble2]} {incr i} { \
1646          #puts $dhandle [lindex $midamble2 $i]
1647     #Put in the "midamble" until the chapter includes.        puts $fhandle [lindex $midamble2 $i]
1648     for {set i 0} {$i < [llength $midamble2]} {incr i} { \        }
1649        #puts $dhandle [lindex $midamble2 $i]  
1650        puts $fhandle [lindex $midamble2 $i]     #Put in the chapter includes.  This will involve looping through the mcl table and
1651        }     #inserting things.  There is a differentiation between draft chapters and non-draft
1652       #chapters.
1653     #Put in the chapter includes.  This will involve looping through the mcl table and     set chapter_or_appendix Chapter
1654     #inserting things.  There is a differentiation between draft chapters and non-draft     for {set i 0} {$i < [llength $mcl]} {incr i 4} { \
1655     #chapters.        set rectype [lindex $mcl $i]
1656     set chapter_or_appendix Chapter          
1657     for {set i 0} {$i < [llength $mcl]} {incr i 4} { \        if {! [string compare $rectype d] || ! [string compare $rectype e]} { \
1658        set rectype [lindex $mcl $i]           #This is a chapter record that we need to be concerned with.
1659                     #Can easily form the file name by a simple string concat with the
1660        if {! [string compare $rectype d] || ! [string compare $rectype e]} { \           #tag.  For aesthetics, will also throw in the title.
1661           #This is a chapter record that we need to be concerned with.           set ctag [lindex $mcl [expr $i + 1]]
1662           #Can easily form the file name by a simple string concat with the           set ctitle [get_chap_long_single_volume_title $ctag]
1663           #tag.  For aesthetics, will also throw in the title.  
1664           set ctag [lindex $mcl [expr $i + 1]]           set line1 "%$chapter_or_appendix:  $ctitle"
1665           set ctitle [get_chap_long_single_volume_title $ctag]           set line2 ""
1666             append line2 \\input\{c_ $ctag /c_ $ctag \}
1667           set line1 "%$chapter_or_appendix:  $ctitle"  
1668           set line2 ""           #puts $dhandle $line1
1669           append line2 \\input\{c_ $ctag /c_ $ctag \}           puts $fhandle $line1
1670             #puts $dhandle $line2
1671           #puts $dhandle $line1           puts $fhandle $line2
1672           puts $fhandle $line1           #puts $dhandle ""
1673           #puts $dhandle $line2           puts $fhandle ""
1674           puts $fhandle $line2           } \
1675           #puts $dhandle ""        elseif {! [string compare $rectype p] || ! [string compare $rectype w]} {
1676           puts $fhandle ""           #This indicates that we need to spin a new part in the book.  There are
1677           } \           #two cases to consider.  Either we yank the title from the volume information,
1678        elseif {! [string compare $rectype p] || ! [string compare $rectype w]} {           #or else we yank the title from the par2 of the record.  Set the title.
1679           #This indicates that we need to spin a new part in the book.  There are           set par1 [lindex $mcl [expr $i + 1]]
1680           #two cases to consider.  Either we yank the title from the volume information,           set par2 [lindex $mcl [expr $i + 2]]
1681           #or else we yank the title from the par2 of the record.  Set the title.  
1682           set par1 [lindex $mcl [expr $i + 1]]           if {[string length $par2]} { \
1683           set par2 [lindex $mcl [expr $i + 2]]              set part_title $par2
1684                } \
1685           if {[string length $par2]} { \           else {
1686              set part_title $par2              set part_title [get_vol_part_title $par1]
1687              } \              }
1688           else {  
1689              set part_title [get_vol_part_title $par1]           #We have the part title.  Output the part record.
1690              }           set line1 "% New part: $part_title"
1691             set line2 "\\part\{$part_title\}"
1692           #We have the part title.  Output the part record.           #puts $dhandle $line1
1693           set line1 "% New part: $part_title"           puts $fhandle $line1
1694           set line2 "\\part\{$part_title\}"           #puts $dhandle $line2
1695           #puts $dhandle $line1           puts $fhandle $line2
1696           puts $fhandle $line1           #puts $dhandle ""
1697           #puts $dhandle $line2           puts $fhandle ""
1698           puts $fhandle $line2           } \
1699           #puts $dhandle ""        elseif {! [string compare $rectype z]} {
1700           puts $fhandle ""           #This tag indicates the location of the beginning of the appendices.  We
1701           } \           #need to switch from chapter to appendix.
1702        elseif {! [string compare $rectype z]} {           set chapter_or_appendix Appendix
1703           #This tag indicates the location of the beginning of the appendices.  We  
1704           #need to switch from chapter to appendix.           #Also need to decorate the output files to reflect that we're going into
1705           set chapter_or_appendix Appendix           #appendix mode.
1706             set appendix_mark {
1707           #Also need to decorate the output files to reflect that we're going into              "%Mark the start of appendices.  This causes numbering to be with letters"                         \
1708           #appendix mode.              "%instead of numbers."                                                                             \
1709           set appendix_mark {              "\\appendix"                                                                                       \
1710              "%Mark the start of appendices.  This causes numbering to be with letters"                         \              ""                                                                                                 \
1711              "%instead of numbers."                                                                             \              }
1712              "\\appendix"                                                                                       \           for {set j 0} {$j < [llength $appendix_mark]} {incr j} { \
1713              ""                                                                                                 \              #puts $dhandle [lindex $appendix_mark $j]
1714              }              puts $fhandle [lindex $appendix_mark $j]
1715           for {set j 0} {$j < [llength $appendix_mark]} {incr j} { \              }
1716              #puts $dhandle [lindex $appendix_mark $j]           }
1717              puts $fhandle [lindex $appendix_mark $j]        }
1718              }  
1719           }     #Now can put in the final matter.
1720        }     output_tex_volume_final_matter $fhandle
1721    
1722     #Now can put in the final matter.     #Mark the end of the files, for aesthetics.
1723     output_tex_volume_final_matter $fhandle     mark_end_of_tex_volume_files_for_aesthetics $fhandle svf.tex
1724    
1725     #Mark the end of the files, for aesthetics.     #Close the files.
1726     mark_end_of_tex_volume_files_for_aesthetics $fhandle svf.tex     #close $dhandle
1727       close $fhandle
1728     #Close the files.  
1729     #close $dhandle     hlineboth
1730     close $fhandle     }
1731    
1732     hlineboth  
1733     }  #Write the preamble to the _README_.HTM file.  This is everything up to the variable part that depends
1734    #on the parts and sections defined in the script.
1735    proc rebuildReadmeWritePreamble { fhandle } {
1736  #Write the preamble to the _README_.HTM file.  This is everything up to the variable part that depends     set preamble {
1737  #on the parts and sections defined in the script.        "<html>"                                                                                                 \
1738  proc rebuildReadmeWritePreamble { fhandle } {        ""                                                                                                       \
1739     set preamble {        "<head>"                                                                                                 \
1740        "<html>"                                                                                                 \        "<title>README File:&nbsp; CD Accompanying &quot;A Practitioner's Guide ...&quot;</title>"               \
1741        ""                                                                                                       \        "</head>"                                                                                                \
1742        "<head>"                                                                                                 \        ""                                                                                                       \
1743        "<title>README File:&nbsp; CD Accompanying &quot;A Practitioner's Guide ...&quot;</title>"               \        "<body BACKGROUND=\"wbbkgnds/bkblue01.gif\" TEXT=\"\#000000\">"                                          \
1744        "</head>"                                                                                                \        ""                                                                                                       \
1745        ""                                                                                                       \        "<h1 ALIGN=\"center\">README File:  CD Accompanying \"A Practitioner's Guide ...\"</h1>"                 \
1746        "<body BACKGROUND=\"wbbkgnds/bkblue01.gif\" TEXT=\"\#000000\">"                                          \        ""                                                                                                       \
1747        ""                                                                                                       \        "<hr>"                                                                                                   \
1748        "<h1 ALIGN=\"center\">README File:  CD Accompanying \"A Practitioner's Guide ...\"</h1>"                 \        ""                                                                                                       \
1749        ""                                                                                                       \        "<p>This HTML file contains links to all of the files distributed with the book"                         \
1750        "<hr>"                                                                                                   \        "&quot;A Practitioner's Guide To The Design And Development Of Small Microcontroller Software&quot;, and"\
1751        ""                                                                                                       \        "explains what each of the files is.&nbsp; This file is automatically generated by the Wish script"      \
1752        "<p>This HTML file contains links to all of the files distributed with the book"                         \        "SCRIPTS\\CP_SCRIPT.TCL.&nbsp; Note that some chapter titles"                                            \
1753        "&quot;A Practitioner's Guide To The Design And Development Of Small Microcontroller Software&quot;, and"\        "and other information in this HTML file may differ subtly from the book, because the Wish script"       \
1754        "explains what each of the files is.&nbsp; This file is automatically generated by the Wish script"      \        "is aware of both long and short names for many titles -- the"                                           \
1755        "SCRIPTS\\CP_SCRIPT.TCL.&nbsp; Note that some chapter titles"                                            \        "long titles are used here, but the short titles may be used in some places in"                          \
1756        "and other information in this HTML file may differ subtly from the book, because the Wish script"       \        "the book.&nbsp; For LaTeX builds of the book,&nbsp; it is assumed that the"                             \
1757        "is aware of both long and short names for many titles -- the"                                           \        "contents of this CD are present, with the subdirectory tree prserved, in the"                           \
1758        "long titles are used here, but the short titles may be used in some places in"                          \        "directory C:\\ESRGUBKA, i.e. so that the full"                                                           \
1759        "the book.&nbsp; For LaTeX builds of the book,&nbsp; it is assumed that the"                             \        "path of this HTML file is C:\\ESRGUBKA\\_README_.HTM.&nbsp; All path names supplied"                     \
1760        "contents of this CD are present, with the subdirectory tree prserved, in the"                           \        "below are with respect to C:\\ESRGUBKA.</p>"                                                             \
1761        "directory C:\\ESRGUBKA, i.e. so that the full"                                                           \        ""                                                                                                       \
1762        "path of this HTML file is C:\\ESRGUBKA\\_README_.HTM.&nbsp; All path names supplied"                     \        "<hr>"                                                                                                   \
1763        "below are with respect to C:\\ESRGUBKA.</p>"                                                             \        ""                                                                                                       \
1764        ""                                                                                                       \        }
1765        "<hr>"                                                                                                   \  
1766        ""                                                                                                       \     for {set i 0} {$i < [llength $preamble]} {incr i} { \
1767        }        puts $fhandle [lindex $preamble $i]
1768          }
1769     for {set i 0} {$i < [llength $preamble]} {incr i} { \     }
1770        puts $fhandle [lindex $preamble $i]  
1771        }  
1772     }  #Write the "meat" to the file.  This is the table and variable stuff.
1773    proc rebuildReadmeWriteMeat { fhandle } {
1774       global readme_build_list
1775  #Write the "meat" to the file.  This is the table and variable stuff.  
1776  proc rebuildReadmeWriteMeat { fhandle } {     #For indentation, the code supplied by Microsoft Front page was used as a guide.
1777     global readme_build_list  
1778       #Write the start of the table.
1779     #For indentation, the code supplied by Microsoft Front page was used as a guide.     puts $fhandle "<table border=\"1\" width=\"100%\">"
1780    
1781     #Write the start of the table.     #Set state variables to remember if anything must be closed as we iterate.
1782     puts $fhandle "<table border=\"1\" width=\"100%\">"     set tr_active 0
1783          #True if in a <tr> block.
1784     #Set state variables to remember if anything must be closed as we iterate.     set td_active 0
1785     set tr_active 0        #True if in a <td> block.
1786        #True if in a <tr> block.     set ul_active 0
1787     set td_active 0        #True if in a <ul> block.
1788        #True if in a <td> block.     set li_active 0
1789     set ul_active 0        #True if in a <li> item.
1790        #True if in a <ul> block.  
1791     set li_active 0     #Loop through the list, processing each record.  Front Page HTML was used as a
1792        #True if in a <li> item.     #guide.
1793       for {set i 0} {$i < [llength $readme_build_list]} {incr i} { \
1794     #Loop through the list, processing each record.  Front Page HTML was used as a        #Loop effort-savers.
1795     #guide.            set cur_rec [lindex $readme_build_list $i]
1796     for {set i 0} {$i < [llength $readme_build_list]} {incr i} { \            set cur_tag [string range $cur_rec 0 0]
1797        #Loop effort-savers.            set cur_meat [string range $cur_rec 2 end]
1798            set cur_rec [lindex $readme_build_list $i]  
1799            set cur_tag [string range $cur_rec 0 0]        #puts $cur_rec
1800            set cur_meat [string range $cur_rec 2 end]  
1801          #Split into cases, one for each possible tag.
1802        #puts $cur_rec        if {! [string compare -nocase $cur_tag F]} { \
1803             #If a <tr> block is not active, must start one.
1804        #Split into cases, one for each possible tag.           if {! $tr_active} { \
1805        if {! [string compare -nocase $cur_tag F]} { \              puts $fhandle "  <tr>"
1806           #If a <tr> block is not active, must start one.              set tr_active 1
1807           if {! $tr_active} { \              }
1808              puts $fhandle "  <tr>"           #If a <td> block is not active, must start one.
1809              set tr_active 1           if {! $td_active} { \
1810              }              puts $fhandle "    <td width=\"100%\">"
1811           #If a <td> block is not active, must start one.              set td_active 1
1812           if {! $td_active} { \              }
1813              puts $fhandle "    <td width=\"100%\">"           #If a <ul> block is not active, must start one.
1814              set td_active 1           if {! $ul_active} { \
1815              }              puts $fhandle "      <ul>"
1816           #If a <ul> block is not active, must start one.              set ul_active 1
1817           if {! $ul_active} { \              }
1818              puts $fhandle "      <ul>"           #OK, can now write the filename and the associated markers.  Will start
1819              set ul_active 1           #a list item in this endeavor, so must set this flag TRUE.
1820              }           #If a <li> block is active, must end it.
1821           #OK, can now write the filename and the associated markers.  Will start           if {$li_active} { \
1822           #a list item in this endeavor, so must set this flag TRUE.              puts $fhandle "        </li>"
1823           #If a <li> block is active, must end it.              set li_active 0
1824           if {$li_active} { \              }
1825              puts $fhandle "        </li>"           set li_active 1
1826              set li_active 0           puts $fhandle "        <li><b><a href=\"" nonewline
1827              }           #When we stuff the file name in this context, need to change spaces to
1828           set li_active 1           #the string "%20".  The reasons for this are HTML syntax.
1829           puts $fhandle "        <li><b><a href=\"" nonewline           puts $fhandle [replace_spaces_with_HTML_codes [string tolower $cur_meat]] nonewline
1830           #When we stuff the file name in this context, need to change spaces to           puts $fhandle "\">" nonewline
1831           #the string "%20".  The reasons for this are HTML syntax.           puts $fhandle [string toupper $cur_meat] nonewline
1832           puts $fhandle [replace_spaces_with_HTML_codes [string tolower $cur_meat]] nonewline           puts $fhandle "</a>:</b>&nbsp; "
1833           puts $fhandle "\">" nonewline           } \
1834           puts $fhandle [string toupper $cur_meat] nonewline        elseif {! [string compare -nocase $cur_tag M]} { \
1835           puts $fhandle "</a>:</b>&nbsp; "           #The first thing we need to do is close out any nested blocks that we are in.
1836           } \           #If a <li> block is active, must end it.
1837        elseif {! [string compare -nocase $cur_tag M]} { \           if {$li_active} { \
1838           #The first thing we need to do is close out any nested blocks that we are in.              puts $fhandle "        </li>"
1839           #If a <li> block is active, must end it.              set li_active 0
1840           if {$li_active} { \              }
1841              puts $fhandle "        </li>"           #If a <ul> block is active, must end it.
1842              set li_active 0           if {$ul_active} { \
1843              }              puts $fhandle "      </ul>"
1844           #If a <ul> block is active, must end it.              set ul_active 0
1845           if {$ul_active} { \              }
1846              puts $fhandle "      </ul>"           #If a <td> block is active, must end it.
1847              set ul_active 0           if {$td_active} { \
1848              }              puts $fhandle "    </td>"
1849           #If a <td> block is active, must end it.              set td_active 0
1850           if {$td_active} { \              }
1851              puts $fhandle "    </td>"           #If a <tr> block is active, must end it.
1852              set td_active 0           if {$tr_active} { \
1853              }              puts $fhandle "  </tr>"
1854           #If a <tr> block is active, must end it.              set tr_active 0
1855           if {$tr_active} { \              }
1856              puts $fhandle "  </tr>"  
1857              set tr_active 0               #Manually-generated header.  Just stuff it in.
1858              }                   puts $fhandle "  <tr>"
1859                     puts $fhandle "    <td width=\"100%\"><b><font size=\"5\">" nonewline
1860               #Manually-generated header.  Just stuff it in.                   puts $fhandle "[string toupper $cur_meat]" nonewline
1861                   puts $fhandle "  <tr>"                   puts $fhandle "</font></b></td>"
1862                   puts $fhandle "    <td width=\"100%\"><b><font size=\"5\">" nonewline                   puts $fhandle "  </tr>"
1863                   puts $fhandle "[string toupper $cur_meat]" nonewline               } \
1864                   puts $fhandle "</font></b></td>"        elseif {! [string compare -nocase $cur_tag C]} { \
1865                   puts $fhandle "  </tr>"           #If a <li> block is active, must end it.
1866               } \           if {$li_active} { \
1867        elseif {! [string compare -nocase $cur_tag C]} { \              puts $fhandle "        </li>"
1868           #If a <li> block is active, must end it.              set li_active 0
1869           if {$li_active} { \              }
1870              puts $fhandle "        </li>"           #If a <ul> block is active, must end it.
1871              set li_active 0           if {$ul_active} { \
1872              }              puts $fhandle "      </ul>"
1873           #If a <ul> block is active, must end it.              set ul_active 0
1874           if {$ul_active} { \              }
1875              puts $fhandle "      </ul>"           #If a <td> block is active, must end it.
1876              set ul_active 0           if {$td_active} { \
1877              }              puts $fhandle "    </td>"
1878           #If a <td> block is active, must end it.              set td_active 0
1879           if {$td_active} { \              }
1880              puts $fhandle "    </td>"           #If a <tr> block is active, must end it.
1881              set td_active 0           if {$tr_active} { \
1882              }              puts $fhandle "  </tr>"
1883           #If a <tr> block is active, must end it.              set tr_active 0
1884           if {$tr_active} { \              }
1885              puts $fhandle "  </tr>"  
1886              set tr_active 0               #This is one with a chapter tag.  We need to look up the tag.
1887              }           set mc_ct [get_chap_long_single_volume_title $cur_meat]
1888                     set uc_ct [string toupper $mc_ct]
1889               #This is one with a chapter tag.  We need to look up the tag.                   puts $fhandle "  <tr>"
1890           set mc_ct [get_chap_long_single_volume_title $cur_meat]                   puts $fhandle "    <td width=\"100%\"><b><font size=\"5\">" nonewline
1891                   set uc_ct [string toupper $mc_ct]                   puts $fhandle "CHAPTER " nonewline
1892                   puts $fhandle "  <tr>"           puts $fhandle [string toupper $cur_meat] nonewline
1893                   puts $fhandle "    <td width=\"100%\"><b><font size=\"5\">" nonewline           puts $fhandle ":&nbsp;  " nonewline
1894                   puts $fhandle "CHAPTER " nonewline                   puts $fhandle $uc_ct nonewline
1895           puts $fhandle [string toupper $cur_meat] nonewline                   puts $fhandle "</font></b></td>"
1896           puts $fhandle ":&nbsp;  " nonewline                   puts $fhandle "  </tr>"
1897                   puts $fhandle $uc_ct nonewline               } \
1898                   puts $fhandle "</font></b></td>"        elseif {! [string compare -nocase $cur_tag D]} { \
1899                   puts $fhandle "  </tr>"           #For descriptions, we just dump it in verbatim.  There is no need to do any processing.
1900               } \           puts $fhandle "          " nonewline
1901        elseif {! [string compare -nocase $cur_tag D]} { \           puts $fhandle $cur_meat
1902           #For descriptions, we just dump it in verbatim.  There is no need to do any processing.               } \
1903           puts $fhandle "          " nonewline        else {
1904           puts $fhandle $cur_meat               error "Unexpected tag in readme_build_list."
1905               } \               }
1906        else {        }
1907               error "Unexpected tag in readme_build_list."  
1908               }     #Write the end of the table.
1909        }     puts $fhandle "</table>"
1910       puts $fhandle ""
1911     #Write the end of the table.     }
1912     puts $fhandle "</table>"  
1913     puts $fhandle ""    
1914     }  #Write the postamble to the file.  This is everything after the variable part.
1915    proc rebuildReadmeWritePostamble { fhandle } {
1916         #First, grab the time as seconds since a time mark unknown.
1917  #Write the postamble to the file.  This is everything after the variable part.     set tref [clock seconds]
1918  proc rebuildReadmeWritePostamble { fhandle } {  
1919     #First, grab the time as seconds since a time mark unknown.     #Convert the time obtained to date.
1920     set tref [clock seconds]     set date [clock format $tref -format "%m/%d/%y"]
1921    
1922     #Convert the time obtained to date.     #Convert the time obtained to hour and minute.
1923     set date [clock format $tref -format "%m/%d/%y"]     set time [clock format $tref -format "%H:%M"]
1924    
1925     #Convert the time obtained to hour and minute.     #This part has to be manually generated because of the date and time.
1926     set time [clock format $tref -format "%H:%M"]     puts $fhandle ""
1927       puts $fhandle "<hr>"
1928     #This part has to be manually generated because of the date and time.     puts $fhandle ""
1929     puts $fhandle ""     puts $fhandle "<p align=\"center\">This file automatically generated on " nonewline
1930     puts $fhandle "<hr>"     puts $fhandle $date nonewline
1931     puts $fhandle ""     puts $fhandle " at " nonewline
1932     puts $fhandle "<p align=\"center\">This file automatically generated on " nonewline     puts $fhandle $time nonewline
1933     puts $fhandle $date nonewline     puts $fhandle            " by "
1934     puts $fhandle " at " nonewline     puts $fhandle "Wish script SCRIPTS\\CP_SCRIPT.TCL.</p>"
1935     puts $fhandle $time nonewline     puts $fhandle ""
1936     puts $fhandle            " by "     puts $fhandle "<hr noshade size=\"10\" color=\"\#000000\">"
1937     puts $fhandle "Wish script SCRIPTS\\CP_SCRIPT.TCL.</p>"     puts $fhandle "</body>"
1938     puts $fhandle ""     puts $fhandle "</html>"
1939     puts $fhandle "<hr noshade size=\"10\" color=\"\#000000\">"     }
1940     puts $fhandle "</body>"  
1941     puts $fhandle "</html>"  #****************************************************************************************
1942     }  #****************************************************************************************
1943    #****    B U T T O N    P R E S S    F U N C T I O N S    *******************************
1944  #****************************************************************************************  #****************************************************************************************
1945  #****************************************************************************************  #****************************************************************************************
1946  #****    B U T T O N    P R E S S    F U N C T I O N S    *******************************  # Each of the functions in this category is called in response to a button on the main
1947  #****************************************************************************************  # graphical window being pressed.
1948  #****************************************************************************************  #----------------------------------------------------------------------------------------
1949  # Each of the functions in this category is called in response to a button on the main  # Performs a full LaTeX compilation and indexing of all volumes.  It isn't necessary to
1950  # graphical window being pressed.  # subdivide this operation any further because the full build is rare enough that any    
1951  #----------------------------------------------------------------------------------------  # reasonable amount of time is OK.  In the long term, it will be necessary to have the
1952  # Performs a full LaTeX compilation and indexing of all volumes.  It isn't necessary to  # tools build a full index spanning all volumes, but this isn't done yet.              
1953  # subdivide this operation any further because the full build is rare enough that any      #
1954  # reasonable amount of time is OK.  In the long term, it will be necessary to have the  proc fullLatexCompileAndIndexProc { } { \
1955  # tools build a full index spanning all volumes, but this isn't done yet.                   global bookVolumeList
1956  #     global bookVolumeListStructSize
1957  proc fullLatexCompileAndIndexProc { } { \     global pathUcBookA
1958     global bookVolumeList     global execAcrobatDistiller
1959     global bookVolumeListStructSize     global mcl
1960     global pathUcBookA     global chapterList
1961     global execAcrobatDistiller     global chapterListStructSize
1962     global mcl  
1963     global chapterList     outboth "BUTTON PRESS:  Full LaTeX compile and index."
1964     global chapterListStructSize     hlineboth
1965    
1966     outboth "BUTTON PRESS:  Full LaTeX compile and index."     #As a first step, extract this script's version control information.  This is used in
1967     hlineboth     #building the .TEX main files, to stamp them with the script's version control
1968       #information.
1969     #As a first step, extract this script's version control information.  This is used in     set script_vcinfo [extract_this_scripts_version_control_information]
1970     #building the .TEX main files, to stamp them with the script's version control  
1971     #information.     #Set up the list of volumes and chapters to be processed.  This involves scanning the mcl to see
1972     set script_vcinfo [extract_this_scripts_version_control_information]     #what is used and what is not used, and setting flags accordingly.  Volume "used" flags affect
1973       #how volumes are numbered and how they are cross-referenced.  Chapter "used" flags are safely
1974     #Set up the list of volumes and chapters to be processed.  This involves scanning the mcl to see     #ignored--it does no harm to include chapter cite information in the LaTeX output files--what will
1975     #what is used and what is not used, and setting flags accordingly.  Volume "used" flags affect     #happen is if the referenced chapter isn't included, the unresolvable references will be "pushed"
1976     #how volumes are numbered and how they are cross-referenced.  Chapter "used" flags are safely     #onto LaTeX.
1977     #ignored--it does no harm to include chapter cite information in the LaTeX output files--what will  
1978     #happen is if the referenced chapter isn't included, the unresolvable references will be "pushed"     #Zero out all of the volume used flags.
1979     #onto LaTeX.     outbothnonl "Marking all volumes unused ... "
1980       mark_all_volumes_unused
1981     #Zero out all of the volume used flags.     outboth "done."
1982     outbothnonl "Marking all volumes unused ... "  
1983     mark_all_volumes_unused     #Zero out all of the chapter used flags.
1984     outboth "done."     outbothnonl "Marking all chapters unused ... "
1985       mark_all_chaps_unused
1986     #Zero out all of the chapter used flags.     outboth "done."
1987     outbothnonl "Marking all chapters unused ... "  
1988     mark_all_chaps_unused     #Iterate through the mcl list, figuring out which volumes and chapters are used.  A "volume" is used
1989     outboth "done."     #if it contains at least one chapter in the mcl list.  A "chapter" is used if it appears either as
1990       #part of a volume or in the standalone work.
1991     #Iterate through the mcl list, figuring out which volumes and chapters are used.  A "volume" is used     outbothnonl "Scanning mcl list for used volumes and used chapters ... "
1992     #if it contains at least one chapter in the mcl list.  A "chapter" is used if it appears either as     set used_volumes 0
1993     #part of a volume or in the standalone work.     set unused_volumes [expr [llength $bookVolumeList] / $bookVolumeListStructSize]
1994     outbothnonl "Scanning mcl list for used volumes and used chapters ... "     set used_chapters 0
1995     set used_volumes 0     set unused_chapters [expr [llength $chapterList] / $chapterListStructSize]
1996     set unused_volumes [expr [llength $bookVolumeList] / $bookVolumeListStructSize]     set cur_vol ""
1997     set used_chapters 0     set N [llength $mcl]
1998     set unused_chapters [expr [llength $chapterList] / $chapterListStructSize]     #Iterate through the list, taking notes.
1999     set cur_vol ""     for {set i 0} {$i < $N} {incr i 4} { \
2000     set N [llength $mcl]        set mcl_rectype [lindex $mcl [expr $i + 0]]
2001     #Iterate through the list, taking notes.        set mcl_par1    [lindex $mcl [expr $i + 1]]
2002     for {set i 0} {$i < $N} {incr i 4} { \        set mcl_par2    [lindex $mcl [expr $i + 2]]
2003        set mcl_rectype [lindex $mcl [expr $i + 0]]        set mcl_par3    [lindex $mcl [expr $i + 3]]
2004        set mcl_par1    [lindex $mcl [expr $i + 1]]  
2005        set mcl_par2    [lindex $mcl [expr $i + 2]]        if {! [string compare $mcl_rectype v] || ! [string compare $mcl_rectype w]} \
2006        set mcl_par3    [lindex $mcl [expr $i + 3]]           {
2007             #The v record type declares a new volume, and the w declares both a new volume and
2008        if {! [string compare $mcl_rectype v] || ! [string compare $mcl_rectype w]} \           #a new part.  Either of these record types mean that we've hit a new volume boundary.
2009           {           #Remember this.
2010           #The v record type declares a new volume, and the w declares both a new volume and           set cur_vol $mcl_par1
2011           #a new part.  Either of these record types mean that we've hit a new volume boundary.           } \
2012           #Remember this.        elseif {! [string compare $mcl_rectype c] || ! [string compare $mcl_rectype e]} { \
2013           set cur_vol $mcl_par1           #Either of these declare a chapter in the current volume.  Process.
2014           } \           #Mark the chapter as used, and update chapter statistics.
2015        elseif {! [string compare $mcl_rectype c] || ! [string compare $mcl_rectype e]} { \           if {[get_chap_used_flag $mcl_par1]} { \
2016           #Either of these declare a chapter in the current volume.  Process.              #The chapter is already used.  Don't want to count the chapter as used
2017           #Mark the chapter as used, and update chapter statistics.              #again.
2018           if {[get_chap_used_flag $mcl_par1]} { \              } \
2019              #The chapter is already used.  Don't want to count the chapter as used           else {
2020              #again.  
2021              } \              #outboth "Marking $mcl_par1"
2022           else {  
2023                #The chapter isn't yet marked used.
2024              #outboth "Marking $mcl_par1"              mark_chapter_used $mcl_par1
2025                incr used_chapters
2026              #The chapter isn't yet marked used.              incr unused_chapters -1
2027              mark_chapter_used $mcl_par1              }
2028              incr used_chapters           #Mark the volume used if it is used.
2029              incr unused_chapters -1           if {[string length $cur_vol]} { \
2030              }              if {![get_volume_used_flag $cur_vol]} { \
2031           #Mark the volume used if it is used.                 #Mark that volume (the nearest above enclosing one) as used.
2032           if {[string length $cur_vol]} { \                 mark_volume_used $cur_vol
2033              if {![get_volume_used_flag $cur_vol]} { \                 incr used_volumes
2034                 #Mark that volume (the nearest above enclosing one) as used.                 incr unused_volumes -1
2035                 mark_volume_used $cur_vol                 }
2036                 incr used_volumes              }
2037                 incr unused_volumes -1           }
2038                 }        }
2039              }  
2040           }     outboth "done."
2041        }  
2042       #Output statistics about what is used and not used.  This is helpful for diagnosis.
2043     outboth "done."     outbothnonl "Used chapters:  $used_chapters  Unused chapters:  $unused_chapters"
2044       outboth .
2045     #Output statistics about what is used and not used.  This is helpful for diagnosis.     outboth "Enumeration of unused chapters (if any):"
2046     outbothnonl "Used chapters:  $used_chapters  Unused chapters:  $unused_chapters"     set N [llength $chapterList]
2047     outboth .     #Iterate through the list, taking notes.
2048     outboth "Enumeration of unused chapters (if any):"     for {set i 0} {$i < $N} {incr i $chapterListStructSize} { \
2049     set N [llength $chapterList]        #outboth "i: $i"
2050     #Iterate through the list, taking notes.        if { ! [get_chap_used_flag [lindex $chapterList $i]]} { \
2051     for {set i 0} {$i < $N} {incr i $chapterListStructSize} { \           outboth "   [lindex $chapterList $i]"
2052        #outboth "i: $i"           }
2053        if { ! [get_chap_used_flag [lindex $chapterList $i]]} { \        }
2054           outboth "   [lindex $chapterList $i]"  
2055           }     outbothnonl "Used volumes:   $used_volumes   Unused volumes:   $unused_volumes"
2056        }     outboth .
2057       outboth "Enumeration of used volumes (if any):"
2058     outbothnonl "Used volumes:   $used_volumes   Unused volumes:   $unused_volumes"     set N [llength $bookVolumeList]
2059     outboth .     #Iterate through the list, taking notes.
2060     outboth "Enumeration of used volumes (if any):"     for {set i 0} {$i < $N} {incr i $bookVolumeListStructSize} { \
2061     set N [llength $bookVolumeList]        #outboth "i: $i"
2062     #Iterate through the list, taking notes.        if {[get_volume_used_flag [lindex $bookVolumeList $i]]} { \
2063     for {set i 0} {$i < $N} {incr i $bookVolumeListStructSize} { \           outboth "   [lindex $bookVolumeList $i]"
2064        #outboth "i: $i"           }
2065        if {[get_volume_used_flag [lindex $bookVolumeList $i]]} { \        }
2066           outboth "   [lindex $bookVolumeList $i]"     outboth "Enumeration of unused volumes (if any):"
2067           }     set N [llength $bookVolumeList]
2068        }     #Iterate through the list, taking notes.
2069     outboth "Enumeration of unused volumes (if any):"     for {set i 0} {$i < $N} {incr i $bookVolumeListStructSize} { \
2070     set N [llength $bookVolumeList]        #outboth "i: $i"
2071     #Iterate through the list, taking notes.        if { ! [get_volume_used_flag [lindex $bookVolumeList $i]]} { \
2072     for {set i 0} {$i < $N} {incr i $bookVolumeListStructSize} { \           outboth "   [lindex $bookVolumeList $i]"
2073        #outboth "i: $i"           }
2074        if { ! [get_volume_used_flag [lindex $bookVolumeList $i]]} { \        }
2075           outboth "   [lindex $bookVolumeList $i]"  
2076           }     #Delete all the output files.  This guards against misunderstandings and accidents.  In the deletion of output
2077        }     #files, whether volumes are used or not is not taken into account.  The reason for this is neatness--if
2078       #the list of used volumes changes, it is helpful to get all of those files gone.
2079     #Delete all the output files.  This guards against misunderstandings and accidents.  In the deletion of output  
2080     #files, whether volumes are used or not is not taken into account.  The reason for this is neatness--if     #Delete the two single-volume files.
2081     #the list of used volumes changes, it is helpful to get all of those files gone.     set pathbase ""
2082       append pathbase $pathUcBookA / sv
2083     #Delete the two single-volume files.     #set svlist {f.dvi f.ps f.pdf d.dvi d.ps d.pdf}
2084     set pathbase ""     set svlist {f.dvi f.ps f.pdf}
2085     append pathbase $pathUcBookA / sv     set N [llength $svlist]
2086     #set svlist {f.dvi f.ps f.pdf d.dvi d.ps d.pdf}  
2087     set svlist {f.dvi f.ps f.pdf}     #Iterate through, delete each single-volume file.
2088     set N [llength $svlist]     for {set i 0} {$i < $N} {incr i} { \
2089          set target $pathbase
2090     #Iterate through, delete each single-volume file.        append target [lindex $svlist $i]
2091     for {set i 0} {$i < $N} {incr i} { \  
2092        set target $pathbase        if {[file exists $target]} { \
2093        append target [lindex $svlist $i]           outbothnonl "Deleting $target"
2094             outboth .
2095        if {[file exists $target]} { \           file delete $target
2096           outbothnonl "Deleting $target"           } \
2097           outboth .        else {
2098           file delete $target           outboth "Skipping $target : file does not exist."
2099           } \           }
2100        else {        }        
2101           outboth "Skipping $target : file does not exist."  
2102           }     #Get number of elements in the list of volumes.
2103        }             set N [llength $bookVolumeList]
2104    
2105     #Get number of elements in the list of volumes.     #Iterate through, delete each file.
2106     set N [llength $bookVolumeList]     for {set volnum 0} {$volnum < $N} {incr volnum $bookVolumeListStructSize} { \
2107          set voltag [lindex $bookVolumeList $volnum]
2108     #Iterate through, delete each file.  
2109     for {set volnum 0} {$volnum < $N} {incr volnum $bookVolumeListStructSize} { \        set target ""
2110        set voltag [lindex $bookVolumeList $volnum]        append target $pathUcBookA / $voltag .dvi
2111    
2112        set target ""        if {[file exists $target]} { \
2113        append target $pathUcBookA / $voltag .dvi           outbothnonl "Deleting $target"
2114             outboth .
2115        if {[file exists $target]} { \           file delete $target
2116           outbothnonl "Deleting $target"           } \
2117           outboth .        else {
2118           file delete $target           outboth "Skipping $target : file does not exist."
2119           } \           }
2120        else {  
2121           outboth "Skipping $target : file does not exist."        set target ""
2122           }        append target $pathUcBookA / $voltag .ps
2123    
2124        set target ""        if {[file exists $target]} { \
2125        append target $pathUcBookA / $voltag .ps           outbothnonl "Deleting $target"
2126             outboth .
2127        if {[file exists $target]} { \           file delete $target
2128           outbothnonl "Deleting $target"           } \
2129           outboth .        else {
2130           file delete $target           outboth "Skipping $target : file does not exist."
2131           } \           }
2132        else {  
2133           outboth "Skipping $target : file does not exist."        set target ""
2134           }        append target $pathUcBookA / $voltag .pdf
2135    
2136        set target ""        if {[file exists $target]} { \
2137        append target $pathUcBookA / $voltag .pdf           outbothnonl "Deleting $target"
2138             outboth .
2139        if {[file exists $target]} { \           file delete $target
2140           outbothnonl "Deleting $target"           } \
2141           outboth .        else {
2142           file delete $target           outboth "Skipping $target : file does not exist."
2143           } \           }
2144        else {  
2145           outboth "Skipping $target : file does not exist."        set target ""
2146           }        append target $pathUcBookA / $voltag .idx
2147    
2148        set target ""        if {[file exists $target]} { \
2149        append target $pathUcBookA / $voltag .idx           outbothnonl "Deleting $target"
2150             outboth .
2151        if {[file exists $target]} { \           file delete $target
2152           outbothnonl "Deleting $target"           } \
2153           outboth .        else {
2154           file delete $target           outboth "Skipping $target : file does not exist."
2155           } \           }
2156        else {  
2157           outboth "Skipping $target : file does not exist."        set target ""
2158           }        append target $pathUcBookA / $voltag .ilg
2159    
2160        set target ""        if {[file exists $target]} { \
2161        append target $pathUcBookA / $voltag .ilg           outbothnonl "Deleting $target"
2162             outboth .
2163        if {[file exists $target]} { \           file delete $target
2164           outbothnonl "Deleting $target"           } \
2165           outboth .        else {
2166           file delete $target           outboth "Skipping $target : file does not exist."
2167           } \           }
2168        else {  
2169           outboth "Skipping $target : file does not exist."        set target ""
2170           }        append target $pathUcBookA / $voltag .ind
2171    
2172        set target ""        if {[file exists $target]} { \
2173        append target $pathUcBookA / $voltag .ind           outbothnonl "Deleting $target"
2174             outboth .
2175        if {[file exists $target]} { \           file delete $target
2176           outbothnonl "Deleting $target"           } \
2177           outboth .        else {
2178           file delete $target           outboth "Skipping $target : file does not exist."
2179           } \           }
2180        else {  
2181           outboth "Skipping $target : file does not exist."        set target ""
2182           }        append target $pathUcBookA / $voltag .toc
2183    
2184        set target ""        if {[file exists $target]} { \
2185        append target $pathUcBookA / $voltag .toc           outbothnonl "Deleting $target"
2186             outboth .
2187        if {[file exists $target]} { \           file delete $target
2188           outbothnonl "Deleting $target"           } \
2189           outboth .        else {
2190           file delete $target           outboth "Skipping $target : file does not exist."
2191           } \           }
2192        else {  
2193           outboth "Skipping $target : file does not exist."        set target ""
2194           }        append target $pathUcBookA / $voltag .aux
2195    
2196        set target ""        if {[file exists $target]} { \
2197        append target $pathUcBookA / $voltag .aux           outbothnonl "Deleting $target"
2198             outboth .
2199        if {[file exists $target]} { \           file delete $target
2200           outbothnonl "Deleting $target"           } \
2201           outboth .        else {
2202           file delete $target           outboth "Skipping $target : file does not exist."
2203           } \           }
2204        else {  
2205           outboth "Skipping $target : file does not exist."        }
2206           }     hlineboth
2207    
2208        }     #Create the master files for the two single volume works (the draft and the final).
2209     hlineboth     createSingleVolumeWorks $script_vcinfo
2210    
2211     #Create the master files for the two single volume works (the draft and the final).     #Create the master files for the volumes.  The volumes are automatically numbered,
2212     createSingleVolumeWorks $script_vcinfo     #based on those that are used, starting with 1.
2213       set volume_number 0
2214     #Create the master files for the volumes.  The volumes are automatically numbered,     set N [llength $bookVolumeList]
2215     #based on those that are used, starting with 1.     #Iterate through, delete each file.
2216     set volume_number 0     for {set volnum 0} {$volnum < $N} {incr volnum $bookVolumeListStructSize} { \
2217     set N [llength $bookVolumeList]        set voltag [lindex $bookVolumeList $volnum]
2218     #Iterate through, delete each file.  
2219     for {set volnum 0} {$volnum < $N} {incr volnum $bookVolumeListStructSize} { \        if {[get_volume_used_flag $voltag]} { \
2220        set voltag [lindex $bookVolumeList $volnum]           incr volume_number
2221             createMultiVolumeWork $voltag $volume_number $script_vcinfo
2222        if {[get_volume_used_flag $voltag]} { \           }
2223           incr volume_number        }  
2224           createMultiVolumeWork $voltag $volume_number $script_vcinfo  
2225           }     #Do four full rounds of LaTeX compiles and index builds.  This is necessary
2226        }       #to resolve cross-dependencies and be sure no page numbering changes.
2227       for {set round 0} {$round < 4} {incr round} { \
2228     #Do four full rounds of LaTeX compiles and index builds.  This is necessary        outbothnonl "LaTeX compile, Round "
2229     #to resolve cross-dependencies and be sure no page numbering changes.        outbothnonl $round
2230     for {set round 0} {$round < 4} {incr round} { \        outboth .
2231        outbothnonl "LaTeX compile, Round "        hlineboth
2232        outbothnonl $round  
2233        outboth .        #Do the single-volume works.
2234        hlineboth        #LatexCompileFile svd.tex
2235          #MakeOrdinaryIndexFile svd
2236        #Do the single-volume works.        LatexCompileFile svf.tex
2237        #LatexCompileFile svd.tex        MakeOrdinaryIndexFile svf
2238        #MakeOrdinaryIndexFile svd  
2239        LatexCompileFile svf.tex        #Get number of elements in the list of volumes.  Compile only the used ones.
2240        MakeOrdinaryIndexFile svf        set N [llength $bookVolumeList]
2241    
2242        #Get number of elements in the list of volumes.  Compile only the used ones.        #Iterate through, compile each file.
2243        set N [llength $bookVolumeList]        for {set volnum 0} {$volnum < $N} {incr volnum $bookVolumeListStructSize} { \
2244             set voltag [lindex $bookVolumeList $volnum]
2245        #Iterate through, compile each file.           if {[get_volume_used_flag $voltag]} { \
2246        for {set volnum 0} {$volnum < $N} {incr volnum $bookVolumeListStructSize} { \              outbothnonl "Latex compile: $voltag"
2247           set voltag [lindex $bookVolumeList $volnum]              outboth .
2248           if {[get_volume_used_flag $voltag]} { \              hlineboth
2249              outbothnonl "Latex compile: $voltag"  
2250              outboth .              set fullfilename ""
2251              hlineboth              append fullfilename $voltag .tex
2252    
2253              set fullfilename ""              LatexCompileFile $fullfilename
2254              append fullfilename $voltag .tex  
2255                MakeOrdinaryIndexFile $voltag
2256              LatexCompileFile $fullfilename              }
2257             }
2258              MakeOrdinaryIndexFile $voltag        update
2259              }        }
2260           }  
2261        update     #DVIPS the single-volume file.
2262        }     outbothnonl "DVIPS: svf"
2263       RunDvipsToGenPsOutput svf
2264     #DVIPS the single-volume file.  
2265     outbothnonl "DVIPS: svf"     #Modify the postscript in the single volume file to
2266     RunDvipsToGenPsOutput svf     #generate a duplex file.
2267       ModifyPsToDuplex svf
2268     #Modify the postscript in the single volume file to  
2269     #generate a duplex file.     #PDF the two single-volume file.
2270     ModifyPsToDuplex svf     set psfilepath ""
2271       append psfilepath $pathUcBookA / svf.ps
2272     #PDF the two single-volume file.     exec $execAcrobatDistiller $psfilepath &
2273     set psfilepath ""  
2274     append psfilepath $pathUcBookA / svf.ps     #Get number of elements in the list of volumes.
2275     exec $execAcrobatDistiller $psfilepath &     set N [llength $bookVolumeList]
2276    
2277     #Get number of elements in the list of volumes.     #Iterate through, DVIPS each file.
2278     set N [llength $bookVolumeList]     for {set volnum 0} {$volnum < $N} {incr volnum $bookVolumeListStructSize} { \
2279          set voltag [lindex $bookVolumeList $volnum]
2280     #Iterate through, DVIPS each file.        if {[get_volume_used_flag $voltag]} { \
2281     for {set volnum 0} {$volnum < $N} {incr volnum $bookVolumeListStructSize} { \           outbothnonl "DVIPS: $voltag"
2282        set voltag [lindex $bookVolumeList $volnum]           outboth .
2283        if {[get_volume_used_flag $voltag]} { \           hlineboth
2284           outbothnonl "DVIPS: $voltag"  
2285           outboth .           RunDvipsToGenPsOutput $voltag
2286           hlineboth           ModifyPsToDuplex      $voltag
2287    
2288           RunDvipsToGenPsOutput $voltag           set psfilepath ""
2289           ModifyPsToDuplex      $voltag           append psfilepath $pathUcBookA / $voltag .ps
2290    
2291           set psfilepath ""           #There is no barrier at this point to also running Distiller.  Distiller gives us
2292           append psfilepath $pathUcBookA / $voltag .ps           #no information back.
2293             exec $execAcrobatDistiller $psfilepath &
2294           #There is no barrier at this point to also running Distiller.  Distiller gives us           }
2295           #no information back.        update
2296           exec $execAcrobatDistiller $psfilepath &        }
2297           }  
2298        update     outboth "DONE:  BUTTON PRESS:  Full LaTeX compile and index."
2299        }     hlineboth
2300       update
2301     outboth "DONE:  BUTTON PRESS:  Full LaTeX compile and index."     }
2302     hlineboth  
2303     update  #----------------------------------------------------------------------------------------
2304     }  # Rebuilds all the master files.  This operation can be useful if one isn't using 4AllTex
2305    # but wants to build the automatically-generated files anyway, perhaps to use another
2306  #----------------------------------------------------------------------------------------  # version of LaTeX.
2307  # Rebuilds all the master files.  This operation can be useful if one isn't using 4AllTex  #
2308  # but wants to build the automatically-generated files anyway, perhaps to use another  proc masterFileRebuildProc { } { \
2309  # version of LaTeX.     global bookVolumeList
2310  #     global bookVolumeListStructSize
2311  proc masterFileRebuildProc { } { \     global pathUcBookA
2312     global bookVolumeList     global execAcrobatDistiller
2313     global bookVolumeListStructSize     global mcl
2314     global pathUcBookA     global chapterList
2315     global execAcrobatDistiller     global chapterListStructSize
2316     global mcl  
2317     global chapterList     outboth "BUTTON PRESS:  Rebuild single-volume and multi-volume master files."
2318     global chapterListStructSize     hlineboth
2319    
2320     outboth "BUTTON PRESS:  Rebuild single-volume and multi-volume master files."     #As a first step, extract this script's version control information.  This is used in
2321     hlineboth     #building the .TEX main files, to stamp them with the script's version control
2322       #information.
2323     #As a first step, extract this script's version control information.  This is used in     set script_vcinfo [extract_this_scripts_version_control_information]
2324     #building the .TEX main files, to stamp them with the script's version control  
2325     #information.     #Set up the list of volumes and chapters to be processed.  This involves scanning the mcl to see
2326     set script_vcinfo [extract_this_scripts_version_control_information]     #what is used and what is not used, and setting flags accordingly.  Volume "used" flags affect
2327       #how volumes are numbered and how they are cross-referenced.  Chapter "used" flags are safely
2328     #Set up the list of volumes and chapters to be processed.  This involves scanning the mcl to see     #ignored--it does no harm to include chapter cite information in the LaTeX output files--what will
2329     #what is used and what is not used, and setting flags accordingly.  Volume "used" flags affect     #happen is if the referenced chapter isn't included, the unresolvable references will be "pushed"
2330     #how volumes are numbered and how they are cross-referenced.  Chapter "used" flags are safely     #onto LaTeX.
2331     #ignored--it does no harm to include chapter cite information in the LaTeX output files--what will  
2332     #happen is if the referenced chapter isn't included, the unresolvable references will be "pushed"     #Zero out all of the volume used flags.
2333     #onto LaTeX.     outbothnonl "Marking all volumes unused ... "
2334       mark_all_volumes_unused
2335     #Zero out all of the volume used flags.     outboth "done."
2336     outbothnonl "Marking all volumes unused ... "  
2337     mark_all_volumes_unused     #Zero out all of the chapter used flags.
2338     outboth "done."     outbothnonl "Marking all chapters unused ... "
2339       mark_all_chaps_unused
2340     #Zero out all of the chapter used flags.     outboth "done."
2341     outbothnonl "Marking all chapters unused ... "  
2342     mark_all_chaps_unused     #Iterate through the mcl list, figuring out which volumes and chapters are used.  A "volume" is used
2343     outboth "done."     #if it contains at least one chapter in the mcl list.  A "chapter" is used if it appears either as
2344       #part of a volume or in the standalone work.
2345     #Iterate through the mcl list, figuring out which volumes and chapters are used.  A "volume" is used     outbothnonl "Scanning mcl list for used volumes and used chapters ... "
2346     #if it contains at least one chapter in the mcl list.  A "chapter" is used if it appears either as     set used_volumes 0
2347     #part of a volume or in the standalone work.     set unused_volumes [expr [llength $bookVolumeList] / $bookVolumeListStructSize]
2348     outbothnonl "Scanning mcl list for used volumes and used chapters ... "     set used_chapters 0
2349     set used_volumes 0     set unused_chapters [expr [llength $chapterList] / $chapterListStructSize]
2350     set unused_volumes [expr [llength $bookVolumeList] / $bookVolumeListStructSize]     set cur_vol ""
2351     set used_chapters 0     set N [llength $mcl]
2352     set unused_chapters [expr [llength $chapterList] / $chapterListStructSize]     #Iterate through the list, taking notes.
2353     set cur_vol ""     for {set i 0} {$i < $N} {incr i 4} { \
2354     set N [llength $mcl]        set mcl_rectype [lindex $mcl [expr $i + 0]]
2355     #Iterate through the list, taking notes.        set mcl_par1    [lindex $mcl [expr $i + 1]]
2356     for {set i 0} {$i < $N} {incr i 4} { \        set mcl_par2    [lindex $mcl [expr $i + 2]]
2357        set mcl_rectype [lindex $mcl [expr $i + 0]]        set mcl_par3    [lindex $mcl [expr $i + 3]]
2358        set mcl_par1    [lindex $mcl [expr $i + 1]]  
2359        set mcl_par2    [lindex $mcl [expr $i + 2]]        if {! [string compare $mcl_rectype v] || ! [string compare $mcl_rectype w]} \
2360        set mcl_par3    [lindex $mcl [expr $i + 3]]           {
2361             #The v record type declares a new volume, and the w declares both a new volume and
2362        if {! [string compare $mcl_rectype v] || ! [string compare $mcl_rectype w]} \           #a new part.  Either of these record types mean that we've hit a new volume boundary.
2363           {           #Remember this.
2364           #The v record type declares a new volume, and the w declares both a new volume and           set cur_vol $mcl_par1
2365           #a new part.  Either of these record types mean that we've hit a new volume boundary.           } \
2366           #Remember this.        elseif {! [string compare $mcl_rectype c] || ! [string compare $mcl_rectype e]} { \
2367           set cur_vol $mcl_par1           #Either of these declare a chapter in the current volume.  Process.
2368           } \           #Mark the chapter as used, and update chapter statistics.
2369        elseif {! [string compare $mcl_rectype c] || ! [string compare $mcl_rectype e]} { \           if {[get_chap_used_flag $mcl_par1]} { \
2370           #Either of these declare a chapter in the current volume.  Process.              #The chapter is already used.  Don't want to count the chapter as used
2371           #Mark the chapter as used, and update chapter statistics.              #again.
2372           if {[get_chap_used_flag $mcl_par1]} { \              } \
2373              #The chapter is already used.  Don't want to count the chapter as used           else {
2374              #again.  
2375              } \              #outboth "Marking $mcl_par1"
2376           else {  
2377                #The chapter isn't yet marked used.
2378              #outboth "Marking $mcl_par1"              mark_chapter_used $mcl_par1
2379                incr used_chapters
2380              #The chapter isn't yet marked used.              incr unused_chapters -1
2381              mark_chapter_used $mcl_par1              }
2382              incr used_chapters           #Mark the volume used if it is used.
2383              incr unused_chapters -1           if {[string length $cur_vol]} { \
2384              }              if {![get_volume_used_flag $cur_vol]} { \
2385           #Mark the volume used if it is used.                 #Mark that volume (the nearest above enclosing one) as used.
2386           if {[string length $cur_vol]} { \                 mark_volume_used $cur_vol
2387              if {![get_volume_used_flag $cur_vol]} { \                 incr used_volumes
2388                 #Mark that volume (the nearest above enclosing one) as used.                 incr unused_volumes -1
2389                 mark_volume_used $cur_vol                 }
2390                 incr used_volumes              }
2391                 incr unused_volumes -1           }
2392                 }        }
2393              }  
2394           }     outboth "done."
2395        }  
2396       #Output statistics about what is used and not used.  This is helpful for diagnosis.
2397     outboth "done."     outbothnonl "Used chapters:  $used_chapters  Unused chapters:  $unused_chapters"
2398       outboth .
2399     #Output statistics about what is used and not used.  This is helpful for diagnosis.     outboth "Enumeration of unused chapters (if any):"
2400     outbothnonl "Used chapters:  $used_chapters  Unused chapters:  $unused_chapters"     set N [llength $chapterList]
2401     outboth .     #Iterate through the list, taking notes.
2402     outboth "Enumeration of unused chapters (if any):"     for {set i 0} {$i < $N} {incr i $chapterListStructSize} { \
2403     set N [llength $chapterList]        #outboth "i: $i"
2404     #Iterate through the list, taking notes.        if { ! [get_chap_used_flag [lindex $chapterList $i]]} { \
2405     for {set i 0} {$i < $N} {incr i $chapterListStructSize} { \           outboth "   [lindex $chapterList $i]"
2406        #outboth "i: $i"           }
2407        if { ! [get_chap_used_flag [lindex $chapterList $i]]} { \        }
2408           outboth "   [lindex $chapterList $i]"  
2409           }     outbothnonl "Used volumes:   $used_volumes   Unused volumes:   $unused_volumes"
2410        }     outboth .
2411       outboth "Enumeration of used volumes (if any):"
2412     outbothnonl "Used volumes:   $used_volumes   Unused volumes:   $unused_volumes"     set N [llength $bookVolumeList]
2413     outboth .     #Iterate through the list, taking notes.
2414     outboth "Enumeration of used volumes (if any):"     for {set i 0} {$i < $N} {incr i $bookVolumeListStructSize} { \
2415     set N [llength $bookVolumeList]        #outboth "i: $i"
2416     #Iterate through the list, taking notes.        if {[get_volume_used_flag [lindex $bookVolumeList $i]]} { \
2417     for {set i 0} {$i < $N} {incr i $bookVolumeListStructSize} { \           outboth "   [lindex $bookVolumeList $i]"
2418        #outboth "i: $i"           }
2419        if {[get_volume_used_flag [lindex $bookVolumeList $i]]} { \        }
2420           outboth "   [lindex $bookVolumeList $i]"     outboth "Enumeration of unused volumes (if any):"
2421           }     set N [llength $bookVolumeList]
2422        }     #Iterate through the list, taking notes.
2423     outboth "Enumeration of unused volumes (if any):"     for {set i 0} {$i < $N} {incr i $bookVolumeListStructSize} { \
2424     set N [llength $bookVolumeList]        #outboth "i: $i"
2425     #Iterate through the list, taking notes.        if { ! [get_volume_used_flag [lindex $bookVolumeList $i]]} { \
2426     for {set i 0} {$i < $N} {incr i $bookVolumeListStructSize} { \           outboth "   [lindex $bookVolumeList $i]"
2427        #outboth "i: $i"           }
2428        if { ! [get_volume_used_flag [lindex $bookVolumeList $i]]} { \        }
2429           outboth "   [lindex $bookVolumeList $i]"  
2430           }     #Delete all the output files.  This guards against misunderstandings and accidents.  In the deletion of output
2431        }     #files, whether volumes are used or not is not taken into account.  The reason for this is neatness--if
2432       #the list of used volumes changes, it is helpful to get all of those files gone.
2433     #Delete all the output files.  This guards against misunderstandings and accidents.  In the deletion of output  
2434     #files, whether volumes are used or not is not taken into account.  The reason for this is neatness--if     #Delete the two single-volume files.
2435     #the list of used volumes changes, it is helpful to get all of those files gone.     set pathbase ""
2436       append pathbase $pathUcBookA / sv
2437     #Delete the two single-volume files.     #set svlist {f.dvi f.ps f.pdf d.dvi d.ps d.pdf}
2438     set pathbase ""     set svlist {f.dvi f.ps f.pdf}
2439     append pathbase $pathUcBookA / sv     set N [llength $svlist]
2440     #set svlist {f.dvi f.ps f.pdf d.dvi d.ps d.pdf}  
2441     set svlist {f.dvi f.ps f.pdf}     #Iterate through, delete each single-volume file.
2442     set N [llength $svlist]     for {set i 0} {$i < $N} {incr i} { \
2443          set target $pathbase
2444     #Iterate through, delete each single-volume file.        append target [lindex $svlist $i]
2445     for {set i 0} {$i < $N} {incr i} { \  
2446        set target $pathbase        if {[file exists $target]} { \
2447        append target [lindex $svlist $i]           outbothnonl "Deleting $target"
2448             outboth .
2449        if {[file exists $target]} { \           file delete $target
2450           outbothnonl "Deleting $target"           } \
2451           outboth .        else {
2452           file delete $target           outboth "Skipping $target : file does not exist."
2453           } \           }
2454        else {        }        
2455           outboth "Skipping $target : file does not exist."  
2456           }     #Get number of elements in the list of volumes.
2457        }             set N [llength $bookVolumeList]
2458    
2459     #Get number of elements in the list of volumes.     #Iterate through, delete each file.
2460     set N [llength $bookVolumeList]     for {set volnum 0} {$volnum < $N} {incr volnum $bookVolumeListStructSize} { \
2461          set voltag [lindex $bookVolumeList $volnum]
2462     #Iterate through, delete each file.  
2463     for {set volnum 0} {$volnum < $N} {incr volnum $bookVolumeListStructSize} { \        set target ""
2464        set voltag [lindex $bookVolumeList $volnum]        append target $pathUcBookA / $voltag .dvi
2465    
2466        set target ""        if {[file exists $target]} { \
2467        append target $pathUcBookA / $voltag .dvi           outbothnonl "Deleting $target"
2468             outboth .
2469        if {[file exists $target]} { \           file delete $target
2470           outbothnonl "Deleting $target"           } \
2471           outboth .        else {
2472           file delete $target           outboth "Skipping $target : file does not exist."
2473           } \           }
2474        else {  
2475           outboth "Skipping $target : file does not exist."        set target ""
2476           }        append target $pathUcBookA / $voltag .ps
2477    
2478        set target ""        if {[file exists $target]} { \
2479        append target $pathUcBookA / $voltag .ps           outbothnonl "Deleting $target"
2480             outboth .
2481        if {[file exists $target]} { \           file delete $target
2482           outbothnonl "Deleting $target"           } \
2483           outboth .        else {
2484           file delete $target           outboth "Skipping $target : file does not exist."
2485           } \           }
2486        else {  
2487           outboth "Skipping $target : file does not exist."        set target ""
2488           }        append target $pathUcBookA / $voltag .pdf
2489    
2490        set target ""        if {[file exists $target]} { \
2491        append target $pathUcBookA / $voltag .pdf           outbothnonl "Deleting $target"
2492             outboth .
2493        if {[file exists $target]} { \           file delete $target
2494           outbothnonl "Deleting $target"           } \
2495           outboth .        else {
2496           file delete $target           outboth "Skipping $target : file does not exist."
2497           } \           }
2498        else {  
2499           outboth "Skipping $target : file does not exist."        set target ""
2500           }        append target $pathUcBookA / $voltag .idx
2501    
2502        set target ""        if {[file exists $target]} { \
2503        append target $pathUcBookA / $voltag .idx           outbothnonl "Deleting $target"
2504             outboth .
2505        if {[file exists $target]} { \           file delete $target
2506           outbothnonl "Deleting $target"           } \
2507           outboth .        else {
2508           file delete $target           outboth "Skipping $target : file does not exist."
2509           } \           }
2510        else {  
2511           outboth "Skipping $target : file does not exist."        set target ""
2512           }        append target $pathUcBookA / $voltag .ilg
2513    
2514        set target ""        if {[file exists $target]} { \
2515        append target $pathUcBookA / $voltag .ilg           outbothnonl "Deleting $target"
2516             outboth .
2517        if {[file exists $target]} { \           file delete $target
2518           outbothnonl "Deleting $target"           } \
2519           outboth .        else {
2520           file delete $target           outboth "Skipping $target : file does not exist."
2521           } \           }
2522        else {  
2523           outboth "Skipping $target : file does not exist."        set target ""
2524           }        append target $pathUcBookA / $voltag .ind
2525    
2526        set target ""        if {[file exists $target]} { \
2527        append target $pathUcBookA / $voltag .ind           outbothnonl "Deleting $target"
2528             outboth .
2529        if {[file exists $target]} { \           file delete $target
2530           outbothnonl "Deleting $target"           } \
2531           outboth .        else {
2532           file delete $target           outboth "Skipping $target : file does not exist."
2533           } \           }
2534        else {  
2535           outboth "Skipping $target : file does not exist."        set target ""
2536           }        append target $pathUcBookA / $voltag .toc
2537    
2538        set target ""        if {[file exists $target]} { \
2539        append target $pathUcBookA / $voltag .toc           outbothnonl "Deleting $target"
2540             outboth .
2541        if {[file exists $target]} { \           file delete $target
2542           outbothnonl "Deleting $target"           } \
2543           outboth .        else {
2544           file delete $target           outboth "Skipping $target : file does not exist."
2545           } \           }
2546        else {  
2547           outboth "Skipping $target : file does not exist."        set target ""
2548           }        append target $pathUcBookA / $voltag .aux
2549    
2550        set target ""        if {[file exists $target]} { \
2551        append target $pathUcBookA / $voltag .aux           outbothnonl "Deleting $target"
2552             outboth .
2553        if {[file exists $target]} { \           file delete $target
2554           outbothnonl "Deleting $target"           } \
2555           outboth .        else {
2556           file delete $target           outboth "Skipping $target : file does not exist."
2557           } \           }
2558        else {  
2559           outboth "Skipping $target : file does not exist."        }
2560           }     hlineboth
2561    
2562        }     #Create the master files for the two single volume works (the draft and the final).
2563     hlineboth     createSingleVolumeWorks $script_vcinfo
2564    
2565     #Create the master files for the two single volume works (the draft and the final).     #Create the master files for the volumes.  The volumes are automatically numbered,
2566     createSingleVolumeWorks $script_vcinfo     #based on those that are used, starting with 1.
2567       set volume_number 0
2568     #Create the master files for the volumes.  The volumes are automatically numbered,     set N [llength $bookVolumeList]
2569     #based on those that are used, starting with 1.     #Iterate through, delete each file.
2570     set volume_number 0     for {set volnum 0} {$volnum < $N} {incr volnum $bookVolumeListStructSize} { \
2571     set N [llength $bookVolumeList]        set voltag [lindex $bookVolumeList $volnum]
2572     #Iterate through, delete each file.  
2573     for {set volnum 0} {$volnum < $N} {incr volnum $bookVolumeListStructSize} { \        if {[get_volume_used_flag $voltag]} { \
2574        set voltag [lindex $bookVolumeList $volnum]           incr volume_number
2575             createMultiVolumeWork $voltag $volume_number $script_vcinfo
2576        if {[get_volume_used_flag $voltag]} { \           }
2577           incr volume_number        }  
2578           createMultiVolumeWork $voltag $volume_number $script_vcinfo  
2579           }     outboth "DONE:  Rebuild single-volume and multi-volume master files.."
2580        }       hlineboth
2581       update
2582     outboth "DONE:  Rebuild single-volume and multi-volume master files.."     }
2583     hlineboth  
2584     update  #----------------------------------------------------------------------------------------
2585     }  # Rebuilds the _README_.HTM file for the book, using the list of files and descriptions  
2586    # embedded in the script.  Also identifies files which files and directories which should
2587  #----------------------------------------------------------------------------------------  # be present but are not.
2588  # Rebuilds the _README_.HTM file for the book, using the list of files and descriptions    #
2589  # embedded in the script.  Also identifies files which files and directories which should  proc rebuildReadmeHtmForBookProc { } { \
2590  # be present but are not.     #Entry message.
2591  #     outboth "Rebuild README.HTM for book button clicked."
2592  proc rebuildReadmeHtmForBookProc { } { \  
2593     #Entry message.     #First, open the _README_.HTM file for writing.  This will automatically empty the
2594     outboth "Rebuild README.HTM for book button clicked."     #file if it already exists.
2595       set fhandle [open _README_.HTM "w"]
2596     #First, open the _README_.HTM file for writing.  This will automatically empty the  
2597     #file if it already exists.     #Write the preamble to the file.
2598     set fhandle [open _README_.HTM "w"]     rebuildReadmeWritePreamble $fhandle
2599    
2600     #Write the preamble to the file.     #Write the meat of the file.
2601     rebuildReadmeWritePreamble $fhandle     rebuildReadmeWriteMeat $fhandle
2602    
2603     #Write the meat of the file.     #Write the postamble to the file.
2604     rebuildReadmeWriteMeat $fhandle     rebuildReadmeWritePostamble $fhandle
2605    
2606     #Write the postamble to the file.     #Close the file which was opened.
2607     rebuildReadmeWritePostamble $fhandle     close $fhandle
2608      
2609     #Close the file which was opened.     #Termination message.
2610     close $fhandle     outboth "DONE:  BUTTON PRESS:  Build of _README_.HTM."
2611         hlineboth
2612     #Termination message.     }
2613     outboth "DONE:  BUTTON PRESS:  Build of _README_.HTM."  
2614     hlineboth  #----------------------------------------------------------------------------------------
2615     }  # Copies all of the book .PDF files to the places where they are needed (there may be  
2616    # multiple locations for each file).  This is a simple copy operation.
2617  #----------------------------------------------------------------------------------------  #
2618  # Copies all of the book .PDF files to the places where they are needed (there may be    proc copyBookPdfsProc { } { \
2619  # multiple locations for each file).  This is a simple copy operation.  
2620  #     global bookVolumeList
2621  proc copyBookPdfsProc { } { \     global bookVolumeListStructSize
2622       global readme_build_list
2623     global bookVolumeList  
2624     global bookVolumeListStructSize     set paths { \
2625     global readme_build_list        "c:/distribs/common/supmatls/books/embedded_control/dta_ucswbk_a"                       \
2626          "f:/wrootdta/proftopics/pubs_distributions_downloads/ucswbook01/outline_and_pdfs"       \
2627     set paths { \        }
2628        "c:/distribs/common/supmatls/books/embedded_control/dta_ucswbk_a"                       \  
2629        "f:/wrootdta/proftopics/pubs_distributions_downloads/ucswbook01/outline_and_pdfs"       \     outboth "BUTTON PRESS:  Copy book .PDFs to other locations that must be"
2630        }     outboth "               mirrored."
2631       hlineboth
2632     outboth "BUTTON PRESS:  Copy book .PDFs to other locations that must be"  
2633     outboth "               mirrored."     #These are the names of the two single-volume files.  
2634     hlineboth     #set svlist {svf.pdf svd.pdf}
2635       set svlist {svf.pdf}
2636     #These are the names of the two single-volume files.    
2637     #set svlist {svf.pdf svd.pdf}     foreach path $paths { \
2638     set svlist {svf.pdf}        outbothnonl "Copying to "
2639          outboth $path
2640     foreach path $paths { \  
2641        outbothnonl "Copying to "        #Iterate through, copy each single-volume file.
2642        outboth $path        set N [llength $svlist]
2643          for {set i 0} {$i < $N} {incr i} { \
2644        #Iterate through, copy each single-volume file.           set source [lindex $svlist $i]
2645        set N [llength $svlist]           set dest $path
2646        for {set i 0} {$i < $N} {incr i} { \           append dest / [lindex $svlist $i]
2647           set source [lindex $svlist $i]           if {[file exists $source]} { \
2648           set dest $path              outboth "   Copying from: $source"
2649           append dest / [lindex $svlist $i]              outboth "             to: $dest."
2650           if {[file exists $source]} { \              file copy -force -- $source $dest
2651              outboth "   Copying from: $source"              } \
2652              outboth "             to: $dest."           else {
2653              file copy -force -- $source $dest              outboth "   Can't copy $source:  does not exist."
2654              } \              }
2655           else {           update
2656              outboth "   Can't copy $source:  does not exist."           }        
2657              }  
2658           update        #Get number of elements in the list of volumes.
2659           }                set N [llength $bookVolumeList]
2660    
2661        #Get number of elements in the list of volumes.        #Iterate through, copy each file.
2662        set N [llength $bookVolumeList]        for {set i 0} {$i < $N} {incr i $bookVolumeListStructSize} { \
2663             set source [lindex $bookVolumeList $i]
2664        #Iterate through, copy each file.           append source .pdf
2665        for {set i 0} {$i < $N} {incr i $bookVolumeListStructSize} { \           set dest $path
2666           set source [lindex $bookVolumeList $i]           append dest / [lindex $bookVolumeList $i] .pdf
2667           append source .pdf           if {[file exists $source]} { \
2668           set dest $path              outboth "   Copying from: $source"
2669           append dest / [lindex $bookVolumeList $i] .pdf              outboth "             to: $dest."
2670           if {[file exists $source]} { \              file copy -force -- $source $dest
2671              outboth "   Copying from: $source"              } \
2672              outboth "             to: $dest."           else {
2673              file copy -force -- $source $dest              outboth "   Can't copy $source:  does not exist."
2674              } \              }
2675           else {           update
2676              outboth "   Can't copy $source:  does not exist."           }
2677              }        }
2678           update  
2679           }     hlineboth
2680        }  
2681       #The above just copies the .PDF files to a few needed locations.  The portion below
2682     hlineboth     #performs a full directory copy (just of the files mentioned in the list which
2683       #defines the _README_.HTM file) to a set of target directories.  The directories
2684     #The above just copies the .PDF files to a few needed locations.  The portion below     #themselves are wiped in advance.
2685     #performs a full directory copy (just of the files mentioned in the list which     set fullcopypaths { \
2686     #defines the _README_.HTM file) to a set of target directories.  The directories        "f:/wrootdta/proftopics/pubs_distributions_downloads/ucswbook01/outline_and_pdfs"       \
2687     #themselves are wiped in advance.        "f:/ftproot/anonymous_user_common_area/books/ucswbka"                                   \
2688     set fullcopypaths { \        }
2689        "f:/wrootdta/proftopics/pubs_distributions_downloads/ucswbook01/outline_and_pdfs"       \  
2690        "f:/ftproot/anonymous_user_common_area/books/ucswbka"                                   \     foreach fullcopypath $fullcopypaths { \
2691        }        #Destroy the subdirectory and all subcomponents.
2692          outbothnonl "Destroying: "
2693     foreach fullcopypath $fullcopypaths { \        outboth $fullcopypath
2694        #Destroy the subdirectory and all subcomponents.        file delete -force $fullcopypath
2695        outbothnonl "Destroying: "  
2696        outboth $fullcopypath        #Create the base directory.  This will be at the same level as the directory
2697        file delete -force $fullcopypath        #"c:/esrgubka" in the build on Dave Ashley's computer.
2698          file mkdir $fullcopypath
2699        #Create the base directory.  This will be at the same level as the directory  
2700        #"c:/esrgubka" in the build on Dave Ashley's computer.        #For each of the files in the list to build the _README_.HTM file, create the
2701        file mkdir $fullcopypath        #directory in which the file exists, the copy the file.
2702          foreach cur_line $readme_build_list { \
2703        #For each of the files in the list to build the _README_.HTM file, create the           #Update the display so there is not an apparent freeze.
2704        #directory in which the file exists, the copy the file.           update
2705        foreach cur_line $readme_build_list { \  
2706           #Update the display so there is not an apparent freeze.           #Iteration timesavers.
2707           update           set cur_tag [string range $cur_line 0 0]
2708             set cur_meat [string range $cur_line 2 end]
2709           #Iteration timesavers.  
2710           set cur_tag [string range $cur_line 0 0]           if {! [string compare -nocase $cur_tag "F"]} { \
2711           set cur_meat [string range $cur_line 2 end]  
2712                #puts $cur_tag
2713           if {! [string compare -nocase $cur_tag "F"]} { \              #puts $cur_meat
2714    
2715              #puts $cur_tag              #Replace any backslashes in the string with forward slashes.
2716              #puts $cur_meat              set fname $cur_meat
2717                set fname [string map {"\\" "/"} $fname]
2718              #Replace any backslashes in the string with forward slashes.  
2719              set fname $cur_meat              #Concatenate the target directory with the file name to get the full name.
2720              set fname [string map {"\\" "/"} $fname]              set fullfname ""
2721                append fullfname $fullcopypath
2722              #Concatenate the target directory with the file name to get the full name.              append fullfname "/"
2723              set fullfname ""              append fullfname $fname
2724              append fullfname $fullcopypath  
2725              append fullfname "/"              #Rip off the final path component to get the directory that must exist, and
2726              append fullfname $fname              #create the required directory.
2727                set location [string last "/" $fullfname]
2728              #Rip off the final path component to get the directory that must exist, and              if {$location >= 0} { \
2729              #create the required directory.                 set dir_to_create [string range $fullfname 0 [expr $location - 1]]
2730              set location [string last "/" $fullfname]                 outbothnonl "   Creating directory: "
2731              if {$location >= 0} { \                 set dir_to_create [string tolower $dir_to_create]
2732                 set dir_to_create [string range $fullfname 0 [expr $location - 1]]                 outboth $dir_to_create
2733                 outbothnonl "   Creating directory: "                 file mkdir $dir_to_create
2734                 set dir_to_create [string tolower $dir_to_create]                 } \
2735                 outboth $dir_to_create              else {
2736                 file mkdir $dir_to_create                 outboth "No directory to create."
2737                 } \                 }
2738              else {  
2739                 outboth "No directory to create."              #Convert everything to lower case.  It looks more aesthetically pleasing
2740                 }              #that way.
2741                set fname [string tolower $fname]
2742              #Convert everything to lower case.  It looks more aesthetically pleasing              set fullfname [string tolower $fullfname]
2743              #that way.  
2744              set fname [string tolower $fname]              #The directory that needs to exist definitely exists.  Perform the copy.
2745              set fullfname [string tolower $fullfname]              outbothnonl "   Copying from: "
2746                outboth $fname
2747              #The directory that needs to exist definitely exists.  Perform the copy.              outbothnonl "             to: "
2748              outbothnonl "   Copying from: "              outboth $fullfname
2749              outboth $fname              file copy -force -- $fname $fullfname
2750              outbothnonl "             to: "              }
2751              outboth $fullfname           }
2752              file copy -force -- $fname $fullfname        }
2753              }  
2754           }     hlineboth
2755        }     }
2756    
2757     hlineboth  #----------------------------------------------------------------------------------------
2758     }  # Removes known extraneous and disposable ESRG Tool Set files and directories.              
2759    #
2760  #----------------------------------------------------------------------------------------  proc removeESRGToolSetKnownExtraneousFilesAndDirectoriesProc { } { \
2761  # Removes known extraneous and disposable ESRG Tool Set files and directories.                   outboth "ESRG Tool Set remove extraneous files and directories button clicked."
2762  #     hlineboth
2763  proc removeESRGToolSetKnownExtraneousFilesAndDirectoriesProc { } { \     }
2764     outboth "ESRG Tool Set remove extraneous files and directories button clicked."  
2765     hlineboth  #----------------------------------------------------------------------------------------
2766     }  # Identifies extraneous ESRG Tool Set files and directories, which are foreign but at the
2767    # same time not known to be deletable.  It is safest to let the user look at these.
2768  #----------------------------------------------------------------------------------------  #
2769  # Identifies extraneous ESRG Tool Set files and directories, which are foreign but at the  proc identifyESRGToolSetExtraneousFilesAndDirectoriesProc { } { \
2770  # same time not known to be deletable.  It is safest to let the user look at these.     outboth "ESRG Tool Set identify extraneous files and directories button clicked."
2771  #     hlineboth
2772  proc identifyESRGToolSetExtraneousFilesAndDirectoriesProc { } { \     }
2773     outboth "ESRG Tool Set identify extraneous files and directories button clicked."  
2774     hlineboth  #----------------------------------------------------------------------------------------
2775     }  # Performs a full clean build of all executable versions of ESRGScripter.  This consists
2776    # of:
2777  #----------------------------------------------------------------------------------------  #    o Deletion of all existing .OBJ and .EXE files to assure a clean build.
2778  # Performs a full clean build of all executable versions of ESRGScripter.  This consists  #    o Deletion of all other copy targets.
2779  # of:  #    o A full clean build.
2780  #    o Deletion of all existing .OBJ and .EXE files to assure a clean build.  #    o A full re-copy to destinations for assembly.
2781  #    o Deletion of all other copy targets.  #    o Generation of README.HTM files, watching for missing files.
2782  #    o A full clean build.  #
2783  #    o A full re-copy to destinations for assembly.  proc fullBuildOfAllESRGToolSetExecutableVersionsProc { } { \
2784  #    o Generation of README.HTM files, watching for missing files.     outboth "ESRG Tool Set full build button clicked."
2785  #     hlineboth
2786  proc fullBuildOfAllESRGToolSetExecutableVersionsProc { } { \     }
2787     outboth "ESRG Tool Set full build button clicked."  
2788     hlineboth  
2789     }  #----------------------------------------------------------------------------------------
2790    #----------------------------------------------------------------------------------------
2791    #----------------------------------------------------------------------------------------
2792  #----------------------------------------------------------------------------------------  # Main script.
2793  #----------------------------------------------------------------------------------------  
2794  #----------------------------------------------------------------------------------------  console show
2795  # Main script.     #We have to use this, or the console won't be created when running a script
2796       #directly on invocation.
2797  console show  
2798     #We have to use this, or the console won't be created when running a script  #----------------------------------------------------------------------------------------
2799     #directly on invocation.  #----------------------------------------------------------------------------------------
2800    #------  C O N S T A N T S   ----------------------------------------------------------__
2801  #----------------------------------------------------------------------------------------  #----------------------------------------------------------------------------------------
2802  #----------------------------------------------------------------------------------------  #----------------------------------------------------------------------------------------
2803  #------  C O N S T A N T S   ----------------------------------------------------------__  #***************************************************************************
2804  #----------------------------------------------------------------------------------------  #Logging constants.
2805  #----------------------------------------------------------------------------------------  set loglinelength 78
2806  #***************************************************************************     #The length of a line in the log.
2807  #Logging constants.  
2808  set loglinelength 78  set buildlogfilename cp_log.txt
2809     #The length of a line in the log.     #The name of the log file which we'll use.
2810    
2811  set buildlogfilename cp_log.txt  #***************************************************************************
2812     #The name of the log file which we'll use.  #Directory path constants.  These can be configured for a different machine
2813    #which might have a different drive name, etc.
2814  #***************************************************************************  #
2815  #Directory path constants.  These can be configured for a different machine  #Path where Tex executables are located.
2816  #which might have a different drive name, etc.  set pathTexExecutables "C:/Program Files/MiKTeX 2.9/miktex/bin/x64"
2817  #  #
2818  #Path where Tex executables are located.  #Path where the the book source code is located.  Everything is assumed in
2819  set pathTexExecutables c:/texmf/miktex/bin  #a static arrangement below this directory.
2820  #  set pathUcBookA c:/svnsbx/dtapublic/pubs/books/ucbka/trunk
2821  #Path where the the book source code is located.  Everything is assumed in  
2822  #a static arrangement below this directory.  
2823  set pathUcBookA c:/e3ft_gpl01/dtaipubs/esrgubka  #***************************************************************************
2824    #Executable path constants.  There should be very little variation in these
2825    #from machine to machine.  I've used 4AllTex (a distribution of LaTeX), but
2826  #***************************************************************************  #my understanding is that all distributions of LaTeX are the same executable
2827  #Executable path constants.  There should be very little variation in these  #names, etc.--usually just different GUI wrappers.
2828  #from machine to machine.  I've used 4AllTex (a distribution of LaTeX), but  #
2829  #my understanding is that all distributions of LaTeX are the same executable  #File where the LaTeX compiler resides.
2830  #names, etc.--usually just different GUI wrappers.  set execLatexCompiler ""
2831  #  append execLatexCompiler $pathTexExecutables / latex.exe
2832  #File where the LaTeX compiler resides.  
2833  set execLatexCompiler ""  #File where the MAKEINDEX program resides.
2834  append execLatexCompiler $pathTexExecutables / latex.exe  set execMakeindex ""
2835    append execMakeindex $pathTexExecutables / makeindex.exe
2836  #File where the MAKEINDEX program resides.  
2837  set execMakeindex ""  #File where the DVIPS program resides.
2838  append execMakeindex $pathTexExecutables / makeindex.exe  set execDvips ""
2839    append execDvips $pathTexExecutables / dvips.exe
2840  #File where the DVIPS program resides.  
2841  set execDvips ""  #Executable for Acrobat Distiller.
2842  append execDvips $pathTexExecutables / dvips.exe  set execAcrobatDistiller "C:/Program Files (x86)/Adobe/Acrobat 2017/Acrobat/acrodist.exe"
2843    
2844  #Executable for Acrobat Distiller.  
2845  set execAcrobatDistiller "c:/program files/adobe/acrobat 6.0/distillr/acrodist.exe"  #***************************************************************************
2846    #Volumes of the book, with their long and short titles, in the
2847    #single-volume and multi-volume versions of the book, respectively.
2848  #***************************************************************************  #Order is:
2849  #Volumes of the book, with their long and short titles, in the  #   Single volume long name (used when longer description is required in
2850  #single-volume and multi-volume versions of the book, respectively.  #      single volume build).
2851  #Order is:  #   Single volume short name (used when shorter description is required in
2852  #   Single volume long name (used when longer description is required in  #      single volume build).
2853  #      single volume build).  #   Single volume part name (used to actually name the "Part" in the
2854  #   Single volume short name (used when shorter description is required in  #      single-volume compile).  (May not be used.)
2855  #      single volume build).  #   Multi-volume long name (used when longer description required).
2856  #   Single volume part name (used to actually name the "Part" in the  #   Multi-volume short name (used when shorter description required).
2857  #      single-volume compile).  (May not be used.)  #   Multi-volume cover name (the name which actually appears on the volume
2858  #   Multi-volume long name (used when longer description required).  #      cover).
2859  #   Multi-volume short name (used when shorter description required).  #   Used flag (1 or 0), a scratch flag.
2860  #   Multi-volume cover name (the name which actually appears on the volume  #      
2861  #      cover).  #Each of these is a LaTeX compilation unit.  All
2862  #   Used flag (1 or 0), a scratch flag.  #compilations and builds are based on this set of names.  These should be
2863  #        #arranged in order of ascending volume numbers, not in alphabetical order.
2864  #Each of these is a LaTeX compilation unit.  All  #This is to protect for the case of moving to the Tcl script generating
2865  #compilations and builds are based on this set of names.  These should be  #certain of the files automatically and numbering automatically.
2866  #arranged in order of ascending volume numbers, not in alphabetical order.  #
2867  #This is to protect for the case of moving to the Tcl script generating  #As of 08/27/01, this list contains many unused volumes that were deleted (and
2868  #certain of the files automatically and numbering automatically.  #turned into chapters).  These will be kept around for a while, in case they
2869  #  #are added again in the future as the work grows.
2870  #As of 08/27/01, this list contains many unused volumes that were deleted (and  set bookVolumeList {
2871  #turned into chapters).  These will be kept around for a while, in case they                     con0                                                            \
2872  #are added again in the future as the work grows.                        "Concepts"                                                   \
2873  set bookVolumeList {                        "Concepts"                                                   \
2874                     con0                                                            \                        "Concepts"                                                   \
2875                        "Concepts"                                                   \                        "Concepts"                                                   \
2876                        "Concepts"                                                   \                        "Concepts"                                                   \
2877                        "Concepts"                                                   \                        "Concepts"                                                   \
2878                        "Concepts"                                                   \                        "1"                                                          \
2879                        "Concepts"                                                   \                     mfr0                                                            \
2880                        "Concepts"                                                   \                        "Mathematical Frameworks And Results"                        \
2881                        "1"                                                          \                        "Mathematical Frameworks And Results"                        \
2882                     mfr0                                                            \                        "Mathematical Frameworks And Results"                        \
2883                        "Mathematical Frameworks And Results"                        \                        "Mathematical Frameworks And Results"                        \
2884                        "Mathematical Frameworks And Results"                        \                        "Mathematical Frameworks And Results"                        \
2885                        "Mathematical Frameworks And Results"                        \                        "Mathematical Frameworks And Results"                        \
2886                        "Mathematical Frameworks And Results"                        \                        "1"                                                          \
2887                        "Mathematical Frameworks And Results"                        \                     csw0                                                            \
2888                        "Mathematical Frameworks And Results"                        \                        "Construction Of Embedded Software"                          \
2889                        "1"                                                          \                        "Construction Of Embedded Software"                          \
2890                     csw0                                                            \                        "Construction Of Embedded Software"                          \
2891                        "Construction Of Embedded Software"                          \                        "Construction Of Embedded Software"                          \
2892                        "Construction Of Embedded Software"                          \                        "Construction Of Embedded Software"                          \
2893                        "Construction Of Embedded Software"                          \                        "Construction Of Embedded Software"                          \
2894                        "Construction Of Embedded Software"                          \                        "1"                                                          \
2895                        "Construction Of Embedded Software"                          \                     alg0                                                            \
2896                        "Construction Of Embedded Software"                          \                        "Embedded System Algorithms And Techniques"                  \
2897                        "1"                                                          \                        "Embedded System Algorithms And Techniques"                  \
2898                     alg0                                                            \                        "Embedded System Algorithms And Techniques"                  \
2899                        "Embedded System Algorithms And Techniques"                  \                        "Embedded System Algorithms And Techniques"                  \
2900                        "Embedded System Algorithms And Techniques"                  \                        "Embedded System Algorithms And Techniques"                  \
2901                        "Embedded System Algorithms And Techniques"                  \                        "Embedded System Algorithms And Techniques"                  \
2902                        "Embedded System Algorithms And Techniques"                  \                        "1"                                                          \
2903                        "Embedded System Algorithms And Techniques"                  \                     pac0                                                            \
2904                        "Embedded System Algorithms And Techniques"                  \                        "Practical, Administrative, Incidental, And Miscellaneous Topics" \
2905                        "1"                                                          \                        "Practical, Administrative, Incidental, And Miscellaneous Topics" \
2906                     pac0                                                            \                        "Practical, Administrative, Incidental, And Miscellaneous Topics" \
2907                        "Practical, Administrative, Incidental, And Miscellaneous Topics" \                        "Practical, Administrative, Incidental, And Miscellaneous Topics" \
2908                        "Practical, Administrative, Incidental, And Miscellaneous Topics" \                        "Practical, Administrative, Incidental, And Miscellaneous Topics" \
2909                        "Practical, Administrative, Incidental, And Miscellaneous Topics" \                        "Practical, Administrative, Incidental, And Miscellaneous Topics" \
2910                        "Practical, Administrative, Incidental, And Miscellaneous Topics" \                        "1"                                                          \
2911                        "Practical, Administrative, Incidental, And Miscellaneous Topics" \                     isk0                                                            \
2912                        "Practical, Administrative, Incidental, And Miscellaneous Topics" \                        "Insektengericht And Lessons Learned"                        \
2913                        "1"                                                          \                        "Insektengericht And Lessons Learned"                        \
2914                     isk0                                                            \                        "Insektengericht And Lessons Learned"                        \
2915                        "Insektengericht And Lessons Learned"                        \                        "Insektengericht And Lessons Learned"                        \
2916                        "Insektengericht And Lessons Learned"                        \                        "Insektengericht And Lessons Learned"                        \
2917                        "Insektengericht And Lessons Learned"                        \                        "Insektengericht And Lessons Learned"                        \
2918                        "Insektengericht And Lessons Learned"                        \                        "1"                                                          \
2919                        "Insektengericht And Lessons Learned"                        \                     ijt0                                                            \
2920                        "Insektengericht And Lessons Learned"                        \                        "ESRG Workstation-Based Tool Set Reference Guide"            \
2921                        "1"                                                          \                        "ESRG Workstation-Based Tool Set Reference Guide"            \
2922                     ijt0                                                            \                        "ESRG Workstation-Based Tool Set Reference Guide"            \
2923                        "ESRG Workstation-Based Tool Set Reference Guide"            \                        "ESRG Workstation-Based Tool Set Reference Guide"            \
2924                        "ESRG Workstation-Based Tool Set Reference Guide"            \                        "ESRG Workstation-Based Tool Set Reference Guide"            \
2925                        "ESRG Workstation-Based Tool Set Reference Guide"            \                        "ESRG Workstation-Based Tool Set Reference Guide"            \
2926                        "ESRG Workstation-Based Tool Set Reference Guide"            \                        "1"                                                          \
2927                        "ESRG Workstation-Based Tool Set Reference Guide"            \                     ijv0                                                            \
2928                        "ESRG Workstation-Based Tool Set Reference Guide"            \                        "ESRG Server-Based Tool Set Reference Guide"                 \
2929                        "1"                                                          \                        "ESRG Server-Based Tool Set Reference Guide"                 \
2930                     ijv0                                                            \                        "ESRG Server-Based Tool Set Reference Guide"                 \
2931                        "ESRG Server-Based Tool Set Reference Guide"                 \                        "ESRG Server-Based Tool Set Reference Guide"                 \
2932                        "ESRG Server-Based Tool Set Reference Guide"                 \                        "ESRG Server-Based Tool Set Reference Guide"                 \
2933                        "ESRG Server-Based Tool Set Reference Guide"                 \                        "ESRG Server-Based Tool Set Reference Guide"                 \
2934                        "ESRG Server-Based Tool Set Reference Guide"                 \                        "1"                                                          \
2935                        "ESRG Server-Based Tool Set Reference Guide"                 \                     sma0                                                            \
2936                        "ESRG Server-Based Tool Set Reference Guide"                 \                        "Solutions Manual"                                           \
2937                        "1"                                                          \                        "Solutions Manual"                                           \
2938                     sma0                                                            \                        "Solutions Manual"                                           \
2939                        "Solutions Manual"                                           \                        "Solutions Manual"                                           \
2940                        "Solutions Manual"                                           \                        "Solutions Manual"                                           \
2941                        "Solutions Manual"                                           \                        "Solutions Manual"                                           \
2942                        "Solutions Manual"                                           \                        "1"                                                          \
2943                        "Solutions Manual"                                           \                     rta0                                                            \
2944                        "Solutions Manual"                                           \                        "Real-Time Analysis"                                         \
2945                        "1"                                                          \                        "Real-Time Analysis"                                         \
2946                     rta0                                                            \                        "Real-Time Analysis"                                         \
2947                        "Real-Time Analysis"                                         \                        "Real-Time Analysis"                                         \
2948                        "Real-Time Analysis"                                         \                        "Real-Time Analysis"                                         \
2949                        "Real-Time Analysis"                                         \                        "Real-Time Analysis"                                         \
2950                        "Real-Time Analysis"                                         \                        "1"                                                          \
2951                        "Real-Time Analysis"                                         \                     scr0                                                            \
2952                        "Real-Time Analysis"                                         \                        "Support Of Common Software Requirements And Design Scenarios"\
2953                        "1"                                                          \                        "Support Of Common Software Requirements And Design Scenarios"\
2954                     scr0                                                            \                        "Support Of Common Software Requirements And Design Scenarios"\
2955                        "Support Of Common Software Requirements And Design Scenarios"\                        "Support Of Common Software Requirements And Design Scenarios"\
2956                        "Support Of Common Software Requirements And Design Scenarios"\                        "Support Of Common Software Requirements And Design Scenarios"\
2957                        "Support Of Common Software Requirements And Design Scenarios"\                        "Support Of Common Software Requirements And Design Scenarios"\
2958                        "Support Of Common Software Requirements And Design Scenarios"\                        "1"                                                          \
2959                        "Support Of Common Software Requirements And Design Scenarios"\                     soc0                                                            \
2960                        "Support Of Common Software Requirements And Design Scenarios"\                        "Support Of On-Chip Peripherals And Systems"                 \
2961                        "1"                                                          \                        "Support Of On-Chip Peripherals And Systems"                 \
2962                     soc0                                                            \                        "Support Of On-Chip Peripherals And Systems"                 \
2963                        "Support Of On-Chip Peripherals And Systems"                 \                        "Support Of On-Chip Peripherals And Systems"                 \
2964                        "Support Of On-Chip Peripherals And Systems"                 \                        "Support Of On-Chip Peripherals And Systems"                 \
2965                        "Support Of On-Chip Peripherals And Systems"                 \                        "Support Of On-Chip Peripherals And Systems"                 \
2966                        "Support Of On-Chip Peripherals And Systems"                 \                        "1"                                                          \
2967                        "Support Of On-Chip Peripherals And Systems"                 \                     sfc0                                                            \
2968                        "Support Of On-Chip Peripherals And Systems"                 \                        "Support Of Off-Chip Peripherals And Systems"                \
2969                        "1"                                                          \                        "Support Of Off-Chip Peripherals And Systems"                \
2970                     sfc0                                                            \                        "Support Of Off-Chip Peripherals And Systems"                \
2971                        "Support Of Off-Chip Peripherals And Systems"                \                        "Support Of Off-Chip Peripherals And Systems"                \
2972                        "Support Of Off-Chip Peripherals And Systems"                \                        "Support Of Off-Chip Peripherals And Systems"                \
2973                        "Support Of Off-Chip Peripherals And Systems"                \                        "Support Of Off-Chip Peripherals And Systems"                \
2974                        "Support Of Off-Chip Peripherals And Systems"                \                        "1"                                                          \
2975                        "Support Of Off-Chip Peripherals And Systems"                \                     caf0                                                            \
2976                        "Support Of Off-Chip Peripherals And Systems"                \                        "Implementation Of Common Automotive Features"               \
2977                        "1"                                                          \                        "Implementation Of Common Automotive Features"               \
2978                     caf0                                                            \                        "Implementation Of Common Automotive Features"               \
2979                        "Implementation Of Common Automotive Features"               \                        "Implementation Of Common Automotive Features"               \
2980                        "Implementation Of Common Automotive Features"               \                        "Implementation Of Common Automotive Features"               \
2981                        "Implementation Of Common Automotive Features"               \                        "Implementation Of Common Automotive Features"               \
2982                        "Implementation Of Common Automotive Features"               \                        "1"                                                          \
2983                        "Implementation Of Common Automotive Features"               \                     snw0                                                            \
2984                        "Implementation Of Common Automotive Features"               \                        "Support Of Networks And Communication Protocols"            \
2985                        "1"                                                          \                        "Support Of Networks And Communication Protocols"            \
2986                     snw0                                                            \                        "Support Of Networks And Communication Protocols"            \
2987                        "Support Of Networks And Communication Protocols"            \                        "Support Of Networks And Communication Protocols"            \
2988                        "Support Of Networks And Communication Protocols"            \                        "Support Of Networks And Communication Protocols"            \
2989                        "Support Of Networks And Communication Protocols"            \                        "Support Of Networks And Communication Protocols"            \
2990                        "Support Of Networks And Communication Protocols"            \                        "1"                                                          \
2991                        "Support Of Networks And Communication Protocols"            \                     nal0                                                            \
2992                        "Support Of Networks And Communication Protocols"            \                        "Numerical Algorithms, Results, And Techniques"              \
2993                        "1"                                                          \                        "Numerical Algorithms, Results, And Techniques"              \
2994                     nal0                                                            \                        "Numerical Algorithms, Results, And Techniques"              \
2995                        "Numerical Algorithms, Results, And Techniques"              \                        "Numerical Algorithms, Results, And Techniques"              \
2996                        "Numerical Algorithms, Results, And Techniques"              \                        "Numerical Algorithms, Results, And Techniques"              \
2997                        "Numerical Algorithms, Results, And Techniques"              \                        "Numerical Algorithms, Results, And Techniques"              \
2998                        "Numerical Algorithms, Results, And Techniques"              \                        "1"                                                          \
2999                        "Numerical Algorithms, Results, And Techniques"              \                     nna0                                                            \
3000                        "Numerical Algorithms, Results, And Techniques"              \                        "Non-Numerical Algorithms, Results, And Techniques"          \
3001                        "1"                                                          \                        "Non-Numerical Algorithms, Results, And Techniques"          \
3002                     nna0                                                            \                        "Non-Numerical Algorithms, Results, And Techniques"          \
3003                        "Non-Numerical Algorithms, Results, And Techniques"          \                        "Non-Numerical Algorithms, Results, And Techniques"          \
3004                        "Non-Numerical Algorithms, Results, And Techniques"          \                        "Non-Numerical Algorithms, Results, And Techniques"          \
3005                        "Non-Numerical Algorithms, Results, And Techniques"          \                        "Non-Numerical Algorithms, Results, And Techniques"          \
3006                        "Non-Numerical Algorithms, Results, And Techniques"          \                        "1"                                                          \
3007                        "Non-Numerical Algorithms, Results, And Techniques"          \                     sdm0                                                            \
3008                        "Non-Numerical Algorithms, Results, And Techniques"          \                        "Software Design Methods"                                    \
3009                        "1"                                                          \                        "Software Design Methods"                                    \
3010                     sdm0                                                            \                        "Software Design Methods"                                    \
3011                        "Software Design Methods"                                    \                        "Software Design Methods"                                    \
3012                        "Software Design Methods"                                    \                        "Software Design Methods"                                    \
3013                        "Software Design Methods"                                    \                        "Software Design Methods"                                    \
3014                        "Software Design Methods"                                    \                        "1"                                                          \
3015                        "Software Design Methods"                                    \                     cpc0                                                            \
3016                        "Software Design Methods"                                    \                        "Microcontroller And CPU Core Usage Application Notes"       \
3017                        "1"                                                          \                        "Microcontroller And CPU Core Usage Application Notes"       \
3018                     cpc0                                                            \                        "Microcontroller And CPU Core Usage Application Notes"       \
3019                        "Microcontroller And CPU Core Usage Application Notes"       \                        "Microcontroller And CPU Core Usage Application Notes"       \
3020                        "Microcontroller And CPU Core Usage Application Notes"       \                        "Microcontroller And CPU Core Usage Application Notes"       \
3021                        "Microcontroller And CPU Core Usage Application Notes"       \                        "Microcontroller And CPU Core Usage Application Notes"       \
3022                        "Microcontroller And CPU Core Usage Application Notes"       \                        "1"                                                          \
3023                        "Microcontroller And CPU Core Usage Application Notes"       \                     sti0                                                            \
3024                        "Microcontroller And CPU Core Usage Application Notes"       \                        "Software Tool Descriptions And Information"                 \
3025                        "1"                                                          \                        "Software Tool Descriptions And Information"                 \
3026                     sti0                                                            \                        "Software Tool Descriptions And Information"                 \
3027                        "Software Tool Descriptions And Information"                 \                        "Software Tool Descriptions And Information"                 \
3028                        "Software Tool Descriptions And Information"                 \                        "Software Tool Descriptions And Information"                 \
3029                        "Software Tool Descriptions And Information"                 \                        "Software Tool Descriptions And Information"                 \
3030                        "Software Tool Descriptions And Information"                 \                        "1"                                                          \
3031                        "Software Tool Descriptions And Information"                 \                     stn0                                                            \
3032                        "Software Tool Descriptions And Information"                 \                        "Software Tool Usage And Application Notes"                  \
3033                        "1"                                                          \                        "Software Tool Usage And Application Notes"                  \
3034                     stn0                                                            \                        "Software Tool Usage And Application Notes"                  \
3035                        "Software Tool Usage And Application Notes"                  \                        "Software Tool Usage And Application Notes"                  \
3036                        "Software Tool Usage And Application Notes"                  \                        "Software Tool Usage And Application Notes"                  \
3037                        "Software Tool Usage And Application Notes"                  \                        "Software Tool Usage And Application Notes"                  \
3038                        "Software Tool Usage And Application Notes"                  \                        "1"                                                          \
3039                        "Software Tool Usage And Application Notes"                  \                     hti0                                                            \
3040                        "Software Tool Usage And Application Notes"                  \                        "Hardware Tool Descriptions And Information"                 \
3041                        "1"                                                          \                        "Hardware Tool Descriptions And Information"                 \
3042                     hti0                                                            \                        "Hardware Tool Descriptions And Information"                 \
3043                        "Hardware Tool Descriptions And Information"                 \                        "Hardware Tool Descriptions And Information"                 \
3044                        "Hardware Tool Descriptions And Information"                 \                        "Hardware Tool Descriptions And Information"                 \
3045                        "Hardware Tool Descriptions And Information"                 \                        "Hardware Tool Descriptions And Information"                 \
3046                        "Hardware Tool Descriptions And Information"                 \                        "1"                                                          \
3047                        "Hardware Tool Descriptions And Information"                 \                     htn0                                                            \
3048                        "Hardware Tool Descriptions And Information"                 \                        "Hardware Tool Usage And Application Notes"                  \
3049                        "1"                                                          \                        "Hardware Tool Usage And Application Notes"                  \
3050                     htn0                                                            \                        "Hardware Tool Usage And Application Notes"                  \
3051                        "Hardware Tool Usage And Application Notes"                  \                        "Hardware Tool Usage And Application Notes"                  \
3052                        "Hardware Tool Usage And Application Notes"                  \                        "Hardware Tool Usage And Application Notes"                  \
3053                        "Hardware Tool Usage And Application Notes"                  \                        "Hardware Tool Usage And Application Notes"                  \
3054                        "Hardware Tool Usage And Application Notes"                  \                        "1"                                                          \
3055                        "Hardware Tool Usage And Application Notes"                  \                     hwd0                                                            \
3056                        "Hardware Tool Usage And Application Notes"                  \                        "Hardware Design"                                            \
3057                        "1"                                                          \                        "Hardware Design"                                            \
3058                     hwd0                                                            \                        "Hardware Design"                                            \
3059                        "Hardware Design"                                            \                        "Hardware Design"                                            \
3060                        "Hardware Design"                                            \                        "Hardware Design"                                            \
3061                        "Hardware Design"                                            \                        "Hardware Design"                                            \
3062                        "Hardware Design"                                            \                        "1"                                                          \
3063                        "Hardware Design"                                            \                     pte0                                                            \
3064                        "Hardware Design"                                            \                        "Product Testing"                                            \
3065                        "1"                                                          \                        "Product Testing"                                            \
3066                     pte0                                                            \                        "Product Testing"                                            \
3067                        "Product Testing"                                            \                        "Product Testing"                                            \
3068                        "Product Testing"                                            \                        "Product Testing"                                            \
3069                        "Product Testing"                                            \                        "Product Testing"                                            \
3070                        "Product Testing"                                            \                        "1"                                                          \
3071                        "Product Testing"                                            \                     pas0                                                            \
3072                        "Product Testing"                                            \                        "Product Manufacturing And Assembly"                         \
3073                        "1"                                                          \                        "Product Manufacturing And Assembly"                         \
3074                     pas0                                                            \                        "Product Manufacturing And Assembly"                         \
3075                        "Product Manufacturing And Assembly"                         \                        "Product Manufacturing And Assembly"                         \
3076                        "Product Manufacturing And Assembly"                         \                        "Product Manufacturing And Assembly"                         \
3077                        "Product Manufacturing And Assembly"                         \                        "Product Manufacturing And Assembly"                         \
3078                        "Product Manufacturing And Assembly"                         \                        "1"                                                          \
3079                        "Product Manufacturing And Assembly"                         \                     pro0                                                            \
3080                        "Product Manufacturing And Assembly"                         \                        "Process, Administrative, And Personnel Issues"              \
3081                        "1"                                                          \                        "Process, Administrative, And Personnel Issues"              \
3082                     pro0                                                            \                        "Process, Administrative, And Personnel Issues"              \
3083                        "Process, Administrative, And Personnel Issues"              \                        "Process, Administrative, And Personnel Issues"              \
3084                        "Process, Administrative, And Personnel Issues"              \                        "Process, Administrative, And Personnel Issues"              \
3085                        "Process, Administrative, And Personnel Issues"              \                        "Process, Administrative, And Personnel Issues"              \
3086                        "Process, Administrative, And Personnel Issues"              \                        "1"                                                          \
3087                        "Process, Administrative, And Personnel Issues"              \                     orq0                                                            \
3088                        "Process, Administrative, And Personnel Issues"              \                        "Open Research Questions"                                    \
3089                        "1"                                                          \                        "Open Research Questions"                                    \
3090                     orq0                                                            \                        "Open Research Questions"                                    \
3091                        "Open Research Questions"                                    \                        "Open Research Questions"                                    \
3092                        "Open Research Questions"                                    \                        "Open Research Questions"                                    \
3093                        "Open Research Questions"                                    \                        "Open Research Questions"                                    \
3094                        "Open Research Questions"                                    \                        "1"                                                          \
3095                        "Open Research Questions"                                    \                     llr0                                                            \
3096                        "Open Research Questions"                                    \                        "Lessons Learned"                                            \
3097                        "1"                                                          \                        "Lessons Learned"                                            \
3098                     llr0                                                            \                        "Lessons Learned"                                            \
3099                        "Lessons Learned"                                            \                        "Lessons Learned"                                            \
3100                        "Lessons Learned"                                            \                        "Lessons Learned"                                            \
3101                        "Lessons Learned"                                            \                        "Lessons Learned"                                            \
3102                        "Lessons Learned"                                            \                        "1"                                                          \
3103                        "Lessons Learned"                                            \                     bpr0                                                            \
3104                        "Lessons Learned"                                            \                        "Best Practices"                                             \
3105                        "1"                                                          \                        "Best Practices"                                             \
3106                     bpr0                                                            \                        "Best Practices"                                             \
3107                        "Best Practices"                                             \                        "Best Practices"                                             \
3108                        "Best Practices"                                             \                        "Best Practices"                                             \
3109                        "Best Practices"                                             \                        "Best Practices"                                             \
3110                        "Best Practices"                                             \                        "1"                                                          \
3111                        "Best Practices"                                             \                     hpj0                                                            \
3112                        "Best Practices"                                             \                        "Hardware Projects"                                          \
3113                        "1"                                                          \                        "Hardware Projects"                                          \
3114                     hpj0                                                            \                        "Hardware Projects"                                          \
3115                        "Hardware Projects"                                          \                        "Hardware Projects"                                          \
3116                        "Hardware Projects"                                          \                        "Hardware Projects"                                          \
3117                        "Hardware Projects"                                          \                        "Hardware Projects"                                          \
3118                        "Hardware Projects"                                          \                        "1"                                                          \
3119                        "Hardware Projects"                                          \                     sca0                                                            \
3120                        "Hardware Projects"                                          \                        "Software Case Studies"                                      \
3121                        "1"                                                          \                        "Software Case Studies"                                      \
3122                     sca0                                                            \                        "Software Case Studies"                                      \
3123                        "Software Case Studies"                                      \                        "Software Case Studies"                                      \
3124                        "Software Case Studies"                                      \                        "Software Case Studies"                                      \
3125                        "Software Case Studies"                                      \                        "Software Case Studies"                                      \
3126                        "Software Case Studies"                                      \                        "1"                                                          \
3127                        "Software Case Studies"                                      \                     hca0                                                            \
3128                        "Software Case Studies"                                      \                        "Hardware Case Studies"                                      \
3129                        "1"                                                          \                        "Hardware Case Studies"                                      \
3130                     hca0                                                            \                        "Hardware Case Studies"                                      \
3131                        "Hardware Case Studies"                                      \                        "Hardware Case Studies"                                      \
3132                        "Hardware Case Studies"                                      \                        "Hardware Case Studies"                                      \
3133                        "Hardware Case Studies"                                      \                        "Hardware Case Studies"                                      \
3134                        "Hardware Case Studies"                                      \                        "1"                                                          \
3135                        "Hardware Case Studies"                                      \                     cdt0                                                            \
3136                        "Hardware Case Studies"                                      \                        "Correspondence And Discussion Threads"                      \
3137                        "1"                                                          \                        "Correspondence And Discussion Threads"                      \
3138                     cdt0                                                            \                        "Correspondence And Discussion Threads"                      \
3139                        "Correspondence And Discussion Threads"                      \                        "Correspondence And Discussion Threads"                      \
3140                        "Correspondence And Discussion Threads"                      \                        "Correspondence And Discussion Threads"                      \
3141                        "Correspondence And Discussion Threads"                      \                        "Correspondence And Discussion Threads"                      \
3142                        "Correspondence And Discussion Threads"                      \                        "1"                                                          \
3143                        "Correspondence And Discussion Threads"                      \                     dtm0                                                            \
3144                        "Correspondence And Discussion Threads"                      \                        "Document Templates"                                         \
3145                        "1"                                                          \                        "Document Templates"                                         \
3146                     dtm0                                                            \                        "Document Templates"                                         \
3147                        "Document Templates"                                         \                        "Document Templates"                                         \
3148                        "Document Templates"                                         \                        "Document Templates"                                         \
3149                        "Document Templates"                                         \                        "Document Templates"                                         \
3150                        "Document Templates"                                         \                        "1"                                                          \
3151                        "Document Templates"                                         \                     }
3152                        "Document Templates"                                         \  
3153                        "1"                                                          \  set bookVolumeListStructSize 8
3154                     }     #The numer of physical records per each logical record in the list above.  This
3155       #minimizes tearup if things are added to what is above.
3156  set bookVolumeListStructSize 8  
3157     #The numer of physical records per each logical record in the list above.  This  set bookVolumeListIndex(NOT_USED) 0
3158     #minimizes tearup if things are added to what is above.     #Used to initialize the associative index array for the book volumes, so there are
3159       #no problems declaring it global to procs before it is first defined.  This index
3160  set bookVolumeListIndex(NOT_USED) 0     #is associative by the 4-character volume code, and stores an integer which is the
3161     #Used to initialize the associative index array for the book volumes, so there are     #base array index into the group of info for that volume name.  This is done to
3162     #no problems declaring it global to procs before it is first defined.  This index     #avoid repeated searches of the entire space.  I would guess the Tcl hash function
3163     #is associative by the 4-character volume code, and stores an integer which is the     #is faster than a linear search.
3164     #base array index into the group of info for that volume name.  This is done to  
3165     #avoid repeated searches of the entire space.  I would guess the Tcl hash function  # The list of chapters in the entire work.  They don't have to be in any particular
3166     #is faster than a linear search.  # order (so I've arranged them alphabetically by tag).  The fields are, in order:
3167    #    a)The tag.
3168  # The list of chapters in the entire work.  They don't have to be in any particular  #    b)Single volume long name.
3169  # order (so I've arranged them alphabetically by tag).  The fields are, in order:  #    c)Single volume short name.
3170  #    a)The tag.  #    d)Multiple volume long name.
3171  #    b)Single volume long name.  #    e)Multiple volume short name.
3172  #    c)Single volume short name.  #    f)Single volume status ("D" or "F").  "D" indicates that chapter should be treated as a
3173  #    d)Multiple volume long name.  #      draft chapter for the single volume work and only included in the draft version.  "F" indicates
3174  #    e)Multiple volume short name.  #      should be included in both draft and final versions.
3175  #    f)Single volume status ("D" or "F").  "D" indicates that chapter should be treated as a  #    g)Multi-volume status ("D" or "F").  See description immediately above, except
3176  #      draft chapter for the single volume work and only included in the draft version.  "F" indicates  #      applies to multi-volume work.
3177  #      should be included in both draft and final versions.  #    h)"Used" flag ("Y" or "N").  This flag is set by the software as it runs to remember if a chapter
3178  #    g)Multi-volume status ("D" or "F").  See description immediately above, except  #      is referenced in the mcl or not.  This is a scratch flag.
3179  #      applies to multi-volume work.  #
3180  #    h)"Used" flag ("Y" or "N").  This flag is set by the software as it runs to remember if a chapter  # As of 08/27/01, this list contains many unused chapters that were deleted.  These will
3181  #      is referenced in the mcl or not.  This is a scratch flag.  # be kept around for a while, in case they are added again in the future as the work grows.
3182  #  set chapterList {
3183  # As of 08/27/01, this list contains many unused chapters that were deleted.  These will                  add0                                                                                 \
3184  # be kept around for a while, in case they are added again in the future as the work grows.                     "Addition"                                                                        \
3185  set chapterList {                     "Addition"                                                                        \
3186                  add0                                                                                 \                     "Addition"                                                                        \
3187                     "Addition"                                                                        \                     "Addition"                                                                        \
3188                     "Addition"                                                                        \                     "F"                                                                               \
3189                     "Addition"                                                                        \                     "F"                                                                               \
3190                     "Addition"                                                                        \                     "0"                                                                               \
3191                     "F"                                                                               \                  bal0                                                                                 \
3192                     "F"                                                                               \                     "Boolean Algebra And Simplification Of Boolean Functions"                         \
3193                     "0"                                                                               \                     "Simplification Of Boolean Functions"                                             \
3194                  bal0                                                                                 \                     "Boolean Algebra And Simplification Of Boolean Functions"                         \
3195                     "Boolean Algebra And Simplification Of Boolean Functions"                         \                     "Simplification Of Boolean Functions"                                             \
3196                     "Simplification Of Boolean Functions"                                             \                     "F"                                                                               \
3197                     "Boolean Algebra And Simplification Of Boolean Functions"                         \                     "F"                                                                               \
3198                     "Simplification Of Boolean Functions"                                             \                     "0"                                                                               \
3199                     "F"                                                                               \                  bas0                                                                                 \
3200                     "F"                                                                               \                     "Solutions:  Boolean Algebra And Simplification Of Boolean Functions"             \
3201                     "0"                                                                               \                     "Solutions:  Boolean Algebra"                                                     \
3202                  bas0                                                                                 \                     "Solutions:  Boolean Algebra And Simplification Of Boolean Functions"             \
3203                     "Solutions:  Boolean Algebra And Simplification Of Boolean Functions"             \                     "Solutions:  Boolean Algebra"                                                     \
3204                     "Solutions:  Boolean Algebra"                                                     \                     "F"                                                                               \
3205                     "Solutions:  Boolean Algebra And Simplification Of Boolean Functions"             \                     "F"                                                                               \
3206                     "Solutions:  Boolean Algebra"                                                     \                     "0"                                                                               \
3207                     "F"                                                                               \                  ber0                                                                                 \
3208                     "F"                                                                               \                     "Build Environment Research Questions"                                            \
3209                     "0"                                                                               \                     "Build Environment Research Questions"                                            \
3210                  ber0                                                                                 \                     "Build Environment Research Questions"                                            \
3211                     "Build Environment Research Questions"                                            \                     "Build Environment Research Questions"                                            \
3212                     "Build Environment Research Questions"                                            \                     "F"                                                                               \
3213                     "Build Environment Research Questions"                                            \                     "F"                                                                               \
3214                     "Build Environment Research Questions"                                            \                     "0"                                                                               \
3215                     "F"                                                                               \                  bma0                                                                                 \
3216                     "F"                                                                               \                     "Bad Management And Unpleasant Work Situations"                                   \
3217                     "0"                                                                               \                     "Bad Management"                                                                  \
3218                  bma0                                                                                 \                     "Bad Management And Unpleasant Work Situations"                                   \
3219                     "Bad Management And Unpleasant Work Situations"                                   \                     "Bad Management"                                                                  \
3220                     "Bad Management"                                                                  \                     "F"                                                                               \
3221                     "Bad Management And Unpleasant Work Situations"                                   \                     "F"                                                                               \
3222                     "Bad Management"                                                                  \                     "0"                                                                               \
3223                     "F"                                                                               \                  cch0                                                                                 \
3224                     "F"                                                                               \                     "CRC, Checksum, And Hash Function Extensions"                                     \
3225                     "0"                                                                               \                     "CRC, Checksum, And Hash Extensions"                                              \
3226                  cch0                                                                                 \                     "CRC, Checksum, And Hash Function Extensions"                                     \
3227                     "CRC, Checksum, And Hash Function Extensions"                                     \                     "CRC, Checksum, And Hash Extensions"                                              \
3228                     "CRC, Checksum, And Hash Extensions"                                              \                     "F"                                                                               \
3229                     "CRC, Checksum, And Hash Function Extensions"                                     \                     "F"                                                                               \
3230                     "CRC, Checksum, And Hash Extensions"                                              \                     "0"                                                                               \
3231                     "F"                                                                               \                  cfr0                                                                                 \
3232                     "F"                                                                               \                     "Continued Fractions And Related Topics"                                          \
3233                     "0"                                                                               \                     "Continued Fractions And Related Topics"                                          \
3234                  cfr0                                                                                 \                     "Continued Fractions And Related Topics"                                          \
3235                     "Continued Fractions And Related Topics"                                          \                     "Continued Fractions And Related Topics"                                          \
3236                     "Continued Fractions And Related Topics"                                          \                     "F"                                                                               \
3237                     "Continued Fractions And Related Topics"                                          \                     "F"                                                                               \
3238                     "Continued Fractions And Related Topics"                                          \                     "0"                                                                               \
3239                     "F"                                                                               \                  cfs0                                                                                 \
3240                     "F"                                                                               \                     "Solutions:  Continued Fractions And Related Topics"                              \
3241                     "0"                                                                               \                     "Solutions:  Continued Fractions"                                                 \
3242                  cfs0                                                                                 \                     "Solutions:  Continued Fractions And Related Topics"                              \
3243                     "Solutions:  Continued Fractions And Related Topics"                              \                     "Solutions:  Continued Fractions"                                                 \
3244                     "Solutions:  Continued Fractions"                                                 \                     "F"                                                                               \
3245                     "Solutions:  Continued Fractions And Related Topics"                              \                     "F"                                                                               \
3246                     "Solutions:  Continued Fractions"                                                 \                     "0"                                                                               \
3247                     "F"                                                                               \                  cil0                                                                                 \
3248                     "F"                                                                               \                     "Classical And Simple Integer Algorithms And Techniques"                          \
3249                     "0"                                                                               \                     "Simple Integer Algorithms"                                                       \
3250                  cil0                                                                                 \                     "Classical And Simple Integer Algorithms And Techniques"                          \
3251                     "Classical And Simple Integer Algorithms And Techniques"                          \                     "Simple Integer Algorithms"                                                       \
3252                     "Simple Integer Algorithms"                                                       \                     "F"                                                                               \
3253                     "Classical And Simple Integer Algorithms And Techniques"                          \                     "F"                                                                               \
3254                     "Simple Integer Algorithms"                                                       \                     "0"                                                                               \
3255                     "F"                                                                               \                  cis0                                                                                 \
3256                     "F"                                                                               \                     "Solutions:  Classical And Simple Integer Algorithms And Techniques"              \
3257                     "0"                                                                               \                     "Solutions:  Simple Integer Algorithms"                                           \
3258                  cis0                                                                                 \                     "Solutions:  Classical And Simple Integer Algorithms And Techniques"              \
3259                     "Solutions:  Classical And Simple Integer Algorithms And Techniques"              \                     "Solutions:  Simple Integer Algorithms"                                           \
3260                     "Solutions:  Simple Integer Algorithms"                                           \                     "F"                                                                               \
3261                     "Solutions:  Classical And Simple Integer Algorithms And Techniques"              \                     "F"                                                                               \
3262                     "Solutions:  Simple Integer Algorithms"                                           \                     "0"                                                                               \
3263                     "F"                                                                               \                  css1                                                                                 \
3264                     "F"                                                                               \                     "Canonical Server Setup"                                                          \
3265                     "0"                                                                               \                     "Canonical Server Setup"                                                          \
3266                  css1                                                                                 \                     "Canonical Server Setup"                                                          \
3267                     "Canonical Server Setup"                                                          \                     "Canonical Server Setup"                                                          \
3268                     "Canonical Server Setup"                                                          \                     "F"                                                                               \
3269                     "Canonical Server Setup"                                                          \                     "F"                                                                               \
3270                     "Canonical Server Setup"                                                          \                     "0"                                                                               \
3271                     "F"                                                                               \                  cst0                                                                                 \
3272                     "F"                                                                               \                     "Coding Standards"                                                                \
3273                     "0"                                                                               \                     "Coding Standards"                                                                \
3274                  cst0                                                                                 \                     "Coding Standards"                                                                \
3275                     "Coding Standards"                                                                \                     "Coding Standards"                                                                \
3276                     "Coding Standards"                                                                \                     "F"                                                                               \
3277                     "Coding Standards"                                                                \                     "F"                                                                               \
3278                     "Coding Standards"                                                                \                     "0"                                                                               \
3279                     "F"                                                                               \                  daa0                                                                                 \
3280                     "F"                                                                               \                     "Decoration And Automatic Assembly"                                               \
3281                     "0"                                                                               \                     "Decoration And Automatic Assembly"                                               \
3282                  daa0                                                                                 \                     "Decoration And Automatic Assembly"                                               \
3283                     "Decoration And Automatic Assembly"                                               \                     "Decoration And Automatic Assembly"                                               \
3284                     "Decoration And Automatic Assembly"                                               \                     "F"                                                                               \
3285                     "Decoration And Automatic Assembly"                                               \                     "F"                                                                               \
3286                     "Decoration And Automatic Assembly"                                               \                     "0"                                                                               \
3287                     "F"                                                                               \                  dcm0                                                                                 \
3288                     "F"                                                                               \                     "DOS Console-Mode Utilities"                                                      \
3289                     "0"                                                                               \                     "DOS Console-Mode Utilities"                                                      \
3290                  dcm0                                                                                 \                     "DOS Console-Mode Utilities"                                                      \
3291                     "DOS Console-Mode Utilities"                                                      \                     "DOS Console-Mode Utilities"                                                      \
3292                     "DOS Console-Mode Utilities"                                                      \                     "F"                                                                               \
3293                     "DOS Console-Mode Utilities"                                                      \                     "F"                                                                               \
3294                     "DOS Console-Mode Utilities"                                                      \                     "0"                                                                               \
3295                     "F"                                                                               \                  div0                                                                                 \
3296                     "F"                                                                               \                     "Division"                                                                        \
3297                     "0"                                                                               \                     "Division"                                                                        \
3298                  div0                                                                                 \                     "Division"                                                                        \
3299                     "Division"                                                                        \                     "Division"                                                                        \
3300                     "Division"                                                                        \                     "F"                                                                               \
3301                     "Division"                                                                        \                     "F"                                                                               \
3302                     "Division"                                                                        \                     "0"                                                                               \
3303                     "F"                                                                               \                  dta0                                                                                 \
3304                     "F"                                                                               \                     "Discrete-Time And Complex Integer Algorithms And Techniques"                     \
3305                     "0"                                                                               \                     "Complex Integer Algorithms"                                                      \
3306                  dta0                                                                                 \                     "Discrete-Time And Complex Integer Algorithms And Techniques"                     \
3307                     "Discrete-Time And Complex Integer Algorithms And Techniques"                     \                     "Complex Integer Algorithms"                                                      \
3308                     "Complex Integer Algorithms"                                                      \                     "F"                                                                               \
3309                     "Discrete-Time And Complex Integer Algorithms And Techniques"                     \                     "F"                                                                               \
3310                     "Complex Integer Algorithms"                                                      \                     "0"                                                                               \
3311                     "F"                                                                               \                  edc0                                                                                 \
3312                     "F"                                                                               \                     "Error-Detecting And Error-Correcting Codes, With Microcontroller Applications"   \
3313                     "0"                                                                               \                     "Error-Detecting And Correcting Codes"                                            \
3314                  edc0                                                                                 \                     "Error-Detecting And Error-Correcting Codes, With Microcontroller Applications"   \
3315                     "Error-Detecting And Error-Correcting Codes, With Microcontroller Applications"   \                     "Error-Detecting And Correcting Codes"                                            \
3316                     "Error-Detecting And Correcting Codes"                                            \                     "F"                                                                               \
3317                     "Error-Detecting And Error-Correcting Codes, With Microcontroller Applications"   \                     "F"                                                                               \
3318                     "Error-Detecting And Correcting Codes"                                            \                     "0"                                                                               \
3319                     "F"                                                                               \                  eds0                                                                                 \
3320                     "F"                                                                               \                     "Solutions:  Error-Detecting And Error-Correcting Codes, With Microcontroller Applications"   \
3321                     "0"                                                                               \                     "Solutions:  Error-Detecting And Correcting Codes"                                \
3322                  eds0                                                                                 \                     "Solutions:  Error-Detecting And Error-Correcting Codes, With Microcontroller Applications"   \
3323                     "Solutions:  Error-Detecting And Error-Correcting Codes, With Microcontroller Applications"   \                     "Solutions:  Error-Detecting And Correcting Codes"                                \
3324                     "Solutions:  Error-Detecting And Correcting Codes"                                \                     "F"                                                                               \
3325                     "Solutions:  Error-Detecting And Error-Correcting Codes, With Microcontroller Applications"   \                     "F"                                                                               \
3326                     "Solutions:  Error-Detecting And Correcting Codes"                                \                     "0"                                                                               \
3327                     "F"                                                                               \                  faq0                                                                                 \
3328                     "F"                                                                               \                     "Frequently Asked Questions And Frequently Encountered Problems"                  \
3329                     "0"                                                                               \                     "FAQs And Common Problems"                                                        \
3330                  faq0                                                                                 \                     "Frequently Asked Questions And Frequently Encountered Problems"                  \
3331                     "Frequently Asked Questions And Frequently Encountered Problems"                  \                     "FAQs And Common Problems"                                                        \
3332                     "FAQs And Common Problems"                                                        \                     "F"                                                                               \
3333                     "Frequently Asked Questions And Frequently Encountered Problems"                  \                     "F"                                                                               \
3334                     "FAQs And Common Problems"                                                        \                     "0"                                                                               \
3335                     "F"                                                                               \                  frs0                                                                                 \
3336                     "F"                                                                               \                     "Solutions:  Farey Series And Related Topics"                                     \
3337                     "0"                                                                               \                     "Solutions:  Farey Series"                                                        \
3338                  frs0                                                                                 \                     "Solutions:  Farey Series And Related Topics"                                     \
3339                     "Solutions:  Farey Series And Related Topics"                                     \                     "Solutions:  Farey Series"                                                        \
3340                     "Solutions:  Farey Series"                                                        \                     "F"                                                                               \
3341                     "Solutions:  Farey Series And Related Topics"                                     \                     "F"                                                                               \
3342                     "Solutions:  Farey Series"                                                        \                     "0"                                                                               \
3343                     "F"                                                                               \                  fry0                                                                                 \
3344                     "F"                                                                               \                     "Farey Series And Related Topics"                                                 \
3345                     "0"                                                                               \                     "Farey Series And Related Topics"                                                 \
3346                  fry0                                                                                 \                     "Farey Series And Related Topics"                                                 \
3347                     "Farey Series And Related Topics"                                                 \                     "Farey Series And Related Topics"                                                 \
3348                     "Farey Series And Related Topics"                                                 \                     "F"                                                                               \
3349                     "Farey Series And Related Topics"                                                 \                     "F"                                                                               \
3350                     "Farey Series And Related Topics"                                                 \                     "0"                                                                               \
3351                     "F"                                                                               \                  fte0                                                                                 \
3352                     "F"                                                                               \                     "File Transformation Extension"                                                   \
3353                     "0"                                                                               \                     "File Transformation Extension"                                                   \
3354                  fte0                                                                                 \                     "File Transformation Extension"                                                   \
3355                     "File Transformation Extension"                                                   \                     "File Transformation Extension"                                                   \
3356                     "File Transformation Extension"                                                   \                     "F"                                                                               \
3357                     "File Transformation Extension"                                                   \                     "F"                                                                               \
3358                     "File Transformation Extension"                                                   \                     "0"                                                                               \
3359                     "F"                                                                               \                  hgr0                                                                                 \
3360                     "F"                                                                               \                     "The Holy Grail"                                                                  \
3361                     "0"                                                                               \                     "The Holy Grail"                                                                  \
3362                  hgr0                                                                                 \                     "The Holy Grail"                                                                  \
3363                     "The Holy Grail"                                                                  \                     "The Holy Grail"                                                                  \
3364                     "The Holy Grail"                                                                  \                     "F"                                                                               \
3365                     "The Holy Grail"                                                                  \                     "F"                                                                               \
3366                     "The Holy Grail"                                                                  \                     "0"                                                                               \
3367                     "F"                                                                               \                  hrq0                                                                                 \
3368                     "F"                                                                               \                     "Hardware Research Questions"                                                     \
3369                     "0"                                                                               \                     "Hardware Research Questions"                                                     \
3370                  hrq0                                                                                 \                     "Hardware Research Questions"                                                     \
3371                     "Hardware Research Questions"                                                     \                     "Hardware Research Questions"                                                     \
3372                     "Hardware Research Questions"                                                     \                     "F"                                                                               \
3373                     "Hardware Research Questions"                                                     \                     "F"                                                                               \
3374                     "Hardware Research Questions"                                                     \                     "0"                                                                               \
3375                     "F"                                                                               \                  int0                                                                                 \
3376                     "F"                                                                               \                     "Introduction To Small Microcontroller Work"                                      \
3377                     "0"                                                                               \                     "Introduction To Small Microcontroller Work"                                      \
3378                  int0                                                                                 \                     "Introduction To Small Microcontroller Work"                                      \
3379                     "Introduction To Small Microcontroller Work"                                      \                     "Introduction To Small Microcontroller Work"                                      \
3380                     "Introduction To Small Microcontroller Work"                                      \                     "F"                                                                               \
3381                     "Introduction To Small Microcontroller Work"                                      \                     "F"                                                                               \
3382                     "Introduction To Small Microcontroller Work"                                      \                     "0"                                                                               \
3383                     "F"                                                                               \                  ird0                                                                                 \
3384                     "F"                                                                               \                     "Interrupt-Related Software Defects"                                              \
3385                     "0"                                                                               \                     "Interrupt-Related Software Defects"                                              \
3386                  ird0                                                                                 \                     "Interrupt-Related Software Defects"                                              \
3387                     "Interrupt-Related Software Defects"                                              \                     "Interrupt-Related Software Defects"                                              \
3388                     "Interrupt-Related Software Defects"                                              \                     "F"                                                                               \
3389                     "Interrupt-Related Software Defects"                                              \                     "F"                                                                               \
3390                     "Interrupt-Related Software Defects"                                              \                     "0"                                                                               \
3391                     "F"                                                                               \                  isa1                                                                                 \
3392                     "F"                                                                               \                     "Introduction and Server Architecture"                                            \
3393                     "0"                                                                               \                     "Introduction and Server Architecture"                                            \
3394                  isa1                                                                                 \                     "Introduction and Server Architecture"                                            \
3395                     "Introduction and Server Architecture"                                            \                     "Introduction and Server Architecture"                                            \
3396                     "Introduction and Server Architecture"                                            \                     "F"                                                                               \
3397                     "Introduction and Server Architecture"                                            \                     "F"                                                                               \
3398                     "Introduction and Server Architecture"                                            \                     "0"                                                                               \
3399                     "F"                                                                               \                  isk0                                                                                 \
3400                     "F"                                                                               \                     "Insektengericht And Lessons Learned"                                             \
3401                     "0"                                                                               \                     "Insektengericht And Lessons Learned"                                             \
3402                  isk0                                                                                 \                     "Insektengericht And Lessons Learned"                                             \
3403                     "Insektengericht And Lessons Learned"                                             \                     "Insektengericht And Lessons Learned"                                             \
3404                     "Insektengericht And Lessons Learned"                                             \                     "F"                                                                               \
3405                     "Insektengericht And Lessons Learned"                                             \                     "F"                                                                               \
3406                     "Insektengericht And Lessons Learned"                                             \                     "0"                                                                               \
3407                     "F"                                                                               \                  lie0                                                                                 \
3408                     "F"                                                                               \                     "Long Integer Extensions"                                                         \
3409                     "0"                                                                               \                     "Long Integer Extensions"                                                         \
3410                  lie0                                                                                 \                     "Long Integer Extensions"                                                         \
3411                     "Long Integer Extensions"                                                         \                     "Long Integer Extensions"                                                         \
3412                     "Long Integer Extensions"                                                         \                     "F"                                                                               \
3413                     "Long Integer Extensions"                                                         \                     "F"                                                                               \
3414                     "Long Integer Extensions"                                                         \                     "0"                                                                               \
3415                     "F"                                                                               \                  mpd0                                                                                 \
3416                     "F"                                                                               \                     "Management Of Product Development Materials"                                     \
3417                     "0"                                                                               \                     "Management Of Product Development Materials"                                     \
3418                  mpd0                                                                                 \                     "Management Of Product Development Materials"                                     \
3419                     "Management Of Product Development Materials"                                     \                     "Management Of Product Development Materials"                                     \
3420                     "Management Of Product Development Materials"                                     \                     "F"                                                                               \
3421                     "Management Of Product Development Materials"                                     \                     "F"                                                                               \
3422                     "Management Of Product Development Materials"                                     \                     "0"                                                                               \
3423                     "F"                                                                               \                  mtn0                                                                                 \
3424                     "F"                                                                               \                     "Miscellaneous Topics From Mathematics And Number Theory"                         \
3425                     "0"                                                                               \                     "Miscellaneous Mathematical Topics"                                               \
3426                  mtn0                                                                                 \                     "Miscellaneous Topics From Mathematics And Number Theory"                         \
3427                     "Miscellaneous Topics From Mathematics And Number Theory"                         \                     "Miscellaneous Mathematical Topics"                                               \
3428                     "Miscellaneous Mathematical Topics"                                               \                     "F"                                                                               \
3429                     "Miscellaneous Topics From Mathematics And Number Theory"                         \                     "F"                                                                               \
3430                     "Miscellaneous Mathematical Topics"                                               \                     "0"                                                                               \
3431                     "F"                                                                               \                  mul0                                                                                 \
3432                     "F"                                                                               \                     "Multiplication"                                                                  \
3433                     "0"                                                                               \                     "Multiplication"                                                                  \
3434                  mul0                                                                                 \                     "Multiplication"                                                                  \
3435                     "Multiplication"                                                                  \                     "Multiplication"                                                                  \
3436                     "Multiplication"                                                                  \                     "F"                                                                               \
3437                     "Multiplication"                                                                  \                     "F"                                                                               \
3438                     "Multiplication"                                                                  \                     "0"                                                                               \
3439                     "F"                                                                               \                  nam0                                                                                 \
3440                     "F"                                                                               \                     "Naming Conventions"                                                              \
3441                     "0"                                                                               \                     "Naming Conventions"                                                              \
3442                  nam0                                                                                 \                     "Naming Conventions"                                                              \
3443                     "Naming Conventions"                                                              \                     "Naming Conventions"                                                              \
3444                     "Naming Conventions"                                                              \                     "F"                                                                               \
3445                     "Naming Conventions"                                                              \                     "F"                                                                               \
3446                     "Naming Conventions"                                                              \                     "0"                                                                               \
3447                     "F"                                                                               \                  nnu0                                                                                 \
3448                     "F"                                                                               \                     "Non-Numerical Algorithms And Techniques"                                         \
3449                     "0"                                                                               \                     "Non-Numerical Algorithms And Techniques"                                         \
3450                  nnu0                                                                                 \                     "Non-Numerical Algorithms And Techniques"                                         \
3451                     "Non-Numerical Algorithms And Techniques"                                         \                     "Non-Numerical Algorithms And Techniques"                                         \
3452                     "Non-Numerical Algorithms And Techniques"                                         \                     "F"                                                                               \
3453                     "Non-Numerical Algorithms And Techniques"                                         \                     "F"                                                                               \
3454                     "Non-Numerical Algorithms And Techniques"                                         \                     "0"                                                                               \
3455                     "F"                                                                               \                  nth0                                                                                 \
3456                     "F"                                                                               \                     "Number Theory Extensions"                                                        \
3457                     "0"                                                                               \                     "Number Theory Extensions"                                                        \
3458                  nth0                                                                                 \                     "Number Theory Extensions"                                                        \
3459                     "Number Theory Extensions"                                                        \                     "Number Theory Extensions"                                                        \
3460                     "Number Theory Extensions"                                                        \                     "F"                                                                               \
3461                     "Number Theory Extensions"                                                        \                     "F"                                                                               \
3462                     "Number Theory Extensions"                                                        \                     "0"                                                                               \
3463                     "F"                                                                               \                  orq0                                                                                 \
3464                     "F"                                                                               \                     "Open Research Questions"                                                         \
3465                     "0"                                                                               \                     "Open Research Questions"                                                         \
3466                  orq0                                                                                 \                     "Open Research Questions"                                                         \
3467                     "Open Research Questions"                                                         \                     "Open Research Questions"                                                         \
3468                     "Open Research Questions"                                                         \                     "F"                                                                               \
3469                     "Open Research Questions"                                                         \                     "F"                                                                               \
3470                     "Open Research Questions"                                                         \                     "0"                                                                               \
3471                     "F"                                                                               \                  pbc0                                                                                 \
3472                     "F"                                                                               \                     "Product Build- And Configuration-Related Software Defects"                       \
3473                     "0"                                                                               \                     "Build And Configuration Defects"                                                 \
3474                  pbc0                                                                                 \                     "Product Build- And Configuration-Related Software Defects"                       \
3475                     "Product Build- And Configuration-Related Software Defects"                       \                     "Build And Configuration Defects"                                                 \
3476                     "Build And Configuration Defects"                                                 \                     "F"                                                                               \
3477                     "Product Build- And Configuration-Related Software Defects"                       \                     "F"                                                                               \
3478                     "Build And Configuration Defects"                                                 \                     "0"                                                                               \
3479                     "F"                                                                               \                  pco0                                                                                 \
3480                     "F"                                                                               \                     "General Practical Construction Of Embedded Software"                             \
3481                     "0"                                                                               \                     "General Practical Construction Of Embedded Software"                             \
3482                  pco0                                                                                 \                     "General Practical Construction Of Embedded Software"                             \
3483                     "General Practical Construction Of Embedded Software"                             \                     "General Practical Construction Of Embedded Software"                             \
3484                     "General Practical Construction Of Embedded Software"                             \                     "F"                                                                               \
3485                     "General Practical Construction Of Embedded Software"                             \                     "F"                                                                               \
3486                     "General Practical Construction Of Embedded Software"                             \                     "0"                                                                               \
3487                     "F"                                                                               \                  pit0                                                                                 \
3488                     "F"                                                                               \                     "Practical Interface And Test Circuits"                                           \
3489                     "0"                                                                               \                     "Practical Interface And Test Circuits"                                           \
3490                  pit0                                                                                 \                     "Practical Interface And Test Circuits"                                           \
3491                     "Practical Interface And Test Circuits"                                           \                     "Practical Interface And Test Circuits"                                           \
3492                     "Practical Interface And Test Circuits"                                           \                     "F"                                                                               \
3493                     "Practical Interface And Test Circuits"                                           \                     "F"                                                                               \
3494                     "Practical Interface And Test Circuits"                                           \                     "0"                                                                               \
3495                     "F"                                                                               \                  pri0                                                                                 \
3496                     "F"                                                                               \                     "Integers, Prime Numbers, And Related Topics"                                     \
3497                     "0"                                                                               \                     "Integers, Primes, And Related Topics"                                            \
3498                  pri0                                                                                 \                     "Integers, Prime Numbers, And Related Topics"                                     \
3499                     "Integers, Prime Numbers, And Related Topics"                                     \                     "Integers, Primes, And Related Topics"                                            \
3500                     "Integers, Primes, And Related Topics"                                            \                     "F"                                                                               \
3501                     "Integers, Prime Numbers, And Related Topics"                                     \                     "F"                                                                               \
3502                     "Integers, Primes, And Related Topics"                                            \                     "0"                                                                               \
3503                     "F"                                                                               \                  prs0                                                                                 \
3504                     "F"                                                                               \                     "Solutions:  Integers, Prime Numbers, And Related Topics"                         \
3505                     "0"                                                                               \                     "Solutions:  Integers, Primes, And Related Topics"                                \
3506                  prs0                                                                                 \                     "Solutions:  Integers, Prime Numbers, And Related Topics"                         \
3507                     "Solutions:  Integers, Prime Numbers, And Related Topics"                         \                     "Solutions:  Integers, Primes, And Related Topics"                                \
3508                     "Solutions:  Integers, Primes, And Related Topics"                                \                     "F"                                                                               \
3509                     "Solutions:  Integers, Prime Numbers, And Related Topics"                         \                     "F"                                                                               \
3510                     "Solutions:  Integers, Primes, And Related Topics"                                \                     "0"                                                                               \
3511                     "F"                                                                               \                  pxf0                                                                                 \
3512                     "F"                                                                               \                     "Products Of Exceptional Functionality"                                           \
3513                     "0"                                                                               \                     "Products Of Exceptional Functionality"                                           \
3514                  pxf0                                                                                 \                     "Products Of Exceptional Functionality"                                           \
3515                     "Products Of Exceptional Functionality"                                           \                     "Products Of Exceptional Functionality"                                           \
3516                     "Products Of Exceptional Functionality"                                           \                     "F"                                                                               \
3517                     "Products Of Exceptional Functionality"                                           \                     "F"                                                                               \
3518                     "Products Of Exceptional Functionality"                                           \                     "0"                                                                               \
3519                     "F"                                                                               \                  qua0                                                                                 \
3520                     "F"                                                                               \                     "Quantization"                                                                    \
3521                     "0"                                                                               \                     "Quantization"                                                                    \
3522                  qua0                                                                                 \                     "Quantization"                                                                    \
3523                     "Quantization"                                                                    \                     "Quantization"                                                                    \
3524                     "Quantization"                                                                    \                     "F"                                                                               \
3525                     "Quantization"                                                                    \                     "F"                                                                               \
3526                     "Quantization"                                                                    \                     "0"                                                                               \
3527                     "F"                                                                               \                  rat0                                                                                 \
3528                     "F"                                                                               \                     "Rational Approximation"                                                          \
3529                     "0"                                                                               \                     "Rational Approximation"                                                          \
3530                  rat0                                                                                 \                     "Rational Approximation"                                                          \
3531                     "Rational Approximation"                                                          \                     "Rational Approximation"                                                          \
3532                     "Rational Approximation"                                                          \                     "F"                                                                               \
3533                     "Rational Approximation"                                                          \                     "F"                                                                               \
3534                     "Rational Approximation"                                                          \                     "0"                                                                               \
3535                     "F"                                                                               \                  ras0                                                                                 \
3536                     "F"                                                                               \                     "Solutions:  Rational Approximation"                                              \
3537                     "0"                                                                               \                     "Solutions:  Rational Approximation"                                              \
3538                  ras0                                                                                 \                     "Solutions:  Rational Approximation"                                              \
3539                     "Solutions:  Rational Approximation"                                              \                     "Solutions:  Rational Approximation"                                              \
3540                     "Solutions:  Rational Approximation"                                              \                     "F"                                                                               \
3541                     "Solutions:  Rational Approximation"                                              \                     "F"                                                                               \
3542                     "Solutions:  Rational Approximation"                                              \                     "0"                                                                               \
3543                     "F"                                                                               \                  rcs0                                                                                 \
3544                     "F"                                                                               \                     "Ratiometric Conversion And Measurement Systems"                                  \
3545                     "0"                                                                               \                     "Ratiometric Measurement Systems"                                                 \
3546                  rcs0                                                                                 \                     "Ratiometric Conversion And Measurement Systems"                                  \
3547                     "Ratiometric Conversion And Measurement Systems"                                  \                     "Ratiometric Measurement Systems"                                                 \
3548                     "Ratiometric Measurement Systems"                                                 \                     "F"                                                                               \
3549                     "Ratiometric Conversion And Measurement Systems"                                  \                     "F"                                                                               \
3550                     "Ratiometric Measurement Systems"                                                 \                     "0"                                                                               \
3551                     "F"                                                                               \                  rnd1                                                                                 \
3552                     "F"                                                                               \                     "Random Number Generation Extensions"                                             \
3553                     "0"                                                                               \                     "Random Number Generation Extensions"                                             \
3554                  rnd1                                                                                 \                     "Random Number Generation Extensions"                                             \
3555                     "Random Number Generation Extensions"                                             \                     "Random Number Generation Extensions"                                             \
3556                     "Random Number Generation Extensions"                                             \                     "F"                                                                               \
3557                     "Random Number Generation Extensions"                                             \                     "F"                                                                               \
3558                     "Random Number Generation Extensions"                                             \                     "0"                                                                               \
3559                     "F"                                                                               \                  rne0                                                                                 \
3560                     "F"                                                                               \                     "Rational Number Extensions"                                                      \
3561                     "0"                                                                               \                     "Rational Number Extensions"                                                      \
3562                  rne0                                                                                 \                     "Rational Number Extensions"                                                      \
3563                     "Rational Number Extensions"                                                      \                     "Rational Number Extensions"                                                      \
3564                     "Rational Number Extensions"                                                      \                     "F"                                                                               \
3565                     "Rational Number Extensions"                                                      \                     "F"                                                                               \
3566                     "Rational Number Extensions"                                                      \                     "0"                                                                               \
3567                     "F"                                                                               \                  rta0                                                                                 \
3568                     "F"                                                                               \                     "Real-Time Analysis"                                                              \
3569                     "0"                                                                               \                     "Real-Time Analysis"                                                              \
3570                  rta0                                                                                 \                     "Real-Time Analysis"                                                              \
3571                     "Real-Time Analysis"                                                              \                     "Real-Time Analysis"                                                              \
3572                     "Real-Time Analysis"                                                              \                     "F"                                                                               \
3573                     "Real-Time Analysis"                                                              \                     "F"                                                                               \
3574                     "Real-Time Analysis"                                                              \                     "0"                                                                               \
3575                     "F"                                                                               \                  sds0                                                                                 \
3576                     "F"                                                                               \                     "Standard Directory Structures"                                                   \
3577                     "0"                                                                               \                     "Standard Directory Structures"                                                   \
3578                  sds0                                                                                 \                     "Standard Directory Structures"                                                   \
3579                     "Standard Directory Structures"                                                   \                     "Standard Directory Structures"                                                   \
3580                     "Standard Directory Structures"                                                   \                     "F"                                                                               \
3581                     "Standard Directory Structures"                                                   \                     "F"                                                                               \
3582                     "Standard Directory Structures"                                                   \                     "0"                                                                               \
3583                     "F"                                                                               \                  sfo0                                                                                 \
3584                     "F"                                                                               \                     "Support Of Frequently-Occurring Requirements"                                    \
3585                     "0"                                                                               \                     "Support Of Frequently-Occurring Requirements"                                    \
3586                  sfo0                                                                                 \                     "Support Of Frequently-Occurring Requirements"                                    \
3587                     "Support Of Frequently-Occurring Requirements"                                    \                     "Support Of Frequently-Occurring Requirements"                                    \
3588                     "Support Of Frequently-Occurring Requirements"                                    \                     "F"                                                                               \
3589                     "Support Of Frequently-Occurring Requirements"                                    \                     "F"                                                                               \
3590                     "Support Of Frequently-Occurring Requirements"                                    \                     "0"                                                                               \
3591                     "F"                                                                               \                  snc0                                                                                 \
3592                     "F"                                                                               \                     "Support Of Communication Protocols And Networks"                                 \
3593                     "0"                                                                               \                     "Support Of Communication Protocols And Networks"                                 \
3594                  snc0                                                                                 \                     "Support Of Communication Protocols And Networks"                                 \
3595                     "Support Of Communication Protocols And Networks"                                 \                     "Support Of Communication Protocols And Networks"                                 \
3596                     "Support Of Communication Protocols And Networks"                                 \                     "F"                                                                               \
3597                     "Support Of Communication Protocols And Networks"                                 \                     "F"                                                                               \
3598                     "Support Of Communication Protocols And Networks"                                 \                     "0"                                                                               \
3599                     "F"                                                                               \                  soc0                                                                                 \
3600                     "F"                                                                               \                     "Support Of On-Chip Peripherals And Subsystems"                                   \
3601                     "0"                                                                               \                     "Support Of On-Chip Peripherals And Subsystems"                                   \
3602                  soc0                                                                                 \                     "Support Of On-Chip Peripherals And Subsystems"                                   \
3603                     "Support Of On-Chip Peripherals And Subsystems"                                   \                     "Support Of On-Chip Peripherals And Subsystems"                                   \
3604                     "Support Of On-Chip Peripherals And Subsystems"                                   \                     "F"                                                                               \
3605                     "Support Of On-Chip Peripherals And Subsystems"                                   \                     "F"                                                                               \
3606                     "Support Of On-Chip Peripherals And Subsystems"                                   \                     "0"                                                                               \
3607                     "F"                                                                               \                  soc1                                                                                 \
3608                     "F"                                                                               \                     "Support Of Off-Chip Peripherals And Subsystems"                                  \
3609                     "0"                                                                               \                     "Off-Chip Peripherals And Subsystems"                                             \
3610                  soc1                                                                                 \                     "Support Of Off-Chip Peripherals And Subsystems"                                  \
3611                     "Support Of Off-Chip Peripherals And Subsystems"                                  \                     "Off-Chip Peripherals And Subsystems"                                             \
3612                     "Off-Chip Peripherals And Subsystems"                                  \                     "F"                                                                               \
3613                     "Support Of Off-Chip Peripherals And Subsystems"                                  \                     "F"                                                                               \
3614                     "Off-Chip Peripherals And Subsystems"                                  \                     "0"                                                                               \
3615                     "F"                                                                               \                  sub0                                                                                 \
3616                     "F"                                                                               \                     "Subtraction"                                                                     \
3617                     "0"                                                                               \                     "Subtraction"                                                                     \
3618                  sub0                                                                                 \                     "Subtraction"                                                                     \
3619                     "Subtraction"                                                                     \                     "Subtraction"                                                                     \
3620                     "Subtraction"                                                                     \                     "F"                                                                               \
3621                     "Subtraction"                                                                     \                     "F"                                                                               \
3622                     "Subtraction"                                                                     \                     "0"                                                                               \
3623                     "F"                                                                               \                  tcm0                                                                                 \
3624                     "F"                                                                               \                     "Tcl Command Reference"                                                           \
3625                     "0"                                                                               \                     "Tcl Command Reference"                                                           \
3626                  tcm0                                                                                 \                     "Tcl Command Reference"                                                           \
3627                     "Tcl Command Reference"                                                           \                     "Tcl Command Reference"                                                           \
3628                     "Tcl Command Reference"                                                           \                     "F"                                                                               \
3629                     "Tcl Command Reference"                                                           \                     "F"                                                                               \
3630                     "Tcl Command Reference"                                                           \                     "0"                                                                               \
3631                     "F"                                                                               \                  tin0                                                                                 \
3632                     "F"                                                                               \                     "Introduction And Overview Of The ESRG Tool Set"                                  \
3633                     "0"                                                                               \                     "ESRG Tool Set Overview/Introduction"                                             \
3634                  tin0                                                                                 \                     "Introduction And Overview Of The ESRG Tool Set"                                  \
3635                     "Introduction And Overview Of The ESRG Tool Set"                                  \                     "ESRG Tool Set Overview/Introduction"                                             \
3636                     "ESRG Tool Set Overview/Introduction"                                             \                     "F"                                                                               \
3637                     "Introduction And Overview Of The ESRG Tool Set"                                  \                     "F"                                                                               \
3638                     "ESRG Tool Set Overview/Introduction"                                             \                     "0"                                                                               \
3639                     "F"                                                                               \                  tkm0                                                                                 \
3640                     "F"                                                                               \                     "Tk Command Reference"                                                            \
3641                     "0"                                                                               \                     "Tk Command Reference"                                                            \
3642                  tkm0                                                                                 \                     "Tk Command Reference"                                                            \
3643                     "Tk Command Reference"                                                            \                     "Tk Command Reference"                                                            \
3644                     "Tk Command Reference"                                                            \                     "F"                                                                               \
3645                     "Tk Command Reference"                                                            \                     "F"                                                                               \
3646                     "Tk Command Reference"                                                            \                     "0"                                                                               \
3647                     "F"                                                                               \                  vct0                                                                                 \
3648                     "F"                                                                               \                     "Version Control Extensions"                                                      \
3649                     "0"                                                                               \                     "Version Control Extensions"                                                      \
3650                  vct0                                                                                 \                     "Version Control Extensions"                                                      \
3651                     "Version Control Extensions"                                                      \                     "Version Control Extensions"                                                      \
3652                     "Version Control Extensions"                                                      \                     "F"                                                                               \
3653                     "Version Control Extensions"                                                      \                     "F"                                                                               \
3654                     "Version Control Extensions"                                                      \                     "0"                                                                               \
3655                     "F"                                                                               \                  wrl0                                                                                 \
3656                     "F"                                                                               \                     "Watchdog-Related Lessons Learned"                                                \
3657                     "0"                                                                               \                     "Watchdog-Related Lessons Learned"                                                \
3658                  wrl0                                                                                 \                     "Watchdog-Related Lessons Learned"                                                \
3659                     "Watchdog-Related Lessons Learned"                                                \                     "Watchdog-Related Lessons Learned"                                                \
3660                     "Watchdog-Related Lessons Learned"                                                \                     "F"                                                                               \
3661                     "Watchdog-Related Lessons Learned"                                                \                     "F"                                                                               \
3662                     "Watchdog-Related Lessons Learned"                                                \                     "0"                                                                               \
3663                     "F"                                                                               \                  xtn0                                                                                 \
3664                     "F"                                                                               \                     "Tcl/Tk Extensions"                                                               \
3665                     "0"                                                                               \                     "Tcl/Tk Extensions"                                                               \
3666                  xtn0                                                                                 \                     "Tcl/Tk Extensions"                                                               \
3667                     "Tcl/Tk Extensions"                                                               \                     "Tcl/Tk Extensions"                                                               \
3668                     "Tcl/Tk Extensions"                                                               \                     "F"                                                                               \
3669                     "Tcl/Tk Extensions"                                                               \                     "F"                                                                               \
3670                     "Tcl/Tk Extensions"                                                               \                     "0"                                                                               \
3671                     "F"                                                                               \                  }
3672                     "F"                                                                               \  
3673                     "0"                                                                               \  set chapterListStructSize 8
3674                  }     # The number of physical records per logical record.  Makes modifications easier if records added
3675       # to end.
3676  set chapterListStructSize 8  
3677     # The number of physical records per logical record.  Makes modifications easier if records added  set chapterListIndex(NOT_USED) 0
3678     # to end.     #Used to initialize the associative index array for the book chapters, so there are
3679       #no problems declaring it global to procs before it is first defined.  This index
3680  set chapterListIndex(NOT_USED) 0     #is associative by the 4-character chapter code, and stores an integer which is the
3681     #Used to initialize the associative index array for the book chapters, so there are     #base array index into the group of info for that chapter name.  This is done to
3682     #no problems declaring it global to procs before it is first defined.  This index     #avoid repeated searches of the entire space.  I would guess the Tcl hash function
3683     #is associative by the 4-character chapter code, and stores an integer which is the     #is faster than a linear search.
3684     #base array index into the group of info for that chapter name.  This is done to  
3685     #avoid repeated searches of the entire space.  I would guess the Tcl hash function  
3686     #is faster than a linear search.  # This is the master compilation list.  This indicates the bindings between volumes and chapters
3687    # and so forth.  The two major compilation themes are "Single-Volume" (the entire book in one
3688    # document) and "Multi-Volume" (the work is broken up into volumes).  Each type of compilation loops
3689  # This is the master compilation list.  This indicates the bindings between volumes and chapters  # through the list to extract the records of interest to it.  There is commonization possible, but it
3690  # and so forth.  The two major compilation themes are "Single-Volume" (the entire book in one  # is also possible that the two types of work are disjoint enough that they are nearly separate.  The
3691  # document) and "Multi-Volume" (the work is broken up into volumes).  Each type of compilation loops  # list format accomodates both.  Each list item is a record, with the record type followed by three
3692  # through the list to extract the records of interest to it.  There is commonization possible, but it  # parameters, any or all of which may be optional.  Record types are as follows:
3693  # is also possible that the two types of work are disjoint enough that they are nearly separate.  The  #
3694  # list format accomodates both.  Each list item is a record, with the record type followed by three  # v:  Start of a new volume.  In this case, par1 is the 4-character tag of the volume.  par2
3695  # parameters, any or all of which may be optional.  Record types are as follows:  #     and par3 are ignored.
3696  #  #
3697  # v:  Start of a new volume.  In this case, par1 is the 4-character tag of the volume.  par2  # p:  Start of a new part.  In this case, there are two possibilities.  par1 may indicate the
3698  #     and par3 are ignored.  #     4-character tag of the volume to use for info (the part name is extracted from there), or par2 may
3699  #  #     indicate the actual title of the part.
3700  # p:  Start of a new part.  In this case, there are two possibilities.  par1 may indicate the  #
3701  #     4-character tag of the volume to use for info (the part name is extracted from there), or par2 may  # w:  Start of both new volume and new part.  par1 contains the 4-character tag of the volume,
3702  #     indicate the actual title of the part.  #     and par2 contains an optional title string.  The volume title is always taken from the data
3703  #  #     for par1.  The part name is taken from the same data if par2 is empty, or else par2 overrides
3704  # w:  Start of both new volume and new part.  par1 contains the 4-character tag of the volume,  #     the part name.  par3 is ignored.
3705  #     and par2 contains an optional title string.  The volume title is always taken from the data  #
3706  #     for par1.  The part name is taken from the same data if par2 is empty, or else par2 overrides  # c:  Volume chapter.  par1 provides the 4-character chapter tag.  par2 and par3 are ignored.
3707  #     the part name.  par3 is ignored.  #
3708  #  # d:  Part chapter.  par1 provides the 4-character chapter tag.  par2 and par3 are ignored.
3709  # c:  Volume chapter.  par1 provides the 4-character chapter tag.  par2 and par3 are ignored.  #
3710  #  # e:  Both volume and part chapter.  par1 provides the 4-character chapter tag.  par2 and par3 are
3711  # d:  Part chapter.  par1 provides the 4-character chapter tag.  par2 and par3 are ignored.  #     ignored.
3712  #  #
3713  # e:  Both volume and part chapter.  par1 provides the 4-character chapter tag.  par2 and par3 are  # y:  Beginning of "appendix" matter of volume of multi-volume work.  par1, par2, and par3 are ignored.
3714  #     ignored.  #
3715  #  # z:  Beginning of "appendix" matter of single-volume work.  par1, par2, and par3 are ignored.
3716  # y:  Beginning of "appendix" matter of volume of multi-volume work.  par1, par2, and par3 are ignored.  #
3717  #  # Based on this table plus the volume and chapter tables earlier, this Tcl script prepares the following files:
3718  # z:  Beginning of "appendix" matter of single-volume work.  par1, par2, and par3 are ignored.  #   svf.tex
3719  #  #      The single-volume final master TEX file.
3720  # Based on this table plus the volume and chapter tables earlier, this Tcl script prepares the following files:  #   svd.tex
3721  #   svf.tex  #      The single-volume draft master TEX file.
3722  #      The single-volume final master TEX file.  #   ????f.tex
3723  #   svd.tex  #      For each volume, the master volume final TEX file.
3724  #      The single-volume draft master TEX file.  #   ????d.tex
3725  #   ????f.tex  #      For each volume, the master volume draft TEX file.
3726  #      For each volume, the master volume final TEX file.  #
3727  #   ????d.tex  # The differentiation between "final" and "draft" is that in a "final" work, the chapters marked as
3728  #      For each volume, the master volume draft TEX file.  # draft aren't included.
3729  #  #  
3730  # The differentiation between "final" and "draft" is that in a "final" work, the chapters marked as  set mcl {
3731  # draft aren't included.          "v"                                                                                                   \
3732  #            "con0"                                                                                                \
3733  set mcl {          ""                                                                                                    \
3734          "v"                                                                                                   \          ""                                                                                                    \
3735          "con0"                                                                                                \          "p"                                                                                                   \
3736          ""                                                                                                    \          ""                                                                                                    \
3737          ""                                                                                                    \          "Concepts"                                                                                            \
3738          "p"                                                                                                   \          ""                                                                                                    \
3739          ""                                                                                                    \          "e"                                                                                                   \
3740          "Concepts"                                                                                            \          "int0"                                                                                                \
3741          ""                                                                                                    \          ""                                                                                                    \
3742          "e"                                                                                                   \          ""                                                                                                    \
3743          "int0"                                                                                                \          "e"                                                                                                   \
3744          ""                                                                                                    \          "hgr0"                                                                                                \
3745          ""                                                                                                    \          ""                                                                                                    \
3746          "e"                                                                                                   \          ""                                                                                                    \
3747          "hgr0"                                                                                                \          "y"                                                                                                   \
3748          ""                                                                                                    \          ""                                                                                                    \
3749          ""                                                                                                    \          ""                                                                                                    \
3750          "y"                                                                                                   \          ""                                                                                                    \
3751          ""                                                                                                    \          "w"                                                                                                   \
3752          ""                                                                                                    \          "mfr0"                                                                                                \
3753          ""                                                                                                    \          ""                                                                                                    \
3754          "w"                                                                                                   \          ""                                                                                                    \
3755          "mfr0"                                                                                                \          "e"                                                                                                   \
3756          ""                                                                                                    \          "pri0"                                                                                                \
3757          ""                                                                                                    \          ""                                                                                                    \
3758          "e"                                                                                                   \          ""                                                                                                    \
3759          "pri0"                                                                                                \          "e"                                                                                                   \
3760          ""                                                                                                    \          "fry0"                                                                                                \
3761          ""                                                                                                    \          ""                                                                                                    \
3762          "e"                                                                                                   \          ""                                                                                                    \
3763          "fry0"                                                                                                \          "e"                                                                                                   \
3764          ""                                                                                                    \          "cfr0"                                                                                                \
3765          ""                                                                                                    \          ""                                                                                                    \
3766          "e"                                                                                                   \          ""                                                                                                    \
3767          "cfr0"                                                                                                \          "e"                                                                                                   \
3768          ""                                                                                                    \          "edc0"                                                                                                \
3769          ""                                                                                                    \          ""                                                                                                    \
3770          "e"                                                                                                   \          ""                                                                                                    \
3771          "edc0"                                                                                                \          "e"                                                                                                   \
3772          ""                                                                                                    \          "bal0"                                                                                                \
3773          ""                                                                                                    \          ""                                                                                                    \
3774          "e"                                                                                                   \          ""                                                                                                    \
3775          "bal0"                                                                                                \          "e"                                                                                                   \
3776          ""                                                                                                    \          "qua0"                                                                                                \
3777          ""                                                                                                    \          ""                                                                                                    \
3778          "e"                                                                                                   \          ""                                                                                                    \
3779          "qua0"                                                                                                \          "e"                                                                                                   \
3780          ""                                                                                                    \          "mtn0"                                                                                                \
3781          ""                                                                                                    \          ""                                                                                                    \
3782          "e"                                                                                                   \          ""                                                                                                    \
3783          "mtn0"                                                                                                \          "w"                                                                                                   \
3784          ""                                                                                                    \          "csw0"                                                                                                \
3785          ""                                                                                                    \          ""                                                                                                    \
3786          "w"                                                                                                   \          ""                                                                                                    \
3787          "csw0"                                                                                                \          "e"                                                                                                   \
3788          ""                                                                                                    \          "pco0"                                                                                                \
3789          ""                                                                                                    \          ""                                                                                                    \
3790          "e"                                                                                                   \          ""                                                                                                    \
3791          "pco0"                                                                                                \          "e"                                                                                                   \
3792          ""                                                                                                    \          "soc0"                                                                                                \
3793          ""                                                                                                    \          ""                                                                                                    \
3794          "e"                                                                                                   \          ""                                                                                                    \
3795          "soc0"                                                                                                \          "e"                                                                                                   \
3796          ""                                                                                                    \          "soc1"                                                                                                \
3797          ""                                                                                                    \          ""                                                                                                    \
3798          "e"                                                                                                   \          ""                                                                                                    \
3799          "soc1"                                                                                                \          "e"                                                                                                   \
3800          ""                                                                                                    \          "snc0"                                                                                                \
3801          ""                                                                                                    \          ""                                                                                                    \
3802          "e"                                                                                                   \          ""                                                                                                    \
3803          "snc0"                                                                                                \          "e"                                                                                                   \
3804          ""                                                                                                    \          "sfo0"                                                                                                \
3805          ""                                                                                                    \          ""                                                                                                    \
3806          "e"                                                                                                   \          ""                                                                                                    \
3807          "sfo0"                                                                                                \          "e"                                                                                                   \
3808          ""                                                                                                    \          "rta0"                                                                                                \
3809          ""                                                                                                    \          ""                                                                                                    \
3810          "e"                                                                                                   \          ""                                                                                                    \
3811          "rta0"                                                                                                \          "w"                                                                                                   \
3812          ""                                                                                                    \          "alg0"                                                                                                \
3813          ""                                                                                                    \          ""                                                                                                    \
3814          "w"                                                                                                   \          ""                                                                                                    \
3815          "alg0"                                                                                                \          "e"                                                                                                   \
3816          ""                                                                                                    \          "cil0"                                                                                                \
3817          ""                                                                                                    \          ""                                                                                                    \
3818          "e"                                                                                                   \          ""                                                                                                    \
3819          "cil0"                                                                                                \          "e"                                                                                                   \
3820          ""                                                                                                    \          "rat0"                                                                                                \
3821          ""                                                                                                    \          ""                                                                                                    \
3822          "e"                                                                                                   \          ""                                                                                                    \
3823          "rat0"                                                                                                \          "e"                                                                                                   \
3824          ""                                                                                                    \          "dta0"                                                                                                \
3825          ""                                                                                                    \          ""                                                                                                    \
3826          "e"                                                                                                   \          ""                                                                                                    \
3827          "dta0"                                                                                                \          "e"                                                                                                   \
3828          ""                                                                                                    \          "nnu0"                                                                                                \
3829          ""                                                                                                    \          ""                                                                                                    \
3830          "e"                                                                                                   \          ""                                                                                                    \
3831          "nnu0"                                                                                                \          "w"                                                                                                   \
3832          ""                                                                                                    \          "pac0"                                                                                                \
3833          ""                                                                                                    \          ""                                                                                                    \
3834          "w"                                                                                                   \          ""                                                                                                    \
3835          "pac0"                                                                                                \          "e"                                                                                                   \
3836          ""                                                                                                    \          "mpd0"                                                                                                \
3837          ""                                                                                                    \          ""                                                                                                    \
3838          "e"                                                                                                   \          ""                                                                                                    \
3839          "mpd0"                                                                                                \          "e"                                                                                                   \
3840          ""                                                                                                    \          "pit0"                                                                                                \
3841          ""                                                                                                    \          ""                                                                                                    \
3842          "e"                                                                                                   \          ""                                                                                                    \
3843          "pit0"                                                                                                \          "e"                                                                                                   \
3844          ""                                                                                                    \          "bma0"                                                                                                \
3845          ""                                                                                                    \          ""                                                                                                    \
3846          "e"                                                                                                   \          ""                                                                                                    \
3847          "bma0"                                                                                                \          "e"                                                                                                   \
3848          ""                                                                                                    \          "pxf0"                                                                                                \
3849          ""                                                                                                    \          ""                                                                                                    \
3850          "e"                                                                                                   \          ""                                                                                                    \
3851          "pxf0"                                                                                                \          "e"                                                                                                   \
3852          ""                                                                                                    \          "orq0"                                                                                                \
3853          ""                                                                                                    \          ""                                                                                                    \
3854          "e"                                                                                                   \          ""                                                                                                    \
3855          "orq0"                                                                                                \          "e"                                                                                                   \
3856          ""                                                                                                    \          "isk0"                                                                                                \
3857          ""                                                                                                    \          ""                                                                                                    \
3858          "e"                                                                                                   \          ""                                                                                                    \
3859          "isk0"                                                                                                \          "w"                                                                                                   \
3860          ""                                                                                                    \          "ijt0"                                                                                                \
3861          ""                                                                                                    \          ""                                                                                                    \
3862          "w"                                                                                                   \          ""                                                                                                    \
3863          "ijt0"                                                                                                \          "e"                                                                                                   \
3864          ""                                                                                                    \          "tin0"                                                                                                \
3865          ""                                                                                                    \          ""                                                                                                    \
3866          "e"                                                                                                   \          ""                                                                                                    \
3867          "tin0"                                                                                                \          "e"                                                                                                   \
3868          ""                                                                                                    \          "tcm0"                                                                                                \
3869          ""                                                                                                    \          ""                                                                                                    \
3870          "e"                                                                                                   \          ""                                                                                                    \
3871          "tcm0"                                                                                                \          "e"                                                                                                   \
3872          ""                                                                                                    \          "tkm0"                                                                                                \
3873          ""                                                                                                    \          ""                                                                                                    \
3874          "e"                                                                                                   \          ""                                                                                                    \
3875          "tkm0"                                                                                                \          "e"                                                                                                   \
3876          ""                                                                                                    \          "faq0"                                                                                                \
3877          ""                                                                                                    \          ""                                                                                                    \
3878          "e"                                                                                                   \          ""                                                                                                    \
3879          "faq0"                                                                                                \          "e"                                                                                                   \
3880          ""                                                                                                    \          "xtn0"                                                                                                \
3881          ""                                                                                                    \          ""                                                                                                    \
3882          "e"                                                                                                   \          ""                                                                                                    \
3883          "xtn0"                                                                                                \          "e"                                                                                                   \
3884          ""                                                                                                    \          "dcm0"                                                                                                \
3885          ""                                                                                                    \          ""                                                                                                    \
3886          "e"                                                                                                   \          ""                                                                                                    \
3887          "dcm0"                                                                                                \          "w"                                                                                                   \
3888          ""                                                                                                    \          "ijv0"                                                                                                \
3889          ""                                                                                                    \          ""                                                                                                    \
3890          "w"                                                                                                   \          ""                                                                                                    \
3891          "ijv0"                                                                                                \          "e"                                                                                                   \
3892          ""                                                                                                    \          "isa1"                                                                                                \
3893          ""                                                                                                    \          ""                                                                                                    \
3894          "e"                                                                                                   \          ""                                                                                                    \
3895          "isa1"                                                                                                \          "e"                                                                                                   \
3896          ""                                                                                                    \          "css1"                                                                                                \
3897          ""                                                                                                    \          ""                                                                                                    \
3898          "e"                                                                                                   \          ""                                                                                                    \
3899          "css1"                                                                                                \          "w"                                                                                                   \
3900          ""                                                                                                    \          "sma0"                                                                                                \
3901          ""                                                                                                    \          ""                                                                                                    \
3902          "w"                                                                                                   \          ""                                                                                                    \
3903          "sma0"                                                                                                \          "e"                                                                                                   \
3904          ""                                                                                                    \          "prs0"                                                                                                \
3905          ""                                                                                                    \          ""                                                                                                    \
3906          "e"                                                                                                   \          ""                                                                                                    \
3907          "prs0"                                                                                                \          "e"                                                                                                   \
3908          ""                                                                                                    \          "frs0"                                                                                                \
3909          ""                                                                                                    \          ""                                                                                                    \
3910          "e"                                                                                                   \          ""                                                                                                    \
3911          "frs0"                                                                                                \          "e"                                                                                                   \
3912          ""                                                                                                    \          "cfs0"                                                                                                \
3913          ""                                                                                                    \          ""                                                                                                    \
3914          "e"                                                                                                   \          ""                                                                                                    \
3915          "cfs0"                                                                                                \          "e"                                                                                                   \
3916          ""                                                                                                    \          "eds0"                                                                                                \
3917          ""                                                                                                    \          ""                                                                                                    \
3918          "e"                                                                                                   \          ""                                                                                                    \
3919          "eds0"                                                                                                \          "e"                                                                                                   \
3920          ""                                                                                                    \          "bas0"                                                                                                \
3921          ""                                                                                                    \          ""                                                                                                    \
3922          "e"                                                                                                   \          ""                                                                                                    \
3923          "bas0"                                                                                                \          "e"                                                                                                   \
3924          ""                                                                                                    \          "cis0"                                                                                              \
3925          ""                                                                                                    \          ""                                                                                                    \
3926          "e"                                                                                                   \          ""                                                                                                    \
3927          "cis0"                                                                                              \          "e"                                                                                                   \
3928          ""                                                                                                    \          "ras0"                                                                                                \
3929          ""                                                                                                    \          ""                                                                                                    \
3930          "e"                                                                                                   \          ""                                                                                                    \
3931          "ras0"                                                                                                \          "p"                                                                                                   \
3932          ""                                                                                                    \          ""                                                                                                    \
3933          ""                                                                                                    \          "Glossaries, Bibliography, And Index"                                                                                            \
3934          "p"                                                                                                   \          ""                                                                                                    \
3935          ""                                                                                                    \          "z"                                                                                                   \
3936          "Glossaries, Bibliography, And Index"                                                                                            \          ""                                                                                                    \
3937          ""                                                                                                    \          ""                                                                                                    \
3938          "z"                                                                                                   \          ""                                                                                                    \
3939          ""                                                                                                    \          }
3940          ""                                                                                                    \  
3941          ""                                                                                                    \  #List which gives instructions for forming the _README_.HTM file.  Each string in the
3942          }  #list is one of the following types:
3943    #  F:  filename : specifies a filename to be incorporated as a link.  Also used
3944  #List which gives instructions for forming the _README_.HTM file.  Each string in the  #      as a reference to copy files which will eventually go into the CD for
3945  #list is one of the following types:  #      the book.  If it doesn't appear in this list and in the _README_.HTM
3946  #  F:  filename : specifies a filename to be incorporated as a link.  Also used  #      file, it won't be copied.
3947  #      as a reference to copy files which will eventually go into the CD for  #  H:  Manually specified header.  This is a banner header with a title
3948  #      the book.  If it doesn't appear in this list and in the _README_.HTM  #      we get to specify.
3949  #      file, it won't be copied.  #  C:  Chapter header.  We use the chapter tag for this.
3950  #  H:  Manually specified header.  This is a banner header with a title  #  D:  Description line following filename.
3951  #      we get to specify.  #
3952  #  C:  Chapter header.  We use the chapter tag for this.  set readme_build_list {
3953  #  D:  Description line following filename.          "M:PDF Versions Of This Work"                                                                         \
3954  #          "F:SVF.PDF"                                                                                           \
3955  set readme_build_list {          "D:PDF version of the single-volume work."                                                            \
3956          "M:PDF Versions Of This Work"                                                                         \          "M:Outline Of This Work (And FTP Information)"                                                        \
3957          "F:SVF.PDF"                                                                                           \          "F:INDEX2.HTM"                                                                                        \
3958          "D:PDF version of the single-volume work."                                                            \          "D:Outline of this work.  Also includes information about how to obtain the complete set of LaTeX"    \
3959          "M:Outline Of This Work (And FTP Information)"                                                        \          "D:build materials via anonymous FTP."                                                                \
3960          "F:INDEX2.HTM"                                                                                        \          "M:Utility And Build Files"                                                                           \
3961          "D:Outline of this work.  Also includes information about how to obtain the complete set of LaTeX"    \          "F:_README_.HTM"                                                                                      \
3962          "D:build materials via anonymous FTP."                                                                \          "D:This file."                                                                                        \
3963          "M:Utility And Build Files"                                                                           \          "F:WBBKGNDS\\BKBLUE01.GIF"                                                                            \
3964          "F:_README_.HTM"                                                                                      \          "D:Blue background used for some HTML documents."                                                     \
3965          "D:This file."                                                                                        \          "F:WBBKGNDS\\BKYELL01.GIF"                                                                            \
3966          "F:WBBKGNDS\\BKBLUE01.GIF"                                                                            \          "D:Yellow background used for some HTML documents."                                                   \
3967          "D:Blue background used for some HTML documents."                                                     \          "F:SCRIPTS\\CP_SCRIPT.TCL"                                                                            \
3968          "F:WBBKGNDS\\BKYELL01.GIF"                                                                            \          "D:The Wish (i.e. Tcl/Tk) script used to build the book and peform utility functions"                 \
3969          "D:Yellow background used for some HTML documents."                                                   \          "D:(such as copying the resulting files to locations on the server in Dave Ashley's"                  \
3970          "F:SCRIPTS\\CP_SCRIPT.TCL"                                                                            \          "D:apartment).&nbsp; This script must be checked and modified to run on any computer"                 \
3971          "D:The Wish (i.e. Tcl/Tk) script used to build the book and peform utility functions"                 \          "D:(besides Dave Ashley's) because it makes assumptions about the location and presence"              \
3972          "D:(such as copying the resulting files to locations on the server in Dave Ashley's"                  \          "D:of LaTeX, LaTeX utilities, and other programs.&nbsp; To build the book without using"              \
3973          "D:apartment).&nbsp; This script must be checked and modified to run on any computer"                 \          "D:this script, use a LaTeX compiler to compile the file"                                             \
3974          "D:(besides Dave Ashley's) because it makes assumptions about the location and presence"              \          "D:<a href=\"svf.tex\">SVF.TEX</a>."                                                                  \
3975          "D:of LaTeX, LaTeX utilities, and other programs.&nbsp; To build the book without using"              \          "F:SCRIPTS\\IJC.EXE"                                                                                  \
3976          "D:this script, use a LaTeX compiler to compile the file"                                             \          "D:The statically compiled Wish interpreter used to interpret the Wish script above.&nbsp; This"      \
3977          "D:<a href=\"svf.tex\">SVF.TEX</a>."                                                                  \          "D:executable is usable &quot;as-is&quot;; however, the full distribution of this Wish interpreter"   \
3978          "F:SCRIPTS\\IJC.EXE"                                                                                  \          "D:can be obtained as <a href=\"http://www.digibuy.com/cgi-bin/product.html?97647721717\">Digibuy"    \
3979          "D:The statically compiled Wish interpreter used to interpret the Wish script above.&nbsp; This"      \          "D:Product \#97647721717</a>, and the full source code can be obtained as"                            \
3980          "D:executable is usable &quot;as-is&quot;; however, the full distribution of this Wish interpreter"   \          "D:<a href=\"http://www.digibuy.com/cgi-bin/product.html?97647784511\">Digibuy Product"               \
3981          "D:can be obtained as <a href=\"http://www.digibuy.com/cgi-bin/product.html?97647721717\">Digibuy"    \          "D:#97647784511</a>.&nbsp; Please note that newer versions of these Digibuy products"                 \
3982          "D:Product \#97647721717</a>, and the full source code can be obtained as"                            \          "D:may be available."                                                                                 \
3983          "D:<a href=\"http://www.digibuy.com/cgi-bin/product.html?97647784511\">Digibuy Product"               \          "F:SCRIPTS\\BOOK BUILD SCRIPT.LNK"                                                                    \
3984          "D:#97647784511</a>.&nbsp; Please note that newer versions of these Digibuy products"                 \          "D:The Windows 98 shortcut which allows the Wish script (above) to be run using the static"           \
3985          "D:may be available."                                                                                 \          "D:Wish interpreter (above).&nbsp; This shortcut comes from a Windows '98 system and it is"           \
3986          "F:SCRIPTS\\BOOK BUILD SCRIPT.LNK"                                                                    \          "D:not known which Windows systems it is compatible with."                                            \
3987          "D:The Windows 98 shortcut which allows the Wish script (above) to be run using the static"           \          "C:int0"                                                                                              \
3988          "D:Wish interpreter (above).&nbsp; This shortcut comes from a Windows '98 system and it is"           \          "F:C_INT0\\C_INT0.TEX"                                                                                \
3989          "D:not known which Windows systems it is compatible with."                                            \          "D:LaTeX source code for the chapter."                                                                \
3990          "C:int0"                                                                                              \          "C:hgr0"                                                                                              \
3991          "F:C_INT0\\C_INT0.TEX"                                                                                \          "F:C_HGR0\\C_HGR0.TEX"                                                                                \
3992          "D:LaTeX source code for the chapter."                                                                \          "D:LaTeX source code for the chapter."                                                                \
3993          "C:hgr0"                                                                                              \          "C:pri0"                                                                                              \
3994          "F:C_HGR0\\C_HGR0.TEX"                                                                                \          "F:C_PRI0\\C_PRI0.TEX"                                                                                \
3995          "D:LaTeX source code for the chapter."                                                                \          "D:LaTeX source code for the chapter."                                                                \
3996          "C:pri0"                                                                                              \          "F:C_FRY0\\C_FRY0.TEX"                                                                                \
3997          "F:C_PRI0\\C_PRI0.TEX"                                                                                \          "D:LaTeX source code for the chapter."                                                                \
3998          "D:LaTeX source code for the chapter."                                                                \          "F:C_FRY0\\FAREY01A.DSF"                                                                              \
3999          "F:C_FRY0\\C_FRY0.TEX"                                                                                \          "D:Micrografx Designer document for the diagram showing the integer lattice interpretation"           \
4000          "D:LaTeX source code for the chapter."                                                                \          "D:of the Farey series with numerator and denominator both constrained."                              \
4001          "F:C_FRY0\\FAREY01A.DSF"                                                                              \          "F:C_FRY0\\FAREY01A.EPS"                                                                              \
4002          "D:Micrografx Designer document for the diagram showing the integer lattice interpretation"           \          "D:Postscript version of C_FRY0\\FAREY01A.DSF, used with LaTeX."                                      \
4003          "D:of the Farey series with numerator and denominator both constrained."                              \          "F:C_FRY0\\FAREY01B.DSF"                                                                              \
4004          "F:C_FRY0\\FAREY01A.EPS"                                                                              \          "D:Micrografx Designer document for the diagram showing the graphical construction of the Farey"      \
4005          "D:Postscript version of C_FRY0\\FAREY01A.DSF, used with LaTeX."                                      \          "D:series with numerator and denominator both constrained."                                           \
4006          "F:C_FRY0\\FAREY01B.DSF"                                                                              \          "F:C_FRY0\\FAREY01B.EPS"                                                                              \
4007          "D:Micrografx Designer document for the diagram showing the graphical construction of the Farey"      \          "D:Postscript version of C_FRY0\\FAREY01B.DSF, used with LaTeX."                                      \
4008          "D:series with numerator and denominator both constrained."                                           \          "C:cfr0"                                                                                              \
4009          "F:C_FRY0\\FAREY01B.EPS"                                                                              \          "F:C_CFR0\\C_CFR0.TEX"                                                                                \
4010          "D:Postscript version of C_FRY0\\FAREY01B.DSF, used with LaTeX."                                      \          "D:LaTeX source code for the chapter."                                                                \
4011          "C:cfr0"                                                                                              \          }
4012          "F:C_CFR0\\C_CFR0.TEX"                                                                                \  
4013          "D:LaTeX source code for the chapter."                                                                \  
4014          }  #*************************************
4015    #Graphical button display constants
4016    set buttonPadx 5
4017  #*************************************  set buttonPady 5
4018  #Graphical button display constants  set buttonWidth 45
4019  set buttonPadx 5  set buttonHeight 2
4020  set buttonPady 5  set exitButtonColor #f88
4021  set buttonWidth 45  set bookButtonColor #3d3
4022  set buttonHeight 2  set esrgtoolsetButtonColor #99d
4023  set exitButtonColor #f88  
4024  set bookButtonColor #3d3  #----------------------------------------------------------------------------------------
4025  set esrgtoolsetButtonColor #99d  #----------------------------------------------------------------------------------------
4026    #-----   L O G    F I L E    O P E N    -----------------------------------------------__
4027  #----------------------------------------------------------------------------------------  #----------------------------------------------------------------------------------------
4028  #----------------------------------------------------------------------------------------  #----------------------------------------------------------------------------------------
4029  #-----   L O G    F I L E    O P E N    -----------------------------------------------__  #Write a thick horizontal line to the console.
4030  #----------------------------------------------------------------------------------------  thickhlineconsole
4031  #----------------------------------------------------------------------------------------  
4032  #Write a thick horizontal line to the console.  #Need to change working directories to the root directory for the book.
4033  thickhlineconsole  #The log file goes there.
4034    cd $pathUcBookA
4035  #Need to change working directories to the root directory for the book.  
4036  #The log file goes there.  #Attempt to get the build log file open.  If this file is read only (which I
4037  cd $pathUcBookA  #don't care to override from the script), or if there are other problems,
4038    #just abort.  We cannot proceed unless we can make a log.
4039  #Attempt to get the build log file open.  If this file is read only (which I  #      
4040  #don't care to override from the script), or if there are other problems,  puts -nonewline "Attempting to open the build log file ($buildlogfilename) ... "  
4041  #just abort.  We cannot proceed unless we can make a log.  set buildlogfilehandle [open $buildlogfilename "w+"]
4042  #        puts "success."
4043  puts -nonewline "Attempting to open the build log file ($buildlogfilename) ... "    puts -nonewline "Build log file handle is:  $buildlogfilehandle"; puts "."
4044  set buildlogfilehandle [open $buildlogfilename "w+"]  puts "All console output from this point forward will be echoed to the log file."
4045  puts "success."  
4046  puts -nonewline "Build log file handle is:  $buildlogfilehandle"; puts "."  #-----------------------------------------------------------------------------
4047  puts "All console output from this point forward will be echoed to the log file."  #Thick horizontal line to denote start.
4048    thickhlineboth
4049  #-----------------------------------------------------------------------------  
4050  #Thick horizontal line to denote start.  #Annunciation, what we are trying to build.
4051  thickhlineboth  outboth "*** Book And ESRG Tool Set Utility Script Log ***"
4052    hlineboth
4053  #Annunciation, what we are trying to build.  
4054  outboth "*** Book And ESRG Tool Set Utility Script Log ***"  #Put the system date and time into the build log and on the console.
4055  hlineboth  set buildbegintimestamp [clock seconds]
4056    set s0 [clock format $buildbegintimestamp -format "Execution beginning at: %A, %B %d, %Y; %I:%M:%S %p."]
4057  #Put the system date and time into the build log and on the console.  outboth $s0
4058  set buildbegintimestamp [clock seconds]  hlineboth
4059  set s0 [clock format $buildbegintimestamp -format "Execution beginning at: %A, %B %d, %Y; %I:%M:%S %p."]  
4060  outboth $s0  #Index the list of volumes for quicker access and manipulation.
4061  hlineboth  IndexVolumeList
4062    
4063  #Index the list of volumes for quicker access and manipulation.  #Index the list of chapters for quicker access and manipulation.
4064  IndexVolumeList  IndexChapterList
4065    
4066  #Index the list of chapters for quicker access and manipulation.  
4067  IndexChapterList  #*************************************
4068    
4069    set exitButton      [button .b1 -padx $buttonPadx -pady $buttonPady \
4070  #*************************************                      -text "Exit" \
4071                                            -command exitProc -width $buttonWidth -height $buttonHeight \
4072  set exitButton      [button .b1 -padx $buttonPadx -pady $buttonPady \                                          -background $exitButtonColor]
4073                      -text "Exit" \  
4074                                          -command exitProc -width $buttonWidth -height $buttonHeight \  set rebuildMasterFilesButton \
4075                                          -background $exitButtonColor]                      [button .b2 -padx $buttonPadx -pady $buttonPady \
4076                        -text "BOOK:  Rebuild\nmaster .TEX files" \
4077  set rebuildMasterFilesButton \                                          -command masterFileRebuildProc -width $buttonWidth -height $buttonHeight \
4078                      [button .b2 -padx $buttonPadx -pady $buttonPady \                                          -background $bookButtonColor]
4079                      -text "BOOK:  Rebuild\nmaster .TEX files" \  
4080                                          -command masterFileRebuildProc -width $buttonWidth -height $buttonHeight \  set rebuildReadmeHtmBookButton \
4081                                          -background $bookButtonColor]                      [button .b3 -padx $buttonPadx -pady $buttonPady \
4082                        -text "BOOK:  Rebuild\nREADME.HTM" \
4083  set rebuildReadmeHtmBookButton \                                          -command rebuildReadmeHtmForBookProc -width $buttonWidth -height $buttonHeight \
4084                      [button .b3 -padx $buttonPadx -pady $buttonPady \                                          -background $bookButtonColor]
4085                      -text "BOOK:  Rebuild\nREADME.HTM" \  
4086                                          -command rebuildReadmeHtmForBookProc -width $buttonWidth -height $buttonHeight \  set fullLatexCompileBookButton \
4087                                          -background $bookButtonColor]                      [button .b4 -padx $buttonPadx -pady $buttonPady \
4088                        -text "BOOK:  Full LaTeX Compile\nAnd Index" \
4089  set fullLatexCompileBookButton \                                          -command fullLatexCompileAndIndexProc -width $buttonWidth -height $buttonHeight \
4090                      [button .b4 -padx $buttonPadx -pady $buttonPady \                                          -background $bookButtonColor]
4091                      -text "BOOK:  Full LaTeX Compile\nAnd Index" \  
4092                                          -command fullLatexCompileAndIndexProc -width $buttonWidth -height $buttonHeight \  grid $rebuildMasterFilesButton   -row 0 -column 1
4093                                          -background $bookButtonColor]  grid $rebuildReadmeHtmBookButton -row 1 -column 1
4094    grid $fullLatexCompileBookButton -row 2 -column 1
4095  grid $rebuildMasterFilesButton   -row 0 -column 1  
4096  grid $rebuildReadmeHtmBookButton -row 1 -column 1  grid $exitButton -row 3 -column 1
4097  grid $fullLatexCompileBookButton -row 2 -column 1  
4098    outboth "Buttons formed and awaiting press."
4099  grid $exitButton -row 3 -column 1  hlineboth
4100    
4101  outboth "Buttons formed and awaiting press."  #----------------------------------------------------------------------------------------
4102  hlineboth  # End of CP_SCRIPT.TCL
4103    #----------------------------------------------------------------------------------------
 #----------------------------------------------------------------------------------------  
 # $Log: cp_script.tcl,v $  
 # Revision 1.40  2009/08/14 03:38:57  dashley  
 # Base path of book changed.  
 #  
 # Revision 1.39  2005/05/22 18:42:28  dtashley  
 # Addition of chapter.  
 #  
 # Revision 1.38  2005/05/22 18:28:54  dtashley  
 # a)Addition of server-based tool set volume.  
 # b)Addition of chapter to that volume.  
 #  
 # Revision 1.37  2005/05/22 17:53:33  dtashley  
 # Modified to use Adobe 6.0 Distiller rather than Adobe 4.0 Distiller.  
 #  
 # Revision 1.36  2004/02/22 15:01:57  dtashley  
 # Edits.  
 #  
 # Revision 1.35  2003/11/28 23:45:38  dtashley  
 # Verbiage changed because IJU Tool Set changed to ESRG Tool Set.  
 #  
 # Revision 1.34  2003/10/30 16:41:18  dtashley  
 # Modified to incorporate Acrobat Distiller 5.0.  
 #  
 # Revision 1.33  2003/10/30 15:56:24  dtashley  
 # Changes made to make near-duplicate PostScript files that will print  
 # full duplex (both sides of page).  
 #  
 # Revision 1.32  2003/10/29 23:35:12  dtashley  
 # Comments about duplex printing added.  
 #  
 # Revision 1.31  2003/10/29 23:25:39  dtashley  
 # Modifications for MikTex.  
 #  
 # Revision 1.30  2003/05/17 01:11:20  dtashley  
 # Script modified to include separator before glossaries, bibliography,  
 # and index in single-volume .TEX file.  
 #  
 # Revision 1.29  2003/05/15 08:25:08  dtashley  
 # Changes for removal of "Information for Authors" chapter (this has been  
 # moved to a web page).  
 #  
 # Revision 1.28  2003/05/15 04:50:47  dtashley  
 # Changes pursuant to removal of the quote farm chapter (it has been moved to  
 # be a web page).  
 #  
 # Revision 1.27  2003/04/30 06:35:06  dtashley  
 # Script simplified by removal of buttons and functionality split so that the  
 # master .TEX files can be built independently of compilation--this will  
 # hopefully support those who are using versions of LaTeX other than 4allTex.  
 #  
 # Revision 1.26  2003/04/07 07:05:49  dtashley  
 # List of algorithms added to generation of SVF.TEX.  
 #  
 # Revision 1.25  2003/02/27 05:00:54  dtashley  
 # Chapter about complex integer algorithms added.  
 #  
 # Revision 1.24  2002/10/30 02:05:47  dtashley  
 # Additional chapter containing solutions of chapter on error-detecting  
 # and error-correcting codes added.  
 #  
 # Revision 1.23  2002/09/25 05:39:11  dtashley  
 # Addition of chapter on error-detecting and error-correcting codes.  
 #  
 # Revision 1.22  2002/08/26 17:57:04  dtashley  
 # Additional solutions chapter added.  Precautionary checkin to be sure  
 # that I've captured all changes.  
 #  
 # Revision 1.21  2002/07/31 04:37:19  dtashley  
 # Title of number theory chapter changed.  
 #  
 # Revision 1.20  2002/04/09 23:50:52  dtashley  
 # Modification of Tcl script for lists of tables, figures.  
 #  
 # Revision 1.19  2002/04/09 23:32:21  dtashley  
 # Edits, preparing for addition of lists of tables and figures.  
 #  
 # Revision 1.18  2002/01/25 11:29:34  dtashley  
 # Path of book changed in preparation for transfer to ESRG.  
 #  
 # Revision 1.17  2001/08/31 23:11:17  dtashley  
 # End of August 2001 safety check-in.  
 #  
 # Revision 1.16  2001/08/27 20:06:09  dtashley  
 # Edits and substantial re-organization.  
 #  
 # Revision 1.15  2001/08/25 22:51:26  dtashley  
 # Complex re-organization of book.  
 #  
 # Revision 1.14  2001/07/11 20:10:30  dtashley  
 # Chapter on DOS console-mode utilities added.  
 #  
 # Revision 1.13  2001/07/01 00:25:46  dtashley  
 # Four chapters of solutions added.  
 #  
 # Revision 1.12  2001/06/19 22:52:26  dtashley  
 # Chapters added.  
 #  
 # Revision 1.11  2001/06/19 19:15:50  dtashley  
 # New chapters added.  
 #  
 # Revision 1.10  2001/06/19 00:15:32  dtashley  
 # Preface finished, acks modified to include gratitude to  
 # SourceForge, and name of tool set changed from IjuTools  
 # to The Iju Tool Set.  
 #  
 # Revision 1.9  2001/06/17 00:17:02  dtashley  
 # LOG spacing error confirmed fixed.  Script runs.  
 #  
 # Revision 1.8  2001/06/17 00:10:49  dtashley  
 # Test check-in to correct LOG spacing problem.  
 #  
 # Revision 1.7  2001/06/17 00:06:25  dtashley  
 # Line EOL and keyword expansion problems believed fixed.  Test  
 # check-in.  
 #----------------------------------------------------------------------------------------  
 # End of CP_SCRIPT.TCL  
 #----------------------------------------------------------------------------------------  

Legend:
Removed from v.4  
changed lines
  Added in v.273

dashley@gmail.com
ViewVC Help
Powered by ViewVC 1.1.25