#!/bin/sh # Shell script for typesetting a teTeX document with French Pro features. # # Copyright Bernard Gaulle, as in french_doc.pdf # # last update=2007/01/25 # # Here is the version number for this shell script fpversion="4.0" # Various BSD systems don't have $home but $HOME if test "$home" == "" then home=$HOME fi # # Modify $PATH search, if necessary, to access to FrenchPro binaries # pathfpcmd=`type FrenchPro 2>/dev/null | sed -e "s/^FrenchPro is //"` if test "$pathfpcmd" != "" then pathfp=`dirname $pathfpcmd` fi if test "$pathfp" == "" then pathfp=`echo "$0" | sed -e "sI/FrenchProII"` fi usualht=$home/texmf if test "$pathfp" == "" then pathfp=$usualht/bin fi declare -x PATH="$pathfp:$PATH" # # Search for kpsewhich # pathkpscmd=`type kpsewhich 2>/dev/null | sed -e "s/^kpsewhich is //"` if test "$pathkpscmd" != "" then pathkps=`dirname $pathkpscmd`/ fi if test "$pathkps" == "" then for f in ${pathfp}/fr*tex do ls -l $f > /tmp/FrenchPro_fr_tex.$$ break done pathkpsfile=`cat /tmp/FrenchPro_fr_tex.$$ | awk 'BEGIN {RS="\t"} {printf($11)}'` pathkps=`dirname ${pathkpsfile}`/ fi # Use the texmf.cnf completed by FrenchPro texmfmain=`${pathkps}kpsewhich --expand-var='$TEXMFMAIN'` hometexmf=`${pathkps}kpsewhich --expand-var='$TEXMFHOME'` if test "$hometexmf" == "" then hometexmf=`${pathkps}kpsewhich --expand-var='$HOMETEXMF'` fi hometexmfcnf=$hometexmf/web2c/texmf.cnf texmfcnffile=`${pathkps}kpsewhich texmf.cnf` texmfcnf=`${pathkps}kpsewhich --expand-var='$TEXMFCNF'` l0="This is the FrenchPro command, script version=$fpversion" u1="Usage1: FrenchPro [-h] format_name file_name[.tex]" u2="Usage2: FrenchPro teTeX_command" u3="Usage3: FrenchPro other_FrenchPro_command" # which translate file to use to obtain 8bit output ? transfile=cp8bit.tcx if test -f "$texmfmain/web2c/cp227.tcx" then transfile=cp227.tcx fi translatefile="--translate-file=$transfile" # Set running texmf.cnf path if test "$hometexmfcnf" != "$texmfcnffile" then declare -x TEXMFCNF="$hometexmf/web2c:$usualht/web2c:$texmfcnf" fi baseengine=tex # # Parse off the command line # if test "$1" = "" then echo $u1 echo $u2 echo $u3 exit 1 fi for i do case $1 in -v) echo $l0 exit; ;; -version) echo $l0 exit; ;; frtex) fmt="frtex -no-mktex=FMT" shift; ;; frlatex) fmt="frlatex -no-mktex=FMT" shift; ;; frpdftex) fmt="frpdftex -no-mktex=FMT" initid=pdf shift; ;; frpdflatex) fmt="frpdflatex -no-mktex=FMT" initid=pdf shift; ;; fretex) fmt="fretex -no-mktex=FMT" initopt=e shift; ;; frelatex) fmt="frelatex -no-mktex=FMT" initopt=e shift; ;; frpdfetex) fmt="frpdfetex -no-mktex=FMT" initid=pdf initopt=e shift; ;; frpdfelatex) fmt="frpdfelatex -no-mktex=FMT" initid=pdf initopt=e shift; ;; frotex) fmt="frotex -no-mktex=FMT" initopt=o shift; ;; frolatex) fmt="frolatex -no-mktex=FMT" initopt=o shift; ;; frpdfotex) fmt="frpdfotex -no-mktex=FMT" initid=pdf initopt= shift; ;; frpdfolatex) fmt="frpdfotex -no-mktex=FMT" initid=pdf initopt=o shift; ;; -h) echo "==============================================" echo " $l0" echo $u1 echo " This is the unix command to use FrenchPro " echo " format_name should be : frtex/frlatex " echo " or fretex/frelatex " echo " or frpdftex/frpdflatex " echo $u2 echo $u3 echo "==============================================" exit; ;; -interaction=*) interaction="$1" shift; ;; -translate-file=*) translatefile="$1" shift; ;; --translate-file=*) translatefile="$1" shift; ;; *) file=$i break ;; esac done if test "$file" = "" then FrenchPro -h ; exit 1 else if test "$fmt" = "" then $* else # We can't use the following way because TEXINPUTS.fr* would not be used: # $initid$initopt$baseengine $translatefile $interaction "&$fmt $file" # Usual way is: $fmt $translatefile $interaction $file fi fi exit ###############################################################################