mirror of
https://github.com/python/cpython.git
synced 2025-11-03 11:23:31 +00:00
Adjust to allow both general and module indexes.
PDF output properly supports the outline.
This commit is contained in:
parent
60961c561d
commit
12f842e33e
1 changed files with 45 additions and 26 deletions
|
|
@ -81,33 +81,56 @@ build_html() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
build_dvi() {
|
use_latex() {
|
||||||
latex $1 || exit $?
|
# two args: <file> <latextype>
|
||||||
latex $1 || exit $?
|
MYFILE=$1
|
||||||
if [ -f $1.idx ] ; then
|
MYLATEX=$2
|
||||||
`dirname $0`/fix_hack $1.idx || exit $?
|
#
|
||||||
makeindex -s $TOPDIR/texinputs/myindex.ist $1.idx || exit $?
|
# We really have to do it three times to get all the page numbers right,
|
||||||
|
# since the length of the ToC makes a real difference.
|
||||||
|
#
|
||||||
|
$MYDIR/newind.py >$MYFILE.ind
|
||||||
|
$MYDIR/newind.py modindex >mod$MYFILE.ind
|
||||||
|
$MYLATEX $MYFILE || exit $?
|
||||||
|
if [ -f mod$MYFILE.idx ] ; then
|
||||||
|
makeindex mod$MYFILE.idx
|
||||||
fi
|
fi
|
||||||
latex $1 || exit $?
|
if [ -f $MYFILE.idx ] ; then
|
||||||
|
$MYDIR/fix_hack $MYFILE.idx
|
||||||
|
makeindex $MYFILE.idx
|
||||||
|
$MYDIR/indfix.py $MYFILE.ind
|
||||||
|
fi
|
||||||
|
$MYLATEX $MYFILE || exit $?
|
||||||
|
if [ -f mod$MYFILE.idx ] ; then
|
||||||
|
makeindex mod$MYFILE.idx
|
||||||
|
fi
|
||||||
|
if [ -f $MYFILE.idx ] ; then
|
||||||
|
$MYDIR/fix_hack $MYFILE.idx || exit $?
|
||||||
|
makeindex -s $TOPDIR/texinputs/myindex.ist $MYFILE.idx || exit $?
|
||||||
|
fi
|
||||||
|
if [ -f $MYFILE.toc ] ; then
|
||||||
|
$MYDIR/toc2bkm.py -c section $MYFILE
|
||||||
|
fi
|
||||||
|
$MYLATEX $MYFILE || exit $?
|
||||||
}
|
}
|
||||||
|
|
||||||
build_ps() {
|
build_dvi() {
|
||||||
# note weird sequence of redirects is used to get stderr to the old stdout
|
use_latex $1 latex
|
||||||
# and the new stdout goes to a file
|
|
||||||
dvips -N0 -f $1 >$1.ps || exit $?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
build_pdf() {
|
build_pdf() {
|
||||||
# We really have to do it three times to get all the page numbers right,
|
use_latex $1 pdflatex
|
||||||
# since the length of the ToC makes a real difference.
|
}
|
||||||
pdflatex $1 || exit $?
|
|
||||||
pdflatex $1 || exit $?
|
build_ps() {
|
||||||
`dirname $0`/toc2bkm.py -c section $FILE || exit $?
|
dvips -N0 -o $1.ps -f $1 || exit $?
|
||||||
if [ -f $1.idx ] ; then
|
}
|
||||||
`dirname $0`/fix_hack $1.idx || exit $?
|
|
||||||
makeindex -s $TOPDIR/texinputs/myindex.ist $1.idx || exit $?
|
cleanup() {
|
||||||
|
rm -f $1.aux $1.log $1.out $1.toc $1.bkm $1.idx $1.ind
|
||||||
|
if [ ! "$BUILD_DVI" ] ; then
|
||||||
|
rm -f $FILE.dvi
|
||||||
fi
|
fi
|
||||||
pdflatex $1 || exit $?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# figure out what our targets are:
|
# figure out what our targets are:
|
||||||
|
|
@ -203,13 +226,9 @@ for FILE in $@ ; do
|
||||||
build_html $FILE 2>&1 | tee -a $LOGFILE
|
build_html $FILE 2>&1 | tee -a $LOGFILE
|
||||||
fi
|
fi
|
||||||
if [ "$DISCARD_TEMPS" ] ; then
|
if [ "$DISCARD_TEMPS" ] ; then
|
||||||
rm -f $FILE.aux $FILE.log $FILE.out $FILE.toc $FILE.bkm 2>&1 \
|
cleanup $FILE 2>&1 | tee -a $LOGFILE
|
||||||
| tee -a $LOGFILE
|
|
||||||
if [ ! "$BUILD_DVI" ] ; then
|
|
||||||
rm -f $FILE.dvi 2>&1 | tee -a $LOGFILE
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
# the the logfile around
|
# keep the logfile around
|
||||||
if [ "$LOGGING" ] ; then
|
if [ "$LOGGING" ] ; then
|
||||||
cp $LOGFILE $FILE.how
|
cp $LOGFILE $FILE.how
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue