Index: palm/trunk/SCRIPTS/compile_tutorial
===================================================================
--- palm/trunk/SCRIPTS/compile_tutorial	(revision 915)
+++ palm/trunk/SCRIPTS/compile_tutorial	(revision 915)
@@ -0,0 +1,155 @@
+#!/bin/ksh
+#------------------------------------------------------------------------------!
+# Current revisions:
+# -----------------
+# Initial revision
+# 
+# Former revisions:
+# -----------------
+# $Id$
+#
+# Description:
+# ------------
+# This script compiles all LaTeX files that are located in TUTORIAL/SOURCE/.
+# Three PDFs are generated for each source file: 
+# the lecture version has a step-by-step layout, the handout version contains 
+# lines for notes, the web version can contain additional comments by the 
+# authors and has no step-by-step layout.
+# If a file is given as input parameter, only this file will be compiled.
+#
+# Execution:
+# ----------
+# compile_tutorial                 --> compiles all *.tex files in directory.
+# compile_tutorial -f filename.tex --> compiles filename.tex only.
+#------------------------------------------------------------------------------!
+
+    cycles=3
+    debug=false
+    file=""
+
+    full_name=`readlink -f $0`
+    directory="$(dirname $full_name)/../TUTORIAL/SOURCE"
+    output_dir="$(dirname $full_name)/../TUTORIAL"
+    cd $directory
+
+    while  getopts  :df: option
+    do
+       case  $option  in
+          (d)   debug=true;;
+          (f)   file=$OPTARG;;
+          (\?)  printf "\n  +++ unknown option $OPTARG \n"
+                printf "\n  --> type \"$0 ?\" for available options \n"
+                locat=parameter;exit;;
+       esac
+    done
+
+    shift OPTIND-1
+
+
+#   Print help
+    if [[ "$1" = "?" ]]
+    then
+       (printf "\n  *** compile_tutorial can be called as follows:\n"
+        printf "\n     compile  -d  -f..\n"
+        printf "\n     Description of available options:\n"
+        printf "\n      Option      Description                                 Default-Value"
+        printf "\n        -d        show all debug output                               false"
+        printf "\n        -f        Filename (single file compilation mode)                \"\""
+        printf "\n         ?        this outline \n\n") | more
+        exit
+    fi
+
+    if [[ "$file" != "" ]] then
+       file_list=`readlink -f $(basename $file)`
+    else
+       file_list="$directory/*.tex"
+    fi
+
+
+    if [[ ! -d $output_dir/LECTURE ]] then
+       printf " $output_dir/LECTURE will be created.\n"
+       mkdir -p $output_dir/LECTURE
+    fi
+
+    if [[ ! -d $output_dir/HANDOUT ]] then
+       printf " $output_dir/HANDOUT will be created.\n"
+       mkdir -p $output_dir/HANDOUT
+    fi
+
+    if [[ ! -d $output_dir/WEB ]] then
+       printf " $output_dir/WEB will be created.\n"
+       mkdir -p $output_dir/WEB
+    fi
+
+    for i in $file_list;
+    do 
+       if [[ "$(echo $(basename $i)|cut -c1-6)" != "header" ]] then
+          printf "\n Compiling $i.\ Please wait..."
+
+#         Check if file exists
+          if [[ ! -f "$i" ]] then
+             printf " error."
+             printf "\n File $i does not exist. Skipping..."
+             break
+          fi
+
+          compiling_type="LECTURE"
+          for (( j=0; j<=2; j+=1 ))
+          do
+             rm -rf tmp_dir
+             mkdir tmp_dir
+             cp header_${compiling_type}.tex header_tmp.tex
+             for (( k=1; k<=$cycles; k+=1 ))
+             do
+                if ( $debug ) then
+                   printf "\n pdflatex output:\n\n\n"
+                   pdflatex -halt-on-error -output-directory=tmp_dir $i
+                   if [[ "$?" != "0" ]] 
+                   then
+                      printf "\n\n Compilation aborted. Please check your source code.\n"
+                      rm -rf tmp_dir
+                      exit
+                    fi
+                else
+                   pdflatex -halt-on-error -output-directory=tmp_dir $i  2>&1 > error_file
+
+                   if [[ "$?" != "0" ]] 
+                   then
+                      printf " error."
+                      printf "\n The following error occured during the compilation:\n\n\n"
+                      cat error_file |grep "Error"
+                      printf "\n\n Compilation aborted. Please check your source code.\n"
+                      rm -rf tmp_dir
+                      rm error_file
+                      exit
+                   fi
+                fi
+                mv tmp_dir/*.pdf $output_dir/$compiling_type
+             done
+             if [[ "$compiling_type" = "LECTURE" ]]
+             then
+                compiling_type="WEB"
+             elif [[ "$compiling_type" = "WEB" ]]
+             then
+                compiling_type="HANDOUT"
+             fi
+          done  
+          printf " done."
+       fi
+
+#      Cleaning up
+       if [[ -f header_tmp.tex ]] then
+          rm header_tmp.tex
+       fi
+       if [[ -f error_file ]] then
+          rm error_file
+       fi
+       if [[ -d tmp_dir ]] then
+          rm -rf tmp_dir
+       fi
+
+    done
+
+    printf "\n\n +++ All actions finished.\n"
+
+exit
Index: palm/trunk/SCRIPTS/release_tutorial
===================================================================
--- palm/trunk/SCRIPTS/release_tutorial	(revision 915)
+++ palm/trunk/SCRIPTS/release_tutorial	(revision 915)
@@ -0,0 +1,72 @@
+#!/bin/ksh
+#------------------------------------------------------------------------------!
+# Current revisions:
+# -----------------
+# Initial revision
+# 
+# Former revisions:
+# -----------------
+# $Id$
+#
+# Description:
+# ------------
+# Script for copying the compiled PDFs to a desired web directory. This script
+# should be used by user raasch only.
+#
+# Execution:
+# ----------
+# release_tutorial --> Copy all PDF files to $release_directory (see below)
+#------------------------------------------------------------------------------!
+
+    release_directory="/home/raasc/public_html/files"
+    mod_dir_lecture="755"
+    mod_dir_handout="755"
+    mod_dir_web="755"
+    mod_lecture="644"
+    mod_handout="644"
+    mod_web="644"
+
+    full_name=`readlink -f $0`
+    directory="$(dirname $full_name)/../TUTORIAL/SOURCE"
+    input_dir="$(dirname $full_name)/../TUTORIAL"
+    cd $input_dir
+
+    printf "\n Files will be released in $release_directory/."
+    printf "\n Subdirectories LECTURE, HANDOUT and WEB will be creared if necessary."
+    printf "\n Start copying...\n"
+
+
+    if [[ ! -d $release_directory/LECTURE ]] then
+       printf " $release_directory/LECTURE will be created.\n"
+       mkdir -p $release_directory/LECTURE
+       chmod $mod_dir_lecture $release_directory/LECTURE
+    fi
+    cp LECTURE/*.pdf "$release_directory/LECTURE/"
+    chmod $mod_lecture $release_directory/LECTURE/*
+    printf " Finished LECTURE.\n"
+
+    if [[ ! -d $release_directory/HANDOUT ]] then
+       printf " $release_directory/HANDOUT will be created.\n"
+       mkdir -p $release_directory/HANDOUT
+       chmod $mod_dir_handout $release_directory/HANDOUT
+
+    fi
+    cp HANDOUT/*.pdf "$release_directory/HANDOUT/"
+    chmod $mod_handout $release_directory/HANDOUT/*
+    printf " Finished HANDOUT.\n"
+
+    if [[ ! -d $release_directory/WEB ]] then
+       printf " $release_directory/WEB will be created.\n"
+       mkdir -p $release_directory/WEB
+       chmod $mod_dir_web $release_directory/WEB
+    fi
+    cp WEB/*.pdf "$release_directory/WEB/"
+    chmod $mod_web $release_directory/WEB/*
+    printf " Finished WEB.\n"
+
+    printf " \n +++ All actions finished.\n"
+
+exit
+
+
+
