Fred Drake | 11300cc | 1998-08-05 04:48:18 +0000 | [diff] [blame] | 1 | #! /usr/bin/env bash |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 2 | |
Fred Drake | c794c38 | 1998-08-12 17:50:07 +0000 | [diff] [blame^] | 3 | # This script may be invoked by naming it directly or via a shell alias, |
| 4 | # but NOT through a symbolic link. Perhaps a future version will allow |
| 5 | # the use of a symbolic link. |
| 6 | # |
| 7 | # Using a symbolic link will cause the script to not be able to locate |
| 8 | # its support files. |
| 9 | |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 10 | MYDIR=`dirname $0` |
Fred Drake | f558e31 | 1998-03-24 17:48:20 +0000 | [diff] [blame] | 11 | WORKDIR=`pwd` |
| 12 | cd $MYDIR |
| 13 | MYDIR=`pwd` |
Fred Drake | ac8f91a | 1998-04-02 15:37:13 +0000 | [diff] [blame] | 14 | cd .. |
| 15 | TOPDIR=`pwd` |
Fred Drake | f558e31 | 1998-03-24 17:48:20 +0000 | [diff] [blame] | 16 | cd $WORKDIR |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 17 | |
| 18 | # DEFAULT_FORMAT must be upper case... |
| 19 | DEFAULT_FORMAT=PDF |
| 20 | USE_DEFAULT_FORMAT=true |
Fred Drake | dbc879e | 1998-03-11 15:33:44 +0000 | [diff] [blame] | 21 | DISCARD_TEMPS=true |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 22 | |
Fred Drake | 11300cc | 1998-08-05 04:48:18 +0000 | [diff] [blame] | 23 | ICONSERVER='' |
| 24 | |
Fred Drake | ac8f91a | 1998-04-02 15:37:13 +0000 | [diff] [blame] | 25 | L2H_INIT_FILE=$TOPDIR/perl/l2hinit.perl |
Fred Drake | 11300cc | 1998-08-05 04:48:18 +0000 | [diff] [blame] | 26 | L2H_AUX_INIT_FILE=/usr/tmp/mkhowto-$LOGNAME-$$.perl |
Fred Drake | ac8f91a | 1998-04-02 15:37:13 +0000 | [diff] [blame] | 27 | |
Fred Drake | dbc879e | 1998-03-11 15:33:44 +0000 | [diff] [blame] | 28 | LOGFILE=/usr/tmp/mkhowto-$LOGNAME-$$.how |
| 29 | LOGGING='' |
| 30 | |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 31 | usage() { |
Fred Drake | ac8f91a | 1998-04-02 15:37:13 +0000 | [diff] [blame] | 32 | MYNAME=`basename $0` |
| 33 | echo "usage: $MYNAME [options...] file ..." |
| 34 | cat <<EOF |
| 35 | |
| 36 | Options specifying formats to build: |
| 37 | --html HyperText Markup Language |
| 38 | --pdf Portable Document Format (default) |
| 39 | --ps PostScript |
| 40 | --dvi "DeVice Indepentent" format from TeX |
| 41 | |
| 42 | More than one output format may be specified. |
| 43 | |
| 44 | HTML options: |
| 45 | --address, -a Specify an address for page footers. |
Fred Drake | 8805354 | 1998-04-24 21:57:12 +0000 | [diff] [blame] | 46 | --link Specify the number of levels to include on each page. |
Fred Drake | ac8f91a | 1998-04-02 15:37:13 +0000 | [diff] [blame] | 47 | --split, -s Specify a section level for page splitting. |
Fred Drake | 11300cc | 1998-08-05 04:48:18 +0000 | [diff] [blame] | 48 | --iconserver, -i Specify location of icons (default: ../). |
Fred Drake | ac8f91a | 1998-04-02 15:37:13 +0000 | [diff] [blame] | 49 | |
| 50 | Other options: |
Fred Drake | 1a3541c | 1998-05-11 19:04:56 +0000 | [diff] [blame] | 51 | --a4 Format for A4 paper. |
Fred Drake | d5d473f | 1998-05-11 20:40:24 +0000 | [diff] [blame] | 52 | --letter Format for US letter paper (the default). |
Fred Drake | ac8f91a | 1998-04-02 15:37:13 +0000 | [diff] [blame] | 53 | --help, -H Show this text. |
| 54 | --logging, -l Log stdout and stderr to a file (*.how). |
| 55 | --debugging, -D Echo commands as they are executed. |
| 56 | --keep, -k Keep temporary files around. |
| 57 | --quiet, -q Do not print command output to stdout. |
| 58 | (stderr is also lost, sorry; see *.how for errors) |
| 59 | |
| 60 | EOF |
Fred Drake | 11300cc | 1998-08-05 04:48:18 +0000 | [diff] [blame] | 61 | |
Fred Drake | ac8f91a | 1998-04-02 15:37:13 +0000 | [diff] [blame] | 62 | exit $1 |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 63 | } |
| 64 | |
Fred Drake | 8805354 | 1998-04-24 21:57:12 +0000 | [diff] [blame] | 65 | # These are LaTeX2HTML controls; they reflect l2h variables of the same name. |
| 66 | # The values here are the defaults after modification by perl/l2hinit.perl. |
| 67 | # |
| 68 | ADDRESS='' |
| 69 | MAX_LINK_DEPTH=3 |
| 70 | MAX_SPLIT_DEPTH=8 |
| 71 | |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 72 | build_html() { |
Fred Drake | 19c7c84 | 1998-05-07 21:20:39 +0000 | [diff] [blame] | 73 | TEXFILE=`kpsewhich $1.tex` |
Fred Drake | 9940bd7 | 1998-08-06 20:15:20 +0000 | [diff] [blame] | 74 | BUILDDIR=${2:-$1} |
Fred Drake | 11300cc | 1998-08-05 04:48:18 +0000 | [diff] [blame] | 75 | latex2html \ |
| 76 | -init_file $L2H_INIT_FILE \ |
| 77 | -init_file $L2H_AUX_INIT_FILE \ |
Fred Drake | 9940bd7 | 1998-08-06 20:15:20 +0000 | [diff] [blame] | 78 | -dir $BUILDDIR $TEXFILE || exit $? |
Fred Drake | 8805354 | 1998-04-24 21:57:12 +0000 | [diff] [blame] | 79 | if [ "$MAX_SPLIT_DEPTH" -ne 1 ] ; then |
Fred Drake | 9940bd7 | 1998-08-06 20:15:20 +0000 | [diff] [blame] | 80 | (cd $BUILDDIR; $MYDIR/node2label.pl *.html) || exit $? |
Fred Drake | ac8f91a | 1998-04-02 15:37:13 +0000 | [diff] [blame] | 81 | fi |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 82 | } |
| 83 | |
Fred Drake | 12f842e | 1998-04-17 02:52:12 +0000 | [diff] [blame] | 84 | use_latex() { |
| 85 | # two args: <file> <latextype> |
| 86 | MYFILE=$1 |
| 87 | MYLATEX=$2 |
| 88 | # |
| 89 | # We really have to do it three times to get all the page numbers right, |
| 90 | # since the length of the ToC makes a real difference. |
| 91 | # |
| 92 | $MYDIR/newind.py >$MYFILE.ind |
| 93 | $MYDIR/newind.py modindex >mod$MYFILE.ind |
| 94 | $MYLATEX $MYFILE || exit $? |
| 95 | if [ -f mod$MYFILE.idx ] ; then |
| 96 | makeindex mod$MYFILE.idx |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 97 | fi |
Fred Drake | 12f842e | 1998-04-17 02:52:12 +0000 | [diff] [blame] | 98 | if [ -f $MYFILE.idx ] ; then |
| 99 | $MYDIR/fix_hack $MYFILE.idx |
| 100 | makeindex $MYFILE.idx |
| 101 | $MYDIR/indfix.py $MYFILE.ind |
| 102 | fi |
Fred Drake | 8cab549 | 1998-07-23 19:13:52 +0000 | [diff] [blame] | 103 | if [ -f $MYFILE.syn ] ; then |
| 104 | # This hack is due to a bug with the module synopsis support that |
| 105 | # causes the last module synopsis to be written out twice in |
| 106 | # howto documents (not present for manuals). Repeated below. |
| 107 | uniq $MYFILE.syn >TEMP.syn && mv TEMP.syn $MYFILE.syn || exit $? |
| 108 | fi |
Fred Drake | 12f842e | 1998-04-17 02:52:12 +0000 | [diff] [blame] | 109 | $MYLATEX $MYFILE || exit $? |
| 110 | if [ -f mod$MYFILE.idx ] ; then |
| 111 | makeindex mod$MYFILE.idx |
| 112 | fi |
| 113 | if [ -f $MYFILE.idx ] ; then |
| 114 | $MYDIR/fix_hack $MYFILE.idx || exit $? |
| 115 | makeindex -s $TOPDIR/texinputs/myindex.ist $MYFILE.idx || exit $? |
| 116 | fi |
Fred Drake | f4fc476 | 1998-05-14 20:03:14 +0000 | [diff] [blame] | 117 | if [ -f $MYFILE.toc -a $MYLATEX = pdflatex ] ; then |
Fred Drake | 12f842e | 1998-04-17 02:52:12 +0000 | [diff] [blame] | 118 | $MYDIR/toc2bkm.py -c section $MYFILE |
| 119 | fi |
Fred Drake | 8cab549 | 1998-07-23 19:13:52 +0000 | [diff] [blame] | 120 | if [ -f $MYFILE.syn ] ; then |
| 121 | uniq $MYFILE.syn >TEMP.syn && mv TEMP.syn $MYFILE.syn || exit $? |
| 122 | fi |
Fred Drake | 12f842e | 1998-04-17 02:52:12 +0000 | [diff] [blame] | 123 | $MYLATEX $MYFILE || exit $? |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 124 | } |
| 125 | |
Fred Drake | 12f842e | 1998-04-17 02:52:12 +0000 | [diff] [blame] | 126 | build_dvi() { |
| 127 | use_latex $1 latex |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 128 | } |
| 129 | |
| 130 | build_pdf() { |
Fred Drake | 12f842e | 1998-04-17 02:52:12 +0000 | [diff] [blame] | 131 | use_latex $1 pdflatex |
| 132 | } |
| 133 | |
| 134 | build_ps() { |
Fred Drake | 7984256 | 1998-04-17 20:06:16 +0000 | [diff] [blame] | 135 | dvips -N0 -o $1.ps $1 || exit $? |
Fred Drake | 12f842e | 1998-04-17 02:52:12 +0000 | [diff] [blame] | 136 | } |
| 137 | |
Fred Drake | 9940bd7 | 1998-08-06 20:15:20 +0000 | [diff] [blame] | 138 | build_text() { |
| 139 | lynx -nolist -dump $2/index.html >$1.txt |
| 140 | } |
| 141 | |
Fred Drake | 11300cc | 1998-08-05 04:48:18 +0000 | [diff] [blame] | 142 | l2hoption() { |
| 143 | if [ "$2" ] ; then |
| 144 | echo "\$$1 = \"$2\";" >>$L2H_AUX_INIT_FILE |
| 145 | fi |
| 146 | } |
| 147 | |
Fred Drake | 12f842e | 1998-04-17 02:52:12 +0000 | [diff] [blame] | 148 | cleanup() { |
Fred Drake | 8cab549 | 1998-07-23 19:13:52 +0000 | [diff] [blame] | 149 | rm -f $1.aux $1.log $1.out $1.toc $1.bkm $1.idx $1.ilg $1.ind $1.syn |
Fred Drake | c9b8a57 | 1998-04-29 21:28:25 +0000 | [diff] [blame] | 150 | rm -f mod$1.idx mod$1.ilg mod$1.ind |
Fred Drake | 12f842e | 1998-04-17 02:52:12 +0000 | [diff] [blame] | 151 | if [ ! "$BUILD_DVI" ] ; then |
Fred Drake | 19c7c84 | 1998-05-07 21:20:39 +0000 | [diff] [blame] | 152 | rm -f $1.dvi |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 153 | fi |
Fred Drake | 9940bd7 | 1998-08-06 20:15:20 +0000 | [diff] [blame] | 154 | rm -rf $1.temp-html |
Fred Drake | 8dbf46a | 1998-05-15 17:13:08 +0000 | [diff] [blame] | 155 | rm -f $1/IMG* $1/*.pl $1/WARNINGS $1/index.dat $1/modindex.dat |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 156 | } |
| 157 | |
| 158 | # figure out what our targets are: |
| 159 | while [ "$1" ] ; do |
| 160 | case "$1" in |
| 161 | --pdf|--pd) |
| 162 | BUILD_PDF=true |
| 163 | USE_DEFAULT_FORMAT=false |
| 164 | shift 1 |
| 165 | ;; |
Fred Drake | 8805354 | 1998-04-24 21:57:12 +0000 | [diff] [blame] | 166 | --ps|--postscript|--postscrip|--postscri|--postscr|--postsc|--posts|--post|--pos|--po) |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 167 | BUILD_PS=true |
| 168 | USE_DEFAULT_FORMAT=false |
| 169 | shift 1 |
| 170 | ;; |
| 171 | --dvi|--dv|--d) |
| 172 | BUILD_DVI=true |
| 173 | USE_DEFAULT_FORMAT=false |
| 174 | shift 1 |
| 175 | ;; |
Fred Drake | ac8f91a | 1998-04-02 15:37:13 +0000 | [diff] [blame] | 176 | --html|--htm|--ht) |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 177 | BUILD_HTML=true |
| 178 | USE_DEFAULT_FORMAT=false |
| 179 | shift 1 |
| 180 | ;; |
Fred Drake | 9940bd7 | 1998-08-06 20:15:20 +0000 | [diff] [blame] | 181 | --text|--tex|--te|--t) |
| 182 | BUILD_TEXT=true |
| 183 | USE_DEFAULT_FORMAT=false |
| 184 | shift 1 |
| 185 | ;; |
Fred Drake | ac8f91a | 1998-04-02 15:37:13 +0000 | [diff] [blame] | 186 | -H|--help|--hel|--he) |
| 187 | usage 0 |
| 188 | ;; |
Fred Drake | 11300cc | 1998-08-05 04:48:18 +0000 | [diff] [blame] | 189 | -i|--iconserver|--iconserve|--iconserv|--iconser|--iconse|--icons|--icon|--ico|--ic|--i) |
| 190 | ICONSERVER="$2" |
| 191 | shift 2 |
| 192 | ;; |
Fred Drake | 3504952 | 1998-05-11 19:04:06 +0000 | [diff] [blame] | 193 | -a|--address|--addres|--addre|-addr|--add|--ad) |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 194 | ADDRESS="$2" |
| 195 | shift 2 |
| 196 | ;; |
Fred Drake | 3504952 | 1998-05-11 19:04:06 +0000 | [diff] [blame] | 197 | --a4) |
| 198 | TEXINPUTS=$TOPDIR/paper-a4:$TEXINPUTS |
| 199 | shift 1 |
| 200 | ;; |
Fred Drake | d5d473f | 1998-05-11 20:40:24 +0000 | [diff] [blame] | 201 | --letter|--lette|--lett|--let|--le) |
| 202 | shift 1 |
| 203 | ;; |
Fred Drake | 8805354 | 1998-04-24 21:57:12 +0000 | [diff] [blame] | 204 | --link|--lin|--li) |
| 205 | LINK="$2" |
Fred Drake | ac8f91a | 1998-04-02 15:37:13 +0000 | [diff] [blame] | 206 | shift 2 |
| 207 | ;; |
Fred Drake | 8805354 | 1998-04-24 21:57:12 +0000 | [diff] [blame] | 208 | -s|--split|--spli|--spl|--sp|--s) |
| 209 | MAX_SPLIT_DEPTH="$2" |
| 210 | shift 2 |
| 211 | ;; |
| 212 | -l|--logging|--loggin|--loggi|--logg|--log|--lo) |
Fred Drake | dbc879e | 1998-03-11 15:33:44 +0000 | [diff] [blame] | 213 | LOGGING=true |
| 214 | shift 1 |
| 215 | ;; |
| 216 | -D|--debugging|--debuggin|--debuggi|--debugg|--debug|--debu|--deb|--de) |
| 217 | DEBUGGING=true |
| 218 | shift 1 |
| 219 | ;; |
| 220 | -k|--keep|--kee|--ke|--k) |
| 221 | DISCARD_TEMPS='' |
| 222 | shift 1 |
| 223 | ;; |
Fred Drake | ac8f91a | 1998-04-02 15:37:13 +0000 | [diff] [blame] | 224 | -q|--quiet|--quie|--qui|--qu|--q) |
Fred Drake | 664b36f | 1998-03-11 15:41:21 +0000 | [diff] [blame] | 225 | QUIET=true |
| 226 | shift 1 |
| 227 | ;; |
Fred Drake | 8805354 | 1998-04-24 21:57:12 +0000 | [diff] [blame] | 228 | --) |
Fred Drake | c9b8a57 | 1998-04-29 21:28:25 +0000 | [diff] [blame] | 229 | shift 1 |
Fred Drake | 8805354 | 1998-04-24 21:57:12 +0000 | [diff] [blame] | 230 | break |
| 231 | ;; |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 232 | -*) |
Fred Drake | ac8f91a | 1998-04-02 15:37:13 +0000 | [diff] [blame] | 233 | usage 2 |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 234 | ;; |
| 235 | *) |
| 236 | break;; |
| 237 | esac |
| 238 | done |
| 239 | |
| 240 | if [ $# = 0 ] ; then |
Fred Drake | 9940bd7 | 1998-08-06 20:15:20 +0000 | [diff] [blame] | 241 | # check for a single .tex file in . |
| 242 | COUNT=`ls -1 *.tex | wc -l | sed 's/[ ]//g'` |
| 243 | if [ "$COUNT" -eq 1 ] ; then |
| 244 | set -- `ls -1 *.tex` |
| 245 | else |
| 246 | usage 2 |
| 247 | fi |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 248 | fi |
| 249 | |
| 250 | if [ $USE_DEFAULT_FORMAT = true ] ; then |
| 251 | eval "BUILD_$DEFAULT_FORMAT=true" |
| 252 | fi |
| 253 | |
Fred Drake | 664b36f | 1998-03-11 15:41:21 +0000 | [diff] [blame] | 254 | if [ "$QUIET" ] ; then |
| 255 | exec >/dev/null |
| 256 | fi |
| 257 | |
Fred Drake | 9940bd7 | 1998-08-06 20:15:20 +0000 | [diff] [blame] | 258 | if [ "$DEBUGGING" ] ; then |
| 259 | set -x |
| 260 | fi |
| 261 | |
Fred Drake | 11300cc | 1998-08-05 04:48:18 +0000 | [diff] [blame] | 262 | echo '# auxillary init file for latex2html' >$L2H_AUX_INIT_FILE |
| 263 | echo '# generated by mkhowto.sh -- do no edit' >>$L2H_AUX_INIT_FILE |
| 264 | l2hoption ICONSERVER "$ICONSERVER" |
| 265 | l2hoption ADDRESS "$ADDRESS" |
| 266 | l2hoption MAX_LINK_DEPTH "$MAX_LINK_DEPTH" |
| 267 | l2hoption MAX_SPLIT_DEPTH "$MAX_SPLIT_DEPTH" |
| 268 | echo '1;' >>$L2H_AUX_INIT_FILE |
Fred Drake | f4fc476 | 1998-05-14 20:03:14 +0000 | [diff] [blame] | 269 | |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 270 | for FILE in $@ ; do |
Fred Drake | df825a1 | 1998-05-14 20:36:49 +0000 | [diff] [blame] | 271 | FILEDIR=`dirname $FILE` |
Fred Drake | 19c7c84 | 1998-05-07 21:20:39 +0000 | [diff] [blame] | 272 | FILE=`basename ${FILE%.tex}` |
Fred Drake | f4fc476 | 1998-05-14 20:03:14 +0000 | [diff] [blame] | 273 | # |
| 274 | # Put the directory the .tex file is in is also the first directory in |
| 275 | # TEXINPUTS, to allow files there to override files in the common area. |
| 276 | # |
Fred Drake | 11300cc | 1998-08-05 04:48:18 +0000 | [diff] [blame] | 277 | TEXINPUTS=$FILEDIR:$TOPDIR/texinputs:$TEXINPUTS |
Fred Drake | f4fc476 | 1998-05-14 20:03:14 +0000 | [diff] [blame] | 278 | export TEXINPUTS |
| 279 | # |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 280 | if [ "$BUILD_DVI" -o "$BUILD_PS" ] ; then |
Fred Drake | dbc879e | 1998-03-11 15:33:44 +0000 | [diff] [blame] | 281 | build_dvi $FILE 2>&1 | tee -a $LOGFILE |
Fred Drake | 9940bd7 | 1998-08-06 20:15:20 +0000 | [diff] [blame] | 282 | HAVE_TEMPS=true |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 283 | fi |
| 284 | if [ "$BUILD_PDF" ] ; then |
Fred Drake | dbc879e | 1998-03-11 15:33:44 +0000 | [diff] [blame] | 285 | build_pdf $FILE 2>&1 | tee -a $LOGFILE |
Fred Drake | 9940bd7 | 1998-08-06 20:15:20 +0000 | [diff] [blame] | 286 | HAVE_TEMPS=true |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 287 | fi |
| 288 | if [ "$BUILD_PS" ] ; then |
Fred Drake | dbc879e | 1998-03-11 15:33:44 +0000 | [diff] [blame] | 289 | build_ps $FILE 2>&1 | tee -a $LOGFILE |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 290 | fi |
| 291 | if [ "$BUILD_HTML" ] ; then |
Fred Drake | 9940bd7 | 1998-08-06 20:15:20 +0000 | [diff] [blame] | 292 | if [ ! "$HAVE_TEMPS" ] ; then |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 293 | # need to get aux file |
Fred Drake | dbc879e | 1998-03-11 15:33:44 +0000 | [diff] [blame] | 294 | build_dvi $FILE 2>&1 | tee -a $LOGFILE |
Fred Drake | 9940bd7 | 1998-08-06 20:15:20 +0000 | [diff] [blame] | 295 | HAVE_TEMPS=true |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 296 | fi |
Fred Drake | 9940bd7 | 1998-08-06 20:15:20 +0000 | [diff] [blame] | 297 | build_html $FILE $FILE 2>&1 | tee -a $LOGFILE |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 298 | fi |
Fred Drake | 9940bd7 | 1998-08-06 20:15:20 +0000 | [diff] [blame] | 299 | if [ "$BUILD_TEXT" ] ; then |
| 300 | if [ ! "$HAVE_TEMPS" ] ; then |
| 301 | # need to get aux file |
| 302 | build_dvi $FILE 2>&1 | tee -a $LOGFILE |
| 303 | HAVE_TEMPS=true |
| 304 | fi |
| 305 | # this is why building text really has to be last: |
| 306 | if [ "$MAX_SPLIT_DEPTH" -ne 1 ] ; then |
| 307 | echo '# re-hack this file for --text:' >>$L2H_AUX_INIT_FILE |
| 308 | l2hoption MAX_SPLIT_DEPTH 1 |
| 309 | echo '1;' >>$L2H_AUX_INIT_FILE |
| 310 | TEMPDIR=$FILE.temp-html |
| 311 | build_html $FILE $TEMPDIR 2>&1 | tee -a $LOGFILE |
| 312 | else |
| 313 | TEMPDIR=$FILE |
| 314 | fi |
| 315 | build_text $FILE $TEMPDIR 2>&1 | tee -a $LOGFILE |
| 316 | fi |
| 317 | |
Fred Drake | dbc879e | 1998-03-11 15:33:44 +0000 | [diff] [blame] | 318 | if [ "$DISCARD_TEMPS" ] ; then |
Fred Drake | 12f842e | 1998-04-17 02:52:12 +0000 | [diff] [blame] | 319 | cleanup $FILE 2>&1 | tee -a $LOGFILE |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 320 | fi |
Fred Drake | 12f842e | 1998-04-17 02:52:12 +0000 | [diff] [blame] | 321 | # keep the logfile around |
Fred Drake | dbc879e | 1998-03-11 15:33:44 +0000 | [diff] [blame] | 322 | if [ "$LOGGING" ] ; then |
| 323 | cp $LOGFILE $FILE.how |
| 324 | fi |
| 325 | rm -f $LOGFILE |
Fred Drake | e2e904f | 1998-03-10 23:23:05 +0000 | [diff] [blame] | 326 | done |
Fred Drake | 11300cc | 1998-08-05 04:48:18 +0000 | [diff] [blame] | 327 | |
| 328 | rm -f $L2H_AUX_INIT_FILE |