| 1 |
#!/bin/bash |
| 2 |
# |
| 3 |
# Everything after a `#' is ignored |
| 4 |
# |
| 5 |
# remove the string `> /dev/null' if you want more log-output |
| 6 |
# remove the line containing `batchmode' if you want even more |
| 7 |
# log-information while running LaTeX |
| 8 |
# |
| 9 |
#----------------- create a `ltxdoc.cfg': -------------------------- |
| 10 |
|
| 11 |
# Make sure that we start with an clean 'ltxdoc.cfg': |
| 12 |
echo "" > ltxdoc.cfg |
| 13 |
|
| 14 |
# Put here a (comma-separated) list of options to pass to |
| 15 |
# class 'article': |
| 16 |
C_OPT=a4paper |
| 17 |
|
| 18 |
# Put here a (comma-separated) list of options to pass to |
| 19 |
# package 'notes' (color?): |
| 20 |
|
| 21 |
if [ -n "$C_OPT" ]; then |
| 22 |
echo "\PassOptionsToClass{$C_OPT}{article}" >> ltxdoc.cfg |
| 23 |
fi |
| 24 |
echo "\\batchmode" >> ltxdoc.cfg |
| 25 |
|
| 26 |
# The next lines produce full indexes and change logs |
| 27 |
# you may not want those (comment the lines out with |
| 28 |
# TeX-comment-character '%'!) |
| 29 |
cat >> ltxdoc.cfg <<EOF |
| 30 |
% \AtBeginDocument{\RecordChanges} |
| 31 |
% \AtEndDocument{\PrintChanges} |
| 32 |
\AtBeginDocument{\CodelineIndex\EnableCrossrefs} |
| 33 |
\AtEndDocument{\PrintIndex} |
| 34 |
\AtEndDocument{\addcontentsline{toc}{section}{Index}} |
| 35 |
EOF |
| 36 |
|
| 37 |
# If you do not want any code listings, just documentation, then instead |
| 38 |
# of the lines above, uncomment the following: |
| 39 |
#echo "\AtBeginDocument{\OnlyDescription}" >> ltxdoc.cfg |
| 40 |
|
| 41 |
#---------- latex the documentation using `ltxdoc.cfg': -------------- |
| 42 |
|
| 43 |
ThisDoc=notes.dtx |
| 44 |
Base=notes |
| 45 |
|
| 46 |
echo "1st latex $ThisDoc" |
| 47 |
if (latex $ThisDoc > /dev/null); then |
| 48 |
echo "2nd latex $ThisDoc" |
| 49 |
latex $ThisDoc > /dev/null |
| 50 |
|
| 51 |
echo "makeindex -s gind.ist $Base.idx" |
| 52 |
makeindex -s gind.ist $Base.idx |
| 53 |
echo "3rd latex $ThisDoc" |
| 54 |
latex $ThisDoc > /dev/null |
| 55 |
else |
| 56 |
echo "!!! LaTeX ERROR: $ThisDoc. (See $Base.log.)" |
| 57 |
fi |