summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/bosisio/makedoc
blob: dfebbcaa5a58ce0366f2755a98444cdb65578507 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
	#########################################################
	#							#
	#		       FILE makedoc			#
	#							#
	#	Copyright(C) by F. Bosisio, 6 September 1997	#
	#							#
	#		E-mail:	bosisio@mate.polimi.it		#
	#							#
	#########################################################
#
# If there isn't a command-line parameter, ask for a filename
#
if test $1
then
  FILE=$1
else
  echo '	Insert the filename you want to process with makedoc'
  read
  FILE=$REPLY
fi
#
# Strip the ".dtx" extension (if present) and check that the file exists
#
FILE=`basename $FILE .dtx`
test -f $FILE.dtx || exit
#
# Run LaTeX on the ".dtx" file to generate the ".sty" and ".drv" files
#
echo
echo "		Running LaTeX on $FILE.dtx ..."
echo
latex $FILE.dtx || exit
#
# Run LaTeX once to generate the ".aux", ".idx" and ".glo" files
#
echo
echo "		Running LaTeX on $FILE.drv ..."
echo
latex $FILE.drv || exit
#
# Run BibTeX to generate the bibliography file (".bbl")
#
if grep bibdata $FILE.aux
then
  echo
  echo "		Running BibTeX on $FILE.aux ..."
  echo
  bibtex $FILE || exit
  rm $FILE.blg
fi
#
# Run MakeIndex on the index file
#
if test $FILE.idx
then
  echo
  echo "		Running MakeIndex on $FILE.idx ..."
  echo
  makeindex -s gind.ist -o $FILE.ind $FILE.idx || exit
  rm $FILE.ilg
fi
#
# Run MakeIndex on the glossary file
#
if test $FILE.glo
then
  echo
  echo "		Running MakeIndex on $FILE.glo ..."
  echo
  makeindex -s gglo.ist -o $FILE.gls $FILE.glo || exit
  rm $FILE.ilg
fi
#
# Rerun LaTeX to read the ".bbl", ".ind" and ".gls" files
#
echo
echo '		Re-running LaTeX on $FILE.drv ...'
echo
latex $FILE.drv
#
# Rerun LaTeX again to get the cross-references right
#
if grep "Rerun to get cross-references right" makedoc.log
then
  echo
  echo '		Re-running LaTeX again on $FILE.drv ...'
  echo
  latex $FILE.drv
fi
rm $FILE.drv $FILE.log $FILE.aux $FILE.ind $FILE.glo $FILE.bbl $FILE.idx $FILE.gls
#
# Show the generated output
#
xdvi $FILE.dvi
#
# Run DviPs to produce the postscript file
#
echo
echo '		Running DviPs ...'
echo
dvips $FILE.dvi
rm $FILE.dvi