cppannotations/annotations/bin/latexonly
Frank B. Brokken 777b182edd Moved all files but 'excluded', 'sf', and 'sourcetar' to ./annotations
This allowed me to standardize the sourcetar and sf/* scripts: the base
    directory (containing ./git) is now empty, except for maintenance scripts,
    while the source files and build scripts of the annotations are stored in
    a subdirectory of their own.
2013-05-29 20:44:08 +02: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