cgal/Packages/Manual_tools/release_scripts/latexloop

65 lines
1.1 KiB
Tcsh
Executable File

#!/usr/bin/csh -f
#
set prog_name = $0
set prog_name = $prog_name:t
set BIB = 0
set INDEX = 0
if ( $#argv < 1 ) goto usage
set in_files = ""
while ($#argv > 0)
if ("$1" == "-bib") then
set BIB = 1
shift
continue
endif
if ("$1" == "-idx") then
set INDEX = 1
shift
continue
endif
if ("$1" == "-idxfix") then
set INDEX = 2
shift
continue
endif
set in_files = "$in_files $1"
setenv TEXINPUTS $1:h:$TEXINPUTS
setenv BIBINPUTS $1:h:$BIBINPUTS
shift
end
foreach file ($in_files)
set file_root = $file:r
latex $file_root
if ($BIB == 1) then
bibtex $file_root
endif
if ($INDEX == 1) then
makeindex $file_root
endif
if ($INDEX == 2) then
makeindex $file_root
index_fix $file_root.ind
endif
latex $file_root
latex $file_root
end
exit (0)
usage:
echo "Usage: $prog_name [<options>] <tex-files...>"
echo " -bib switch to indicate bibtex should be used"
echo " -idx switch to indicate makeindex should be used"
echo " -idxfix switch to indicate makeindex and index_fix should be used"
exit (1)