cppannotations/bin/latexonly
2010-12-23 14:26:04 +00:00

49 lines
1.1 KiB
Bash
Executable file

#!/bin/sh
cd ../latex
repairtoc()
{
# this adds 0.5em space to the toc entries for sections numbered dd.dd
# For some reason I don't understand there is too little space
# for these sections causing dd.dd and the section's name to overlap
# Lamport's user guide and Googling didn't come up with a solution for
# this problem, but 'sedding' the toc file solves the problem too.
sed 's,\({[[:digit:]]\{2\}\.[[:digit:]]\{2\}}\),\1\\hspace{0.5em},' \
cplusplus.toc > cplusplus.tocs || exit 1
mv cplusplus.tocs cplusplus.toc || exit 1
}
echo 1>&2 "
Removing blanks around verbatim environments.
"
../bin/patchlatexverb < cplusplus${1}.latex > cplusplus.latex2
mv cplusplus.latex2 cplusplus${1}.latex
echo 1>&2 "
Constructing preliminary .dvi file in `pwd`.
"
latex cplusplus${1}.latex
[ $? -eq 0 ] || exit 1
repairtoc
latex cplusplus${1}.latex
[ $? -eq 0 ] || exit 1
repairtoc
echo 1>&2 "
Constructing the index file in `pwd`.
"
makeindex cplusplus${1}
../bin/patchlatexidx $1
echo 1>&2 "
Constructing final .dvi file in `pwd`.
"
latex cplusplus${1}.latex
repairtoc