# mktex.opt -- common mktex* options, etc. # Meant to be sourced after $usage and $version and $TEXMF have been set. # # te@informatik.uni-hannover.de and kb@mail.tug.org. Public domain. # $Id: mktex.opt,v 1.23 1998/03/17 18:35:26 olaf Exp $ if(~ $1 --help -help) { echo $usage exit usage } if(~ $1 --version -version) { echo `{basename $0} $version kpsewhich --version exit version } if(~ $"mt_min_args '') mt_min_args=0 if(~ $"mt_max_arg '') mt_max_args=1000 if(test $#* -lt $mt_min_args) { echo $0: missing arguments. >[1=2] echo try `{basename $0} --help for more info >[1=2] exit minarg } if(test $#* -gt $mt_max_args) { for(i in `{seq 1 $mt_max_args}) shift echo $0: extra arguments: $* >[1=2] echo try `{basename $0} --help for more info >[1=2] exit maxarg } # MS-DOS and MS-Windows define $COMSPEC or $ComSpec and use `;' to separate # directories in path lists whereas Unix uses `:'. # Create a variable that holds the right character to be used by the scripts. if(~ $"COMSPEC '' && ~ $"ComSpec '') SEP=':' if not SEP=';' # TEMPDIR needs to be unique to each process because of the possibility of two # people running dvips (or whatever) simultaneously. TEMPDIR=/tmp/mt$pid.tmp # We want to output only filenames to standard output, but it's too # error-prone to write the scripts that way, so we direct stdout here. STDOUT=$TEMPDIR/mt$pid.out # We will change search paths to include $KPSE_DOT. This is necessary # since we cd to $TEMPDIR. if(~ $"KPSE_DOT '') KPSE_DOT=`{pwd} # Clean up on normal or abnormal exit. fn xsighup { cd $KPSE_DOT test -f $STDOUT && cat $STDOUT rm -rf $TEMPDIR exit } fn xsigint { cd $KPSE_DOT test -f $STDOUT && cat $STDOUT rm -rf $TEMPDIR exit } fn xsigterm { cd $KPSE_DOT test -f $STDOUT && cat $STDOUT rm -rf $TEMPDIR exit } fn sigexit { cd $KPSE_DOT test -f $STDOUT && cat $STDOUT rm -rf $TEMPDIR exit } mkdir $TEMPDIR || exit mktempdir cd $TEMPDIR || exit cdtempdir if(~ $"MT_VARTEXFONTS '') MT_VARTEXFONTS=`{kpsewhich --expand-var'=$VARTEXFONTS' | sed 's%^!!%%'} if(~ $"MT_VARTEXFONTS '') { echo $0: VARTEXFONTS is not defined. defaulting to $KPSE_DOT >[1=2] MT_VARTEXFONTS=$KPSE_DOT } if(~ $"MT_MKTEXNAM '') MT_MKTEXNAM=`{kpsewhich --'format=web2c files' mktexnam} if(~ $"MT_MKTEXNAM '') MT_MKTEXNAM=$MT_TEXMFMAIN/web2c/mktexnam if(~ $"MT_MKTEXNAM_OPT '') MT_MKTEXNAM_OPT=`{kpsewhich --'format=web2c files' mktexnam.opt} if(~ $"MT_MKTEXNAM_OPT '') MT_MKTEXNAM=$MT_TEXMFMAIN/web2c/mktexnam.opt if(~ $"MT_MKTEXDIR '') MT_MKTEXDIR=`{kpsewhich --'format=web2c files' mktexdir} if(~ $"MT_MKTEXDIR '') MT_MKTEXDIR=$MT_TEXMFMAIN/web2c/mktexdir if(~ $"MT_MKTEXDIR_OPT '') MT_MKTEXDIR_OPT=`{kpsewhich --'format=web2c files' mktexdir.opt} if(~ $"MT_MKTEXDIR_OPT '') MT_MKTEXDIR_OPT=$MT_TEXMFMAIN/web2c/mktexdir.opt if(~ $"MT_MKTEXUPD '') MT_MKTEXUPD=`{kpsewhich --'format=web2c files' mktexupd} if(~ $"MT_MKTEXUPD '') MT_MKTEXUPD=$MT_TEXMFMAIN/web2c/mktexupd # mktexupd and mktexlsr make sure they're coordinated via this. A copy of # the first string is found in mktexlsr. ls_R_magic='% ls-R -- filename database for kpathsea; do not change this line.' # Old ls-R files should continue to work. old_ls_R_magic='% ls-R -- maintained by MakeTeXls-R; do not change this line.' # Read defaults from mktex.cnf if that file exists. Can be used to # overwrite anything defined below. Please use the same syntax as # given here (e.g. ``: ${MODE=ljfour}'', not just ``MODE=ljfour'', as # this can cause trouble (e.g. when the mode for mktexnam is # already specified on the command line). # : ${MT_MKTEX_CNF=`/bin/kpsewhich --format='web2c files' mktex.cnf`} # test -n "$MT_MKTEX_CNF" && test -r "$MT_MKTEX_CNF" && . "$MT_MKTEX_CNF" # Possible features: appendonlydir dosnames fontmaps nomode stripsupplier # striptypeface varfonts. if(~ $"MT_FEATURES '') MT_FEATURES=appendonlydir if(~ $"MODE '') MODE=ljfour if(~ $"BDPI) BDPI=600 if(~ $ps_to_pk) ps_to_pk=gsftopk # Allow fonts to be read and written (especially in case we make # directories) by everyone. # umask 0 # Cache values that may be useful for recursive calls. # export MT_MKTEX_OPT MT_MKTEX_CNF # # export MT_MKTEXNAM MT_MKTEXNAM_OPT # export MT_MKTEXDIR MT_MKTEXDIR_OPT # export MT_MKTEXUPD # export MT_TEXMFMAIN MT_VARTEXFONTS