#!/bin/sh

# generated by xteminstall

# If you need to change this file (e.g. adding environment settings etc.),
# you can prevent xteminstall from overwriting this file
# at further calls of xteminstall: 
# just create a file "xtemInstalled" in this directory, eg with Unix command:
#
#      touch xtemInstalled

#####  command to call wishx (must include Tcl, Tk and TclX)
wishcall="/usr/local/bin/wishx"

#####  command to call tcl (pure Tcl, without Tk)
tclcall="/usr/local/bin/tcl"

#####  path in which xtem is installed:
#####  can be set by the environment variable XTEMPATH; 
#####  if XTEMPATH doesn't exist, it will be set to the following default value:
: ${XTEMPATH=${XTEMPATH-/usr/local/lib/tex/xtem}}
#####  (i.e. files      /usr/local/lib/tex/xtem/*.tcl     will be found)

#####  one of the following language defining lines must be made active! 
#defaultlanguage="german"
#defaultlanguage="english"
defaultlanguage="german"

if [ ! -d "$XTEMPATH" ]
then
  echo "error at xtem call:  XTEMPATH=$XTEMPATH   doesn't exist"
  echo "probably your installation is incomplete, see: xtem Installation Guide)"
  exit
fi

if [ "$defaultlanguage" = "" ]
then
  defaultlanguage="english"
  echo "installation incomplete: default language is not specified;  set to $defaultlanguage"
  echo "please modify file (shell script) \"$0\""
fi

language=$defaultlanguage

if [ "$1 " = "-l " ] ;# Blanks inserted for Linux
then language="$2"; shift
  if [ "$1" = "" ]
  then
    echo "syntax:  `basename $0` [ -l language ] [ filename[.tex] ]"
  else
    shift
  fi
fi

if [ "$language" = "deutsch" ]; then language="german"; fi
if [ \
        "$language" != "german" \
     -a "$language" != "english" \
   ]
then
  echo "Warning: language \"$language\" not implemented; we use \"$defaultlanguage\" instead"
  echo "         supported languages are:   german | deutsch, english"
  language=$defaultlanguage
fi

exec $wishcall -f $XTEMPATH/xtem.tcl -n xtem $wishcall $tclcall $XTEMPATH $language $*
####

