3
# TeXConfig version 3.0
4
# Originally written by Thomas Esser. Public domain.
5
# Now maintained as part of TeX Live; correspondence to tex-live@tug.org.
7
# invoke the right shell:
9
test -f /bin/ksh && test -z "$RUNNING_KSH" \
10
&& { UNAMES=`uname -s`; test "x$UNAMES" = xULTRIX; } 2>/dev/null \
11
&& { RUNNING_KSH=true; export RUNNING_KSH; exec /bin/ksh $0 ${1+"$@"}; }
14
test -f /bin/bsh && test -z "$RUNNING_BSH" \
15
&& { UNAMES=`uname -s`; test "x$UNAMES" = xAIX; } 2>/dev/null \
16
&& { RUNNING_BSH=true; export RUNNING_BSH; exec /bin/bsh $0 ${1+"$@"}; }
21
# hack around a bug in zsh:
22
test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"'
31
AFMFONTS BIBINPUTS BSTINPUTS CMAPFONTS CWEBINPUTS ENCFONTS GFFONTS
32
GLYPHFONTS INDEXSTYLE LIGFONTS MFBASES MFINPUTS MFPOOL MFTINPUTS
33
MISCFONTS MPINPUTS MPMEMS MPPOOL MPSUPPORT OCPINPUTS OFMFONTS
34
OPENTYPEFONTS OPLFONTS OTPINPUTS OVFFONTS OVPFONTS PDFTEXCONFIG PKFONTS
35
PSHEADERS SFDFONTS T1FONTS T1INPUTS T42FONTS TEXBIB TEXCONFIG TEXDOCS
36
TEXFONTMAPS TEXFONTS TEXFORMATS TEXINDEXSTYLE TEXINPUTS TEXMFCNF
37
TEXMFDBS TEXMFINI TEXMFSCRIPTS TEXPICTS TEXPKS TEXPOOL TEXPSHEADERS
38
TEXSOURCES TFMFONTS TRFONTS TTFONTS VFFONTS WEB2C WEBINPUTS
40
tmpdir=${TMPDIR-${TEMP-${TMP-/tmp}}}/tctmp.$$
45
###############################################################################
46
# setupFMT(void) - find a suitable version of fmt / adjust
53
test ! -x /bin/fmt && test ! -f /usr/bin/fmt &&
54
{ test -x /bin/adjust || test -x /usr/bin/adjust; } && FMT=adjust
62
###############################################################################
63
# myFmt(args) - run $FMT
71
###############################################################################
72
# echoShowVariable(args ...)
73
# show environment variables which names are as args and their values
80
eval val=\"\${$var+=}\${$var- is unset}\"
82
done | grep -v 'is unset$'
85
###############################################################################
86
# echoShowKpseVariable(args ...)
87
# show kpathsea variables which names are as args and their values
89
echoShowKpseVariable()
94
val=`kpsewhich -var-value="$eskv"`
99
###############################################################################
100
# echoLocateBinary(args ...) - show where programs actually exist
106
elbLoc=`checkForBinary "$elb"`
107
if test -n "$ELB_PATH_ONLY"; then
108
test -n "$elbLoc" && echo "$elbLoc"
111
"") echo "$elb: not found";;
112
*) echo "$elb: $elbLoc";;
118
###############################################################################
119
# echoLocateCfgfile(args ...) - show where files actually exist
126
texmf.cnf) elcLoc=`kpsewhich $elc`;;
127
*) elcLoc=`tcfmgr --cmd find --file "$elc"`;;
130
"") echo "$elc: not found";;
136
###############################################################################
137
# checkForBinary(prog) - echo full path of prog
145
set x `echo "$PATH" | sed 's/^:/.:/; s/:$/:./; s/::/:.:/g'`; shift
151
*) test -f "$pathElem/$cfbBinary" && { echo "$pathElem/$cfbBinary"; found=true; break; }
156
true) (exit 0); return 0;;
157
false) (exit 1); return 1;;
161
###############################################################################
162
# cleanup() - clean up the temp area and exit with proper exit status
167
$needsCleanup && test -n "$tmpdir" && test -d "$tmpdir" \
168
&& { cd / && rm -rf "$tmpdir"; }
172
###############################################################################
173
# setupTmpDir() - set up a temp directory and a trap to remove it
177
case $needsCleanup in
181
trap 'cleanup 1' 1 2 3 7 13 15
183
(umask 077; mkdir "$tmpdir") \
184
|| abort "could not create directory \`$tmpdir'"
187
###############################################################################
188
# setupTexmfmain() - get value for MT_TEXMFMAIN (with caching)
192
case $MT_TEXMFMAIN in
193
"") MT_TEXMFMAIN=`kpsewhich -var-value=TEXMFMAIN`;;
198
###############################################################################
199
# setupTexmfmain() - get value for MT_TEXMFDIST (with caching)
203
case $MT_TEXMFDIST in
204
"") MT_TEXMFDIST=`kpsewhich -var-value=TEXMFDIST`;;
209
###############################################################################
210
# setupTexmfvar() - get value for MT_TEXMFVAR (with caching)
215
"") MT_TEXMVAR=`kpsewhich -var-value=TEXMFVAR`;;
220
###############################################################################
221
# setupSystexmf() - get value for MT_SYSTEXMF (with caching)
226
"") MT_SYSTEXMF=`kpsewhich -var-value=SYSTEXMF`;;
231
###############################################################################
233
# print `errmsg' to stderr and exit with error code 1
237
echo "$progname: $1." >&2
241
###############################################################################
243
# call mktexdir script, disable all features (to prevent sticky directories)
248
MT_FEATURES=none "$MT_TEXMFMAIN/web2c/mktexdir" "$@" >&2
251
###############################################################################
252
# tcfmgr(args) - call tcfmgr script
257
"$MT_TEXMFMAIN/texconfig/tcfmgr" "$@"
260
###############################################################################
261
# mktexupd(args) - call mktexupd script
266
"$MT_TEXMFMAIN/web2c/mktexupd" "$@"
269
###############################################################################
271
# matches file against SYSTEXMF. Returns relative directory of file within
272
# a texmf tree in variable relPart.
283
set x `echo "$MT_SYSTEXMF" | tr : '
287
# now loop over all components of SYSTEXMF
290
test -n "$dir" || continue
293
relPart=`echo "$file" | sed "s%$dir/*%%"`
299
# now check for success / failure
302
# empty or full filename -> getRelDir failed!
306
# relPart should just have the "dirname" part:
307
relPart=`echo "$relPart" | sed 's%/*[^/]*$%%'`
313
###############################################################################
314
# configReplace(file pattern line)
315
# The first line in file that matches pattern gets replaced by line.
316
# line will be added at the end of the file if pattern does not match.
320
configReplaceFile=$1; configReplacePat=$2; configReplaceLine=$3
322
if grep "$configReplacePat" "$configReplaceFile" >/dev/null; then
323
ed "$configReplaceFile" >/dev/null 2>&1 <<-eof
331
echo "$configReplaceLine" >> $configReplaceFile
335
###############################################################################
336
# fmgrConfigReplace (file regex value)
337
# replaces line matching regex by value in file
341
fmgrConfigReplaceChanged=false
346
--*) moreArgs="$moreArgs $1 $2";;
349
do shift; shift; done
350
fmgrConfigReplaceFile=$1
351
fmgrConfigReplaceRegex=$2
352
fmgrConfigReplaceValue=$3
355
co=`tcfmgr $moreArgs --tmp $tmpdir --cmd co --file $fmgrConfigReplaceFile`
356
if test $? != 0; then
357
echo "$progname: fmgrConfigReplace co failed for \`$fmgrConfigReplaceFile'" >&2
361
fmgrConfigReplaceID=$1; fmgrConfigReplaceCfgFile=$3; fmgrConfigReplaceOrigFile=$4
362
configReplace "$fmgrConfigReplaceCfgFile" "$fmgrConfigReplaceRegex" "$fmgrConfigReplaceValue"
363
ci=`tcfmgr --tmp $tmpdir --cmd ci --id "$fmgrConfigReplaceID"`
364
if test $? != 0; then
365
echo "$progname: fmgrConfigReplace ci failed for \`$fmgrConfigReplaceFile'" >&2
371
fmgrConfigReplaceChanged=true;;
372
*) echo "$progname: updated configuration saved as file \`$ci'" >&2
373
fmgrConfigReplaceChanged=true
374
lastUpdatedFile=$ci;;
379
###############################################################################
380
# setupDvipsPaper(paper)
381
# rearranges config.ps to make paper the first paper definition
385
setupDvipsPaperChanged=false
386
setupDvipsPaperFile=config.ps
387
setupDvipsPaperDftPaper=$1
390
co=`tcfmgr --tmp $tmpdir --cmd co --file $setupDvipsPaperFile`
391
if test $? != 0; then
392
echo "$progname: setupDvipsPaper co failed for \`$setupDvipsPaperFile'" >&2
396
setupDvipsPaperID=$1; setupDvipsPaperCfgFile=$3; setupDvipsPaperOrigFile=$4
398
ed "$setupDvipsPaperCfgFile" > /dev/null 2>&1 <<-eof
403
/@ $setupDvipsPaperDftPaper /;/@ /-1m'a-1
409
ci=`tcfmgr --tmp $tmpdir --cmd ci --id "$setupDvipsPaperID"`
410
if test $? != 0; then
411
echo "$progname: setupDvipsPaper ci failed for \`$setupDvipsPaperFile'" >&2
417
setupDvipsPaperChanged=true;;
418
*) echo "$progname: updated configuration saved as file \`$ci'" >&2
419
setupDvipsPaperChanged=true
420
lastUpdatedFile=$ci;;
425
###############################################################################
426
# setupModesMfFile(void) - find modes.mf file (with caching)
432
modesMfFile=`tcfmgr --cmd find --file modes.mf`
440
###############################################################################
441
# locateConfigPsFile(void) - find config.ps file (with caching)
445
case $configPsFile in
447
configPsFile=`tcfmgr --cmd find --file config.ps`
455
###############################################################################
456
# listMfModes(file) - list modes from modes.mf file
460
grep mode_def "$modesMfFile" |
461
sed -e "s/mode_def //" \
462
-e "s/ .*%[^ ]* / '/" \
464
egrep -v "^(help|%)" | sort
467
###############################################################################
468
# listDvipsPapers(void) - list paper definitions from config.ps
472
grep '@ ' $configPsFile | sed "s/..//;s/ / '/;s/\$/' /"
475
###############################################################################
476
# getFormatsForHyphen(void)
477
# list all formats which have customizable hyphenation
479
getFormatsForHyphen()
481
fmtutil --catcfg | awk '$3 != "-" {print $1}' | sort
484
###############################################################################
485
# getRes(mode) - print resolution (both X and Y axis) to metafont mode
492
cat >mftmp.mf <<-'eof'
493
let myexit = primitive_end_;
496
xdpi := decimal round pixels_per_inch;
497
message "XDPI = " & xdpi;
499
ydpi := decimal round (pixels_per_inch * aspect_ratio);
500
message "YDPI = " & ydpi;
504
mf '\mode='"$getResMode"'; \input ./mftmp' </dev/null \
505
| awk '$1 == "XDPI" || $1 == "YDPI" { print $3 }'
509
###############################################################################
510
# checkElemInList(elem, list)
511
# check if element exists in list
512
###############################################################################
515
checkElemInListElem=$1; shift
516
checkElemInListFound=false
517
for checkElemInListIter
519
case "x$checkElemInListElem" in
520
x$checkElemInListIter)
521
checkElemInListFound=true
526
case $checkElemInListFound in
527
true) (exit 0); return 0;;
533
# show version information from the distribution, if we have any.
534
showDistVersionInfo()
537
test -f $MT_TEXMFMAIN/../release-texlive.txt \
538
&& sed 1q $MT_TEXMFMAIN/../release-texlive.txt
540
# no harm in continuing to look for the teTeX files.
541
test -f $MT_TEXMFMAIN/release-tetex-src.txt \
542
&& "teTeX-src release: `cat $MT_TEXMFMAIN/release-tetex-src.txt`"
543
test -f $MT_TEXMFDIST/release-tetex-texmf.txt \
544
&& "teTeX-texmf release: `cat $MT_TEXMFDIST/release-tetex-texmf.txt`"
548
###############################################################################
551
###############################################################################
554
help="texconfig supports adjusting and updating many aspects of
555
the TeX installation.
557
Usage: $progname conf (show configuration information)
558
$progname dvipdfmx paper PAPER (dvipdfmx paper size)
559
$progname dvipdfm paper PAPER (dvipdfm paper size)
560
$progname dvips [OPTION...] (dvips options)
561
$progname faq (show teTeX faq)
562
$progname findprog PROG... (show locations of PROGs, a la which)
563
$progname font vardir DIR
566
$progname formats (edit fmtutil.cnf)
567
$progname help (or --help; show this help)
568
$progname hyphen FORMAT (edit hyphenation config for FORMAT)
569
$progname init [FORMAT]... (rebuild FORMATs, or all formats
570
plus run texlinks and updmap)
571
$progname mode MODE (set Metafont MODE)
572
$progname paper PAPER (set default paper size to PAPER)
573
$progname pdftex [OPTION]... (pdftex options)
574
$progname rehash (rebuild ls-R files with mktexlsr)
575
$progname version (or --version; show version info)
576
$progname xdvi paper PAPER (xdvi paper size)
589
Report bugs to: tex-k@tug.org
590
TeX Live home page: <http://tug.org/texlive/>
598
echo '=========================== version information =========================='
601
echo '==================== binaries found by searching $PATH ==================='
603
echoLocateBinary kpsewhich updmap fmtutil texconfig tex pdftex mktexpk dvips dvipdfm
605
echo '=========================== active config files =========================='
606
echoLocateCfgfile texmf.cnf updmap.cfg fmtutil.cnf config.ps mktex.cnf XDvi pdftexconfig.tex config | sort -k 2
608
echo '============================= font map files ============================='
609
for m in psfonts.map pdftex.map ps2pk.map dvipdfm.map; do
610
echo "$m: `kpsewhich $m`"
613
echo '=========================== kpathsea variables ==========================='
614
echoShowKpseVariable TEXMFMAIN TEXMFDIST TEXMFLOCAL TEXMFSYSVAR TEXMFSYSCONFIG TEXMFVAR TEXMFCONFIG TEXMFHOME VARTEXFONTS TEXMF SYSTEXMF TEXMFDBS WEB2C TEXPSHEADERS TEXCONFIG ENCFONTS TEXFONTMAPS
617
echo '==== kpathsea variables from environment only (ok if no output here) ===='
618
echoShowVariable $envVars
623
help="Usage: $progname dvipdfm paper PAPER
625
Valid PAPER settings:
626
letter legal ledger tabloid a4 a3"
628
# texconfig dvipdfm paper
630
for p in letter legal ledger tabloid a4 a3; do echo $p; done
634
letter|legal|ledger|tabloid|a4|a3)
635
fmgrConfigReplace config '^p' "p $3";;
636
"") echo "$help" >&2; rc=1;;
638
echo "$progname: unknown PAPER \`$3' given as argument for \`$progname dvipdfm paper'" >&2
639
echo "$progname: try \`$progname dvipdfm paper' for help" >&2
642
# texconfig dvipdfm ""
644
echo "$help" >&2; rc=1 ;;
645
# texconfig dvipdfm <unknown>
647
echo "$progname: unknown option \`$2' given as argument for \`$progname dvipdfm'" >&2
648
echo "$progname: try \`$progname dvipdfm' for help" >&2
656
help="Usage: $progname dvipdfmx paper PAPER
658
Valid PAPER settings:
659
letter legal ledger tabloid a4 a3"
661
# texconfig dvipdfmx paper
663
for p in letter legal ledger tabloid a4 a3; do echo $p; done
667
letter|legal|ledger|tabloid|a4|a3)
668
fmgrConfigReplace dvipdfmx.cfg '^p' "p $3";;
669
"") echo "$help" >&2; rc=1;;
671
echo "$progname: unknown PAPER \`$3' given as argument for \`$progname dvipdfmx paper'" >&2
672
echo "$progname: try \`$progname dvipdfmx paper' for help" >&2
675
# texconfig dvipdfmx ""
677
echo "$help" >&2; rc=1 ;;
678
# texconfig dvipdfmx <unknown>
680
echo "$progname: unknown option \`$2' given as argument for \`$progname dvipdfmx'" >&2
681
echo "$progname: try \`$progname dvipdfmx' for help" >&2
690
help="Usage: $progname dvips add PRINTER
691
$progname dvips del PRINTER
692
$progname dvips paper PAPER
693
$progname dvips [-P PRINTER] mode MODE
694
$progname dvips [-P PRINTER] offset OFFSET
695
$progname dvips [-P PRINTER] printcmd CMD"
700
echo "$progname: missing arg for parameter -P" >&2
701
rc=1; (exit $rc); return $rc
706
otherPrinterFile=`kpsewhich -format='dvips config' "config.$otherPrinterName"`
707
case $otherPrinterFile in
709
echo "$progname: configuration file \`config.$otherPrinterName' for printer \`$otherPrinterName' not found" >&2
710
rc=1; (exit $rc); return $rc
721
case $otherPrinter in
723
tcBatchDvipsPrinter=$otherPrinterName
724
moreFmgrArgs="--reldir dvips/config --infile $otherPrinterFile"
727
tcBatchDvipsPrinter=ps
734
echo "Usage: $progname dvips add PRINTER" >&2
739
pFile=`kpsewhich -format='dvips config' "config.$printerName"`
743
tcfRet=`tcfmgr --emptyinfile --reldir dvips/config --cmd co --tmp $tmpdir --file "config.$printerName"`
744
if test $? != 0; then
745
echo "$progname: failed to add new configuration file \`config.$printerName'" >&2
749
tcBatchDvipsAddID=$1; tcBatchDvipsAddFile=$3
750
echo "% file config.$printerName; added by texconfig" > "$tcBatchDvipsAddFile"
751
tcfRet=`tcfmgr --tmp $tmpdir --id "$tcBatchDvipsAddID" --cmd ci`
752
if test $? != 0; then
753
echo "$progname: failed to add new configuration file \`config.$printerName'" >&2
756
echo "$progname: file $tcfRet added" >&2
761
echo "$progname: configuration file for printer \`$printerName' already exists (\`$pFile')" >&2
771
echo "Usage: $progname dvips del PRINTER" >&2
776
pFile=`kpsewhich -format='dvips config' "config.$printerName"`
779
echo "$progname: configuration file for printer \`$printerName' (config.$printerName) not found" >&2
784
echo "$progname: file \`$pFile' removed" >&2
786
echo "$progname: failed to remove file \`$pFile'" >&2
801
echo "Usage: $progname dvips paper PAPER" >&2
802
echo >&2; echo "Valid PAPER settings:" >&2
804
listDvipsPapers | sed 's@ .*@@; s@^@ @' | myFmt
810
case "$configPsFile" in
812
echo "$progname: file config.ps not found" >&2; rc=1
815
if grep "@ $tcBatchDvipsPaper " $configPsFile >/dev/null 2>&1; then
816
setupDvipsPaper "$tcBatchDvipsPaper"
818
echo "$progname: paper \`$tcBatchDvipsPaper' not found in file \`$configPsFile'" >&2; rc=1
828
echo "Usage: $progname dvips mode MODE
830
Valid MODE settings:"
832
listMfModes | sed 's@ .*@@; s@^@ @' | myFmt
839
if checkElemInList "$tcBatchDvipsMode" `listMfModes | sed 's@ .*@@'`; then
840
set x `getRes "$tcBatchDvipsMode"`; shift
842
fmgrConfigReplace $moreFmgrArgs config.$tcBatchDvipsPrinter '^M' "M $tcBatchDvipsMode"
843
fmgrConfigReplace $moreFmgrArgs config.$tcBatchDvipsPrinter '^D' "D $resX"
844
fmgrConfigReplace $moreFmgrArgs config.$tcBatchDvipsPrinter '^X' "X $resX"
845
fmgrConfigReplace $moreFmgrArgs config.$tcBatchDvipsPrinter '^Y' "Y $resY"
847
echo "$progname: unknown MODE \`$tcBatchDvipsMode' given as argument for \`$progname dvips mode'" >&2
848
echo "$progname: try \`$progname dvips mode' for help" >&2
858
echo "Usage: $progname dvips offset OFFSET"
862
fmgrConfigReplace $moreFmgrArgs config.$tcBatchDvipsPrinter '^O' "O $offset"
869
echo "Usage: $progname dvips printcmd CMD"
873
fmgrConfigReplace $moreFmgrArgs config.$tcBatchDvipsPrinter '^o' o
876
fmgrConfigReplace $moreFmgrArgs config.$tcBatchDvipsPrinter '^o' "o |$printcmd"
881
echo "$help" >&2; rc=1
884
echo "$progname: unknown option \`$1' given as argument for \`$progname dvips'" >&2
885
echo "$progname: try \`$progname dvips' for help" >&2
893
if test -f $MT_TEXMFMAIN/doc/tetex/teTeX-FAQ; then
894
<$MT_TEXMFMAIN/doc/tetex/teTeX-FAQ eval ${PAGER-more}
896
echo "$progname: faq not found (usually in \$TEXMFMAIN/doc/tetex/teTeX-FAQ)" >&2
903
ELB_PATH_ONLY=1 echoLocateBinary "$@"
906
# handle "texconfig font"
908
help="Usage: $progname font vardir DIR
912
The vardir option changes the VARTEXFONTS variable in the texmf.cnf file.
914
The rw option makes the VARTEXFONTS directory (and subtrees pk, tfm,
915
source) world writable and sets the features appendonlydir:varfonts
918
The ro option makes the VARTEXFONTS directory (and subtrees pk, tfm,
919
source) writable for the owner only and sets the feature texmfvar in
922
For more information about these \`features', consult the teTeX manual
923
(e.g. by running \`texdoc TETEXDOC')."
934
tfc=`kpsewhich texmf.cnf`
935
if test -n "$tfc"; then
936
if test -w "$tfc"; then
937
configReplace "$tfc" '^VARTEXFONTS' "VARTEXFONTS = $tcBatchFontVardir"
939
echo "$progname: setting up vardir failed. Reason: no permission to write file \`$tfc'" >&2
943
echo "$progname: setting up vardir failed. Reason: failed to find file texmf.cnf" >&2
950
MT_VARTEXFONTS=`kpsewhich -var-value VARTEXFONTS`
951
if test -z "$MT_VARTEXFONTS"; then
952
echo "$progname: failed to set \`font rw'; reason: could not determine VARTEXFONTS variable." >&2; rc=1
955
test -d "$MT_VARTEXFONTS" || mktexdir "$MT_VARTEXFONTS"
956
if test ! -d "$MT_VARTEXFONTS"; then
957
echo "$progname: failed to set \`font rw'; reason: directory \`$MT_VARTEXFONTS' does not exist." >&2; rc=1
960
chmod 1777 "$MT_VARTEXFONTS" || {
961
echo "$progname: failed to modify permissions in \`$MT_VARTEXFONTS'." >&2; rc=1
965
cd "$MT_VARTEXFONTS" || exit
966
echo "$progname: modifying permissions in \`$MT_VARTEXFONTS' ..." >&2
967
for d in pk tfm source; do
968
test -d "$d" && find $d -type d -exec chmod 1777 '{}' \;
970
echo "$progname: all permissions set." >&2
973
fmgrConfigReplace mktex.cnf '^: ..MT_FEATURES=' ": \${MT_FEATURES=appendonlydir:varfonts}"
976
MT_VARTEXFONTS=`kpsewhich -var-value VARTEXFONTS`
977
if test -z "$MT_VARTEXFONTS"; then
978
echo "$progname: failed to set \`font ro'; reason: could not determine VARTEXFONTS variable." >&2; rc=1
981
test -d "$MT_VARTEXFONTS" || mktexdir "$MT_VARTEXFONTS"
982
if test ! -d "$MT_VARTEXFONTS"; then
983
echo "$progname: failed to set \`font ro'; reason: directory \`$MT_VARTEXFONTS' does not exist." >&2; rc=1
986
chmod 755 "$MT_VARTEXFONTS" || {
987
echo "$progname: failed to modify permissions in \`$MT_VARTEXFONTS'." >&2; rc=1
991
cd "$MT_VARTEXFONTS" || exit
992
echo "$progname: modifying permissions in \`$MT_VARTEXFONTS' ..." >&2
993
for d in pk tfm source; do
994
test -d "$d" && find "$d" -type d -exec chmod 755 '{}' \;
996
echo "$progname: all permissions set." >&2
999
fmgrConfigReplace mktex.cnf '^: ..MT_FEATURES=' ": \${MT_FEATURES=texmfvar}"
1001
"") echo "$help" >&2; rc=1;;
1002
*) echo "$progname: unknown option \`$2' given as argument for \`$progname font'" >&2
1003
echo "$progname: try \`$progname font' for help" >&2
1011
texconfig formats is no longer supported, because manual edits of
1012
fmtutil.cnf will be overwritten by the new TeX Live package manager,
1013
tlmgr, which regenerates that file as needed upon package changes.
1014
Thus, to add or remove formats, the recommended method is to use tlmgr
1015
to add or remove the appropriate package.
1017
If you need to make manual additions, you can edit the file
1018
fmtutil-local.cnf under TEXMFLOCAL. Further information with
1019
tlmgr --help and at http://tug.org/texlive/tlmgr.html.
1023
exit 1 # but leave the real code for posterity
1026
echo "$progname: analyzing old configuration..." >&2
1027
fmtutil --catcfg > $tmpdir/pre
1029
echo "$progname: analyzing new configuration..." >&2
1030
fmtutil --catcfg > $tmpdir/post
1032
if cmp $tmpdir/pre $tmpdir/post >/dev/null 2>&1; then
1033
echo "$progname: no new/updated formats available ..." >&2
1035
echo "$progname: updating formats ..." >&2
1036
comm -13 $tmpdir/pre $tmpdir/post > $tmpdir/addOrChange
1037
for i in `awk '{print $1}' $tmpdir/addOrChange`; do
1038
fmtutil --byfmt "$i" || rc=1
1040
texlinks --multiplatform || rc=1
1051
texconfig hyphen is no longer supported, because manual edits of
1052
language.dat (or language.def) will be overwritten by the new TeX Live
1053
package manager, tlmgr, which regenerates those configuration files as
1054
needed upon package changes. Thus, to add or remove hyphenation
1055
patterns, the recommended method is to use tlmgr to add or remove the
1056
appropriate package.
1058
If you need to make manual additions, you can edit the files
1059
language-local.dat and language-local.def under TEXMFLOCAL. Further
1060
information with tlmgr --help and at http://tug.org/texlive/tlmgr.html.
1064
exit 1 # but leave the real code for posterity
1066
tcBatchHyphenFormat=$2
1067
formatsForHyphen=`getFormatsForHyphen`
1068
formatsForHyphenFmt=`echo "$formatsForHyphen" | myFmt | sed 's@^@ @'`
1069
help="Usage: $progname hyphen FORMAT
1072
$formatsForHyphenFmt"
1073
case $tcBatchHyphenFormat in
1075
echo "$help" >&2; rc=1
1078
if checkElemInList "$tcBatchHyphenFormat" $formatsForHyphen; then
1080
tcBatchHyphenFile=`fmtutil --showhyphen "$tcBatchHyphenFormat"`
1081
case $tcBatchHyphenFile in
1083
echo "$progname: could not find hyphen setup file for format \`$tcBatchHyphenFormat'" >&2
1089
getRelDir "$tcBatchHyphenFile"
1092
# edit tcBatchHyphenFile directly
1095
tcBatchHFEdit=$tcBatchHyphenFile
1096
tcBatchHFOrig=$tmpdir/hforig
1097
cp "$tcBatchHyphenFile" "$tcBatchHFOrig"
1101
tcBatchHyphenFileBasename=`echo "$tcBatchHyphenFile" | sed 's@.*/@@'`
1103
co=`tcfmgr --tmp $tmpdir --cmd co --file "$tcBatchHyphenFileBasename" --reldir "$relPart" --infile "$tcBatchHyphenFile"`
1104
if test $? != 0; then
1105
echo "$progname: failed to check out file \`$tcBatchHyphenFile'" >&2
1110
tcBatchHFID=$1; tcBatchHFEdit=$3; tcBatchHFOrig=$4
1114
${VISUAL-${EDITOR-vi}} "$tcBatchHFEdit"
1115
if cmp "$tcBatchHFEdit" "$tcBatchHFOrig" >/dev/null 2>&1; then
1116
echo "$progname: configuration unchanged." >&2
1118
case $tcBatchHFID in
1120
tcBatchHFOut=$tcBatchHFEdit
1121
echo "$progname: updated configuration saved as file \`$tcBatchHFOut'" >&2
1125
ci=`tcfmgr --tmp $tmpdir --cmd ci --id "$tcBatchHFID"`
1126
if test $? != 0; then
1127
echo "$progname: failed to check in file \`$tcBatchHyphenFileBasename'" >&2
1132
echo "$progname: updated configuration saved as file \`$tcBatchHFOut'" >&2
1137
fmtutil --byhyphen "$tcBatchHFOut"
1140
echo "$progname: invalid format \`$tcBatchHyphenFormat' specified as argument for \`$progname hyphen'" >&2
1141
echo "$progname: for getting help, try \`$progname hyphen'" >&2
1156
&& texlinks --multiplatform \
1166
fmtutil --byfmt "$i" || rc=1
1180
echo "Usage: $progname mode MODE
1182
Valid MODE settings:"
1184
listMfModes | sed 's@ .*@@; s@^@ @' | myFmt
1190
if checkElemInList $tcBatchMode `listMfModes | sed 's@ .*@@'`; then
1194
fmgrConfigReplace mktex.cnf '^: ..MODE=' ": \${MODE=$tcBatchMode}"
1195
set x `getRes "$tcBatchMode"`; shift
1197
fmgrConfigReplace mktex.cnf '^: ..BDPI=' ": \${BDPI=$tcBatchRes}"
1199
if checkForBinary dvips >/dev/null && tcfmgr --cmd find --file config.ps >/dev/null 2>&1; then
1200
tcBatch dvips mode "$tcBatchMode"
1202
if checkForBinary pdftex >/dev/null && tcfmgr --cmd find --file pdftexconfig.tex >/dev/null 2>&1; then
1203
tcBatch pdftex mode "$tcBatchMode"
1206
echo "$progname: unknown mode \`$tcBatchMode' specified as argument for \`$progname mode'" >&2; rc=1
1213
help="Usage: $progname paper PAPER
1215
Valid PAPER settings:
1218
p=$2; pXdvi=$2; pDvips=$2
1224
"") echo "$help" >&2; rc=1; return;;
1226
echo "$progname: unknown PAPER \`$2' given as argument for \`$progname paper'" >&2
1227
echo "$progname: try \`$progname paper' for help" >&2
1231
if checkForBinary dvips >/dev/null && tcfmgr --cmd find --file config.ps >/dev/null 2>&1; then
1232
tcBatch dvips paper $pDvips
1234
if checkForBinary dvipdfm >/dev/null && tcfmgr --cmd find --file config >/dev/null 2>&1; then
1235
tcBatch dvipdfm paper $p
1237
if checkForBinary dvipdfmx >/dev/null && tcfmgr --cmd find --file dvipdfmx.cfg >/dev/null 2>&1; then
1238
tcBatch dvipdfmx paper $p
1240
if checkForBinary xdvi >/dev/null && tcfmgr --cmd find --file XDvi >/dev/null 2>&1; then
1241
tcBatch xdvi paper $pXdvi
1243
if checkForBinary pdftex >/dev/null && tcfmgr --cmd find --file pdftexconfig.tex >/dev/null 2>&1; then
1244
tcBatch pdftex paper $p
1249
help="Usage: $progname pdftex paper PAPER
1251
Valid PAPER settings:
1258
echo "Usage: $progname pdftex mode MODE"
1262
tcBatchPdftexMode=$3
1265
if checkElemInList "$tcBatchPdftexMode" `listMfModes | sed 's@ .*@@'`; then
1266
set x `getRes "$tcBatchPdftexMode"`; shift
1267
fmgrConfigReplace pdftexconfig.tex 'pdfpkresolution' "\\pdfpkresolution=$1"
1268
if $fmgrConfigReplaceChanged; then
1272
echo "$progname: unknown MODE \`$tcBatchPdftexMode' given as argument for \`$progname pdftex mode'" >&2
1282
w="8.5 true in"; h="11 true in"
1284
fmgrConfigReplace pdftexconfig.tex pdfpagewidth '\pdfpagewidth='"$w"
1285
wChanged=$fmgrConfigReplaceChanged
1286
fmgrConfigReplace pdftexconfig.tex pdfpageheight '\pdfpageheight='"$h"
1287
if $wChanged || $fmgrConfigReplaceChanged; then
1292
w="210 true mm"; h="297 true mm"
1293
fmgrConfigReplace pdftexconfig.tex pdfpagewidth '\pdfpagewidth='"$w"
1294
wChanged=$fmgrConfigReplaceChanged
1295
fmgrConfigReplace pdftexconfig.tex pdfpageheight '\pdfpageheight='"$h"
1296
if $wChanged || $fmgrConfigReplaceChanged; then
1300
"") echo "$help" >&2; rc=1;;
1302
echo "$progname: unknown PAPER \`$3' given as argument for \`$progname pdftex paper'" >&2
1303
echo "$progname: try \`$progname pdftex paper' for help" >&2
1307
echo "$help" >&2; rc=1;;
1309
echo "$progname: unknown option \`$2' given as argument for \`$progname pdftex'" >&2
1310
echo "$progname: try \`$progname pdftex' for help" >&2
1322
echo "$progname version $version"
1328
# handle "xdvi paper PAPER"
1330
tcBatchXdviPapers='us "8.5x11"
1333
foolscap "13.5x17.0"
1376
help="Usage: $progname xdvi paper PAPER
1378
Valid PAPER settings:
1379
a1 a1r a2 a2r a3 a3r a4 a4r a5 a5r a6 a6r a7 a7r
1380
b1 b1r b2 b2r b3 b3r b4 b4r b5 b5r b6 b6r b7 b7r
1381
c1 c1r c2 c2r c3 c3r c4 c4r c5 c5r c6 c6r c7 c7r
1382
foolscap legal us usr"
1385
echo "$tcBatchXdviPapers"
1389
a1|a1r|a2|a2r|a3|a3r|a4|a4r|a5|a5r|a6|a6r|a7|a7r|b1|b1r|b2|b2r|b3|b3r|b4|b4r|b5|b5r|b6|b6r|b7|b7r|c1|c1r|c2|c2r|c3|c3r|c4|c4r|c5|c5r|c6|c6r|c7|c7r|foolscap|legal|us|usr)
1390
fmgrConfigReplace XDvi paper: "*paper: $3"
1392
"") echo "$help" >&2; rc=1;;
1394
echo "$progname: unknown PAPER \`$3' given as argument for \`$progname xdvi paper'" >&2
1395
echo "$progname: try \`$progname xdvi paper' for help" >&2
1399
echo "$help" >&2; rc=1;;
1401
echo "$progname: unknown option \`$2' given as argument for \`$progname xdvi'" >&2
1402
echo "$progname: try \`$progname xdvi' for help" >&2
1408
echo "$progname: unknown option \`$1' given as argument for \`$progname'" >&2
1409
echo "$progname: try \`$progname help' for help" >&2
1414
###############################################################################
1415
# tcInteractive(void)
1416
# handle interactive mode
1417
###############################################################################
1423
###############################################################################
1425
###############################################################################