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