lib/Tools/latex
changeset 14921 4ad751fa50c1
parent 14344 0f0a2148a099
child 14970 8159ade98144
--- a/lib/Tools/latex	Sat Jun 12 13:50:55 2004 +0200
+++ b/lib/Tools/latex	Sat Jun 12 22:44:58 2004 +0200
@@ -16,7 +16,7 @@
   echo
   echo "  Options are:"
   echo "    -o FORMAT    specify output format: dvi (default), dvi.gz, ps, ps.gz,"
-  echo "                 pdf, bbl, png, sty"
+  echo "                 pdf, bbl, png, sty, syms"
   echo
   echo "  Run LaTeX (and related tools) on FILE (default root.tex),"
   echo "  producing the specified output format."
@@ -73,6 +73,9 @@
 
 # operations
 
+#set by configure
+AUTO_PERL=perl
+
 function run_latex () { $ISABELLE_LATEX "\\nonstopmode\\input{$FILEBASE.tex}"; }
 function run_pdflatex () { $ISABELLE_PDFLATEX "\\nonstopmode\\input{$FILEBASE.tex}"; }
 function run_bibtex () { $ISABELLE_BIBTEX </dev/null "$FILEBASE"; }
@@ -81,6 +84,16 @@
 function run_thumbpdf () { [ -n "$ISABELLE_THUMBPDF" ] && $ISABELLE_THUMBPDF "$FILEBASE"; }
 function copy_styles () { cp -f "$ISABELLE_HOME/lib/texinputs"/*.sty "$DIR"; }
 
+function extract_syms ()
+{
+  "$AUTO_PERL" -n \
+    -e '!m,%requires, && m,\\newcommand\{\\isasym(\w+)\}, && print "$1\n";' \
+    "$ISABELLE_HOME/lib/texinputs/isabellesym.sty" > "$DIR/syms.lst"
+  "$AUTO_PERL" -n \
+    -e 'm,\\newcommand\{\\isactrl(\w+)\}, && print "$1\n";' \
+    "$ISABELLE_HOME/lib/texinputs/isabelle.sty" > "$DIR/ctrls.lst"
+}
+
 case "$OUTFORMAT" in
   dvi)
     check_root && \
@@ -130,6 +143,10 @@
     copy_styles
     RC="$?"
     ;;
+  syms)
+    extract_syms
+    RC="$?"
+    ;;
   *)
     fail "Bad output format '$OUTFORMAT'"
     ;;