From 006ade39648b1d3cdc89a4bdc16cbe29882d70d3 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Thu, 25 Sep 2003 00:00:00 +0200 Subject: stable 2003.09.25 --- context/config/texexec.rme | 120 +- context/data/cont-cz.tws | 6 +- context/data/cont-de.tws | 6 +- context/data/cont-en.tws | 6 +- context/data/cont-it.tws | 6 +- context/data/cont-nl.tws | 6 +- context/data/cont-ro.tws | 6 +- context/perltk/texexec.pl | 4402 ++++++++++++++++++++-------------------- context/perltk/texexec.rme | 120 +- context/perltk/texfont.pl | 301 +-- context/perltk/texutil.pl | 89 +- tex/context/base/cont-log.tex | 72 +- tex/context/base/cont-new.tex | 274 ++- tex/context/base/context.tex | 2 +- tex/context/base/core-box.tex | 208 +- tex/context/base/core-des.tex | 130 +- tex/context/base/core-fig.tex | 462 ++--- tex/context/base/core-job.tex | 81 +- tex/context/base/core-lst.tex | 104 +- tex/context/base/core-mat.tex | 693 ++++--- tex/context/base/core-mis.tex | 217 +- tex/context/base/core-ntb.tex | 22 +- tex/context/base/core-reg.tex | 150 +- tex/context/base/core-rul.tex | 68 +- tex/context/base/core-sec.tex | 3 +- tex/context/base/core-spa.tex | 37 +- tex/context/base/core-syn.tex | 29 +- tex/context/base/core-tbl.tex | 115 +- tex/context/base/enco-fde.tex | 52 +- tex/context/base/font-chi.tex | 32 +- tex/context/base/font-ini.tex | 243 +-- tex/context/base/font-unk.tex | 72 +- tex/context/base/lang-ger.tex | 82 +- tex/context/base/math-ams.tex | 20 +- tex/context/base/math-fou.tex | 169 ++ tex/context/base/meta-dum.tex | 24 +- tex/context/base/mult-sys.tex | 39 +- tex/context/base/page-flt.tex | 30 +- tex/context/base/page-lay.tex | 13 +- tex/context/base/page-set.tex | 240 +-- tex/context/base/page-sid.tex | 76 +- tex/context/base/s-mod-00.tex | 135 +- tex/context/base/setupa.tex | 71 +- tex/context/base/setupb.tex | 10 +- tex/context/base/setupe.tex | 81 +- tex/context/base/supp-num.tex | 150 +- tex/context/base/symb-eur.tex | 22 +- tex/context/base/symb-glm.tex | 10 +- tex/context/base/syst-gen.tex | 420 ++-- tex/context/base/syst-omg.tex | 52 +- tex/context/base/type-enc.tex | 295 +-- tex/context/base/type-exa.tex | 24 +- tex/context/base/type-map.tex | 64 +- tex/context/base/type-pre.tex | 9 +- tex/context/base/type-siz.tex | 437 ++-- tex/context/base/type-spe.tex | 24 +- tex/context/base/type-syn.tex | 59 +- tex/context/base/x-xml-01.tex | 40 +- tex/context/base/xtag-ext.tex | 88 +- tex/context/extra/setup-qr.tex | 24 +- 60 files changed, 5786 insertions(+), 5056 deletions(-) create mode 100644 tex/context/base/math-fou.tex diff --git a/context/config/texexec.rme b/context/config/texexec.rme index 01c0a4dde..f544f5bbf 100644 --- a/context/config/texexec.rme +++ b/context/config/texexec.rme @@ -1,62 +1,62 @@ -% == introduction == -% -% This is 'texexec.ini', the file used by texexec to determine where -% to find files, what TeX to use, what flags to pass, etc. Although -% TeXexec tries to locate things itself, a little help is sometimes -% needed. One can influence texexec by setting some variables. These -% are only needed when the automatic determined settings fail. -% +% == introduction == +% +% This is 'texexec.ini', the file used by texexec to determine where +% to find files, what TeX to use, what flags to pass, etc. Although +% TeXexec tries to locate things itself, a little help is sometimes +% needed. One can influence texexec by setting some variables. These +% are only needed when the automatic determined settings fail. +% % == interfacing == -% +% % UsedInterfaces nl,en the formats generated with --make % UserInterface nl the default format used % -% == binaries == -% -% TeXExecutable pdfetex the TeX binary to use -% MpExecutable mpost the MetaPost binary to use +% == binaries == +% +% TeXExecutable pdfetex the TeX binary to use +% MpExecutable mpost the MetaPost binary to use % MpToTeXExecutable mpto the MetaPost to TeX converter % DviToMpExecutable dvitomp the DVI to MetaPost converter % -% == Scripts == +% == Scripts == % -% DviSpecialScript dvispec the DVI special filter script +% DviSpecialScript dvispec the DVI special filter script % -% == flags == -% -% TeXFormatFlag & the format introducer +% == flags == +% +% TeXFormatFlag & the format introducer % TeXVirginFlag -ini the format generation switch % -% == paths == +% == paths == % -% TeXFormatPath texmf/... fmt files +% TeXFormatPath texmf/... fmt files % ConTeXtPath texmf/tex/context/base sources % SetupPath texmf/tex/base/user cont-sys/usr file % TeXScriptsPath texmf/context/perltk scripts % TeXFontsPath texmf font files % -% MpFormatPath TeXFormatPath mem files +% MpFormatPath TeXFormatPath mem files % % == the main shell setting == % -% As shown below, one can define his/her own sections. We default to -% the teTeX/fpTeX web2c based settings. +% As shown below, one can define his/her own sections. We default to +% the teTeX/fpTeX web2c based settings. -set TeXShell to tetex -%set TeXShell to fptex +set TeXShell to tetex +%set TeXShell to fptex %set TeXShell to miktex -%set TeXShell to private +%set TeXShell to private % == setting up the variables == % -% Here are some general defaults. They can be overruled later. +% Here are some general defaults. They can be overruled later. -set UsedInterfaces to en nl metafun mptopdf +set UsedInterfaces to en nl metafun mptopdf set UserInterface to en -set TeXExecutable to tex +set TeXExecutable to tex -set MpExecutable to mpost +set MpExecutable to mpost set MpToTeXExecutable to mpto set DviToMpExecutable to dvitomp set DviSpecialScript to dvispec @@ -72,28 +72,32 @@ set TeXFontsPath to l:/tex/texmf;l:/tex/texmf-local; % For teTeX the next settings will do. +% -default-translate-file=cp8bit -file-line-error-style + for tetex set TeXHashExecutable to mktexlsr for tetex set TeXExecutable to pdfetex for tetex set TeXVirginFlag to -ini -for tetex set TeXPassString to -progname=context -for tetex set TeXBatchFlag to -int=batchmode +for tetex set TeXPassString to -progname=context +for tetex set TeXBatchFlag to -int=batchmode for tetex set TeXNonStopFlag to -int=nonstopmode for tetex set MpToTeXExecutable to mpto -for tetex set MpVirginFlag to -ini +for tetex set MpVirginFlag to -ini for tetex set MpPassString to -progname=mpost -for tetex set MpBatchFlag to -int=batchmode +for tetex set MpBatchFlag to -int=batchmode for tetex set MpNonStopFlag to -int=nonstopmode -% These also apply to fpTeX. +% These also apply to fpTeX. + +% -default-translate-file=cp8bit -file-line-error-style for fptex set TeXHashExecutable to mktexlsr for fptex set TeXExecutable to pdfetex for fptex set TeXVirginFlag to -ini -for fptex set TeXPassString to -progname=context -for fptex set TeXBatchFlag to -int=batchmode +for fptex set TeXPassString to -progname=context +for fptex set TeXBatchFlag to -int=batchmode for tetex set TeXNonStopFlag to -int=nonstopmode for fptex set MpToTeXExecutable to mpto -for fptex set MpVirginFlag to -ini +for fptex set MpVirginFlag to -ini for fptex set MpPassString to -progname=mpost for fptex set MpBatchFlag to -int=batchmode for tetex set MpNonStopFlag to -int=nonstopmode @@ -103,40 +107,40 @@ for tetex set MpNonStopFlag to -int=nonstopmode for miktex set TeXHashExecutable to initexmf --update-fndb for miktex set TeXExecutable to pdfetex for miktex set TeXVirginFlag to --initialize -for miktex set TeXPassString to --alias=context -for miktex set TeXBatchFlag to --interaction=batchmode +for miktex set TeXPassString to --alias=context +for miktex set TeXBatchFlag to --interaction=batchmode for miktex set TeXNonStopFlag to --interaction=nonstopmode for miktex set MpToTeXExecutable to mptotex for miktex set MpVirginFlag to --initialize for miktex set MpPassString to --alias=mpost -for miktex set MpBatchFlag to --interaction=batchmode +for miktex set MpBatchFlag to --interaction=batchmode for miktex set MpNonStopFlag to --interaction=nonstopmode for miktex set TeXFormatFlag to --undump= for miktex set MpFormatFlag to --undump= -% These are the settings used on some machines at PRAGMA ADE that -% don't use the texmf tree. They can serve as an example for local -% settings. Local settings should either be added to the previous -% one, or go without the 'for' directives. Consider these -% settings as an example. +% These are the settings used on some machines at PRAGMA ADE that +% don't use the texmf tree. They can serve as an example for local +% settings. Local settings should either be added to the previous +% one, or go without the 'for' directives. Consider these +% settings as an example. for private set UsedInterfaces to en nl for private set UserInterface to nl for private set ConTeXtPath to t:/sources/ -for private set SetupPath to t:/perl/ +for private set SetupPath to t:/perl/ for private set TeXScriptsPath to t:/perl/ -% == read this too == +% == read this too == % -% If this file is called 'texexec.rme', copy it to 'texexec.ini', +% If this file is called 'texexec.rme', copy it to 'texexec.ini', % check the settings above, change them according to your TeX -% distribution, and say: +% distribution, and say: % % texexec --verbose -% -% When set up properly, you should see your local settings fly by. -% When these settings are ok, the next call should work: +% +% When set up properly, you should see your local settings fly by. +% When these settings are ok, the next call should work: % % texexec --make % @@ -145,11 +149,11 @@ for private set TeXScriptsPath to t:/perl/ % texexec filename % % See 'mtexexec.pdf' for more information on the flags you can use with -% 'texexec'. Also make sure you have the 'texutil' script installed in -% the same path as 'texexec'. +% 'texexec'. Also make sure you have the 'texutil' script installed in +% the same path as 'texexec'. -% Experimental +% Experimental % % set TcXPath to d:/tex/texmf/web2c -% set FmtLanguage to pl -% set FmtBodyFont to plr +% set FmtLanguage to pl +% set FmtBodyFont to plr diff --git a/context/data/cont-cz.tws b/context/data/cont-cz.tws index d80c91eb1..1fa17f085 100644 --- a/context/data/cont-cz.tws +++ b/context/data/cont-cz.tws @@ -27,13 +27,13 @@ stopsetup startsetup com:jazyk: typ:val/: -val:nl,fr,en,uk,de,es,cz,..:nl: +val:nl,fr,en,uk,de,es,cz,..:: stopsetup startsetup com:hlavnijazyk: typ:val/: -val:nl,fr,en,uk,de,es,cz,..:nl: +val:nl,fr,en,uk,de,es,cz,..:: stopsetup startsetup @@ -1878,7 +1878,7 @@ stopsetup startsetup com:nastavdelitko: typ:var/: -var:znak:--,---,-,~,),(,=,/:: +var:znak:--,---,-,~,(,),=,/:: stopsetup startsetup diff --git a/context/data/cont-de.tws b/context/data/cont-de.tws index f63530b65..46aec9df8 100644 --- a/context/data/cont-de.tws +++ b/context/data/cont-de.tws @@ -27,13 +27,13 @@ stopsetup startsetup com:sprache: typ:val/: -val:nl,fr,en,uk,de,es,cz,..:nl: +val:nl,fr,en,uk,de,es,cz,..:: stopsetup startsetup com:hauptsprache: typ:val/: -val:nl,fr,en,uk,de,es,cz,..:nl: +val:nl,fr,en,uk,de,es,cz,..:: stopsetup startsetup @@ -1878,7 +1878,7 @@ stopsetup startsetup com:stellebindestrichein: typ:var/: -var:zeichen:--,---,-,~,),(,=,/:: +var:zeichen:--,---,-,~,(,),=,/:: stopsetup startsetup diff --git a/context/data/cont-en.tws b/context/data/cont-en.tws index f284dd902..18b4defa3 100644 --- a/context/data/cont-en.tws +++ b/context/data/cont-en.tws @@ -27,13 +27,13 @@ stopsetup startsetup com:language: typ:val/: -val:nl,fr,en,uk,de,es,cz,..:nl: +val:nl,fr,en,uk,de,es,cz,..:: stopsetup startsetup com:mainlanguage: typ:val/: -val:nl,fr,en,uk,de,es,cz,..:nl: +val:nl,fr,en,uk,de,es,cz,..:: stopsetup startsetup @@ -1878,7 +1878,7 @@ stopsetup startsetup com:setuphyphenmark: typ:var/: -var:sign:--,---,-,~,),(,=,/:: +var:sign:--,---,-,~,(,),=,/:: stopsetup startsetup diff --git a/context/data/cont-it.tws b/context/data/cont-it.tws index b5a90dc6b..63bc87e2e 100644 --- a/context/data/cont-it.tws +++ b/context/data/cont-it.tws @@ -27,13 +27,13 @@ stopsetup startsetup com:lingua: typ:val/: -val:nl,fr,en,uk,de,es,cz,..:nl: +val:nl,fr,en,uk,de,es,cz,..:: stopsetup startsetup com:linguaprincipale: typ:val/: -val:nl,fr,en,uk,de,es,cz,..:nl: +val:nl,fr,en,uk,de,es,cz,..:: stopsetup startsetup @@ -1878,7 +1878,7 @@ stopsetup startsetup com:impostasegnosillabazione: typ:var/: -var:segno:--,---,-,~,),(,=,/:: +var:segno:--,---,-,~,(,),=,/:: stopsetup startsetup diff --git a/context/data/cont-nl.tws b/context/data/cont-nl.tws index 6a2541761..c22da3f08 100644 --- a/context/data/cont-nl.tws +++ b/context/data/cont-nl.tws @@ -27,13 +27,13 @@ stopsetup startsetup com:taal: typ:val/: -val:nl,fr,en,uk,de,es,cz,..:nl: +val:nl,fr,en,uk,de,es,cz,..:: stopsetup startsetup com:hoofdtaal: typ:val/: -val:nl,fr,en,uk,de,es,cz,..:nl: +val:nl,fr,en,uk,de,es,cz,..:: stopsetup startsetup @@ -1878,7 +1878,7 @@ stopsetup startsetup com:stelkoppeltekenin: typ:var/: -var:teken:--,---,-,~,),(,=,/:: +var:teken:--,---,-,~,(,),=,/:: stopsetup startsetup diff --git a/context/data/cont-ro.tws b/context/data/cont-ro.tws index 8d06df512..d27468f3f 100644 --- a/context/data/cont-ro.tws +++ b/context/data/cont-ro.tws @@ -27,13 +27,13 @@ stopsetup startsetup com:limba: typ:val/: -val:nl,fr,en,uk,de,es,cz,..:nl: +val:nl,fr,en,uk,de,es,cz,..:: stopsetup startsetup com:limbaprincipala: typ:val/: -val:nl,fr,en,uk,de,es,cz,..:nl: +val:nl,fr,en,uk,de,es,cz,..:: stopsetup startsetup @@ -1878,7 +1878,7 @@ stopsetup startsetup com:seteazaliniesilabe: typ:var/: -var:semn:--,---,-,~,),(,=,/:: +var:semn:--,---,-,~,(,),=,/:: stopsetup startsetup diff --git a/context/perltk/texexec.pl b/context/perltk/texexec.pl index cc63f0926..7e5320039 100644 --- a/context/perltk/texexec.pl +++ b/context/perltk/texexec.pl @@ -1,14 +1,9 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' - if 0; - -# todo: second run of checksum of mp file with --nomprun changes -# todo: warning if no args -# todo: <<<< in messages -# todo: cleanup +eval '(exit $?0)' && eval 'exec perl -w -S $0 ${1+"$@"}' && eval 'exec perl -w -S $0 $argv:q' + if 0 ; #D \module #D [ file=texexec.pl, -#D version=2002.05.04, +#D version=2003.09.16, #D title=running \ConTeXt, #D subtitle=\TEXEXEC, #D author=Hans Hagen, @@ -19,11 +14,11 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $ #C therefore copyrighted by \PRAGMA. See licen-en.pdf for #C details. -# Thanks to Tobias Burnus for the german translations. -# Thanks to Thomas Esser for hooking it into web2c -# Thanks to Taco Hoekwater for suggesting improvements -# Thanks to Wybo Dekker for the advanced help interface -# Thanks to Fabrice Popineau for windows path trickery +# Thanks to Tobias Burnus for the german translations. +# Thanks to Thomas Esser for hooking it into web2c +# Thanks to Taco Hoekwater for suggesting improvements +# Thanks to Wybo Dekker for the advanced help interface and making it strict +# Thanks to Fabrice Popineau for windows path trickery and fixes # (I still have to completely understand the help code -) @@ -31,20 +26,25 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $ #D expression replaces the unix specific line \type #D {#!/usr/bin/perl}. -use Cwd ; -use Time::Local ; -use Config ; -use Getopt::Long ; -use Class::Struct ; # needed for help subsystem -#se Data::Dumper ; # needed for help subsystem -use FindBin ; +use strict ; -my %ConTeXtInterfaces ; # otherwise problems with strict -my %ResponceInterface ; # since i dunno how to allocate else +# todo: second run of checksum of mp file with --nomprun changes +# todo: warning if no args +# todo: <<<< in messages +# todo: cleanup + +use Cwd; +use Time::Local; +use Config; +use Getopt::Long; +use Class::Struct; # needed for help subsystem +use FindBin; +use File::Compare; -# my %Help ; +my %ConTeXtInterfaces; # otherwise problems with strict +my %ResponseInterface; # since i dunno how to allocate else -# use strict ; +my %Help; #D In this script we will launch some programs and other #D scripts. \TEXEXEC\ uses an ini||file to sort out where @@ -54,9 +54,9 @@ my %ResponceInterface ; # since i dunno how to allocate else #D It will be no surprise that Thomas Esser provided me #D the neccessary code to accomplish this. -$ENV{"MPXCOMMAND"} = "0" ; # otherwise loop +$ENV{"MPXCOMMAND"} = "0"; # otherwise loop -my $TotalTime = time ; +my $TotalTime = time; # start random seed hack # @@ -64,345 +64,365 @@ my $TotalTime = time ; # we need to be smaller about 1440 (== 24*60 == tex's max time) # in which case (david a's) random calculator will overflow. -my ($sec,$min,$rest) = gmtime ; -my $RandomSeed = $min*60+$sec ; -# i have to look up the mod function -) -if ($RandomSeed>2880) { $RandomSeed -= 2880 } -if ($RandomSeed>1440) { $RandomSeed -= 1440 } +# my ( $sec, $min, $rest ) = gmtime; +# my $RandomSeed = $min * 60 + $sec; +# +# # i have to look up the mod function -) +# +# if ( $RandomSeed > 2880 ) { $RandomSeed -= 2880 } +# if ( $RandomSeed > 1440 ) { $RandomSeed -= 1440 } + +my ($sec, $min) = gmtime; +my $RandomSeed = ($min * 60 + $sec) % 1440; # See usage of $Random and $RandomSeed later on. # # end random seed hack -## $dosish = ($Config{'osname'} =~ /dos|mswin/i) ; -## $dosish = ($Config{'osname'} =~ /^(ms)?dos|^os\/2|^(ms|cyg)win/i) ; -my $dosish = ($Config{'osname'} =~ /^(ms)?dos|^os\/2|^mswin/i) ; -my $escapeshell = ($ENV{'SHELL'} =~ m/sh/i); - -my $TeXUtil = 'texutil' ; -my $TeXExec = 'texexec' ; -my $DVIspec = 'dvispec' ; -my $SGMLtoTeX = 'sgml2tex' ; -my $FDFtoTeX = 'fdf2tex' ; - -my $MetaFun = 'metafun' ; -my $MpToPdf = 'mptopdf' ; - -$Getopt::Long::passthrough = 1 ; # no error message -$Getopt::Long::autoabbrev = 1 ; # partial switch accepted - -my $AddEmpty = '' ; -my $Alone = 0 ; -my $Optimize = 0 ; -my $ForceTeXutil = 0 ; -my $Arrange = 0 ; -my $BackSpace = '0pt' ; -my $Background = '' ; -my $CenterPage = 0 ; -my $ConTeXtInterface = 'unknown' ; -my $Convert = '' ; -my $DoMPTeX = 0 ; -my $DoMPXTeX = 0 ; -my $EnterBatchMode = 0 ; -my $EnterNonStopMode = 0 ; -my $Environments = '' ; -my $Modules = '' ; -my $FastMode = 0 ; -my $FinalMode = 0 ; -my $Format = '' ; -my $MpDoFormat = '' ; -my $HelpAsked = 0 ; -my $MainBodyFont = 'standard' ; -my $MainLanguage = 'standard' ; -my $MainResponse = 'standard' ; -my $MakeFormats = 0 ; -my $Markings = 0 ; -my $Mode = '' ; -my $NoArrange = 0 ; -my $NoDuplex = 0 ; -my $NOfRuns = 7 ; -my $NoMPMode = 0 ; -my $NoMPRun = 0 ; -my $NoBanner = 0 ; -my $AutoMPRun = 0 ; -my $OutputFormat = 'standard' ; -my $Pages = '' ; -my $PageScale = '1000' ; # == 1.0 -my $PaperFormat = 'standard' ; -my $PaperOffset = '0pt' ; -my $PassOn = '' ; -my $PdfArrange = 0 ; -my $PdfSelect = 0 ; -my $PdfCombine = 0 ; -my $PrintFormat = 'standard' ; -my $ProducePdfT = 0 ; -my $ProducePdfM = 0 ; -my $ProducePdfX = 0 ; -my $Input = "" ; -my $Result = '' ; -my $Suffix = '' ; -my $RunOnce = 0 ; -my $Selection = '' ; -my $Combination = '2*4' ; -my $SilentMode = 0 ; -my $TeXProgram = '' ; -my $TeXTranslation = '' ; -my $TextWidth = '0pt' ; -my $TopSpace = '0pt' ; -my $TypesetFigures = 0 ; -my $ForceFullScreen = 0 ; -my $ScreenSaver = 0 ; -my $TypesetListing = 0 ; -my $TypesetModule = 0 ; -my $UseColor = 0 ; -my $Verbose = 0 ; -my $PdfCopy = 0 ; -my $LogFile = "" ; -my $MpyForce = 0 ; -my $RunPath = "" ; -my $Arguments = "" ; -my $Pretty = 0 ; -my $SetFile = "" ; -my $TeXTree = "" ; -my $TeXRoot = "" ; -my $Purge = 0 ; -my $Separation = "" ; -my $ModeFile = "" ; -my $GlobalFile = 0 ; -my $AllPatterns = 0 ; -my $ForceXML = 0 ; -my $Random = 0 ; -my $Filters = '' ; +my $dosish = ( $Config{'osname'} =~ /^(ms)?dos|^os\/2|^mswin/i ); +my $escapeshell = ( ($ENV{'SHELL'}) && ($ENV{'SHELL'} =~ m/sh/i )); + +my $TeXUtil = 'texutil'; +my $TeXExec = 'texexec'; +my $DVIspec = 'dvispec'; +my $SGMLtoTeX = 'sgml2tex'; +my $FDFtoTeX = 'fdf2tex'; + +my $MetaFun = 'metafun'; +my $MpToPdf = 'mptopdf'; + +$Getopt::Long::passthrough = 1; # no error message +$Getopt::Long::autoabbrev = 1; # partial switch accepted + +my $AddEmpty = ''; +my $Alone = 0; +my $Optimize = 0; +my $ForceTeXutil = 0; +my $Arrange = 0; +my $BackSpace = '0pt'; +my $Background = ''; +my $CenterPage = 0; +my $ConTeXtInterface = 'unknown'; +my $Convert = ''; +my $DoMPTeX = 0; +my $DoMPXTeX = 0; +my $EnterBatchMode = 0; +my $EnterNonStopMode = 0; +my $Environments = ''; +my $Modules = ''; +my $FastMode = 0; +my $FinalMode = 0; +my $Format = ''; +my $MpDoFormat = ''; +my $HelpAsked = 0; +my $MainBodyFont = 'standard'; +my $MainLanguage = 'standard'; +my $MainResponse = 'standard'; +my $MakeFormats = 0; +my $Markings = 0; +my $Mode = ''; +my $NoArrange = 0; +my $NoDuplex = 0; +my $NOfRuns = 7; +my $NoMPMode = 0; +my $NoMPRun = 0; +my $NoBanner = 0; +my $AutoMPRun = 0; +my $OutputFormat = 'standard'; +my $Pages = ''; +my $PageScale = '1000'; # == 1.0 +my $PaperFormat = 'standard'; +my $PaperOffset = '0pt'; +my $PassOn = ''; +my $PdfArrange = 0; +my $PdfSelect = 0; +my $PdfCombine = 0; +my $PdfOpen = 0; +my $PdfClose = 0; +my $PrintFormat = 'standard'; +my $ProducePdfT = 0; +my $ProducePdfM = 0; +my $ProducePdfX = 0; +my $Input = ""; +my $Result = ''; +my $Suffix = ''; +my $RunOnce = 0; +my $Selection = ''; +my $Combination = '2*4'; +my $SilentMode = 0; +my $TeXProgram = ''; +my $TeXTranslation = ''; +my $TextWidth = '0pt'; +my $TopSpace = '0pt'; +my $TypesetFigures = 0; +my $ForceFullScreen = 0; +my $ScreenSaver = 0; +my $TypesetListing = 0; +my $TypesetModule = 0; +my $UseColor = 0; +my $Verbose = 0; +my $PdfCopy = 0; +my $LogFile = ""; +my $MpyForce = 0; +my $RunPath = ""; +my $Arguments = ""; +my $Pretty = 0; +my $SetFile = ""; +my $TeXTree = ""; +my $TeXRoot = ""; +my $Purge = 0; +my $Separation = ""; +my $ModeFile = ""; +my $GlobalFile = 0; +my $AllPatterns = 0; +my $ForceXML = 0; +my $Random = 0; +my $Filters = ''; # makempy : -my $MakeMpy = '' ; - -&GetOptions - ( "arrange" => \$Arrange , - "batch" => \$EnterBatchMode , - "nonstop" => \$EnterNonStopMode , - "color" => \$UseColor , - "centerpage" => \$CenterPage , - "convert=s" => \$Convert , - "environments=s"=> \$Environments , - "usemodules=s" => \$Modules , - "xml" => \$ForceXML , - "xmlfilters=s" => \$Filters , - "fast" => \$FastMode , - "final" => \$FinalMode , - "format=s" => \$Format , - "mpformat=s" => \$MpDoFormat , - "help" => \$HelpAsked , - "interface=s" => \$ConTeXtInterface , - "language=s" => \$MainLanguage , - "bodyfont=s" => \$MainBodyFont , - "results=s" => \$Result , - "response=s" => \$MainResponse , - "make" => \$MakeFormats , - "mode=s" => \$Mode , - "module" => \$TypesetModule , - "figures=s" => \$TypesetFigures , - "fullscreen" => \$ForceFullScreen , - "screensaver" => \$ScreenSaver , - "listing" => \$TypesetListing , - "mptex" => \$DoMPTeX , - "mpxtex" => \$DoMPXTeX , - "noarrange" => \$NoArrange , - "nomp" => \$NoMPMode , - "nomprun" => \$NoMPRun , - "nobanner" => \$NoBanner , - "automprun" => \$AutoMPRun , - "once" => \$RunOnce , - "output=s" => \$OutputFormat , - "pages=s" => \$Pages , - "paper=s" => \$PaperFormat , - "passon=s" => \$PassOn , - "path=s" => \$RunPath , - "pdf" => \$ProducePdfT , - "pdm" => \$ProducePdfM , - "pdx" => \$ProducePdfX , - "pdfarrange" => \$PdfArrange , - "pdfselect" => \$PdfSelect , - "pdfcombine" => \$PdfCombine , - "pdfcopy" => \$PdfCopy , - "scale=s" => \$PageScale , - "selection=s" => \$Selection , - "combination=s" => \$Combination , - "noduplex" => \$NoDuplex , - "paperoffset=s" => \$PaperOffset , - "backspace=s" => \$BackSpace , - "topspace=s" => \$TopSpace , - "markings" => \$Markings , - "textwidth=s" => \$TextWidth , - "addempty=s" => \$AddEmpty , - "background=s" => \$Background , - "logfile=s" => \$LogFile , - "print=s" => \$PrintFormat , - "suffix=s" => \$Suffix , - "runs=s" => \$NOfRuns , - "silent" => \$SilentMode , - "tex=s" => \$TeXProgram , - "verbose" => \$Verbose , - "alone" => \$Alone , - "optimize" => \$Optimize , - "texutil" => \$ForceTeXutil , - "mpyforce" => \$MpyForce , - "input=s" => \$Input , - "arguments=s" => \$Arguments , - "pretty" => \$Pretty , - "setfile=s" => \$SetFile , - "purge" => \$Purge , +my $MakeMpy = ''; + +&GetOptions( + "arrange" => \$Arrange, + "batch" => \$EnterBatchMode, + "nonstop" => \$EnterNonStopMode, + "color" => \$UseColor, + "centerpage" => \$CenterPage, + "convert=s" => \$Convert, + "environments=s" => \$Environments, + "usemodules=s" => \$Modules, + "xml" => \$ForceXML, + "xmlfilters=s" => \$Filters, + "fast" => \$FastMode, + "final" => \$FinalMode, + "format=s" => \$Format, + "mpformat=s" => \$MpDoFormat, + "help" => \$HelpAsked, + "interface=s" => \$ConTeXtInterface, + "language=s" => \$MainLanguage, + "bodyfont=s" => \$MainBodyFont, + "results=s" => \$Result, + "response=s" => \$MainResponse, + "make" => \$MakeFormats, + "mode=s" => \$Mode, + "module" => \$TypesetModule, + "figures=s" => \$TypesetFigures, + "fullscreen" => \$ForceFullScreen, + "screensaver" => \$ScreenSaver, + "listing" => \$TypesetListing, + "mptex" => \$DoMPTeX, + "mpxtex" => \$DoMPXTeX, + "noarrange" => \$NoArrange, + "nomp" => \$NoMPMode, + "nomprun" => \$NoMPRun, + "nobanner" => \$NoBanner, + "automprun" => \$AutoMPRun, + "once" => \$RunOnce, + "output=s" => \$OutputFormat, + "pages=s" => \$Pages, + "paper=s" => \$PaperFormat, + "passon=s" => \$PassOn, + "path=s" => \$RunPath, + "pdf" => \$ProducePdfT, + "pdm" => \$ProducePdfM, + "pdx" => \$ProducePdfX, + "pdfarrange" => \$PdfArrange, + "pdfselect" => \$PdfSelect, + "pdfcombine" => \$PdfCombine, + "pdfcopy" => \$PdfCopy, + "scale=s" => \$PageScale, + "selection=s" => \$Selection, + "combination=s" => \$Combination, + "noduplex" => \$NoDuplex, + "paperoffset=s" => \$PaperOffset, + "backspace=s" => \$BackSpace, + "topspace=s" => \$TopSpace, + "markings" => \$Markings, + "textwidth=s" => \$TextWidth, + "addempty=s" => \$AddEmpty, + "background=s" => \$Background, + "logfile=s" => \$LogFile, + "print=s" => \$PrintFormat, + "suffix=s" => \$Suffix, + "runs=s" => \$NOfRuns, + "silent" => \$SilentMode, + "tex=s" => \$TeXProgram, + "verbose" => \$Verbose, + "alone" => \$Alone, + "optimize" => \$Optimize, + "texutil" => \$ForceTeXutil, + "mpyforce" => \$MpyForce, + "input=s" => \$Input, + "arguments=s" => \$Arguments, + "pretty" => \$Pretty, + "setfile=s" => \$SetFile, + "purge" => \$Purge, #### yet undocumented ################# - "random" => \$Random , - "makempy=s" => \$MakeMpy , - "allpatterns" => \$AllPatterns , - "separation=s" => \$Separation , - "textree=s" => \$TeXTree , - "texroot=s" => \$TeXRoot , - "translate=s" => \$TeXTranslation , - "modefile=s" => \$ModeFile , # additional modes file - "globalfile" => \$GlobalFile ) ; # don't check name + "random" => \$Random, + "makempy=s" => \$MakeMpy, + "allpatterns" => \$AllPatterns, + "separation=s" => \$Separation, + "textree=s" => \$TeXTree, + "texroot=s" => \$TeXRoot, + "translate=s" => \$TeXTranslation, + "pdfclose" => \$PdfClose, + "pdfopen" => \$PdfOpen, + "modefile=s" => \$ModeFile, # additional modes file + "globalfile" => \$GlobalFile +); # don't check name # a set file (like blabla.bat) can set paths now -if ($SetFile ne "") - { load_set_file ($SetFile,$Verbose) ; $SetFile = "" } +if ( $SetFile ne "" ) { load_set_file( $SetFile, $Verbose ); $SetFile = "" } # later we will do a second attempt. -$SIG{INT} = "IGNORE" ; - -if ($ARGV[0] =~ /\.mpx$/io) # catch -tex=.... bug in mpost - { $TeXProgram = '' ; $DoMPXTeX = 1 ; $NoMPMode = 1 } - -if ($ScreenSaver) - { $ForceFullScreen = 1 ; - $TypesetFigures = 'c' ; - $ProducePdfT = 1 ; - $Purge = 1 } - -if ($DoMPTeX||$DoMPXTeX) - { $RunOnce = 1 ; - $ProducePdfT = 0 ; - $ProducePdfX = 0 ; - $ProducePdfM = 0 } - -if ($PdfArrange||$PdfSelect||$PdfCopy||$PdfCombine) - { $ProducePdfT = 1 ; - $RunOnce = 1 } +$SIG{INT} = "IGNORE"; + +if ( $ARGV[0] && $ARGV[0] =~ /\.mpx$/io ) { # catch -tex=.... bug in mpost + $TeXProgram = ''; + $DoMPXTeX = 1; + $NoMPMode = 1; +} + +if ($ScreenSaver) { + $ForceFullScreen = 1; + $TypesetFigures = 'c'; + $ProducePdfT = 1; + $Purge = 1; +} + +if ( $DoMPTeX || $DoMPXTeX ) { + $RunOnce = 1; + $ProducePdfT = 0; + $ProducePdfX = 0; + $ProducePdfM = 0; +} + +if ( $PdfArrange || $PdfSelect || $PdfCopy || $PdfCombine ) { + $ProducePdfT = 1; + $RunOnce = 1; +} if ($ProducePdfT) { $OutputFormat = "pdftex" } elsif ($ProducePdfM) { $OutputFormat = "dvipdfm" } elsif ($ProducePdfX) { $OutputFormat = "dvipdfmx" } -if ($RunOnce||$Pages||$TypesetFigures||$TypesetListing) - { $NOfRuns = 1 } +if ( $RunOnce || $Pages || $TypesetFigures || $TypesetListing ) { $NOfRuns = 1 } -if (($LogFile ne '')&&($LogFile =~ /\w+\.log$/io)) - { open (LOGFILE,">$LogFile") ; - *STDOUT = *LOGFILE ; - *STDERR = *LOGFILE } +if ( ( $LogFile ne '' ) && ( $LogFile =~ /\w+\.log$/io ) ) { + open( LOGFILE, ">$LogFile" ); + *STDOUT = *LOGFILE; + *STDERR = *LOGFILE; +} -my $Program = " TeXExec 3.3 - ConTeXt / PRAGMA ADE 1997-2003" ; +my $Program = " TeXExec 4.0 - ConTeXt / PRAGMA ADE 1997-2003"; -print "\n$Program\n\n" ; +print "\n$Program\n\n"; -if ($Verbose) - { print " current path : " . cwd . "\n" } +if ($Verbose) { print " current path : " . cwd . "\n" } -## $pathslash = '/' ; if ($0 =~ /\\/) { $pathslash = "\\" } -my $pathslash = '/' ; if ($FindBin::Bin =~ /\\/) { $pathslash = "\\" } -my $cur_path = ".$pathslash" ; - -# $own_path = $0 ; $own_path =~ s/texexec(\.pl|\.bat|)//io ; -# $own_type = $1 ; -# $own_stub = "" ; +my $pathslash = '/'; +if ( $FindBin::Bin =~ /\\/ ) { $pathslash = "\\" } +my $cur_path = ".$pathslash"; # we need to handle window's "Program Files" path (patch by Fabrice P) -my $own_path = "$FindBin::Bin/" ; -my $own_type = $0 ; -my $own_type = $FindBin::Script ; -my $own_quote = ($own_path =~ m/^[^\"].* / ? "\"" : "") ; -my $own_stub = "" ; - -if ($own_type =~ /(\.pl|perl)/oi) - { $own_stub = "perl " } - -if ($own_type =~ /(\.(pl|bin|exe))$/io) - { $own_type = $1 } -else - { $own_type = '' } - -sub checked_path - { my $path = shift ; - if ((defined($path))&&($path ne '')) - { $path =~ s/[\/\\]/$pathslash/go ; - $path =~ s/[\/\\]*$//go ; - $path .= $pathslash } - else - { $path = '' } - return $path } - -sub checked_file - { my $path = shift ; - if ((defined($path))&&($path ne '')) - { $path =~ s/[\/\\]/$pathslash/go } - else - { $path = '' } - return $path } - -sub CheckPath - { my ($Key, $Value) = @_ ; - if (($Value =~ /\//)&&($Value !~ /\;/)) # no multipath test yet - { $Value = checked_path($Value) ; - unless (-d $Value) - { print " error : $Key set to unknown path $Value\n" } } } +my $own_path = "$FindBin::Bin/"; +my $own_type = $FindBin::Script; +my $own_quote = ( $own_path =~ m/^[^\"].* / ? "\"" : "" ); +my $own_stub = ""; + +if ( $own_type =~ /(\.pl|perl)/oi ) { $own_stub = "perl " } + +if ( $own_type =~ /(\.(pl|bin|exe))$/io ) { $own_type = $1 } +else { $own_type = '' } + +sub checked_path { + my $path = shift; + if ( ( defined($path) ) && ( $path ne '' ) ) { + $path =~ s/[\/\\]/$pathslash/go; + $path =~ s/[\/\\]*$//go; + $path .= $pathslash; + } else { + $path = ''; + } + return $path; +} + +sub checked_file { + my $path = shift; + if ( ( defined($path) ) && ( $path ne '' ) ) { + $path =~ s/[\/\\]/$pathslash/go; + } else { + $path = ''; + } + return $path; +} + +sub CheckPath { + my ( $Key, $Value ) = @_; + if ( ( $Value =~ /\// ) && ( $Value !~ /\;/ ) ) # no multipath test yet + { + $Value = checked_path($Value); + unless ( -d $Value ) { + print " error : $Key set to unknown path $Value\n"; + } + } +} # set to # for