| 1 | #!/bin/sh |
| 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 -n > 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 'flabels' (color?): |
| 20 | #P_OPT=color |
| 21 | |
| 22 | if [ -n "$C_OPT" ]; then |
| 23 | echo "\PassOptionsToClass{$C_OPT}{article}" >> ltxdoc.cfg |
| 24 | fi |
| 25 | if [ -n "$P_OPT" ]; then |
| 26 | echo "\PassOptionsToPackage{$P_OPT}{flabels}" >> ltxdoc.cfg |
| 27 | if echo $P_OPT | grep color > /dev/null && [ ! -s color.cfg ]; then |
| 28 | echo "Package 'color' needs a file 'color.cfg'!" |
| 29 | fi |
| 30 | fi |
| 31 | echo "\batchmode" >> ltxdoc.cfg |
| 32 | |
| 33 | # The next lines produce full indexes and change logs |
| 34 | # you may not want those (comment the lines out with |
| 35 | # TeX-comment-character '%'!) |
| 36 | cat >> ltxdoc.cfg <<EOF |
| 37 | % \AtBeginDocument{\RecordChanges} |
| 38 | % \AtEndDocument{\PrintChanges} |
| 39 | \AtBeginDocument{\CodelineIndex\EnableCrossrefs} |
| 40 | \AtEndDocument{\PrintIndex} |
| 41 | \AtEndDocument{\addcontentsline{toc}{section}{Index}} |
| 42 | EOF |
| 43 | |
| 44 | # If you do not want any code listings, just documentation, then instead |
| 45 | # of the lines above, uncomment the following: |
| 46 | #echo "\AtBeginDocument{\OnlyDescription}" >> ltxdoc.cfg |
| 47 | |
| 48 | #---------- latex the documentation using `ltxdoc.cfg': -------------- |
| 49 | |
| 50 | ThisDoc=flabels.dtx |
| 51 | Base=flabels |
| 52 | |
| 53 | echo "1st latex $ThisDoc" |
| 54 | if (latex $ThisDoc > /dev/null); then |
| 55 | echo "2nd latex $ThisDoc" |
| 56 | latex $ThisDoc > /dev/null |
| 57 | |
| 58 | echo "makeindex -s gind.ist $Base.idx" |
| 59 | makeindex -s gind.ist $Base.idx |
| 60 | echo "3rd latex $ThisDoc" |
| 61 | latex $ThisDoc > /dev/null |
| 62 | else |
| 63 | echo "!!! LaTeX ERROR: $ThisDoc. (See $Base.log.)" |
| 64 | fi |