From 6b30d8eb0ad7be8b7581f54e5cbcfc3ea413a804 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Mon, 21 Jun 2004 00:00:00 +0200 Subject: stable 2004.06.21 --- context/config/texexec.rme | 4 +- scripts/context/perl/texexec.rme | 4 +- scripts/context/ruby/textools.rb | 2 +- scripts/context/ruby/xmltools.rb | 81 +++++++++++++++++++++++++++++++++++++++- tex/context/base/context.tex | 2 +- tex/context/base/core-fig.tex | 7 +++- tex/context/base/hand-def.tex | 21 ++++++----- tex/context/base/hand-ini.tex | 71 ++++++++++------------------------- tex/context/base/java-exa.tex | 11 +++--- tex/context/base/spec-tpd.tex | 2 +- tex/context/base/supp-mps.tex | 17 +++++---- tex/context/base/type-buy.tex | 9 +---- tex/context/base/x-mathml.tex | 32 ++++++++-------- tex/context/base/xtag-xsl.tex | 9 +++++ 14 files changed, 163 insertions(+), 109 deletions(-) diff --git a/context/config/texexec.rme b/context/config/texexec.rme index ff3d3ae26..5ccf1f645 100644 --- a/context/config/texexec.rme +++ b/context/config/texexec.rme @@ -115,12 +115,12 @@ for fptex set MpPassString to -progname=mpost -translate-file=natural 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 --8bit +for miktex set TeXPassString to --alias=context --translate-file=natural.tcx 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 MpPassString to --alias=mpost --translate-file=natural.tcx for miktex set MpBatchFlag to --interaction=batchmode for miktex set MpNonStopFlag to --interaction=nonstopmode diff --git a/scripts/context/perl/texexec.rme b/scripts/context/perl/texexec.rme index ff3d3ae26..5ccf1f645 100644 --- a/scripts/context/perl/texexec.rme +++ b/scripts/context/perl/texexec.rme @@ -115,12 +115,12 @@ for fptex set MpPassString to -progname=mpost -translate-file=natural 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 --8bit +for miktex set TeXPassString to --alias=context --translate-file=natural.tcx 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 MpPassString to --alias=mpost --translate-file=natural.tcx for miktex set MpBatchFlag to --interaction=batchmode for miktex set MpNonStopFlag to --interaction=nonstopmode diff --git a/scripts/context/ruby/textools.rb b/scripts/context/ruby/textools.rb index 379964dde..fec093cf3 100644 --- a/scripts/context/ruby/textools.rb +++ b/scripts/context/ruby/textools.rb @@ -11,7 +11,7 @@ banner = ['TeXTools', 'version 1.2', '2002/2004', 'PRAGMA ADE/POD'] unless defined? ownpath - ownpath = $0.sub(/[\\\/]\w*?\.rb/i,'') + ownpath = $0.sub(/[\\\/][a-z0-9\-]*?\.rb/i,'') $: << ownpath end diff --git a/scripts/context/ruby/xmltools.rb b/scripts/context/ruby/xmltools.rb index e1803daf6..0c2367068 100644 --- a/scripts/context/ruby/xmltools.rb +++ b/scripts/context/ruby/xmltools.rb @@ -11,7 +11,7 @@ banner = ['XMLTools', 'version 1.0', '2002/2004', 'PRAGMA ADE/POD'] unless defined? ownpath - ownpath = $0.sub(/[\\\/]\w*?\.rb/i,'') + ownpath = $0.sub(/[\\\/][a-z0-9\-]*?\.rb/i,'') $: << ownpath end @@ -114,12 +114,84 @@ class Commands alias ls :dir + def mmlpages + + file = @commandline.argument('first') + eps = @commandline.option('eps') + png = @commandline.option('png') + style = @commandline.option('style') + modes = @commandline.option('modes') + + file = file.sub(/\.xml/io, '') + long = "#{file}-mmlpages" + if FileTest.file?(file+'.xml') then + style = "--arg=\"style=#{style}\"" unless style.empty? + modes = "--mode=#{modes}" unless modes.empty? + if system("texmfstart texexec.pl --batch --pdf --once --result=#{long} --use=mmlpag #{style} #{modes} #{file}.xml") then + if f = open("#{file}-mmlpages.txt") then + while line = f.gets do + data = Hash.new + if fields = line.split then + fields.each do |fld| + key, value = fld.split('=') + data[key] = value if key && value + end + if data.key?('p') then + page = data['p'] + name = "#{long}-#{page}" + if eps then + report("generating eps file #{name}") + if system("pdftops -eps -f #{page} -l #{page} #{long}.pdf #{name}.eps") then + if data.key?('d') then + if epsfile = IO.read("#{name}.eps") then + epsfile.sub!(/^(\%\%BoundingBox:.*?$)/i) do + newline = $1 + "\n%%Baseline: #{data['d']}\n" + if data.key?('w') && data.key?('h') then + newline += "%%PositionWidth: #{data['w']}\n" + newline += "%%PositionHeight: #{data['h']}\n" + newline += "%%PositionDepth: #{data['d']}" + end + newline + end + if g = File.open("#{name}.eps",'wb') then + g.write(epsfile) + g.close + end + end + end + else + report("error in generating eps from #{name}") + end + end + if png then + report("generating png file #{name}") + system("imagemagick #{name}.eps #{name}.png") + end + end + end + end + f.close + else + report("missing data log file #{filename}") + end + else + report("error in processing file #{filename}") + end + system("texmfstart texutil --purge") + else + report("error in processing file #{filename}") + end + + end + end logger = EXA::ExaLogger.new(banner.shift) commandline = CommandLine.new -commandline.registeraction('dir','generate directory listing') +commandline.registeraction('dir', 'generate directory listing') +commandline.registeraction('mmlpages','generate graphic from mathml') + commandline.registeraction('ls') commandline.registeraction('help') @@ -133,6 +205,11 @@ commandline.registervalue('url') commandline.registervalue('output') commandline.registervalue('root') +commandline.registerflag('eps') +commandline.registerflag('png') +commandline.registervalue('style') +commandline.registervalue('modes') + commandline.expand Commands.new(commandline,logger,banner).send(commandline.action || 'help') \ No newline at end of file diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex index 8a79f50eb..ccd439213 100644 --- a/tex/context/base/context.tex +++ b/tex/context/base/context.tex @@ -15,7 +15,7 @@ \catcode`\{=1 \catcode`\}=2 -\def\contextversion{2004.6.20} +\def\contextversion{2004.6.21} %D Welcome to the main module. When this module is ran through %D \type{initex} or \type{tex -i} or \type{whatevertex} using diff --git a/tex/context/base/core-fig.tex b/tex/context/base/core-fig.tex index 9132763f2..628200837 100644 --- a/tex/context/base/core-fig.tex +++ b/tex/context/base/core-fig.tex @@ -194,8 +194,7 @@ %D filetype is specified, we scan for the next set of files. %D As one can see, we prefer outlines over bitmaps. -\def\figuretypes% - {\c!eps,\c!mps,\c!pdf,\c!png,\c!jpg,\c!tif} % ,\c!tex,\c!tmp} % \c!mov +\def\figuretypes{\c!eps,\c!mps,\c!pdf,\c!png,\c!jpg,\c!tif} % ,\c!tex,\c!tmp} % \c!mov %D Instead of using a comma separated list, we could have use a %D faster alternative, but the current implementation is not @@ -950,6 +949,10 @@ \newif\ifgridfigure +% the preset for mov/avi should move to the driver +% +% this whole mess needs a clean up anyway + \def\calculateexternalfigure[#1][#2][#3][#4][#5][#6]% {\mindermeldingen \setupexternalfigures diff --git a/tex/context/base/hand-def.tex b/tex/context/base/hand-def.tex index a928e30a0..5da5b9d94 100644 --- a/tex/context/base/hand-def.tex +++ b/tex/context/base/hand-def.tex @@ -357,22 +357,25 @@ \unprotect % beware: extended extends the preceding vector (both protruding and -% adjusting) but as loign as the normal ascii characters are not set +% adjusting) but as long as the normal ascii characters are not set % beforehand, they default to normal % protruding variants -- slanted/italic is yet incomplete -\definefonthandling [pure] [pure] -\definefonthandling [normal] [punctuation,alpha,extended] -\definefonthandling [bold] [punctuation,alpha,extended] -\definefonthandling [slanted] [punctuation] [\c!rechts=1.5] -\definefonthandling [italic] [punctuation] [\c!rechts=1.5] -\definefonthandling [boldslanted] [punctuation] [\c!rechts=1.5] -\definefonthandling [bolditalic] [punctuation] [\c!rechts=1.5] +\definefonthandling [pure] [pure] [\c!type=\v!hangend] +\definefonthandling [normal] [punctuation,alpha,extended] [\c!type=\v!hangend] +\definefonthandling [bold] [punctuation,alpha,extended] [\c!type=\v!hangend] +\definefonthandling [slanted] [punctuation] [\c!type=\v!hangend,\c!rechts=1.5] +\definefonthandling [italic] [punctuation] [\c!type=\v!hangend,\c!rechts=1.5] +\definefonthandling [boldslanted] [punctuation] [\c!type=\v!hangend,\c!rechts=1.5] +\definefonthandling [bolditalic] [punctuation] [\c!type=\v!hangend,\c!rechts=1.5] % hz variants -\definefonthandling [hz] [hz,extended] +\definefonthandling [hz] [hz,extended] [\c!type=\v!hz] + +% combined variants + \definefonthandling [quality] [hz,extended,pure] % A special case of guillemots, beware: when used ungrouped, diff --git a/tex/context/base/hand-ini.tex b/tex/context/base/hand-ini.tex index 6d451befd..a8a87db7e 100644 --- a/tex/context/base/hand-ini.tex +++ b/tex/context/base/hand-ini.tex @@ -135,33 +135,16 @@ \def\@@pdfexpandbonus{autoexpand}% \fi - \beginTEX - - \def\setfontadjusting#1% - {\expandafter\ifx\csname\@fha@\@fha@#1\c!stap\endcsname\relax\else - \iftracefonthandling\showfontadjusting{#1}\fi - \pdffontexpand\handledfont - \csname\@fha@\@fha@#1\c!min \endcsname\space - \csname\@fha@\@fha@#1\c!max \endcsname\space - \csname\@fha@\@fha@#1\c!stap\endcsname\space - \@@pdfexpandbonus\relax - \fi} - - \endTEX - - \beginETEX - - \def\setfontadjusting#1% - {\ifcsname\@fha@\@fha@#1\c!stap\endcsname - \iftracefonthandling\showfontadjusting{#1}\fi - \pdffontexpand\handledfont - \csname\@fha@\@fha@#1\c!min \endcsname\space - \csname\@fha@\@fha@#1\c!max \endcsname\space - \csname\@fha@\@fha@#1\c!stap\endcsname\space - \@@pdfexpandbonus\relax - \fi} - - \endETEX + \def\setfontadjusting#1% + {\doifvalue{\@fha@\@fha@#1\c!type}\v!hz{\dosetfontadjusting{#1}}} + + \def\dosetfontadjusting#1% + {\iftracefonthandling\showfontadjusting{#1}\fi + \pdffontexpand\handledfont + \csname\@fha@\@fha@#1\c!min \endcsname\space + \csname\@fha@\@fha@#1\c!max \endcsname\space + \csname\@fha@\@fha@#1\c!stap\endcsname\space + \@@pdfexpandbonus\relax} \def\showfontadjusting#1% {\writestatus\m!handlings{[adjust]\space#1\space @@ -194,31 +177,15 @@ \lproddimen1000\onepoint \divide\lproddimen\maxcard \rproddimen1000\onepoint \divide\rproddimen\maxcard - \beginTEX - - \def\setprotrudingfactor#1% mo \onepoint instead of pt - {\expandafter\ifx\csname\@fha@\@fha@#1\c!links\endcsname\relax\else - \lproddimen\csname\@fha@\@fha@#1\c!links\endcsname\s!pt - \multiply\lproddimen\plusthousand\divide\lproddimen\maxcard\relax - \rproddimen\csname\@fha@\@fha@#1\c!rechts\endcsname\s!pt - \multiply\rproddimen\plusthousand\divide\rproddimen\maxcard\relax - \iftracefonthandling\showprotrudingfactor{#1}\fi - \fi} - - \endTEX - - \beginETEX + \def\setprotrudingfactor#1% + {\doifvalue{\@fha@\@fha@#1\c!type}\v!hangend{\dosetprotrudingfactor{#1}}} - \def\setprotrudingfactor#1% mo \onepoint instead of pt - {\ifcsname\@fha@\@fha@#1\c!links\endcsname - \lproddimen\csname\@fha@\@fha@#1\c!links\endcsname\s!pt - \multiply\lproddimen\plusthousand\divide\lproddimen\maxcard\relax - \rproddimen\csname\@fha@\@fha@#1\c!rechts\endcsname\s!pt - \multiply\rproddimen\plusthousand\divide\rproddimen\maxcard\relax - \iftracefonthandling\showprotrudingfactor{#1}\fi - \fi} - - \endETEX + \def\dosetprotrudingfactor#1% mo \onepoint instead of pt + {\lproddimen\csname\@fha@\@fha@#1\c!links\endcsname\s!pt + \multiply\lproddimen\plusthousand\divide\lproddimen\maxcard\relax + \rproddimen\csname\@fha@\@fha@#1\c!rechts\endcsname\s!pt + \multiply\rproddimen\plusthousand\divide\rproddimen\maxcard\relax + \iftracefonthandling\showprotrudingfactor{#1}\fi} \def\showprotrudingfactor#1% {\writestatus\m!handlings{[protrude]\space#1\space @@ -357,7 +324,7 @@ \def\dodefinefonthandling[#1][#2][#3]% {\setvalue{\@fha@\@fha@#1}{#2}% - \getparameters[\@fha@\@fha@#1][\c!links=1,\c!rechts=1,\c!min=20,\c!max=20,\c!stap=5,#3]} + \getparameters[\@fha@\@fha@#1][\c!type=\v!hangend,\c!links=1,\c!rechts=1,\c!min=20,\c!max=20,\c!stap=5,#3]} \def\setupfonthandling {\dodoubleempty\dosetupfonthandling} diff --git a/tex/context/base/java-exa.tex b/tex/context/base/java-exa.tex index caad5a175..52c26bf10 100644 --- a/tex/context/base/java-exa.tex +++ b/tex/context/base/java-exa.tex @@ -143,7 +143,8 @@ if (example_file != "") { url = url + "/" + example_file ; } - this.submitForm({cURL : url, cSubmitAs : example_method}) ; + % we need the bFDF for acrobat 5 + this.submitForm({cURL : url, bFDF : false, cSubmitAs : example_method}) ; } function submit_example_form ( ) { @@ -230,7 +231,7 @@ } } else { if (exa_multiple) { for (i=1;i<=100;i++) { -console.println("file field "+i) ; + % console.println("file field "+i) ; f = this.getField("filename-"+ i) ; % if (f) { if (f.value != "") { % if (g) { if (g.value == "") { @@ -245,13 +246,13 @@ console.println("file field "+i) ; fls = fls + "" ; } else { -console.println("b") ; + % console.println("b") ; fls = fls + " label='" + g.value + "'>" ; } } else { -console.println("c") ; + % console.println("c") ; fls = fls + ">" ; } fls = fls + f.value + "" ; diff --git a/tex/context/base/spec-tpd.tex b/tex/context/base/spec-tpd.tex index d0be1067b..1de624c76 100644 --- a/tex/context/base/spec-tpd.tex +++ b/tex/context/base/spec-tpd.tex @@ -1201,7 +1201,7 @@ %D File embedding. Storing the stream identifier is needed %D to get access to the number. When typeset, the user can -%D use feed this number to \type {pdftosrc} and filter the +%D feed this number to \type {pdftosrc} and filter the %D file from the \PDF\ file. \let\PDFlaststreamobject \s!unknown diff --git a/tex/context/base/supp-mps.tex b/tex/context/base/supp-mps.tex index 4f44c3518..cd795eca2 100644 --- a/tex/context/base/supp-mps.tex +++ b/tex/context/base/supp-mps.tex @@ -103,7 +103,7 @@ \MPruntrue \doifsomething{#1}{\def\MPgraphicfile{#1}}% \startwritingMPgraphic - \writecheckMPgraphic{#2}% + \writecheckedMPgraphic{#2}% \stopwritingMPgraphic \egroup} @@ -383,7 +383,7 @@ %D The next alternative permits extensions in other modules %D without the need to know the details of testing. -\newtoks\MPTEXgrapicchecks +\newtoks\MPTEXgraphicchecks % \long\def\checkMPTEXgraphic#1% % {\ifforceMPTEXgraphic @@ -391,7 +391,7 @@ % \else % \global\MPTEXgraphicfalse % \expandafter\convertargument#1\to\MPascii -% \the\MPTEXgrapicchecks\relax % \relax is end condition! +% \the\MPTEXgraphicchecks\relax % \relax is end condition! % \fi} \long\def\writecheckedMPgraphic#1% @@ -400,8 +400,9 @@ \else \global\MPTEXgraphicfalse \expandafter\convertargument#1\to\MPascii - \the\MPTEXgrapicchecks\relax % \relax is end condition! + \the\MPTEXgraphicchecks\relax % \relax is end condition! \fi + \flushMPTEXgraphic % verbatimtex etc \writeMPgraphic{#1}} %D We could have used a kind of array approach using a @@ -415,7 +416,7 @@ \@EA\appendtoks \@EA\doifincsnameelse\csname MPascii#1\endcsname\MPascii {\global\MPTEXgraphictrue\gobbleuntil\relax}\donothing - \to \MPTEXgrapicchecks} + \to \MPTEXgraphicchecks} \forceMPTEXcheck{etex} \forceMPTEXcheck{textext} @@ -434,9 +435,9 @@ %D \stoptypen \def\flushMPTEXgraphic - {\ifMPTEXgraphic \ifx\everyMPTEXgraphic\emptytoks \else + {\ifMPTEXgraphic \immediate\write\MPwrite{verbatimtex \the\everyMPTEXgraphic\space etex;}% - \fi \fi} + \fi} \long\def\flushMPgraphicline#1#2;% {\ifx#1\relax \else @@ -616,7 +617,7 @@ \theMPinclusions \global\let\theMPinclusions\relax \fi - \flushMPTEXgraphic + %\flushMPTEXgraphic \ifMPrun \else \immediate\write\MPwrite{let mprunend = end ;}% \immediate\write\MPwrite{beginfig(\the\currentMPgraphic);}% diff --git a/tex/context/base/type-buy.tex b/tex/context/base/type-buy.tex index 7fdb11bbc..8fff2a0f1 100644 --- a/tex/context/base/type-buy.tex +++ b/tex/context/base/type-buy.tex @@ -94,13 +94,6 @@ \definefontsynonym [MathBeta] [LucidaNewMath-Roman] \stoptypescript - \definefontsynonym [LucidaNewMath-AltDemiItalic] [lbmdo] - \definefontsynonym [LucidaNewMath-Arrows-Demi] [lbmad] - \definefontsynonym [LucidaNewMath-Extension] [lbme] - \definefontsynonym [LucidaNewMath-Demibold] [lbmd] - \definefontsynonym [LucidaNewMath-DemiItalic] [lbmdi] - \definefontsynonym [LucidaNewMath-Symbol-Demi] [lbmsd] - \starttypescript [boldmath] [lucida] [name] \definefontsynonym [MathRoman] [LucidaBright-Demi] \definefontsynonym [MathExtension] [LucidaNewMath-Extension] @@ -140,7 +133,7 @@ \starttypescript [sans] [lucida] [texnansi,ec,8r] \definefontsynonym [LucidaSans] [\typescriptthree-lsr] [encoding=\typescriptthree] \definefontsynonym [LucidaSans-Demi] [\typescriptthree-lsd] [encoding=\typescriptthree] - \definefontsynonym f[LucidaSans-DemiItalic] [\typescriptthree-lsdi] [encoding=\typescriptthree] + \definefontsynonym [LucidaSans-DemiItalic] [\typescriptthree-lsdi] [encoding=\typescriptthree] \definefontsynonym [LucidaSans-Italic] [\typescriptthree-lsi] [encoding=\typescriptthree] \definefontsynonym [LucidaSans-Bold] [\typescriptthree-lsb] [encoding=\typescriptthree] \definefontsynonym [LucidaSans-BoldItalic] [\typescriptthree-lsbi] [encoding=\typescriptthree] diff --git a/tex/context/base/x-mathml.tex b/tex/context/base/x-mathml.tex index 5c36c35fb..ed8e25866 100644 --- a/tex/context/base/x-mathml.tex +++ b/tex/context/base/x-mathml.tex @@ -2,47 +2,47 @@ %D [ file=m-mathml, %D version=1999.12.20, %D title=\CONTEXT\ XML Modules, -%D subtitle=Loading \MATHML\ Filters, +%D subtitle=Loading \MATHML\ Filters, %D author=Hans Hagen, %D date=\currentdate, %D copyright={PRAGMA ADE / Hans Hagen \& Ton Otten}] %C %C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. -%D We have to make sure that some basic entities are +%D We have to make sure that some basic entities are %D loaded: -\useXMLfilter[ent] +\useXMLfilter[ent] -%D Then we load the math: +%D Then we load the math: -\useXMLfilter[mml,mmp,mmc] +\useXMLfilter[mml,mmp,mmc] -%D And we also load the whole bunch of entities: +%D And we also load the whole bunch of entities: % \useXMLfilter[mea,meb,mec,meh,men,meo,mer] % \useXMLfilter[mxa,mxb,mxc,mxh,mxn,mxo,mxr] -%D For simple inline math, we first provide: +%D For simple inline math, we first provide: -\newcount\xmlmathlevel % todo : nesting ! ! ! ! +\newcount\xmlmathlevel % todo : nesting ! ! ! ! -\defineXMLenvironment [m] \startXMLinlinemath \stopXMLinlinemath +\defineXMLenvironment [m] \startXMLinlinemath \stopXMLinlinemath -\def\startXMLinlinemath +\def\startXMLinlinemath {\ifmmode - \advance\xmlmathlevel1\relax + \advance\xmlmathlevel1\relax \else \xmlmathlevel1$% - \fi} + \fi} -\def\stopXMLinlinemath +\def\stopXMLinlinemath {\ifcase\xmlmathlevel\or $\xmlmathlevel0\relax \else \advance\xmlmathlevel-1\relax \fi} -\endinput +\endinput \ No newline at end of file diff --git a/tex/context/base/xtag-xsl.tex b/tex/context/base/xtag-xsl.tex index 2ebb15e9b..4d844c8e1 100644 --- a/tex/context/base/xtag-xsl.tex +++ b/tex/context/base/xtag-xsl.tex @@ -11,6 +11,15 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +% FOR THIS TO WORK YOU NEED A PROPER cp8bit VECTOR +% +% 8 bit support has been messed up in a couple of distributions +% +% 0x00 0x00 +% 0x01 0x01 +% 0x02 0x02 +% etc + %D This module is rather experimental so users may expect %D changes in the interface. -- cgit v1.2.3