summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2006-02-15 17:41:00 +0100
committerHans Hagen <pragma@wxs.nl>2006-02-15 17:41:00 +0100
commitfdd3cea7faff04a5b62069ac88895817288a5199 (patch)
treeefd8848e4137fd276bc8b38d4ca6292e3a5f693e
parent78097dfcd572aa98629093eec31f6ab42971a248 (diff)
downloadcontext-fdd3cea7faff04a5b62069ac88895817288a5199.tar.gz
stable 2006.02.15 17:41
-rw-r--r--metapost/context/base/mp-core.mp32
-rw-r--r--scripts/context/ruby/base/exa.rb406
-rw-r--r--scripts/context/ruby/base/tex.rb293
-rw-r--r--scripts/context/ruby/base/texutil.rb2
-rw-r--r--scripts/context/ruby/texmfstart.rb95
-rw-r--r--tex/context/base/colo-ini.tex2
-rw-r--r--tex/context/base/cont-new.tex2
-rw-r--r--tex/context/base/cont-old.tex2
-rw-r--r--tex/context/base/context.tex2
-rw-r--r--tex/context/base/core-itm.tex3
-rw-r--r--tex/context/base/core-job.tex34
-rw-r--r--tex/context/base/core-mat.tex1
-rw-r--r--tex/context/base/core-mis.tex2
-rw-r--r--tex/context/base/core-spa.tex30
-rw-r--r--tex/context/base/core-syn.tex51
-rw-r--r--tex/context/base/core-ver.tex60
-rw-r--r--tex/context/base/lang-ctx.tex2
-rw-r--r--tex/context/base/meta-ini.tex10
-rw-r--r--tex/context/base/s-pre-01.tex92
-rw-r--r--tex/context/base/s-pre-02.tex108
-rw-r--r--tex/context/base/s-pre-03.tex40
-rw-r--r--tex/context/base/s-pre-04.tex152
-rw-r--r--tex/context/base/s-pre-05.tex80
-rw-r--r--tex/context/base/s-pre-06.tex42
-rw-r--r--tex/context/base/s-pre-07.tex28
-rw-r--r--tex/context/base/s-pre-13.tex138
-rw-r--r--tex/context/base/s-pre-14.tex68
-rw-r--r--tex/context/base/spec-tpd.tex9
-rw-r--r--tex/context/base/syst-ext.tex9
-rw-r--r--tex/context/base/syst-gen.tex126
-rw-r--r--tex/context/base/verb-ini.tex60
-rw-r--r--tex/context/base/x-contml.tex13
-rw-r--r--tex/context/interface/cont-cz.xml8
-rw-r--r--tex/context/interface/cont-de.xml8
-rw-r--r--tex/context/interface/cont-en.xml8
-rw-r--r--tex/context/interface/cont-fr.xml8
-rw-r--r--tex/context/interface/cont-it.xml8
-rw-r--r--tex/context/interface/cont-nl.xml8
-rw-r--r--tex/context/interface/cont-ro.xml8
-rw-r--r--tex/context/interface/keys-cz.xml2
-rw-r--r--tex/context/interface/keys-de.xml2
-rw-r--r--tex/context/interface/keys-en.xml2
-rw-r--r--tex/context/interface/keys-fr.xml2
-rw-r--r--tex/context/interface/keys-it.xml2
-rw-r--r--tex/context/interface/keys-nl.xml2
-rw-r--r--tex/context/interface/keys-ro.xml2
46 files changed, 1471 insertions, 593 deletions
diff --git a/metapost/context/base/mp-core.mp b/metapost/context/base/mp-core.mp
index eb038163e..7845649fc 100644
--- a/metapost/context/base/mp-core.mp
+++ b/metapost/context/base/mp-core.mp
@@ -720,14 +720,24 @@ fi ;
% fallback
- multipar :=
-
- llxy[fpos] --
- lrxy[tpos] --
+ % multipar :=
+ % llxy[fpos] --
+ % lrxy[tpos] --
+ % urxy[tpos] --
+ % ulxy[fpos] -- cycle ;
+ %
+ % save_multipar (1,1,multipar) ;
+
+ % we need to take the boundingbox because there can be
+ % more lines and we want a proper rectange
+
+ multipar :=
+ ulxy[fpos] --
urxy[tpos] --
- ulxy[fpos] -- cycle ;
+ lrxy[fpos] --
+ llxy[tpos] -- cycle ;
- save_multipar (1,1,multipar) ;
+ save_multipar (1,1,boundingbox(multipar)) ;
else :
@@ -963,6 +973,14 @@ fi ;
endgroup ;
fi ;
+ % potential safeguard:
+
+ % for i=1 upto nofmultipars :
+ % if length p <= 4 :
+ % multipars[i] := boundingbox(multipars[i]) ;
+ % fi ;
+ % end ;
+
% quick hack for gb:
one_piece_multi_par := (nofmultipars=1) and (pn=tn) ;
@@ -1349,4 +1367,4 @@ def ProcessSyncTask(expr p, c) =
fill p withcolor c ;
enddef ;
-endinput ; \ No newline at end of file
+endinput ;
diff --git a/scripts/context/ruby/base/exa.rb b/scripts/context/ruby/base/exa.rb
new file mode 100644
index 000000000..fdc5b5093
--- /dev/null
+++ b/scripts/context/ruby/base/exa.rb
@@ -0,0 +1,406 @@
+# \setuplayout[width=3cm]
+#
+# tex.setup.setuplayout.width.[integer|real|dimension|string|key]
+# tex.[mp]var.whatever.width.[integer|real|dimension|string|key]
+
+require 'ftools'
+require 'md5'
+
+# this can become a lua thing
+
+# no .*? but 0-9a-z\:\. because other too slow (and greedy)
+
+class Hash
+
+ def subset(pattern)
+ h = Hash.new
+ r = /^#{pattern.gsub('.','\.')}/
+ self.keys.each do |k|
+ h[k] = self[k].dup if k =~ r
+ end
+ return h
+ end
+
+end
+
+module ExaEncrypt
+
+ def ExaEncrypt.encrypt_base(logger, oldfilename, newfilename)
+ if FileTest.file?(oldfilename) then
+ logger.report("checking #{oldfilename}") if logger
+ if data = IO.read(oldfilename) then
+ done = false
+ # cfg file:
+ #
+ # banner : exa configuration file
+ # user : domain, name = password, projectlist
+ #
+ if data =~ /^\s*banner\s*\:\s*exa\s*configuration\s*file/ then
+ data.gsub!(/^(\s*user\s*\:\s*.+?\s*\,\s*.+?\s*\=\s*)(.+?)(\s*\,\s*.+\s*)$/) do
+ pre, password, post = $1, $2, $3
+ unless password =~ /MD5:/i then
+ done = true
+ password = "MD5:" + MD5.new(password).hexdigest.upcase
+ end
+ "#{pre}#{password}#{post}"
+ end
+ else
+ data.gsub!(/<exa:password([^>]*?)>(.*?)<\/exa:password>/mois) do
+ attributes, password = $1, $2
+ unless password =~ /^([0-9A-F][0-9A-F])+$/ then
+ done = true
+ password = MD5.new(password).hexdigest.upcase
+ attributes = " encryption='md5'#{attributes}"
+ end
+ "<exa:password#{attributes}>#{password}</exa:password>"
+ end
+ end
+ begin
+ File.open(newfilename,'w') do |f|
+ f.puts(data)
+ end
+ rescue
+ logger.report("#{newfilename} cannot be written") if logger
+ else
+ logger.report("#{oldfilename} encrypted into #{newfilename}") if done and logger
+ end
+ end
+ end
+ end
+
+end
+
+module ExaModes
+
+ @@modefile = 'examodes.tex'
+
+ @@request = /(<exa:request.*?)(>.*?<\/exa:request>)/mo
+ @@redone = /<exa:request[^>]*?texified=([\'\"])yes\1.*?>/mo
+ @@reload = /<(exa:variable)([^>]+?label\=)([\"\'])([0-9A-Za-z\-\.\:]+?)(\3[^\/]*?)>(.*?)<(\/exa:variable)>/mo
+ @@recalc = /<(exa:variable)([^>]+?label\=)([\"\'])([0-9A-Za-z\-\.\:]+?)([\.\:]calcmath)(\3[^\/]*?)>(.*?)<(\/exa:variable)>/mo
+ @@rename = /<(exa:variable)([^>]+?label\=)([\"\'])([0-9A-Za-z\-\.\:]+?)(\3[^\/]*?)>(.*?)<(\/exa:variable)>/mo
+ @@refile = /<(exa:filename|exa:filelist)>(.*?)<(\/\1)>/mo
+
+ def ExaModes.cleanup_request(logger,filename='request.exa',modefile=@@modefile)
+ begin File.delete(filename+'.raw') ; rescue ; end
+ begin File.delete(modefile) ; rescue ; end
+ if FileTest.file?(filename) then
+ data, done = nil, false
+ begin
+ data = IO.read(filename)
+ rescue
+ data = nil
+ end
+ if data =~ @@request and data !~ @@redone then
+ data.gsub!(@@rename) do
+ done = true
+ '<' + $1 + $2 + $3 + $4 + $5 + '>' +
+ texifiedstr($4,$6) +
+ '<' + $7 + '>'
+ end
+ data.gsub!(@@refile) do
+ done = true
+ '<' + $1 + '>' +
+ cleanpath($2) +
+ '<' + $3 + '>'
+ end
+ data.gsub!(@@recalc) do
+ done = true
+ '<' + $1 + $2 + $3 + $4 + ":raw" + $6 + '>' + $7 + '<' + $8 + '>' +
+ '<' + $1 + $2 + $3 + $4 + $6 + '>' +
+ calculatortexmath($7,false) +
+ '<' + $8 + '>'
+ end
+ if done then
+ data.gsub!(@@request) do
+ $1 + " texified='yes'" + $2
+ end
+ begin File.copy(filename, filename+'.raw') ; rescue ; end
+ begin
+ logger.report("rewriting #{filename}") if logger
+ File.open(filename,'w') do |f|
+ f.puts(data)
+ end
+ rescue
+ logger.report("#{filename} cannot be rewritten") if logger
+ end
+ end
+ else
+ logger.report("#{filename} is already ok") if logger
+ end
+ @variables = Hash.new
+ data.scan(@@reload) do
+ @variables[$4] = $5
+ end
+ vars = @variables.subset('data.tex.var')
+ mpvars = @variables.subset('data.tex.mpvar')
+ modes = @variables.subset('data.tex.mode')
+ setups = @variables.subset('data.tex.setup')
+ if not (modes.empty? and setups.empty? and vars.empty? and mpvars.empty?) then
+ begin
+ File.open(modefile,'w') do |mod|
+ logger.report("saving modes and setups in #{modefile}") if logger
+ if not modes.empty? then
+ for key in modes.keys do
+ k = key.dup
+ k.gsub!(/\./,'-')
+ mod.puts("\\enablemode[#{k}-#{modes[key]}]\n")
+ if modes[key] =~ /(on|yes|start)/o then # ! ! ! ! !
+ mod.puts("\\enablemode[#{k}]\n")
+ end
+ end
+ mod.puts("\n\\readfile{cont-mod}{}{}\n")
+ end
+ if not setups.empty? then
+ for key in setups.keys
+ if key =~ /^(.+?)\.(.+?)\.(.+?)$/o then
+ command, key, type, value = $1, $2, $3, setups[key]
+ value = cleanedup(key,type,value)
+ mod.puts("\\#{$1}[#{key}=#{value}]\n")
+ elsif key =~ /^(.+?)\.(.+?)$/o then
+ command, type, value = $1, $2, setups[key]
+ mod.puts("\\#{$1}[#{value}]\n")
+ end
+ end
+ end
+ savevaroptions(vars, 'setvariables', mod)
+ savevaroptions(mpvars,'setMPvariables',mod)
+ end
+ rescue
+ logger.report("#{modefile} cannot be saved") if logger
+ end
+ else
+ logger.report("#{modefile} is not created") if logger
+ end
+ end
+ end
+
+ private
+
+ def ExaModes.autoparenthesis(str)
+ if str =~ /[\+\-]/o then '[1]' + str + '[1]' else str end
+ end
+
+ def ExaModes.cleanedup(key,type,value)
+ if type == 'dimension' then
+ unless value =~ /(cm|mm|in|bp|sp|pt|dd|em|ex)/o
+ value + 'pt'
+ else
+ value
+ end
+ elsif type == 'calcmath' then
+ '{' + calculatortexmath(value,true) + '}'
+ elsif type =~ /^filename|filelist$/ or key =~ /^filename|filelist$/ then
+ cleanpath(value)
+ else
+ value
+ end
+ end
+
+ def ExaModes.cleanpath(str)
+ (str ||'').gsub(/\\/o,'/')
+ end
+
+ def ExaModes.texifiedstr(key,val)
+ case key
+ when 'filename' then
+ cleanpath(val)
+ when 'filelist' then
+ cleanpath(val)
+ else
+ val
+ end
+ end
+
+ def ExaModes.savevaroptions(vars,setvariables,mod)
+ if not vars.empty? then
+ for key in vars.keys do
+ # var.whatever.width.dimension.value
+ if key =~ /^(.+?)\.(.+?)\.(.+?)$/o then
+ tag, key, type, value = $1, $2, $3, vars[key]
+ value = cleanedup(key,type,value)
+ mod.puts("\\#{setvariables}[#{tag}][#{key}=#{value}]\n")
+ elsif key =~ /^(.+?)\.(.+?)$/o then
+ tag, key, value = $1, $2, vars[key]
+ mod.puts("\\#{setvariables}[#{tag}][#{key}=#{value}]\n")
+ end
+ end
+ end
+ end
+
+ def ExaModes.calculatortexmath(str,tx=true)
+ if tx then
+ bdisp, edisp = "\\displaymath\{", "\}"
+ binln, einln = "\\inlinemath\{" , "\}"
+ egraf = "\\endgraf"
+ else
+ bdisp, edisp = "<displaytexmath>", "</displaytexmath>"
+ binln, einln = "<inlinetexmath>" , "</inlinetexmath>"
+ egraf = "<p/>"
+ end
+ str.gsub!(/\n\s*\n+/mois, "\\ENDGRAF ")
+ str.gsub!(/(\[\[)\s*(.*?)\s*(\]\])/mos) do
+ $1 + docalculatortexmath($2) + $3
+ end
+ str.gsub!(/(\\ENDGRAF)+\s*(\[\[)\s*(.*?)\s*(\]\])/mois) do
+ $1 + bdisp + $3 + edisp
+ end
+ str.gsub!(/(\[\[)\s*(.*?)\s*(\]\])/o) do
+ binln + $2 + einln
+ end
+ str.gsub!(/\\ENDGRAF/mos, egraf)
+ str
+ end
+
+ def ExaModes.docalculatortexmath(str)
+ str.gsub!(/\n/o) { ' ' }
+ str.gsub!(/\s+/o) { ' ' }
+ str.gsub!(/&gt;/o) { '>' }
+ str.gsub!(/&lt;/o) { '<' }
+ str.gsub!(/&.*?;/o) { }
+ level = 0
+ str.gsub!(/([\(\)])/o) do |chr|
+ if chr == '(' then
+ level = level + 1
+ chr = '[' + level.to_s + ']'
+ elsif chr == ')' then
+ chr = '[' + level.to_s + ']'
+ level = level - 1
+ end
+ chr
+ end
+ # ...E...
+ loop do
+ break unless str.gsub!(/([\d\.]+)E([\-\+]{0,1}[\d\.]+)/o) do
+ "\{\\SCINOT\{#{$1}\}\{#{$2}\}\}"
+ end
+ end
+ # ^-..
+ loop do
+ break unless str.gsub!(/\^([\-\+]*\d+)/o) do
+ "\^\{#{$1}\}"
+ end
+ end
+ # ^(...)
+ loop do
+ break unless str.gsub!(/\^(\[\d+\])(.*?)\1/o) do
+ "\^\{#{$2}\}"
+ end
+ end
+ # 1/x^2
+ loop do
+ break unless str.gsub!(/([\d\w\.]+)\/([\d\w\.]+)\^([\d\w\.]+)/o) do
+ "@\{#{$1}\}\{#{$2}\^\{#{$3}\}\}"
+ end
+ end
+ # int(a,b,c)
+ loop do
+ break unless str.gsub!(/(int|sum|prod)(\[\d+\])(.*?),(.*?),(.*?)\2/o) do
+ "\\#{$1.upcase}\^\{#{$4}\}\_\{#{$5}\}\{#{autoparenthesis($3)}\}"
+ end
+ end
+ # int(a,b)
+ loop do
+ break unless str.gsub!(/(int|sum|prod)(\[\d+\])(.*?),(.*?)\2/o) do
+ "\\#{$1.upcase}\_\{#{$4}\}\{#{autoparenthesis($3)}\}"
+ end
+ end
+ # int(a)
+ loop do
+ break unless str.gsub!(/(int|sum|prod)(\[\d+\])(.*?)\2/o) do
+ "\\#{$1.upcase}\{#{autoparenthesis($3)}\}"
+ end
+ end
+ # sin(x) => {\sin(x)}
+ loop do
+ break unless str.gsub!(/(median|min|max|round|sqrt|sin|cos|tan|sinh|cosh|tanh|ln|log)\s*(\[\d+\])(.*?)\2/o) do
+ "\{\\#{$1.upcase}\{#{$2}#{$3}#{$2}\}\}"
+ end
+ end
+ # mean
+ str.gsub!(/(mean)(\[\d+\])(.*?)\2/o) do
+ "\{\\OVERLINE\{#{$3}\}\}"
+ end
+ # sin x => {\sin(x)}
+ # ...
+ # (1+x)/(1+x) => \frac{1+x}{1+x}
+ loop do
+ break unless str.gsub!(/(\[\d+\])(.*?)\1\/(\[\d+\])(.*?)\3/o) do
+ "@\{#{$2}\}\{#{$4}\}"
+ end
+ end
+ # (1+x)/x => \frac{1+x}{x}
+ loop do
+ break unless str.gsub!(/(\[\d+\])(.*?)\1\/([a-zA-Z0-9]+)/o) do
+ "@\{#{$2}\}\{#{$3}\}"
+ end
+ end
+ # 1/(1+x) => \frac{1}{1+x}
+ loop do
+ break unless str.gsub!(/([a-zA-Z0-9]+)\/(\[\d+\])(.*?)\2/o) do
+ "@\{#{$1}\}\{#{$3}\}"
+ end
+ end
+ # 1/x => \frac{1}{x}
+ loop do
+ break unless str.gsub!(/([a-zA-Z0-9]+)\/([a-zA-Z0-9]+)/o) do
+ "@\{#{$1}\}\{#{$2}\}"
+ end
+ end
+ #
+ str.gsub!(/\@/o) do
+ "\\FRAC "
+ end
+ str.gsub!(/\*/o) do
+ " "
+ end
+ str.gsub!(/\<\=/o) do
+ "\\LE "
+ end
+ str.gsub!(/\>\=/o) do
+ "\\GE "
+ end
+ str.gsub!(/\=/o) do
+ "\\EQ "
+ end
+ str.gsub!(/\</o) do
+ "\\LT "
+ end
+ str.gsub!(/\>/) do
+ "\\GT "
+ end
+ str.gsub!(/(D)(\[\d+\])(.*?)\2/o) do
+ "\{\\FRAC\{\\MBOX{d}\}\{\\MBOX{d}x\}\{#{$2}#{$3}#{$2}\}\}"
+ end
+ str.gsub!(/(exp)(\[\d+\])(.*?)\2/o) do
+ "\{e^\{#{$3}\}\}"
+ end
+ str.gsub!(/(abs)(\[\d+\])(.*?)\2/o) do
+ "\{\\left\|#{$3}\\right\|\}"
+ end
+ str.gsub!(/D([x|y])/o) do
+ "\\FRAC\{\{\\rm d\}#{$1}\}\{\{\\rm d\}x\}"
+ end
+ str.gsub!(/D([f|g])(\[\d+\])(.*?)\2/o) do
+ "\{\\rm #{$1}\}'#{$2}#{$3}#{$2}"
+ end
+ str.gsub!(/([f|g])(\[\d+\])(.*?)\2/o) do
+ "\{\\rm #{$1}\}#{$2}#{$3}#{$2}"
+ end
+ str.gsub!(/(pi|inf)/io) do
+ "\\#{$1} "
+ end
+ loop do
+ break unless str.gsub!(/(\[\d+?\])(.*?)\1/o) do
+ "\\left(#{$2}\\right)"
+ end
+ end
+ str.gsub!(/\\([A-Z]+?)([\s\{\^\_\\])/io) do
+ "\\#{$1.downcase}#{$2}"
+ end
+ str
+ end
+
+end
+
+# ExaModes.cleanup_request()
diff --git a/scripts/context/ruby/base/tex.rb b/scripts/context/ruby/base/tex.rb
index ea909aabc..481d0eb12 100644
--- a/scripts/context/ruby/base/tex.rb
+++ b/scripts/context/ruby/base/tex.rb
@@ -128,7 +128,7 @@ class TEX
'mpyforce', 'forcempy',
'forcetexutil', 'texutil',
'globalfile', 'autopath',
- 'purge', 'purgeall', 'autopdf', 'xpdf', 'simplerun', 'verbose',
+ 'purge', 'purgeall', 'keep', 'autopdf', 'xpdf', 'simplerun', 'verbose',
'nooptionfile'
]
@@stringvars = [
@@ -847,148 +847,157 @@ class TEX
end
def deleteoptionfile(rawname)
- begin
- File.delete(File.suffixed(rawname,'top'))
- rescue
+ ['top','top.keep'].each do |suffix|
+ begin
+ File.delete(File.suffixed(rawname,suffix))
+ rescue
+ end
end
end
def makeoptionfile(rawname, jobname, jobsuffix, finalrun, fastdisabled, kindofrun)
- # jobsuffix = orisuffix
- if topname = File.suffixed(rawname,'top') and opt = File.open(topname,'w') then
- # local handies
- opt << "\% #{topname}\n"
- opt << "\\unprotect\n"
- opt << "\\setupsystem[\\c!n=#{kindofrun}]\n"
- opt << "\\def\\MPOSTformatswitch\{#{prognameflag('metafun')} #{formatflag('mpost')}=\}\n"
- if getvariable('batchmode') then
- opt << "\\batchmode\n"
- end
- if getvariable('nonstopmode') then
- opt << "\\nonstopmode\n"
- end
- if getvariable('paranoid') then
- opt << "\\def\\maxreadlevel{1}\n"
- end
- if (str = File.unixfied(getvariable('modefile'))) && ! str.empty? then
- opt << "\\readlocfile{#{str}}{}{}\n"
- end
- if (str = File.unixfied(getvariable('result'))) && ! str.empty? then
- opt << "\\setupsystem[file=#{str}]\n"
- elsif (str = getvariable('suffix')) && ! str.empty? then
- opt << "\\setupsystem[file=#{jobname}.#{str}]\n"
- end
- opt << "\\setupsystem[\\c!type=#{Tool.ruby_platform()}]\n"
- if (str = File.unixfied(getvariable('path'))) && ! str.empty? then
- opt << "\\usepath[#{str}]\n" unless str.empty?
- end
- if (str = getvariable('mainlanguage').downcase) && ! str.empty? && ! str.standard? then
- opt << "\\setuplanguage[#{str}]\n"
- end
- if str = validbackend(getvariable('backend')) then
- opt << "\\setupoutput[#{str}]\n"
- end
- if getvariable('color') then
- opt << "\\setupcolors[\\c!state=\\v!start]\n"
- end
- if getvariable('nompmode') || getvariable('nomprun') || getvariable('automprun') then
- opt << "\\runMPgraphicsfalse\n"
- end
- if getvariable('fast') && ! getvariable('fastdisabled') then
- opt << "\\fastmode\n"
- end
- if getvariable('silentmode') then
- opt << "\\silentmode\n"
- end
- if (str = getvariable('separation')) && ! str.empty? then
- opt << "\\setupcolors[\\c!split=#{str}]\n"
- end
- if (str = getvariable('setuppath')) && ! str.empty? then
- opt << "\\setupsystem[\\c!directory=\{#{str}\}]\n"
- end
- if (str = getvariable('paperformat')) && ! str.empty? && ! str.standard? then
- if str =~ /^([a-z]+\d+)([a-z]+\d+)$/io then # A5A4 A4A3 A2A1 ...
- opt << "\\setuppapersize[#{$1.upcase}][#{$2.upcase}]\n"
- else # ...*...
- pf = str.upcase.split(/[x\*]/o)
- pf << pf[0] if pd.size == 1
- opt << "\\setuppapersize[#{pf[0]}][#{pf[1]}]\n"
+ begin
+ # jobsuffix = orisuffix
+ if topname = File.suffixed(rawname,'top') and opt = File.open(topname,'w') then
+ report("writing option file #{topname}")
+ # local handies
+ opt << "\% #{topname}\n"
+ opt << "\\unprotect\n"
+ opt << "\\setupsystem[\\c!n=#{kindofrun}]\n"
+ opt << "\\def\\MPOSTformatswitch\{#{prognameflag('metafun')} #{formatflag('mpost')}=\}\n"
+ if getvariable('batchmode') then
+ opt << "\\batchmode\n"
end
- end
- if (str = getvariable('background')) && ! str.empty? then
- opt << "\\defineoverlay[whatever][{\\externalfigure[#{str}][\\c!factor=\\v!max]}]\n"
- opt << "\\setupbackgrounds[\\v!page][\\c!background=whatever]\n"
- end
- if getvariable('centerpage') then
- opt << "\\setuplayout[\\c!location=\\v!middle,\\c!marking=\\v!on]\n"
- end
- if getvariable('nomapfiles') then
- opt << "\\disablemapfiles\n"
- end
- if getvariable('noarrange') then
- opt << "\\setuparranging[\\v!disable]\n"
- elsif getvariable('arrange') then
- arrangement = Array.new
- if finalrun then
- arrangement << "\\v!doublesided" unless getvariable('noduplex')
- case getvariable('printformat')
- when '' then arrangement << "\\v!normal"
- when /.*up/oi then arrangement << "\\v!rotated"
- when /.*down/oi then arrangement << ["2DOWN","\\v!rotated"]
- when /.*side/oi then arrangement << ["2SIDE","\\v!rotated"]
+ if getvariable('nonstopmode') then
+ opt << "\\nonstopmode\n"
+ end
+ if getvariable('paranoid') then
+ opt << "\\def\\maxreadlevel{1}\n"
+ end
+ if (str = File.unixfied(getvariable('modefile'))) && ! str.empty? then
+ opt << "\\readlocfile{#{str}}{}{}\n"
+ end
+ if (str = File.unixfied(getvariable('result'))) && ! str.empty? then
+ opt << "\\setupsystem[file=#{str}]\n"
+ elsif (str = getvariable('suffix')) && ! str.empty? then
+ opt << "\\setupsystem[file=#{jobname}.#{str}]\n"
+ end
+ opt << "\\setupsystem[\\c!type=#{Tool.ruby_platform()}]\n"
+ if (str = File.unixfied(getvariable('path'))) && ! str.empty? then
+ opt << "\\usepath[#{str}]\n" unless str.empty?
+ end
+ if (str = getvariable('mainlanguage').downcase) && ! str.empty? && ! str.standard? then
+ opt << "\\setuplanguage[#{str}]\n"
+ end
+ if str = validbackend(getvariable('backend')) then
+ opt << "\\setupoutput[#{str}]\n"
+ end
+ if getvariable('color') then
+ opt << "\\setupcolors[\\c!state=\\v!start]\n"
+ end
+ if getvariable('nompmode') || getvariable('nomprun') || getvariable('automprun') then
+ opt << "\\runMPgraphicsfalse\n"
+ end
+ if getvariable('fast') && ! getvariable('fastdisabled') then
+ opt << "\\fastmode\n"
+ end
+ if getvariable('silentmode') then
+ opt << "\\silentmode\n"
+ end
+ if (str = getvariable('separation')) && ! str.empty? then
+ opt << "\\setupcolors[\\c!split=#{str}]\n"
+ end
+ if (str = getvariable('setuppath')) && ! str.empty? then
+ opt << "\\setupsystem[\\c!directory=\{#{str}\}]\n"
+ end
+ if (str = getvariable('paperformat')) && ! str.empty? && ! str.standard? then
+ if str =~ /^([a-z]+\d+)([a-z]+\d+)$/io then # A5A4 A4A3 A2A1 ...
+ opt << "\\setuppapersize[#{$1.upcase}][#{$2.upcase}]\n"
+ else # ...*...
+ pf = str.upcase.split(/[x\*]/o)
+ pf << pf[0] if pd.size == 1
+ opt << "\\setuppapersize[#{pf[0]}][#{pf[1]}]\n"
end
- else
- arrangement << "\\v!disable"
end
- opt << "\\setuparranging[#{arrangement.flatten.join(',')}]\n" if arrangement.size > 0
- end
- # we handle both "--mode" and "--modes", else "--mode" is
- # mapped onto "--modefile"
- if (str = getvariable('modes')) && ! str.empty? then
- opt << "\\enablemode[#{str}]\n"
- end
- if (str = getvariable('mode')) && ! str.empty? then
- opt << "\\enablemode[#{str}]\n"
- end
- if (str = getvariable('arguments')) && ! str.empty? then
- opt << "\\setupenv[#{str}]\n"
- end
- if (str = getvariable('randomseed')) && ! str.empty? then
- opt << "\\setupsystem[\\c!random=#{str}]\n"
- end
- if (str = getvariable('input')) && ! str.empty? then
- opt << "\\setupsystem[inputfile=#{str}]\n"
- else
- opt << "\\setupsystem[inputfile=#{rawname}]\n"
- end
- if (str = getvariable('pages')) && ! str.empty? then
- if str.downcase == 'odd' then
- opt << "\\chardef\\whichpagetoshipout=1\n"
- elsif str.downcase == 'even' then
- opt << "\\chardef\\whichpagetoshipout=2\n"
+ if (str = getvariable('background')) && ! str.empty? then
+ opt << "\\defineoverlay[whatever][{\\externalfigure[#{str}][\\c!factor=\\v!max]}]\n"
+ opt << "\\setupbackgrounds[\\v!page][\\c!background=whatever]\n"
+ end
+ if getvariable('centerpage') then
+ opt << "\\setuplayout[\\c!location=\\v!middle,\\c!marking=\\v!on]\n"
+ end
+ if getvariable('nomapfiles') then
+ opt << "\\disablemapfiles\n"
+ end
+ if getvariable('noarrange') then
+ opt << "\\setuparranging[\\v!disable]\n"
+ elsif getvariable('arrange') then
+ arrangement = Array.new
+ if finalrun then
+ arrangement << "\\v!doublesided" unless getvariable('noduplex')
+ case getvariable('printformat')
+ when '' then arrangement << "\\v!normal"
+ when /.*up/oi then arrangement << "\\v!rotated"
+ when /.*down/oi then arrangement << ["2DOWN","\\v!rotated"]
+ when /.*side/oi then arrangement << ["2SIDE","\\v!rotated"]
+ end
+ else
+ arrangement << "\\v!disable"
+ end
+ opt << "\\setuparranging[#{arrangement.flatten.join(',')}]\n" if arrangement.size > 0
+ end
+ # we handle both "--mode" and "--modes", else "--mode" is
+ # mapped onto "--modefile"
+ if (str = getvariable('modes')) && ! str.empty? then
+ opt << "\\enablemode[#{str}]\n"
+ end
+ if (str = getvariable('mode')) && ! str.empty? then
+ opt << "\\enablemode[#{str}]\n"
+ end
+ if (str = getvariable('arguments')) && ! str.empty? then
+ opt << "\\setupenv[#{str}]\n"
+ end
+ if (str = getvariable('randomseed')) && ! str.empty? then
+ opt << "\\setupsystem[\\c!random=#{str}]\n"
+ end
+ if (str = getvariable('input')) && ! str.empty? then
+ opt << "\\setupsystem[inputfile=#{str}]\n"
else
- pagelist = Array.new
- str.split(/\,/).each do |page|
- pagerange = page.split(/(\:|\.\.)/o )
- if pagerange.size > 1 then
- pagerange.first.to_i.upto(pagerange.last.to_i) do |p|
- pagelist << p.to_s
+ opt << "\\setupsystem[inputfile=#{rawname}]\n"
+ end
+ if (str = getvariable('pages')) && ! str.empty? then
+ if str.downcase == 'odd' then
+ opt << "\\chardef\\whichpagetoshipout=1\n"
+ elsif str.downcase == 'even' then
+ opt << "\\chardef\\whichpagetoshipout=2\n"
+ else
+ pagelist = Array.new
+ str.split(/\,/).each do |page|
+ pagerange = page.split(/(\:|\.\.)/o )
+ if pagerange.size > 1 then
+ pagerange.first.to_i.upto(pagerange.last.to_i) do |p|
+ pagelist << p.to_s
+ end
+ else
+ pagelist << page
end
- else
- pagelist << page
end
+ opt << "\\def\\pagestoshipout\{pagelist.join(',')\}\n";
end
- opt << "\\def\\pagestoshipout\{pagelist.join(',')\}\n";
end
+ opt << "\\protect\n";
+ begin getvariable('filters' ).split(',').uniq.each do |f| opt << "\\useXMLfilter[#{f}]\n" end ; rescue ; end
+ begin getvariable('usemodules' ).split(',').uniq.each do |m| opt << "\\usemodule[#{m}]\n" end ; rescue ; end
+ begin getvariable('environments').split(',').uniq.each do |e| opt << "\\environment #{e}\n" end ; rescue ; end
+ # this will become:
+ # begin getvariable('environments').split(',').uniq.each do |e| opt << "\\useenvironment[#{e}]\n" end ; rescue ; end
+ opt << "\\endinput\n"
+ opt.close
+ else
+ report("unable to write option file #{topname}")
end
- opt << "\\protect\n";
- begin getvariable('filters' ).split(',').uniq.each do |f| opt << "\\useXMLfilter[#{f}]\n" end ; rescue ; end
- begin getvariable('usemodules' ).split(',').uniq.each do |m| opt << "\\usemodule[#{m}]\n" end ; rescue ; end
- begin getvariable('environments').split(',').uniq.each do |e| opt << "\\environment #{e}\n" end ; rescue ; end
- # this will become:
- # begin getvariable('environments').split(',').uniq.each do |e| opt << "\\useenvironment[#{e}]\n" end ; rescue ; end
- opt << "\\endinput\n"
- opt.close
+ rescue
+ report("fatal error in writing option file #{topname}")
end
end
@@ -1009,6 +1018,7 @@ class TEX
if ENV.key?('SHELL_ESCAPE') && (ENV['SHELL_ESCAPE'] == 'f') then
setvariable('automprun',true)
end
+ done = false
['TXRESOURCES','MPRESOURCES','MFRESOURCES'].each do |res|
[getvariable('runpath'),getvariable('path')].each do |pat|
unless pat.empty? then
@@ -1017,8 +1027,10 @@ class TEX
else
ENV[res] = pat
end
+ report("setting #{res} to #{ENV[res]}") unless done
end
end
+ done = true
end
end
@@ -1282,8 +1294,11 @@ class TEX
runbackend(rawname)
popresult(rawname,result)
end
- File.silentdelete(File.suffixed(rawname,'tmp'))
- File.silentrename(File.suffixed(rawname,'top'),File.suffixed(rawname,'tmp'))
+ if getvariable('keep') then
+ ['top','log'].each do |suffix|
+ File.silentrename(File.suffixed(rawname,suffix),File.suffixed(rawname,suffix+'.keep'))
+ end
+ end
else
mprundone, ok, stoprunning = false, true, false
texruns, nofruns = 0, getvariable('runs').to_i
@@ -1321,10 +1336,16 @@ class TEX
report("final TeX run #{texruns}")
ok = runtex(File.suffixed(rawname,jobsuffix))
end
- ['tmp','top'].each do |s| # previous tuo file / runtime option file
- File.silentdelete(File.suffixed(rawname,s))
+ if getvariable('keep') then
+ ['top','log'].each do |suffix|
+ File.silentrename(File.suffixed(rawname,suffix),File.suffixed(rawname,suffix+'.keep'))
+ end
+ else
+ File.silentrename(File.suffixed(rawname,'top'),File.suffixed(rawname,'tmp'))
end
- File.silentrename(File.suffixed(rawname,'top'),File.suffixed(rawname,'tmp'))
+ # ['tmp','top','log'].each do |s| # previous tuo file / runtime option file / log file
+ # File.silentdelete(File.suffixed(rawname,s))
+ # end
if ok then
runbackend(rawname)
popresult(rawname,result)
@@ -1422,7 +1443,7 @@ class TEX
end
f.close
end
- File.silentrename(mpfile,"mptrace.tmp")
+ File.silentrename(mpfile,mpfile+'.keep')
File.silentrename(mpcopy, mpfile)
end
end
diff --git a/scripts/context/ruby/base/texutil.rb b/scripts/context/ruby/base/texutil.rb
index e05e88cdc..2c57702de 100644
--- a/scripts/context/ruby/base/texutil.rb
+++ b/scripts/context/ruby/base/texutil.rb
@@ -372,7 +372,7 @@ class TeXUtil
def MyExtras::processor(logger)
@@programs.each do |p|
- cmd = "texmfstart #{@@programs[p.to_i]}"
+ cmd = @@programs[p.to_i]
logger.report("running #{cmd}")
system(cmd)
end
diff --git a/scripts/context/ruby/texmfstart.rb b/scripts/context/ruby/texmfstart.rb
index 4bea5e979..8c22d7d4a 100644
--- a/scripts/context/ruby/texmfstart.rb
+++ b/scripts/context/ruby/texmfstart.rb
@@ -2,7 +2,7 @@
# program : texmfstart
# copyright : PRAGMA Advanced Document Engineering
-# version : 1.7.1 - 2003/2005
+# version : 1.8.3 - 2003/2006
# author : Hans Hagen
#
# project : ConTeXt / eXaMpLe
@@ -36,13 +36,11 @@ require "rbconfig"
$mswindows = Config::CONFIG['host_os'] =~ /mswin/
$separator = File::PATH_SEPARATOR
-$version = "1.7.1"
+$version = "1.8.3"
if $mswindows then
-
require "win32ole"
require "Win32API"
-
end
exit if defined?(REQUIRE2LIB)
@@ -97,7 +95,9 @@ $makelist = [
'xmltools',
'textools',
'mpstools',
- 'tmftools'
+ 'tmftools',
+ 'exatools',
+ 'runtools'
]
if ENV['TEXMFSTART_MODE'] = 'experimental' then
@@ -388,22 +388,22 @@ def runoneof(application,fullname,browserpermitted)
end
def report(str)
- $stderr.puts(str) if $verbose
+ $stdout.puts(str) if $verbose
end
def output(str)
- $stderr.puts(str)
+ $stdout.puts(str)
end
def usage
- print "version : #{$version} - 2003/2005 - www.pragma-ade.com\n"
+ print "version : #{$version} - 2003/2006 - www.pragma-ade.com\n"
print("\n")
print("usage : texmfstart [switches] filename [optional arguments]\n")
print("\n")
print("switches : --verbose --report --browser --direct --execute --locate --iftouched\n")
print(" --program --file --page --arguments --batch --edit --report --clear\n")
print(" --make --lmake --wmake --path --stubpath --indirect --before --after\n")
- print(" --tree --autotree\n")
+ print(" --tree --autotree --showenv\n")
print("\n")
print("example : texmfstart pstopdf.rb cow.eps\n")
print(" texmfstart --locate examplex.rb\n")
@@ -560,9 +560,10 @@ def find(filename,program)
paths = ENV['PATH'].split($separator)
suffixlist.each do |s|
paths.each do |p|
- report("checking #{p} for suffix #{s}")
- if FileTest.file?(File.join(p,"#{filename}.#{s}")) then
- fullname = File.join(p,"#{filename}.#{s}")
+ suffixedname = "#{filename}.#{s}"
+ report("checking #{p} for #{filename}")
+ if FileTest.file?(File.join(p,suffixedname)) then
+ fullname = File.join(p,suffixedname)
return shortpathname(fullname) if register(filename,fullname)
end
end
@@ -696,13 +697,15 @@ def make(filename,windows=false,linux=false)
if windows && f = open(basename+'.bat','w') then
f.binmode
f.write("@echo off\015\012")
- f.write("#{program} #{filename} %*\015\012")
+ # f.write("#{program} #{filename} %*\015\012")
+ f.write("#{program} %~n0 %*\015\012")
f.close
report("windows stub '#{basename}.bat' made")
elsif linux && f = open(basename,'w') then
f.binmode
f.write("#!/bin/sh\012")
f.write("#{program} #{filename} $@\012")
+ # f.write("#{program} `basename $0` $@\012")
f.close
report("unix stub '#{basename}' made")
end
@@ -736,8 +739,8 @@ def process(&block)
end
def checktree(tree)
- unless tree.empty? then
- begin
+ begin
+ unless tree.empty? then
setuptex = File.join(tree,'setuptex.tmf')
if FileTest.file?(setuptex) then
report('')
@@ -753,28 +756,57 @@ def checktree(tree)
end
ENV['TEXMFOS'] = "#{ENV['TEXPATH']}/#{ENV['TEXOS']}"
report('')
- report("preset : TEXPATH => #{ENV['TEXPATH']}")
- report("preset : TEXOS => #{ENV['TEXOS']}")
- report("preset : TEXMFOS => #{ENV['TEXMFOS']}")
- report("preset : TMP => #{ENV['TMP']}")
+ report("preset : TEXPATH => #{ENV['TEXPATH']}")
+ report("preset : TEXOS => #{ENV['TEXOS']}")
+ report("preset : TEXMFOS => #{ENV['TEXMFOS']}")
+ report("preset : TMP => #{ENV['TMP']}")
report('')
IO.readlines(File.join(tree,'setuptex.tmf')).each do |line|
- case line
+ case line.chomp
when /^[\#\%]/ then
# comment
- when /^(.*?)\s+\=\s+(.*)\s*$/ then
- k, v = $1, $2
- ENV[k] = v.gsub(/\%(.*?)\%/) do
- ENV[$1] || ''
+ when /^(.*?)\s*(\>|\=|\<)\s*(.*)\s*$/ then
+ # = assign | > prepend | < append
+ key, how, value = $1, $2, $3
+ begin
+ # $SAFE = 0
+ value.gsub!(/\%(.*?)\%/) do
+ ENV[$1] || ''
+ end
+ # value.gsub!(/\;/,$separator) if key =~ /PATH/i then
+ case how
+ when '=' then ENV[key] = value
+ when '<' then ENV[key] = (ENV[key] ||'') + $separator + value
+ when '>' then ENV[key] = value + $separator + (ENV[key] ||'')
+ end
+ rescue
+ report("user set failed : #{key} (#{$!})")
+ else
+ report("user set : #{key} => #{ENV[key]}")
end
- report("user set : #{k} => #{ENV[k]}")
end
end
else
report("no setup file '#{setuptex}'")
end
- rescue
end
+ rescue
+ # maybe tree is empty or boolean (no arg given)
+ end
+end
+
+def show_environment
+ if $showenv then
+ keys = ENV.keys.sort
+ size = 0
+ keys.each do |k|
+ size = k.size if k.size > size
+ end
+ report('')
+ keys.each do |k|
+ report("#{k.rjust(size)} => #{ENV[k]}")
+ end
+ report('')
end
end
@@ -793,12 +825,12 @@ def execute(arguments)
$page = $directives['page'] || 0
$browser = $directives['browser'] || false
$report = $directives['report'] || false
- $verbose = $directives['verbose'] || (ENV['_CTX_VERBOSE_'] =~ /(y|yes|t|true|on)/io) || false
+ $verbose = $directives['verbose'] || false
$arguments = $directives['arguments'] || ''
$execute = $directives['execute'] || $directives['exec'] || false
$locate = $directives['locate'] || false
- $autotree = if $directives['autotree'] then (ENV['TEXMFSTART_TREE'] || '') else '' end
+ $autotree = if $directives['autotree'] then (ENV['TEXMFSTART_TREE'] || ENV['TEXMFSTARTTREE'] || '') else '' end
$path = $directives['path'] || ''
$tree = $directives['tree'] || $autotree || ''
@@ -818,6 +850,11 @@ def execute(arguments)
$crossover = false if $directives['clear']
+ $showenv = $directives['showenv'] || false
+ $verbose = true if $showenv
+
+ $verbose = true if (ENV['_CTX_VERBOSE_'] =~ /(y|yes|t|true|on)/io) && ! $locate && ! $report
+
ENV['_CTX_VERBOSE_'] = 'yes' if $verbose
if $openoffice then
@@ -841,11 +878,13 @@ def execute(arguments)
if $help || ! $filename || $filename.empty? then
usage
checktree($tree)
+ show_environment()
elsif $batch && $filename && ! $filename.empty? then
# todo, take commands from file and avoid multiple starts and checks
else
report("texmfstart version #{$version}")
checktree($tree)
+ show_environment()
if $make then
if $filename == 'all' then
makelist = $makelist
diff --git a/tex/context/base/colo-ini.tex b/tex/context/base/colo-ini.tex
index d8b057f11..1e2157ea9 100644
--- a/tex/context/base/colo-ini.tex
+++ b/tex/context/base/colo-ini.tex
@@ -379,7 +379,7 @@
\iffreezecolors#3{\??cr#5}{\getvalue{\??cr#6}}\fi}
{\iffreezecolors\@EA#3\else\@EA#2\fi
{\??cr#5}{\getvalue{\??cr#6}}}}
- {\showmessage\m!colors3{#5}{(def)}}}%
+ {\showmessage\m!colors3{#5 (def)}}}%
\ifcase#4\or
\unexpanded#2{#5}{\switchtocolor[#5]}% \unexpanded toegevoegd
\fi}
diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex
index e482b7b85..6a0ce0dee 100644
--- a/tex/context/base/cont-new.tex
+++ b/tex/context/base/cont-new.tex
@@ -24,7 +24,7 @@
\normalend}}
\fi
-\newcontextversion{2006.02.03 21:03}
+\newcontextversion{2006.02.15 17:41}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
diff --git a/tex/context/base/cont-old.tex b/tex/context/base/cont-old.tex
index d0529c695..70628a10c 100644
--- a/tex/context/base/cont-old.tex
+++ b/tex/context/base/cont-old.tex
@@ -15,6 +15,8 @@
\unprotect
+% \def\middleraggedness {6\bodyfontsize}
+
\def\dosubstitutecommand#1#2%
{\writestatus\m!systems{\string#1\normalspace -> \string#2}%
\gdef#1{#2}%
diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex
index 12c6815be..093652d18 100644
--- a/tex/context/base/context.tex
+++ b/tex/context/base/context.tex
@@ -31,7 +31,7 @@
%D 2004.8.30 the low level interface is english. Watch out and adapt
%D your styles an modules.
-\def\contextversion{2006.02.03 21:03}
+\def\contextversion{2006.02.15 17:41}
%D For those who want to use this:
diff --git a/tex/context/base/core-itm.tex b/tex/context/base/core-itm.tex
index 8b216190b..bc203dfa1 100644
--- a/tex/context/base/core-itm.tex
+++ b/tex/context/base/core-itm.tex
@@ -523,7 +523,7 @@
\globallet\somdestination\empty
\let\symsymbol\empty
\the\itemgroupcommands
- \setitemlevel{#1}%
+%\setitemlevel{#1}% moved from here
%\getitemparameter\itemlevel\empty
\let\listitem\empty % ** start value
\doifelsenothing{#1} % iffirstargument
@@ -545,6 +545,7 @@
{\doifnot{##1}{0}{\setitemmark{##1}}}%
% \processcommalist[#1,\@@opsymbol]\docommando
\processcommalist[#1]\docommando}% ** preset sequence or provided sequence
+\setitemlevel{#1}% moved to here
\ifx\listitem\empty
\setitemmark\@@opsymbol % ** default value
\ifx\listitem\empty
diff --git a/tex/context/base/core-job.tex b/tex/context/base/core-job.tex
index 58bfacb3f..7a950fc95 100644
--- a/tex/context/base/core-job.tex
+++ b/tex/context/base/core-job.tex
@@ -470,23 +470,23 @@
\def\executesystemcommand{\immediate\write18}
% soon, when pdftex 1.22 is out in the field:
-%
-% \chardef\systemcommandmode\zerocount % 0=unknown 1=disabled 2=enabled
-%
-% \ifx\pdftexversion\undefined \else \ifnum\number\pdftexversion>122
-% \prependtoks
-% \chardef\systemcommandmode \ifeof18 \plusone \else \plustwo \fi
-% \to \everyjob
-% \fi
-%
-% maybe in meta-ini
-%
-% \appendtoks
-% \ifrunMPgraphics \ifcase\systemcommandmode \or
-% \writestatus\m!systems{system commands are disabled}%
-% \runMPgraphicsfalse
-% \fi \fi
-% \to \everyjob
+
+\chardef\systemcommandmode\zerocount % 0=unknown 1=disabled 2=enabled
+
+\ifx\pdfshellescape\undefined \else
+ \prependtoks
+ \chardef\systemcommandmode \ifcase\pdfshellescape \plusone \else \plustwo \fi
+ \to \everyjob
+\fi
+
+\appendtoks
+ \ifcase\systemcommandmode
+ \or
+ \writestatus\m!systems{system commands are disabled}%
+ \or
+ \writestatus\m!systems{system commands are enabled}%
+ \fi
+\to \everyjob
\ifx\etexversion\undefined \else \ifnum\etexversion<202
\prependtoks
diff --git a/tex/context/base/core-mat.tex b/tex/context/base/core-mat.tex
index 60a1e1f23..d1b91e625 100644
--- a/tex/context/base/core-mat.tex
+++ b/tex/context/base/core-mat.tex
@@ -340,6 +340,7 @@
\nonoindentation
\dochecknextindentation{\??fm\currentformula}%
\egroup
+ \setfalse\handleformulanumber
\dorechecknextindentation} % here ?
\newif\ifinformula
diff --git a/tex/context/base/core-mis.tex b/tex/context/base/core-mis.tex
index 92723bb34..2a08f6ee3 100644
--- a/tex/context/base/core-mis.tex
+++ b/tex/context/base/core-mis.tex
@@ -595,7 +595,7 @@
\or
\prewordbreak %\nobreak
\hskip\hspaceamount\currentlanguage{#2}%
- \languageparameter#1
+ \languageparameter#1%
\or
\languageparameter#1%
\fi
diff --git a/tex/context/base/core-spa.tex b/tex/context/base/core-spa.tex
index 18d091da6..29651ae71 100644
--- a/tex/context/base/core-spa.tex
+++ b/tex/context/base/core-spa.tex
@@ -3661,6 +3661,8 @@
\def\rightraggedness {2\bodyfontsize}
\def\middleraggedness {6\bodyfontsize}
+\def\middleraggedness {.5\hsize} % was: 6\bodyfontsize, fails on: \placefigure{x $x=x$ x}{}
+
%D More hyphenation control, will be combined with align
%D setup.
@@ -4621,6 +4623,34 @@
\def\fixedspaceamount#1%
{#1\fontdimen2\font}
+%D This is a dangerous feature because it makes the \TEX\ source
+%D less portable, i.e. any parser now needs to apply exactly the
+%D same algorithm when it wants to interpret the source. We
+%D strongly recommend not to mention this feature in manuals! It's
+%D provided for users who are hooked to such a mechanism.
+%D
+%D \starttyping
+%D \setupsorting[logo][next=\autoinsertnextspace] \logo[TEX]{\TeX}
+%D
+%D bla bla \TEX bla bla \TEX (bla) bla (\TEX)
+%D \stoptyping
+
+\def\autoinsertnextspace{\futurelet\nexttoken\doautoinsertnextspace}
+
+\def\doautoinsertnextspace % slightly extended version of a user supplied macro
+ {\ifx\nexttoken \bgroup\else \ifx\nexttoken\begingroup\else
+ \ifx\nexttoken \egroup\else \ifx\nexttoken \endgroup\else
+ \ifx\nexttoken \/\else \ifx\nexttoken /\else \ifx\nexttoken ~\else
+ \ifx\nexttoken \ \else \ifx\nexttoken \blankspace\else \ifx\nexttoken \space\else
+ \ifx\nexttoken .\else \ifx\nexttoken ,\else
+ \ifx\nexttoken !\else \ifx\nexttoken ?\else
+ \ifx\nexttoken :\else \ifx\nexttoken ;\else
+ \ifx\nexttoken '\else \ifx\nexttoken "\else
+ \ifx\nexttoken )\else \ifx\nexttoken -\else \ifx\nexttoken |\else
+ \ifx\nexttoken \%\else \ifx\nexttoken \&\else
+ \space
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
+
\setupwhitespace
[\v!none]
diff --git a/tex/context/base/core-syn.tex b/tex/context/base/core-syn.tex
index 0b6685a30..ac48b38f2 100644
--- a/tex/context/base/core-syn.tex
+++ b/tex/context/base/core-syn.tex
@@ -55,6 +55,8 @@
{\setvalue{#1\s!entry}{\getvalue{\??sm#1\c!command}}} % 3 argumenten
{\setvalue{#1\s!entry}{\dohandlesynonymentry{#1}}}}
+\def\synonymparameter#1{\csname\??sm\currentsynonym#1\endcsname}
+
\def\doplacelistofsynonyms#1#2%
{\whitespace
\begingroup
@@ -110,15 +112,30 @@
\immediatewriteutility{s e {#1} {#2} {\asciisynonym} {\asciimeaning}}%
\endgroup}
+% \def\preexecutesynonym#1#2#3#4%
+% {\ifdoinpututilities \else
+% \dowritesynonym{#1}{#2}{#3}{#4}%
+% \unexpanded\setgvalue{#2}{\processsynonym{#1}{#3}{#4}}%
+% \fi}
+%
+% \def\executesynonym#1#2#3#4%
+% {\preexecutesynonym{#1}{#2}{#3}{#4}%
+% \processsynonym{#1}{#3}{#4}}
+
+\def\reprocesssynonym#1#2#3%
+ {\processsynonym{#1}{#2}{#3}%
+ \getvalue{\??sm#1\c!next}} % not formally documented
+
\def\preexecutesynonym#1#2#3#4%
{\ifdoinpututilities \else
\dowritesynonym{#1}{#2}{#3}{#4}%
- \unexpanded\setgvalue{#2}{\processsynonym{#1}{#3}{#4}}%
+ \unexpanded\setgvalue{#2}{\reprocesssynonym{#1}{#3}{#4}}%
\fi}
\def\executesynonym#1#2#3#4%
{\preexecutesynonym{#1}{#2}{#3}{#4}%
- \processsynonym{#1}{#3}{#4}}
+ \processsynonym{#1}{#3}{#4}%
+ \getvalue{\??sm#1\c!next}} % not formally documented
\def\expandsynonym#1#2#3#4%
{{\synonymmeaningtrue
@@ -241,9 +258,9 @@
\def\processsort#1#2#3%
{\explicithmode
- \bgroup
+ \begingroup % was \bgroup
\doattributes{\??so#1}\c!style\c!color{#2}%
- \egroup}
+ \endgroup} % was \egroup
\def\dowritesort#1#2#3%
{\bgroup
@@ -254,18 +271,36 @@
\def\synonymentry#1%
{\executeifdefined{#1\s!entry}\gobblethreearguments}
+% \def\preexecutesort#1#2#3%
+% {\ifdoinpututilities \else
+% \dowritesort{#1}{#2}{#3}%
+% \unexpanded\setgvalue{#2}{\processsort{#1}{#3}{#2}}%
+% \fi}
+%
+% \def\executesort#1#2#3%
+% {\begingroup
+% \let\executesort\thirdofthreearguments % Trick needed for nested logo's.
+% \preexecutesort{#1}{#2}{#3}%
+% \processsort{#1}{#3}{#2}%
+% \endgroup}
+
+\def\reprocesssort#1#2#3%
+ {\processsort{#1}{#2}{#3}%
+ \getvalue{\??so#1\c!next}}
+
\def\preexecutesort#1#2#3%
{\ifdoinpututilities \else
\dowritesort{#1}{#2}{#3}%
- \unexpanded\setgvalue{#2}{\processsort{#1}{#3}{#2}}%
+ \unexpanded\setgvalue{#2}{\reprocesssort{#1}{#3}{#2}}%
\fi}
\def\executesort#1#2#3%
- {\bgroup
- \def\executesort##1##2##3{##3}% Trick needed for nested logo's.
+ {\begingroup
+ \let\executesort\thirdofthreearguments % Trick needed for nested logo's.
\preexecutesort{#1}{#2}{#3}%
\processsort{#1}{#3}{#2}%
- \egroup}
+ \endgroup
+ \getvalue{\??so#1\c!next}} % not formally documented
\def\doloadsort#1%
{\setvalue{#1\s!entry}##1##2##3%
diff --git a/tex/context/base/core-ver.tex b/tex/context/base/core-ver.tex
index b5aa36fd9..7cd0d6100 100644
--- a/tex/context/base/core-ver.tex
+++ b/tex/context/base/core-ver.tex
@@ -164,6 +164,10 @@
[\getvalue{#1\c!lines}]
[ \v!yes=>\obeybreakpoints,
\v!hyphenated=>\obeyhyphens]%
+ \processaction
+ [\getvalue{#1\c!empty}]
+ [\v!yes=>\obeyemptylines,
+ \v!all=>\obeyallemptylines]%
%
\ExpandFirstAfter\processaction
[\getvalue{#1\c!option}]
@@ -296,7 +300,6 @@
% workaround. Beware, spaces are introduced after a \type {\csname}.
\chardef\recodeverbatimmode\zerocount % 0=nothing 1=rescan 2=autorescan
-\chardef\recodeverbatimmode\zerocount % 0=nothing 1=rescan 2=autorescan
% \appendtoks \chardef\recodeverbatimmode\plustwo \to \everytabulate
% \appendtoks \chardef\recodeverbatimmode\plustwo \to \everytable
@@ -522,26 +525,52 @@
\let\protectedfirsttype\string % \relax for special cases
+% \bgroup
+% \catcode`\<=\active
+% \catcode`\>=\active
+% \gdef\doprotectfirsttype
+% {\ifx\next<%
+% \let\next\relax
+% \else\ifx\next\bgroup
+% \let\next\relax
+% \else\ifx\next\egroup % takes care of \type{}
+% \let\next\relax
+% \else\ifx\next\activeleftargument
+% \let\next\relax
+% \else
+% \let\next\protectedfirsttype
+% \fi\fi\fi\fi
+% \next}
+% \egroup
+%
+% \def\protectfirsttype
+% {\futurelet\next\doprotectfirsttype}
+%
+% The next one is safe for:
+%
+% \def\xx#1{\type{#1}} \xx{\ifx}
+
\bgroup
\catcode`\<=\active
\catcode`\>=\active
\gdef\doprotectfirsttype
- {\ifx\next<%
- \let\next\relax
- \else\ifx\next\bgroup
- \let\next\relax
- \else\ifx\next\egroup % takes care of \type{}
- \let\next\relax
- \else\ifx\next\activeleftargument
- \let\next\relax
- \else
- \let\next\protectedfirsttype
- \fi\fi\fi\fi
+ {\normalifx\next<%
+ \endrobusttest \let\next\relax
+ \normalelse\normalifx\next\bgroup
+ \endrobusttest \let\next\relax
+ \normalelse\normalifx\next\egroup % takes care of \type{}
+ \endrobusttest \let\next\relax
+ \normalelse\normalifx\next\activeleftargument
+ \endrobusttest \let\next\relax
+ \normalelse
+ \endrobusttest \let\next\protectedfirsttype
+ \normalfi\normalfi\normalfi\normalfi
\next}
\egroup
\def\protectfirsttype
- {\futurelet\next\doprotectfirsttype}
+ {\beginrobusttest
+ \futurelet\next\doprotectfirsttype}
%D The neccessary initializations are done by calling
%D \type{\initializetype} which in return calls for the support
@@ -838,7 +867,8 @@
\c!blank=\v!line,
\c!escape=/, % beware \string\ , should also be accepted
\c!numbering=\v!no,
- \c!lines=]
+ \c!lines=,
+ \c!empty=]
%D \macros
%D {definetype}
@@ -877,7 +907,7 @@
{\copyparameters
[\??tp#1][\??tp]
[\c!before,\c!after,\c!space,\c!page,\c!tab,\c!color,\c!style,
- \c!text,\c!icommand,\c!vcommand,\c!ccommand,\c!bodyfont,
+ \c!text,\c!icommand,\c!vcommand,\c!ccommand,\c!bodyfont,\c!empty,
\c!option,\c!palet,\c!margin,\c!evenmargin,\c!oddmargin,
\c!indentnext,\c!blank,\c!escape,\c!lines,\c!numbering]%
\getparameters
diff --git a/tex/context/base/lang-ctx.tex b/tex/context/base/lang-ctx.tex
index a686069b5..c9fa10c7c 100644
--- a/tex/context/base/lang-ctx.tex
+++ b/tex/context/base/lang-ctx.tex
@@ -40,7 +40,7 @@
\installlanguage [\s!pl] [\s!mapping={pl0,ec,qx},\s!encoding={pl0,ec,qx}] % pl0 may go
\installlanguage [\s!cz] [\s!mapping={il2,ec},\s!encoding={il2,ec}] % il2 may go
\installlanguage [\s!sk] [\s!mapping={il2,ec},\s!encoding={il2,ec}] % il2 may go
-\installlanguage [\s!sl] [\s!mapping={il2,ec},\s!encoding={il2,ec}] % il2 may go
+\installlanguage [\s!sl] [\s!mapping=ec,\s!encoding=ec] % il2 has gone
\installlanguage [\s!vn] [\s!mapping=t5,\s!encoding=t5]
diff --git a/tex/context/base/meta-ini.tex b/tex/context/base/meta-ini.tex
index 6995201cb..20451074c 100644
--- a/tex/context/base/meta-ini.tex
+++ b/tex/context/base/meta-ini.tex
@@ -549,7 +549,7 @@
\long\def\dostartMPenvironment[#1][#2]#3\stopMPenvironment
{\egroup
\doif{#1}\s!reset\resetMPenvironment % reset mp toks
- \doif{#1}\v!global{#3}% % use in main doc too
+ \doif{#1}\v!global{#3}% % use in main doc too
\doif{#1}+{#3}% % use in main doc too
\convertargument#3\to\ascii
\expandafter\appendtoks\ascii\to\everyMPTEXgraphic}
@@ -1002,6 +1002,14 @@
\protect \endinput
+%D Experimental:
+
+\appendtoks
+ \ifrunMPgraphics \ifcase\systemcommandmode \or
+ \runMPgraphicsfalse
+ \fi \fi
+\to \everyjob
+
% also:
%
% linecap := rounded ;
diff --git a/tex/context/base/s-pre-01.tex b/tex/context/base/s-pre-01.tex
index 2cc8c6e35..b86133fa6 100644
--- a/tex/context/base/s-pre-01.tex
+++ b/tex/context/base/s-pre-01.tex
@@ -8,14 +8,14 @@
%D copyright={PRAGMA / 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 This environment can be used to typeset interactive
%D presentations. This module was first used at the 1997 \TUG\
%D meeting.
-\usemodule[pre-general]
+\usemodule[pre-general]
%D \macros
%D {language}
@@ -30,7 +30,7 @@
%D {setupbodyfont,setuplayout}
%D
%D For screen reading, a Lucida Bright font looks nice. We use
-%D a 14.4 point bodyfont for the main text, but switch back to
+%D a 14.4 point bodyfont for the main text, but switch back to
%D 12 points for ornaments.
\startmode[asintended] \setupbodyfont[lbr] \stopmode
@@ -69,7 +69,7 @@
[topspace=12pt,
header=0pt,
footer=0pt,
- height=402pt, % 450 - 12 - 15 - 12 - 12 + 3
+ height=402pt, % 450 - 12 - 15 - 12 - 12 + 3
bottomdistance=15pt,
bottom=12pt,
backspace=12pt,
@@ -115,7 +115,7 @@
%D
%D We did not enable interactive text support yet, so let's do
%D that now. We force page reference to circumvent problems
-%D with named destinations in buggy viewers.
+%D with named destinations in buggy viewers.
\setupinteraction
[page=yes,
@@ -137,8 +137,8 @@
rightoffset=-3pt]
\startinteractionmenu[bottom]
- \txt \InteractionBar \\
- \txt \InteractionButtons \\
+ \txt \InteractionBar \\
+ \txt \InteractionButtons \\
\stopinteractionmenu
%D \macros
@@ -166,7 +166,7 @@
\setupinteractionbar
[framecolor=white,rulethickness=1pt,
height=\bottomheight,strut=no]
-
+
\def\InteractionButtons%
{\interactionbuttons
[width=15em]
@@ -179,23 +179,23 @@
%D \macros
%D {StartTitlePage, TitlePage}
%D
-%D The titlepage is rather simple and can be typeset in two
-%D ways:
+%D The titlepage is rather simple and can be typeset in two
+%D ways:
%D
%D \starttyping
%D \StartTitlePage
-%D text \\ text \\ text
+%D text \\ text \\ text
%D \StopTitlepage
%D \stoptyping
%D
%D or more straightforward:
%D
%D \starttyping
-%D \TitlePage{text\\text\\text}
+%D \TitlePage{text\\text\\text}
%D \stoptyping
-%D
-%D The first alternative can be used for more complicated
-%D title pages.
+%D
+%D The first alternative can be used for more complicated
+%D title pages.
\def\StartTitlePage%
{\startstandardmakeup
@@ -236,8 +236,8 @@
%D {definehead}
%D
%D The commands \type{\Topic} and \type{\Subject} are defined
-%D as copies of head. We use \type{\Nopic} for internal
-%D purposes.
+%D as copies of head. We use \type{\Nopic} for internal
+%D purposes.
\definehead [Topic] [chapter]
\definehead [Subject] [section]
@@ -247,10 +247,10 @@
%D \macros
%D {setuphead}
%D
-%D Because chapters and sections do not make sense in
-%D presentations, we use our own command for typesetting the
-%D titles. Sectionnumbers are of course hidden from viewing.
-%D Each topic is followed by a list of subjects that belong
+%D Because chapters and sections do not make sense in
+%D presentations, we use our own command for typesetting the
+%D titles. Sectionnumbers are of course hidden from viewing.
+%D Each topic is followed by a list of subjects that belong
%D to the topic.
\setuphead
@@ -302,15 +302,15 @@
%D {\midaligned{#2}}
%D \stoptyping
%D
-%D But why should we complicate things when we can use
-%D alternative~\type{g}. The test is only needed if one
-%D does not automatically goes a new page with each subject.
+%D But why should we complicate things when we can use
+%D alternative~\type{g}. The test is only needed if one
+%D does not automatically goes a new page with each subject.
\def\PlaceSubjectList%
{\blank
- \determinelistcharacteristics[Subject]
+ \determinelistcharacteristics[Subject]
% \ifnum\utilitylistlength>0 \placelist[Subject] \fi}
- \doifmode{*list}{\placelist[Subject]}}
+ \doifmode{*list}{\placelist[Subject]}}
\setuplist
[Subject, Topic]
@@ -323,7 +323,7 @@
% %D {setuptexttexts}
% %D
% %D The topics will be listed in the right edge, using:
-%
+%
% \setuptexttexts
% [edge]
% [][\TopicList]
@@ -332,8 +332,8 @@
%D {setuplist, placelist,startinteractionmenu}
%D
%D The actual topic list is typeset using a \type{\vbox}. We
-%D have to specify \type{criteriumcriterium=all} because otherwise no
-%D list will be typeset. (By default lists are typeset
+%D have to specify \type{criteriumcriterium=all} because otherwise no
+%D list will be typeset. (By default lists are typeset
%D locally.)
\startinteractionmenu[right]
@@ -348,7 +348,7 @@
style=\setsmallbodyfont\bfx]
\stopinteractionmenu
-\def\Topics#1% temporary hack
+\def\Topics#1% temporary hack
{\Nopic{#1}
\placelist[Topic][criterium=all]}
@@ -357,12 +357,12 @@
%D \macros
%D {setuptexttexts, button}
-%D
+%D
%D During a presentation, we want to use the cursor to point to
%D parts of the text. Furthermore we want to be able to jump to
%D the next page, without the need to move the cursor on buttons.
%D Therefore we make the text part of the screen into an
-%D invisible button.
+%D invisible button.
\setuptexttexts
[\GotoNextPage][]
@@ -374,11 +374,31 @@
%D {setupsubpagenumber}
%D
%D The left bottom navigation bar shows the subpages, which will
-%D be counted by text. One can change this in the preentation
-%D itself by saying \type {[way=byTopic]}.
+%D be counted by text. One can change this in the preentation
+%D itself by saying \type {[way=byTopic]}.
\setupsubpagenumber
[way=bytext, % Topic,
state=start]
-\endinput
+\doifnotmode{demo}{\endinput}
+
+%D The (rather silly) demo section.
+
+\starttext
+
+\TitlePage{Title Page\\pre-original}
+
+\Topics{Some Nice Quotes}
+
+\Topic{A Few}
+
+\Subject{Knuth} \input knuth
+\Subject{Tufte} \input tufte
+
+\Topic{Some More}
+
+\Subject{Zapf} \input zapf
+\Subject{Bryson} \input bryson
+
+\stoptext
diff --git a/tex/context/base/s-pre-02.tex b/tex/context/base/s-pre-02.tex
index 4cd450f84..9df1fe383 100644
--- a/tex/context/base/s-pre-02.tex
+++ b/tex/context/base/s-pre-02.tex
@@ -8,12 +8,12 @@
%D copyright={PRAGMA / 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 This environment can be used to typeset interactive
-%D presentations. This module was first used at the 1998
-%D publishers conference of the European Portable Document
+%D presentations. This module was first used at the 1998
+%D publishers conference of the European Portable Document
%D Association (now merged into a graphics association).
\usemodule[pre-general]
@@ -21,8 +21,8 @@
%D \macros
%D {setupbodyfont, switchtobodyfont, setuplayout}
%D
-%D At \PRAGMA\ we prefer using the Lucida Bright fonts, but
-%D one can of course load another typeface.
+%D At \PRAGMA\ we prefer using the Lucida Bright fonts, but
+%D one can of course load another typeface.
\startmode[asintended] \setupbodyfont[lbr] \stopmode
@@ -34,7 +34,7 @@
%D \macros
%D {setuppapersize, setuplayout}
%D
-%D The papersize suits the screen dimensions. The layout is
+%D The papersize suits the screen dimensions. The layout is
%D rather simple. We use the whole width of the screen and only
%D have navigational tools at the bottom of the screen.
@@ -55,8 +55,8 @@
%D \macros
%D {setupwhitespace, setuptyping}
%D
-%D We don't have much height, so we use a more cramped
-%D spacing. Verbatim text looks better when indented.
+%D We don't have much height, so we use a more cramped
+%D spacing. Verbatim text looks better when indented.
%D
\setupwhitespace
@@ -69,7 +69,7 @@
%D {definecolor, setupcolors}
%D
%D Of course we enable color. We define some logical colors,
-%D of which most default to the same green shade.
+%D of which most default to the same green shade.
\definecolor [BackgroundColor] [r=.8, g=.8, b=.8]
\definecolor [OrnamentColor] [r= 0, g=.7, b=.4]
@@ -79,8 +79,8 @@
%D \macros
%D {setupinteraction, setupinteractionscreen}
-%D
-%D We still have to enable interaction mode. We go full
+%D
+%D We still have to enable interaction mode. We go full
%D screen!
\setupinteraction
@@ -103,31 +103,31 @@
%D \macros
%D {defineoverlay, setupbackgrounds}
-%D
-%D The navigational elements and the backgrounds are
+%D
+%D The navigational elements and the backgrounds are
%D provided by \METAPOST.
-%D
+%D
%D When \METAPOST\ is used, it makes sense to generate the
%D graphics at runtime. This is supported when one enables
%D system calls in the local \type {texmf.cnf} file and add the
%D switch \type {\runMPgraphicstrue} to the local file \type
-%D {cont-sys.tex}. When direct processing is disabled or not
-%D supported, \TEXEXEC\ will take care of graphic generation.
+%D {cont-sys.tex}. When direct processing is disabled or not
+%D supported, \TEXEXEC\ will take care of graphic generation.
\startuniqueMPgraphic{PageBackground}
fill unitsquare
- xyscaled(OverlayWidth,OverlayHeight)
- withcolor OverlayColor ;
+ xyscaled(OverlayWidth,OverlayHeight)
+ withcolor OverlayColor ;
draw unitsquare
- xyscaled(OverlayWidth,OverlayHeight)
+ xyscaled(OverlayWidth,OverlayHeight)
enlarged (-2*OverlayLineWidth)
withpen pencircle scaled OverlayLineWidth
- withcolor OverlayLineColor ;
+ withcolor OverlayLineColor ;
\stopuniqueMPgraphic
\defineoverlay
[PageBackground]
- [\uniqueMPgraphic{PageBackground}]
+ [\uniqueMPgraphic{PageBackground}]
\setupbackgrounds
[page]
@@ -139,15 +139,15 @@
%D \macros
%D {setuptexttexts}
%D
-%D By clicking on the text area, one goes to the next page.
-%D We hook this feature into the text backgrounds.
+%D By clicking on the text area, one goes to the next page.
+%D We hook this feature into the text backgrounds.
\startuniqueMPgraphic{TextBackground}
draw unitsquare
- xyscaled(OverlayWidth,OverlayHeight)
+ xyscaled(OverlayWidth,OverlayHeight)
enlarged (4*OverlayLineWidth)
withpen pencircle scaled OverlayLineWidth
- withcolor OverlayLineColor ;
+ withcolor OverlayLineColor ;
\stopuniqueMPgraphic
\defineoverlay
@@ -214,14 +214,14 @@
[menu=on]
\def\WhateverButton
- {\doifreferencefoundelse{Whatever}
- {\raw [Whatever] \uniqueMPgraphic{UpArrow} \\}
+ {\doifreferencefoundelse{Whatever}
+ {\raw [Whatever] \uniqueMPgraphic{UpArrow} \\}
{}}
\startinteractionmenu[bottom]
- \but [Topics] \\ % secret button
+ \but [Topics] \\ % secret button
\hfill
- \WhateverButton % user specific
+ \WhateverButton % user specific
\kern2\bottomheight
\raw [previouspage] \uniqueMPgraphic{LeftArrow} \\
\kern.5\bottomheight
@@ -253,23 +253,23 @@
%D \macros
%D {StartTitlePage, TitlePage}
%D
-%D The titlepage is rather simple and can be typeset in two
-%D ways:
+%D The titlepage is rather simple and can be typeset in two
+%D ways:
%D
%D \starttyping
%D \StartTitlePage
-%D text \\ text \\ text
+%D text \\ text \\ text
%D \StopTitlepage
%D \stoptyping
%D
%D or as one||liner:
%D
%D \starttyping
-%D \TitlePage{text\\text\\text}
+%D \TitlePage{text\\text\\text}
%D \stoptyping
-%D
-%D The first alternative can be used for more complicated
-%D title pages.
+%D
+%D The first alternative can be used for more complicated
+%D title pages.
\def\StartTitlePage%
{\startstandardmakeup
@@ -289,8 +289,8 @@
%D {definehead}
%D
%D The commands \type{\Topic} and \type{\Subject} are defined
-%D as copies of head. We use \type{\Nopic} for internal
-%D purposes.
+%D as copies of head. We use \type{\Nopic} for internal
+%D purposes.
\definehead [Topic] [chapter]
\definehead [Subject] [section]
@@ -323,8 +323,8 @@
%D \macros
%D {setuplist}
%D
-%D When found, the subject list is automatically placed
-%D after the topic head.
+%D When found, the subject list is automatically placed
+%D after the topic head.
\setuplist
[Topic,Subject]
@@ -337,7 +337,7 @@
[Topic]
[criterium=all]
-\def\Topics#1%
+\def\Topics#1%
{\determinelistcharacteristics[Topic]
\doifmode{*list}
{\Nopic[Topics]{#1}
@@ -349,7 +349,7 @@
[Subject]
[criterium=Topic]
-\def\Subjects%
+\def\Subjects%
{\determinelistcharacteristics[Subject]
\doifmode{*list}
{\placelist[Subject]}}
@@ -358,4 +358,24 @@
[Topic]
[after={\blank[3*medium]\Subjects}]
-\endinput
+\doifnotmode{demo}{\endinput}
+
+%D The (rather silly) demo section.
+
+\starttext
+
+\TitlePage{Title Page\\pre-green}
+
+\Topics{Some Nice Quotes}
+
+\Topic{A Few}
+
+\Subject{Knuth} \input knuth
+\Subject{Tufte} \input tufte
+
+\Topic{Some More}
+
+\Subject{Zapf} \input zapf
+\Subject{Bryson} \input bryson
+
+\stoptext
diff --git a/tex/context/base/s-pre-03.tex b/tex/context/base/s-pre-03.tex
index c7420ba37..bdd7960c5 100644
--- a/tex/context/base/s-pre-03.tex
+++ b/tex/context/base/s-pre-03.tex
@@ -99,7 +99,7 @@
% path p; p := superellipse(r,t,l,b,.8) ;
% fill p withcolor \MPcolor{Backgroundcolor} ;
% draw p withcolor \MPcolor{OrnamentColor} ;
-% color contrastcolor ; contrastcolor = 2/3 * \MPcolor{OrnamentColor} ;
+% color contrastcolor ; contrastcolor = 2/3 * \MPcolor{OrnamentColor} ;
% if (pos>0) and (tot>0):
% pair pa ; pa := point 5 of p ;
% pair pb ; pb := point 7 of p ;
@@ -117,28 +117,28 @@
\startuseMPgraphic{PageShape}
StartPage ;
- path p ; pair pa, pb ; numeric len ; color contrastcolor ;
- fill Page withcolor \MPcolor {PageColor} ;
+ path p ; pair pa, pb ; numeric len ; color contrastcolor ;
+ fill Page withcolor \MPcolor {PageColor} ;
pickup pencircle rotated 45 xscaled 10pt yscaled 20pt ;
p := Page enlarged (-10pt,-15pt) superellipsed .8 ;
- p := p shifted (-1.5pt,0) ; % looks better
+ p := p shifted (-1.5pt,0) ; % looks better
fill p withcolor \MPcolor{BackgroundColor} ;
draw p withcolor \MPcolor{OrnamentColor} ;
- contrastcolor = 2/3 * \MPcolor{OrnamentColor} ;
+ contrastcolor = 2/3 * \MPcolor{OrnamentColor} ;
if (PageNumber>0) and (NOfPages>0):
draw point 5 of p withcolor contrastcolor ;
draw point 7 of p withcolor contrastcolor ;
len := 2/NOfPages ;
pa := point (5+len*PageNumber) of p ;
pb := point (5+len*(PageNumber-1)) of p ;
- draw (p cutafter pa) cutbefore pb
+ draw (p cutafter pa) cutbefore pb
withcolor contrastcolor ;
fi ;
StopPage ;
\stopuseMPgraphic
%D We use the viewer provided feature to go to the previous or
-%D next page.
+%D next page.
\defineoverlay[PrevButton][\overlaybutton{PreviousPage}]
\defineoverlay[NextButton][\overlaybutton{NextPage}]
@@ -151,11 +151,11 @@
[text][text]
[background=NextButton]
-% or using hard coded next/prev pages:
+% or using hard coded next/prev pages:
%
% \defineoverlay[PrevButton][\overlaybutton{previouspage}]
% \defineoverlay[NextButton][\overlaybutton{nextpage}]
-%
+%
% \setupbackgrounds[state=repeat]
% \setupbackground[text][text][background=NextButton]
%
@@ -234,4 +234,24 @@
\def\TitlePage#1%
{\StartTitlePage#1\StopTitlePage}
-\endinput
+\doifnotmode{demo}{\endinput}
+
+%D The (rather silly) demo section.
+
+\starttext
+
+\TitlePage{Title Page\\pre-funny}
+
+\Topics{Some Nice Quotes}
+
+\Topic{A Few}
+
+\Subject{Knuth} \input knuth
+\Subject{Tufte} \input tufte
+
+\Topic{Some More}
+
+\Subject{Zapf} \input zapf
+\Subject{Bryson} \input bryson
+
+\stoptext
diff --git a/tex/context/base/s-pre-04.tex b/tex/context/base/s-pre-04.tex
index 29b040a8b..09cc79b72 100644
--- a/tex/context/base/s-pre-04.tex
+++ b/tex/context/base/s-pre-04.tex
@@ -8,17 +8,17 @@
%D copyright={PRAGMA / 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.
-\usemodule[pre-general]
+\usemodule[pre-general]
%D \macros
%D {setupbodyfont}
%D
%D This is just another environment for typesetting interactive
%D presentations. I wrote this module on behalf of a course I
-%D gave for the United Kingdom \TeX\ users group.
+%D gave for the United Kingdom \TeX\ users group.
\setupbodyfont[ams,pos,14.4pt]
@@ -28,33 +28,33 @@
%D I started using dark blue for the navigational elements. In
%D that context, dark red is a logical choice for the contrast
%D color. While playing around with the navigational elements
-%D I decided to use the not so dominant color yellow for the
-%D status bar.
-%D
+%D I decided to use the not so dominant color yellow for the
+%D status bar.
+%D
%D A few days before I wrote this style, the recent acquisition
%D of Mondriaans last painting by the Dutch governement was a
%D hot topic in the dutch news scenary. Therefore I decided to
%D replace the rather dull title page by something more
%D colorful, in mondriaan colors, but far more random than any
-%D of his paintings. For consistence we remap the already
-%D defined primary colors.
+%D of his paintings. For consistence we remap the already
+%D defined primary colors.
\setupcolors [state=start]
-\definecolor [NoneColor] [s=.6]
+\definecolor [NoneColor] [s=.6]
\definecolor [GotoColor] [b=.6] \definecolor[blue] [GotoColor]
\definecolor [ExitColor] [r=.6] \definecolor[red] [ExitColor]
-\definecolor [JumpColor] [s=.6]
+\definecolor [JumpColor] [s=.6]
\definecolor [UserColor] [g=.6] \definecolor[green] [UserColor]
\definecolor [StepColor] [r=.6,g=.6] \definecolor[yellow][StepColor]
\definecolor [PageColor] [s=.80] \definecolor[gray] [PageColor]
-\definecolor [TextColor] [s=.90]
+\definecolor [TextColor] [s=.90]
%D \macros
%D {setuppapersize}
%D
-%D As usual, we take a screen oriented paper size:
+%D As usual, we take a screen oriented paper size:
\setuppapersize
[S6][S6]
@@ -62,9 +62,9 @@
%D \macros
%D {setuplayout,setupinteractionscreen}
%D
-%D The layout definition fits into this $600\times450$ point
+%D The layout definition fits into this $600\times450$ point
%D area, but the dimensions are somewhat diffused by the text
-%D background offset.
+%D background offset.
\setuplayout
[width=530pt,
@@ -85,10 +85,10 @@
%D \macros
%D {setupbackgrounds}
%D
-%D Both the page and the text area have a gray background.
-%D The \type {[text,text]} area also has an offset. Later we
+%D Both the page and the text area have a gray background.
+%D The \type {[text,text]} area also has an offset. Later we
%D will see that we have to compensate for that in the
-%D navigational areas.
+%D navigational areas.
\setupbackgrounds
[page]
@@ -104,19 +104,19 @@
%D \macros
%D {setupinteraction}
%D
-%D For convenient navigation, we turn on interaction.
+%D For convenient navigation, we turn on interaction.
\setupinteraction
[state=start,
menu=on,
- color=UserColor,
+ color=UserColor,
contrastcolor=NoneColor]
%D \macros
%D {setupsubpagenumber}
%D
-%D When navigating the document, we keep the title page out
-%D of sight, therefore we use sub page numbers.
+%D When navigating the document, we keep the title page out
+%D of sight, therefore we use sub page numbers.
\setupsubpagenumber
[state=start,
@@ -127,7 +127,7 @@
%D
%D There is only one interaction menu, located in the right
%D edge of the screen. Both offsets enlarge the edge by the
-%D same amount as the text background offset.
+%D same amount as the text background offset.
\setupinteractionmenu
[right]
@@ -146,10 +146,10 @@
%D start||stop alternative for setting the content. The macro
%D \type {\interactioncolor} expands into either the
%D interaction color or the contrast color, the latter only
-%D when no jump is possible.
+%D when no jump is possible.
\startinteractionmenu[right]
- \setupinteraction[color=GotoColor]
+ \setupinteraction[color=GotoColor]
\but [previoussubpage] \Triangle {90}\framedwidth\interactioncolor \\
\vskip10pt
\but [nextsubpage] \Triangle{270}\framedwidth\interactioncolor \\
@@ -162,11 +162,11 @@
%D \macros
%D {setupinteractionbar}
%D
-%D The interaction bar at the bottom is also larger than the
-%D normal width of the bottom area.
+%D The interaction bar at the bottom is also larger than the
+%D normal width of the bottom area.
\setupinteractionbar
- [alternative=f,
+ [alternative=f,
width=\textwidth,
height=\bottomheight,
distance=10pt,
@@ -176,29 +176,29 @@
%D \macros
%D {setupbottomtexts}
%D
-%D The bar is centered in the middle.
+%D The bar is centered in the middle.
-\setupbottomtexts
+\setupbottomtexts
[\interactionbar]
-%D We can exit viewing with a close button, located on the
-%D rightmost bottom area.
+%D We can exit viewing with a close button, located on the
+%D rightmost bottom area.
\def\CloseButton
{\button
[width=\rightedgewidth,height=\bottomheight,offset=overlay,
background=color,backgroundcolor=ExitColor,frame=off]
{}%
- [CloseDocument]}
+ [CloseDocument]}
\setupbottomtexts
[edge][][\CloseButton]
-%D \macros
+%D \macros
%D {definesymbol,setupitemize}
%D
-%D Because some prominent things are rectangular or triangular,
-%D we prefer some different symbols in itemizations:
+%D Because some prominent things are rectangular or triangular,
+%D we prefer some different symbols in itemizations:
\definesymbol[1][$\blacktriangleright$]
\definesymbol[2][$\blacktriangledown$]
@@ -245,11 +245,11 @@
%D \macros
%D {Topic, Nopic, Subject,
-%D definehead, setuphead}
+%D definehead, setuphead}
%D
-%D We use \type {\Topic} and \type {\Subject} instead of
-%D chapters and sections. The \type {\Nopic} alternative is
-%D meant for internal use.
+%D We use \type {\Topic} and \type {\Subject} instead of
+%D chapters and sections. The \type {\Nopic} alternative is
+%D meant for internal use.
\definehead [Topic] [chapter]
\definehead [Nopic] [title]
@@ -275,9 +275,9 @@
%D {Topics, Subjects,
%D setuplist, placelist, startcolumns}
%D
-%D This style is meant for the more large presentations, and
-%D therefore provided for a list of topics as well as local
-%D lists of subjects. When many topics are introduces, the
+%D This style is meant for the more large presentations, and
+%D therefore provided for a list of topics as well as local
+%D lists of subjects. When many topics are introduces, the
%D list is typeset in columns.
\setuplist
@@ -291,28 +291,28 @@
[Topic]
[criterium=all]
-\def\Topics#1%
+\def\Topics#1%
{\determinelistcharacteristics[Topic]
- \ifnum\utilitylistlength>0
+ \ifnum\utilitylistlength>0
\Nopic[Topics]{#1}
- \ifnum\utilitylistlength>12
+ \ifnum\utilitylistlength>12
\startcolumns
\placelist[Topic]
\stopcolumns
\else
\placelist[Topic]
- \fi
+ \fi
\fi}
-\def\Subjects%
+\def\Subjects%
{\placelist[Subject]}
-%D Last we define the overlays. Look at the way colors are
+%D Last we define the overlays. Look at the way colors are
%D linked into the macros.
\startMPinclusions
def triangle (expr wid, rot, col) =
- x1 := x3 := y1 := 0 ; x2 := y3 := wid ; y2 := .5y3 ;
+ x1 := x3 := y1 := 0 ; x2 := y3 := wid ; y2 := .5y3 ;
fill (z1--z2--z3--cycle) rotated rot withcolor col ;
currentpicture := currentpicture xysized (wid,wid) ;
enddef ;
@@ -331,27 +331,47 @@
\def\Triangle#1#2#3%
{\uniqueMPgraphic{triangle}{rotation=#1,width=#2,color=#3}}
-\startuseMPgraphic{title} % can be simplified with "randomized"
- color c ; path p ;
- for i=1 upto 250 :
- x0 := uniformdeviate \overlaywidth ;
+\startuseMPgraphic{title} % can be simplified with "randomized"
+ color c ; path p ;
+ for i=1 upto 250 :
+ x0 := uniformdeviate \overlaywidth ;
y0 := uniformdeviate \overlayheight ;
- sx := uniformdeviate 20 ;
+ sx := uniformdeviate 20 ;
sy := uniformdeviate 20 ;
- cc := round(uniformdeviate 2) ;
- if cc=0 : c := \MPcolor{GotoColor} fi ;
- if cc=1 : c := \MPcolor{ExitColor} fi ;
- if cc=2 : c := \MPcolor{StepColor} fi ;
- qq := round(uniformdeviate 1) ;
- if qq=0 :
+ cc := round(uniformdeviate 2) ;
+ if cc=0 : c := \MPcolor{GotoColor} fi ;
+ if cc=1 : c := \MPcolor{ExitColor} fi ;
+ if cc=2 : c := \MPcolor{StepColor} fi ;
+ qq := round(uniformdeviate 1) ;
+ if qq=0 :
p := unitsquare xscaled sx yscaled sy ;
else :
- rr := round(uniformdeviate 3) * 90 ;
- x1 := x3 := y1 := 0 ; x2 := y3 := sx; y2 := .5y3 ;
+ rr := round(uniformdeviate 3) * 90 ;
+ x1 := x3 := y1 := 0 ; x2 := y3 := sx; y2 := .5y3 ;
p := (z1--z2--z3--cycle) rotated rr ;
- fi ;
- fill p shifted z0 withcolor c ;
+ fi ;
+ fill p shifted z0 withcolor c ;
endfor ;
\stopuseMPgraphic
-\endinput
+\doifnotmode{demo}{\endinput}
+
+%D The (rather silly) demo section.
+
+\starttext
+
+\TitlePage{Title Page\\pre-colorfull}
+
+\Topics{Some Nice Quotes}
+
+\Topic{A Few}
+
+\Subject{Knuth} \input knuth
+\Subject{Tufte} \input tufte
+
+\Topic{Some More}
+
+\Subject{Zapf} \input zapf
+\Subject{Bryson} \input bryson
+
+\stoptext
diff --git a/tex/context/base/s-pre-05.tex b/tex/context/base/s-pre-05.tex
index f095ae091..9b3ae89ff 100644
--- a/tex/context/base/s-pre-05.tex
+++ b/tex/context/base/s-pre-05.tex
@@ -8,13 +8,13 @@
%D copyright={PRAGMA / 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.
-\usemodule[pre-general]
+\usemodule[pre-general]
-%D As all styles sofar, this one has the same structuring
-%D commands.
+%D As all styles sofar, this one has the same structuring
+%D commands.
\startmode[asintended] \setupbodyfont[lbr] \stopmode
@@ -22,7 +22,7 @@
\setupcolors [state=start]
-\definecolor [BackgroundColor] [s=.95]
+\definecolor [BackgroundColor] [s=.95]
\definecolor [OrnamentColor] [r=.6,g=.7,b=.8]
\setuppapersize
@@ -68,7 +68,7 @@
color=OrnamentColor,
contrastcolor=OrnamentColor]
-%D Watch how we use a list alternative that matches the
+%D Watch how we use a list alternative that matches the
%D menu.
\setupinteractionmenu
@@ -77,7 +77,7 @@
style=smallbold,
frame=off,
offset=10pt,
- height=35pt,
+ height=35pt,
before=,
after=,
inbetween=\endgraf,
@@ -96,7 +96,7 @@
\setupinteractionmenu
[right]
[height=30pt]
- \but [CloseDocument] Close \\
+ \but [CloseDocument] Close \\
\stopinteractionmenu
\setupwhitespace
@@ -140,19 +140,19 @@
\def\TitlePage#1%
{\StartTitlePage#1\StopTitlePage}
-%D \macros
+%D \macros
%D {Topics,Subjects}
%D
-%D Since the lists are in the menu, we don't honor list
-%D placement macros.
+%D Since the lists are in the menu, we don't honor list
+%D placement macros.
\def\Topics#1{}
\def\Subjects{}
%D \macros
-%D {Topic, Nopic, Subject}
+%D {Topic, Nopic, Subject}
%D
-%D Since t his style is meant for rather flat structured
+%D Since t his style is meant for rather flat structured
%D documents, only \type {\Topic} makes sense.
\definehead [Topic] [chapter]
@@ -175,27 +175,27 @@
continue=no,
style=\tfa]
-%D We use only one kind of base graphic, which is sligthly
-%D tuned for the different usage.
+%D We use only one kind of base graphic, which is sligthly
+%D tuned for the different usage.
\startMPinclusions
- def random_hash_frame (expr width, height, offset, linewidth ) =
+ def random_hash_frame (expr width, height, offset, linewidth ) =
def delta = ((uniformdeviate .5offset) + .25offset) enddef ;
x1 := offset ; y1 := offset ; x2 := width-offset ; y2 := height-offset ;
- drawoptions(withpen pencircle scaled linewidth withcolor \MPcolor{BackgroundColor}) ;
+ drawoptions(withpen pencircle scaled linewidth withcolor \MPcolor{BackgroundColor}) ;
fill z1--(x2,y1)--z2--(x1,y2)--cycle ;
- drawoptions(withpen pencircle scaled linewidth withcolor \MPcolor{OrnamentColor}) ;
+ drawoptions(withpen pencircle scaled linewidth withcolor \MPcolor{OrnamentColor}) ;
draw (x1-delta,y1)--(x2+delta,y1) ;
draw (x2,y1-delta)--(x2,y2+delta) ;
draw (x2+delta,y2)--(x1-delta,y2) ;
draw (x1,y2+delta)--(x1,y1-delta) ;
- drawoptions();
+ drawoptions();
setbounds currentpicture to unitsquare xscaled width yscaled height ;
- enddef ;
+ enddef ;
\stopMPinclusions
\startuseMPgraphic{HashFrameA}
@@ -207,14 +207,34 @@
\stopuseMPgraphic
\startuseMPgraphic{TitleGraphic}
- for i=1 upto 300 :
- offset := uniformdeviate 10pt ;
- width := 2*offset + 30pt + uniformdeviate 30pt ;
- height := 2*offset + 10pt + uniformdeviate 10pt ;
- addto currentpicture also
- image(random_hash_frame(width,height,offset,1pt)) shifted
- (uniformdeviate OverlayWidth, uniformdeviate OverlayHeight) ;
- endfor ;
+ for i=1 upto 300 :
+ offset := uniformdeviate 10pt ;
+ width := 2*offset + 30pt + uniformdeviate 30pt ;
+ height := 2*offset + 10pt + uniformdeviate 10pt ;
+ addto currentpicture also
+ image(random_hash_frame(width,height,offset,1pt)) shifted
+ (uniformdeviate OverlayWidth, uniformdeviate OverlayHeight) ;
+ endfor ;
\stopuseMPgraphic
-\endinput
+\doifnotmode{demo}{\endinput}
+
+%D The (rather silly) demo section.
+
+\starttext
+
+\TitlePage{Title Page\\pre-fuzzy}
+
+\Topics{Some Nice Quotes}
+
+\Topic{A Few}
+
+\Subject{Knuth} \input knuth
+\Subject{Tufte} \input tufte
+
+\Topic{Some More}
+
+\Subject{Zapf} \input zapf
+\Subject{Bryson} \input bryson
+
+\stoptext
diff --git a/tex/context/base/s-pre-06.tex b/tex/context/base/s-pre-06.tex
index d3b99d9b7..7a84323e9 100644
--- a/tex/context/base/s-pre-06.tex
+++ b/tex/context/base/s-pre-06.tex
@@ -27,7 +27,7 @@
\usemodule[pre-general]
-%D \macros
+%D \macros
%D {setupbodyfont}
%D
%D As said, we will use the Antikwa Torunska, and because we
@@ -36,7 +36,7 @@
\setupbodyfont
[ant,14.4pt]
-%D \macros
+%D \macros
%D {definecolor, setupcolors}
%D
%D Thus style only uses gray scales, but nevertheless we turn
@@ -49,7 +49,7 @@
\definecolor [ContrastColor] [s=.9]
\definecolor [InteractionColor] [s=.6]
-%D \macros
+%D \macros
%D {setuppapersize}
%D
%D As (nearly) always, we use a 600 pt times 450 pt screen
@@ -268,9 +268,9 @@
%D
%D We use a nested \type {\everypar}; everything in there
%D will be put in front of each paragraph. The nesting prevents
-%D the first paragraph from indenting. The struts give the
+%D the first paragraph from indenting. The struts give the
%D lines a decent height, which looks better inrelation to the
-%D next pages.
+%D next pages.
\def\StartTitlePage%
{\startstandardmakeup
@@ -292,4 +292,34 @@
\def\TitlePage#1%
{\StartTitlePage#1\StopTitlePage}
-\endinput
+\doifnotmode{demo}{\endinput}
+
+%D The (rather silly) demo section.
+
+\usemodule[pre-antikwa]
+
+\starttext
+
+\TitlePage{Title Page\\pre-polish}
+
+\Topics{Some Nice Lists}
+
+\Topic{Some Lists}
+
+\Subject{A list}
+
+\startitemize
+\item first
+\item second
+\stopitemize
+
+\Subject{A bigger list}
+
+\startitemize
+\item first
+\item second
+\item third
+\item fourth
+\stopitemize
+
+\stoptext
diff --git a/tex/context/base/s-pre-07.tex b/tex/context/base/s-pre-07.tex
index 65514403a..bf84971bb 100644
--- a/tex/context/base/s-pre-07.tex
+++ b/tex/context/base/s-pre-07.tex
@@ -16,12 +16,12 @@
%D This is just one way of implementing such a style. Today
%D we have more \METAPOST\ interfacing available, and
%D thereby moore tools and alternative ways to reach such a
-%D goal. I must admit that the main macro looks fuzzy. On
-%D the other hand, the presentation can look quite structured.
-%D
+%D goal. I must admit that the main macro looks fuzzy. On
+%D the other hand, the presentation can look quite structured.
+%D
%D \starttyping
%D \Topics{...}
-%D
+%D
%D \StartIdeas
%D \Topic{...}
%D \StartIdea ... \StopIdea
@@ -54,7 +54,7 @@
%D keep the random seed reasonable constant.
\setupsystem
- [random=big]
+ [random=big]
\setupcolors
[state=start]
@@ -193,4 +193,20 @@
\def\StopIdeas%
{}
-\endinput
+\doifnotmode{demo}{\endinput}
+
+%D The (rather silly) demo section.
+
+\starttext
+
+\Topics{This is about \unknown}
+
+\StartIdeas
+ \Topic{Some topic}
+ \StartIdea An idea \unknown \StopIdea
+ \StartIdea \unknown\ and another \StopIdea
+\StopIdeas
+
+\stoptext
+
+
diff --git a/tex/context/base/s-pre-13.tex b/tex/context/base/s-pre-13.tex
index a7b68dd69..6032f36d2 100644
--- a/tex/context/base/s-pre-13.tex
+++ b/tex/context/base/s-pre-13.tex
@@ -12,7 +12,7 @@
%C details.
%D This is again one of the \EUROTEX\ 99 styles. It's one of
-%D the quick and dirty styles supporting basic structuring.
+%D the quick and dirty styles supporting basic structuring.
\setuppapersize
[S6][S6]
@@ -27,14 +27,14 @@
topspace=2cm,
backspace=2cm]
-%D This style is meant to be used with lucida handwriting
-%D fonts. If you don't have that font, you may reconsider
-%D using this style.
+%D This style is meant to be used with lucida handwriting
+%D fonts. If you don't have that font, you may reconsider
+%D using this style.
\startmode[asintended] \setupbodyfont[lbr,hw] \stopmode
%D These colors will mostly be used in the graphics drawn by
-%D \METAPOST.
+%D \METAPOST.
\setupcolors
[state=start]
@@ -44,8 +44,8 @@
\definecolor[LineColor] [g=.4]
\definecolor[SymbolColor][r=.4]
-%D When interacting, we will use button shaped that are
-%D quite random and thereby regenerated for each instance.
+%D When interacting, we will use button shaped that are
+%D quite random and thereby regenerated for each instance.
\setupinteractionscreen
[option=max]
@@ -66,23 +66,23 @@
\startinteractionmenu[bottom]
\hfill
- \got [previouspage] \symbol[prevmark] \\
- \got [nextpage] \symbol[nextmark] \\
- \got [CloseDocument] \symbol[stopmark] \\
- \txt \tfd \SymbolColor \pagenumber \\
+ \got [previouspage] \symbol[prevmark] \\
+ \got [nextpage] \symbol[nextmark] \\
+ \got [CloseDocument] \symbol[stopmark] \\
+ \txt \tfd \SymbolColor \pagenumber \\
\stopinteractionmenu
%D When not processed at runtime, the itemmark graphics can
%D result in processing loops due to funny dimensions.
%D Therefore, from now on, the itemize macros limit the height
-%D and depth.
+%D and depth.
\definesymbol[itemmark][\useMPgraphic{itemmark}]
\definesymbol[stopmark][\useMPgraphic{stopmark}]
\definesymbol[nextmark][\useMPgraphic{nextmark}]
\definesymbol[prevmark][\useMPgraphic{prevmark}]
-%D Of course we have some backgrounds.
+%D Of course we have some backgrounds.
\defineoverlay [page] [\useMPgraphic{page}]
\defineoverlay [next] [\overlaybutton{forward}]
@@ -90,11 +90,11 @@
\setupbackgrounds
[page]
- [background={page,prev}]
+ [background={page,prev}]
\setupbackgrounds
[text]
- [background=next]
+ [background=next]
\setuphead
[chapter]
@@ -114,7 +114,7 @@
width=3\bodyfontsize]
\def\StartTitlePage%
- {\setupinteractionmenu[bottom][state=stop] % will be named page block
+ {\setupinteractionmenu[bottom][state=stop] % will be named page block
\startstandardmakeup
\setupalign[middle]
\def\\%
@@ -149,11 +149,11 @@
\def\Topics#1%
{\Nopic{#1}
\bgroup
- \setupinteraction
+ \setupinteraction
[color=,
contrastcolor=]
\determinelistcharacteristics[Topic]
- \ifnum\utilitylistlength>12
+ \ifnum\utilitylistlength>12
\startcolumns[n=2]
\placelist[Topic]
\stopcolumns
@@ -162,35 +162,35 @@
\fi
\egroup}
-%D We don't support another level of structuring.
+%D We don't support another level of structuring.
\let\Subject \Topic
\let\Subjects\relax
-%D Most of this style is \METAPOST\ definitions. We could
-%D have shared some code, but it would not on forehand make
-%D things more readable, so we stick to the following
-%D definitions.
+%D Most of this style is \METAPOST\ definitions. We could
+%D have shared some code, but it would not on forehand make
+%D things more readable, so we stick to the following
+%D definitions.
\startuseMPgraphic{page}
- width := \overlaywidth ;
- height := \overlayheight ;
+ width := \overlaywidth ;
+ height := \overlayheight ;
- d := 15 ; dd := d ; dd := 10 ;
+ d := 15 ; dd := d ; dd := 10 ;
- def fuzzy (expr p,dx,dy) =
+ def fuzzy (expr p,dx,dy) =
(xpart p +dx-uniformdeviate dx,ypart p+dy-uniformdeviate dy)
- enddef ;
+ enddef ;
- pair ll, lr, ur, ul ;
+ pair ll, lr, ur, ul ;
ll := (d,d) ;
lr := (width-d,d) ;
ur := (width-d,height-d) ;
ul := (d,height-d) ;
- path p, q, r, s ;
+ path p, q, r, s ;
p := ll.. for i=.1 step .1 until .9 : fuzzy (i[ll,lr],0,+dd).. endfor lr ;
q := lr.. for i=.1 step .1 until .9 : fuzzy (i[lr,ur],-dd,0).. endfor ur ;
@@ -201,27 +201,27 @@
fill p & q & r & s -- cycle withcolor \MPcolor{TextColor} ;
- color c ; c := \MPcolor{LineColor} ;
+ color c ; c := \MPcolor{LineColor} ;
- draw p withpen pencircle xscaled 20 yscaled 5 rotated 30 withcolor c ;
- draw q withpen pencircle xscaled 5 yscaled 20 rotated 30 withcolor c ;
- draw r withpen pencircle xscaled 20 yscaled 5 rotated 30 withcolor c ;
- draw s withpen pencircle xscaled 5 yscaled 20 rotated 30 withcolor c ;
+ draw p withpen pencircle xscaled 20 yscaled 5 rotated 30 withcolor c ;
+ draw q withpen pencircle xscaled 5 yscaled 20 rotated 30 withcolor c ;
+ draw r withpen pencircle xscaled 20 yscaled 5 rotated 30 withcolor c ;
+ draw s withpen pencircle xscaled 5 yscaled 20 rotated 30 withcolor c ;
\stopuseMPgraphic
\startuseMPgraphic{itemmark}
- width := BodyFontSize ; height := width/4 ;
+ width := BodyFontSize ; height := width/4 ;
maxheight := StrutHeight ; line := 3width/2 ;
- def fuzzy = -(height/4)+uniformdeviate (height/2) enddef ;
+ def fuzzy = -(height/4)+uniformdeviate (height/2) enddef ;
- draw
- ((0,0+fuzzy)--(width,height+fuzzy/2))
- shifted (line/2,0)
- withpen pencircle
- xscaled line yscaled (line/4)
- rotated (25+uniformdeviate 10) withcolor \MPcolor{SymbolColor} ;
+ draw
+ ((0,0+fuzzy)--(width,height+fuzzy/2))
+ shifted (line/2,0)
+ withpen pencircle
+ xscaled line yscaled (line/4)
+ rotated (25+uniformdeviate 10) withcolor \MPcolor{SymbolColor} ;
setbounds currentpicture to unitsquare xyscaled(width,maxheight) ;
\stopuseMPgraphic
@@ -229,15 +229,15 @@
\startuseMPgraphic{nextmark}
LoadPageState ; width := BottomHeight ; height := line := width/2 ;
- def fuzzy = -(height/8)+uniformdeviate (height/4) enddef ;
+ def fuzzy = -(height/8)+uniformdeviate (height/4) enddef ;
z1 = (0,0+fuzzy) ; z2 = (width,height/2+fuzzy/2) ; z3 = (0,height+fuzzy) ;
- draw
+ draw
(z1..{right}z2 & z2{left}..z3)
- withpen pencircle
- xscaled line yscaled (line/4)
- rotated 30 withcolor \MPcolor{SymbolColor} ;
+ withpen pencircle
+ xscaled line yscaled (line/4)
+ rotated 30 withcolor \MPcolor{SymbolColor} ;
setbounds currentpicture to unitsquare xyscaled(width,height) ;
\stopuseMPgraphic
@@ -245,15 +245,15 @@
\startuseMPgraphic{prevmark}
LoadPageState ; width := BottomHeight ; height := line := width/2 ;
- def fuzzy = -(height/8)+uniformdeviate (height/4) enddef ;
+ def fuzzy = -(height/8)+uniformdeviate (height/4) enddef ;
z1 = (width,0+fuzzy) ; z2 = (0,height/2+fuzzy/2) ; z3 = (width,height+fuzzy) ;
- draw
+ draw
(z1..{left}z2 & z2{right}..z3)
- withpen pencircle
- xscaled line yscaled (line/4)
- rotated 30 withcolor \MPcolor{SymbolColor} ;
+ withpen pencircle
+ xscaled line yscaled (line/4)
+ rotated 30 withcolor \MPcolor{SymbolColor} ;
setbounds currentpicture to unitsquare xyscaled(width,height) ;
\stopuseMPgraphic
@@ -261,7 +261,7 @@
\startuseMPgraphic{stopmark}
LoadPageState ; width := BottomHeight ; height := line := width/2 ;
- def fuzzy = -(height/8)+uniformdeviate (height/4) enddef ;
+ def fuzzy = -(height/8)+uniformdeviate (height/4) enddef ;
z1 = (0,0+fuzzy) ;
z2 = (width,height+fuzzy) ;
@@ -269,14 +269,34 @@
z4 = (0,height+fuzzy) ;
z5 = (width/2,height/2) ;
- drawoptions
- (withpen pencircle
- xscaled line yscaled (line/4)
- rotated 30 withcolor \MPcolor{SymbolColor}) ;
+ drawoptions
+ (withpen pencircle
+ xscaled line yscaled (line/4)
+ rotated 30 withcolor \MPcolor{SymbolColor}) ;
draw z1..{right}z5..z2 ; draw z3..{left}z5..z4 ;
setbounds currentpicture to unitsquare xyscaled(width,height) ;
\stopuseMPgraphic
-\endinput
+\doifnotmode{demo}{\endinput}
+
+%D The (rather silly) demo section.
+
+\starttext
+
+\TitlePage{Title Page\\pre-writing}
+
+\Topics{Some Nice Quotes}
+
+\Topic{A Few}
+
+\Subject{Knuth} \input knuth
+\Subject{Tufte} \input tufte
+
+\Topic{Some More}
+
+\Subject{Zapf} \input zapf
+\Subject{Bryson} \input bryson
+
+\stoptext
diff --git a/tex/context/base/s-pre-14.tex b/tex/context/base/s-pre-14.tex
index 7a777c27e..f44117e7c 100644
--- a/tex/context/base/s-pre-14.tex
+++ b/tex/context/base/s-pre-14.tex
@@ -15,18 +15,18 @@
%D In the process of making a couple of simple styles for
%D \EUROTEX\ 99, I came to this one. The joke is in the
%D pagenumber. This style can be used for short presentations
-%D with much text.
+%D with much text.
\startmode[asintended] \setupbodyfont[lbr] \stopmode
\setupbodyfont[14.4pt]
-%D Since we expect text, we can best be very tolerant.
+%D Since we expect text, we can best be very tolerant.
-\setuptolerance
+\setuptolerance
[verytolerant,stretch]
-%D As most styles we choose a large screen page size.
+%D As most styles we choose a large screen page size.
\setuppapersize
[S6][S6]
@@ -42,8 +42,8 @@
topspace=1cm,
backspace=1cm]
-%D We only use two colors, named \type {One} and \type
-%D {Two}:
+%D We only use two colors, named \type {One} and \type
+%D {Two}:
\setupcolors
[state=start]
@@ -54,15 +54,15 @@
%D If you've looked at the demo file, you will have noticed
%D that the background consists of four pieces: two filled
%D rectangles and two half numbers. These are put on th epage
-%D using four overlays:
+%D using four overlays:
\setupbackgrounds
[page]
- [background={one,two,three,four}]
+ [background={one,two,three,four}]
%D When we code this in \TEX, we get the following
%D definitions. As an alternative we coudl have used layers
-%D but I'm afraid that it would not have led to less code.
+%D but I'm afraid that it would not have led to less code.
\defineoverlay
[one]
@@ -80,8 +80,8 @@
width=\overlaywidth,height=\overlayheight]
{}}}]
-%D We could have used the main backgroundcolor instead of
-%D overlay \type {one}.
+%D We could have used the main backgroundcolor instead of
+%D overlay \type {one}.
\definefont[NumberFont][RegularBold at 3cm]
@@ -123,7 +123,7 @@
\edef\overlaywidth{\the\scratchdimen}}
%D A much cleaner implementation is the following. If you hate
-%D \METAPOST, you can run this style in the specified mode:
+%D \METAPOST, you can run this style in the specified mode:
\startnotmode[no-metapost]
@@ -135,36 +135,36 @@
\startuseMPgraphic{number}
StartPage ;
- path Vage ; picture Left, Right ;
+ path Vage ; picture Left, Right ;
x1 = x2 = xpart (llcorner Field[Text][RightEdge] shifted (-RightEdgeDistance/2,0)) ;
y1 = ypart llcorner Page ;
y2 = ypart ulcorner Page ;
Vage := llcorner Page -- z1 -- z2 -- ulcorner Page -- cycle ;
fill Page withcolor \MPcolor {One} ;
fill Vage withcolor \MPcolor {Two} ;
- if PageNumber>0 :
+ if PageNumber>0 :
defaultfont := "\truefontname{RegularBold}" ;
- Left := Right := thelabel("\folio",origin) ysized 3cm ;
- clip Right to boundingbox Right shifted (bbwidth(Right)/2,0) ;
+ Left := Right := thelabel("\folio",origin) ysized 3cm ;
+ clip Right to boundingbox Right shifted (bbwidth(Right)/2,0) ;
draw Left shifted z1 shifted (0,2.25cm) withcolor \MPcolor {One} ;
draw Right shifted z1 shifted (0,2.25cm) withcolor \MPcolor {Two} ;
- fi ;
+ fi ;
StopPage ;
\stopuseMPgraphic
\stopnotmode
-%D We use the simple label typesetting present in \METAPOST\
-%D because digits are seldom kerned so real \TEX ing is not
-%D needed. As in the previous method, we let the graphics
-%D overlap so that we don't get white lines due to rounding
-%D problems in viewers.
-%D
+%D We use the simple label typesetting present in \METAPOST\
+%D because digits are seldom kerned so real \TEX ing is not
+%D needed. As in the previous method, we let the graphics
+%D overlap so that we don't get white lines due to rounding
+%D problems in viewers.
+%D
%D We put a button behind the text (this overlay is calculated
-%D each page).
+%D each page).
-\defineoverlay
- [nextpage]
+\defineoverlay
+ [nextpage]
[\overlaybutton{nextpage}]
\setupbackgrounds
@@ -183,7 +183,7 @@
[color=,
contrastcolor=]
-%D Next we define structuring commands.
+%D Next we define structuring commands.
\definehead[Topic] [chapter] \setuphead[Topic] [style=\bfc]
\definehead[Subject][section] \setuphead[Subject][style=\bfa]
@@ -193,12 +193,12 @@
[number=no,
after={\blank[big]}]
-%D Because we will provide a menu, we don't offer lists.
+%D Because we will provide a menu, we don't offer lists.
\let\Topics \gobbleoneargument
\let\Subjects\relax
-%D The table of contents goes to the right edge.
+%D The table of contents goes to the right edge.
\startinteractionmenu[right]
\setupinteraction
@@ -218,7 +218,7 @@
maxwidth=\rightedgewidth,
style=\bfa]
-%D We safe some space:
+%D We safe some space:
\setupwhitespace
[medium]
@@ -226,8 +226,8 @@
\setupblank
[medium]
-%D In the titlepage, we still use the \TEX\ overlays,
-%D so that we don't have to define a second graphic.
+%D In the titlepage, we still use the \TEX\ overlays,
+%D so that we don't have to define a second graphic.
\def\TitlePage#1%
{\StartTitlePage#1\StopTitlePage}
@@ -246,7 +246,7 @@
\stopstandardmakeup
\egroup}
-%D This is it.
+%D This is it.
\doifnotmode{demo}{\endinput}
@@ -259,6 +259,6 @@
\Topic{Reich} \input reich
\Topic{Zapf} \input zapf
\Topic{Materie} \input materie
-\Topic{Stork} \input stork
+%Topic{Stork} \input stork
\stoptext
diff --git a/tex/context/base/spec-tpd.tex b/tex/context/base/spec-tpd.tex
index 0e97a3858..f6c7097bc 100644
--- a/tex/context/base/spec-tpd.tex
+++ b/tex/context/base/spec-tpd.tex
@@ -93,13 +93,14 @@
\pdfvorigin=1 true in
\fi
-%D We default to 300 dots per inch image resolution.
+%D We default to 300 dots per inch image resolution and 600 dpi
+%D bitmap fonts (when asked for).
-\ifx\pdfimageresolution\undefined
- \newcount\pdfimageresolution
-\fi
+\ifx\pdfimageresolution\undefined \newcount\pdfimageresolution \fi
+\ifx\pdfimageresolution\undefined \newcount\pdfpkresolution \fi
\pdfimageresolution=300
+\pdfpkresolution =600
%D Another downward compatible hack:
diff --git a/tex/context/base/syst-ext.tex b/tex/context/base/syst-ext.tex
index 903460abf..f235fed0a 100644
--- a/tex/context/base/syst-ext.tex
+++ b/tex/context/base/syst-ext.tex
@@ -3991,6 +3991,15 @@
\setbox\@@dlhbox\hbox{\mathsurround\zeropoint\everymath\emptytoks$ $}\unhbox\@@dlhbox
\fi \fi}
+% Also ok, but more sensitive to lookahead expansion is:
+%
+% \def\dontleavehmode{\ifvmode \indent \fi}
+%
+% which assumes indent is kept unchanged. Protecting the macro is only
+% possible in etex (watch out: \unexpanded in context is eq to \protected).
+%
+% \unexpanded \def\dontleavehmode{\ifvmode \indent \fi} % functional spec TH
+
%D But, if you run a recent version of \TEX, we can use the new
%D primitive:
diff --git a/tex/context/base/syst-gen.tex b/tex/context/base/syst-gen.tex
index fd78b2520..e249325b9 100644
--- a/tex/context/base/syst-gen.tex
+++ b/tex/context/base/syst-gen.tex
@@ -4111,76 +4111,74 @@
%D \type {\if} and friends, in practice we will use a
%D slightly more complicated macro.
-\let\normalif \if
-\let\normalifx \ifx
-\let\normalifnum \ifnum
-\let\normalifdim \ifdim
-\let\normalifcat \ifcat
-\let\normalifcase \ifcase
-\let\normalifcsname \ifcsname
-\let\normalifhmode \ifhmode
-\let\normalifvmode \ifvmode
-\let\normalor \or
-\let\normalelse \else
-\let\normalfi \fi
+\let\normalif \if
+\let\normalifcat \ifcat
+\let\normalifnum \ifnum
+\let\normalifdim \ifdim
+\let\normalifodd \ifodd
+\let\normalifvmode \ifvmode
+\let\normalifhmode \ifhmode
+\let\normalifmmode \ifmmode
+\let\normalifinner \ifinner
+\let\normalifvoid \ifvoid
+\let\normalifhbox \ifhbox
+\let\normalifvbox \ifvbox
+\let\normalifx \ifx
+\let\normalifeof \ifeof
+\let\normaliftrue \iftrue
+\let\normaliffalse \iffalse
+\let\normalifcase \ifcase
+\let\normalifdefined \ifdefined
+\let\normalifcsname \ifcsname
+\let\normaliffontchar \iffontchar
+\let\normalifincsname \ifincsname
+\let\normalifprimitive\ifprimitive
+\let\normalifabsnum \ifabsnum
+\let\normalifabsdim \ifabsdim
+
+\let\normalelse \else
+\let\normalor \or
+\let\normalfi \fi
+
+\newtoks \everyrobusttest
+
+\everyrobusttest
+ {\let\if \relax
+ \let\ifcat \relax
+ \let\ifnum \relax
+ \let\ifdim \relax
+ \let\ifodd \relax
+ \let\ifvmode \relax
+ \let\ifhmode \relax
+ \let\ifmmode \relax
+ \let\ifinner \relax
+ \let\ifvoid \relax
+ \let\ifhbox \relax
+ \let\ifvbox \relax
+ \let\ifx \relax
+ \let\ifeof \relax
+ \let\iftrue \relax
+ \let\iffalse \relax
+ \let\ifcase \relax
+ \let\ifdefined \relax
+ \let\ifcsname \relax
+ \let\iffontchar \relax
+ \let\ifincsname \relax
+ \let\ifprimitive\relax
+ \let\ifabsnum \relax
+ \let\ifabsdim \relax
+ \let\else \relax
+ \let\or \relax
+ \let\fi \relax}
\def\beginrobusttest
{\begingroup
- \let\if \relax
- \let\ifx \relax
- \let\ifnum \relax
- \let\ifdim \relax
- \let\ifcat \relax
- \let\ifcase \relax
- \let\ifcsname\relax
- \let\or \relax
- \let\else \relax
- \let\fi \relax}
+ \the\everyrobusttest}
\let\endrobusttest\endgroup
-% \def\dogetgroupargument#1#2%
-% {\def\nextnextargument%
-% {\normalifx\nextargument\bgroup
-% \endrobusttest
-% \let\expectedarguments\noexpectedarguments
-% \def\nextargument{#1\dodogetargument}%
-% %\normalelse\normalifx\nextargument\lineending % this can be an option
-% % \def\nextargument{\begingroup\def\\ {\endgroup\dogetgroupargument#1#2}\\}%
-% %\normalelse\normalifx\nextargument\blankspace % but may never be default
-% % \def\nextargument{\begingroup\def\\ {\endgroup\dogetgroupargument#1#2}\\}%
-% \normalelse
-% \endrobusttest
-% \ifnum\expectedarguments>\noexpectedarguments
-% \showargumenterror{\number\expectedarguments}{\number\inputlineno}%
-% \fi
-% \let\expectedarguments\noexpectedarguments
-% \def\nextargument{#2\dodogetargument{}}%
-% \normalfi%\normalfi\normalfi % so let's get rid of it
-% \nextargument}%
-% \beginrobusttest
-% \futurelet\nextargument\nextnextargument}
-
-% \def\dogetgroupargument#1#2%
-% {\def\nextnextargument%
-% {\normalifx\nextargument\bgroup
-% \endrobusttest
-% \noshowargumenterror
-% \def\nextargument{#1\dodogetargument}%
-% %\normalelse\normalifx\nextargument\lineending % this can be an option
-% % \def\nextargument{\begingroup\def\\ {\endgroup\dogetgroupargument#1#2}\\}%
-% %\normalelse\normalifx\nextargument\blankspace % but may never be default
-% % \def\nextargument{\begingroup\def\\ {\endgroup\dogetgroupargument#1#2}\\}%
-% \normalelse
-% \endrobusttest
-% \doshowargumenterror
-% \def\nextargument{#2\dodogetargument{}}%
-% \normalfi%\normalfi\normalfi % so let's get rid of it
-% \nextargument}%
-% \beginrobusttest
-% \futurelet\nextargument\nextnextargument}
-
-% we need to use an \ifcase in order to honor the \normal...
+%D We can add additional definitions later when we have defined
+%D \type {\appendtoks}.
\def \permitspacesbetweengroups{\chardef\@@permitspacesbetweengroups=0 }
\def\dontpermitspacesbetweengroups{\chardef\@@permitspacesbetweengroups=1 }
diff --git a/tex/context/base/verb-ini.tex b/tex/context/base/verb-ini.tex
index 0d587ecb7..97bbf02c4 100644
--- a/tex/context/base/verb-ini.tex
+++ b/tex/context/base/verb-ini.tex
@@ -374,14 +374,41 @@
{\global\let\savedverbatimline\empty
\global\chardef\verbatimstatus\ifskipfirstverbatimline0 \else1 \fi}
-\let\donextemptyverbatimline\relax
+% \let\donextemptyverbatimline\relax
+
+% \def\presetemptyverbatimline
+% {\ifcase\verbatimstatus
+% \global\chardef\verbatimstatus\plusone
+% \or
+% \or
+% \donextemptyverbatimline
+% \or
+% \doflushverbatimline
+% \global\let\savedverbatimline\empty
+% \doemptyverbatimline
+% \global\chardef\verbatimstatus\plustwo
+% \else
+% \kern\zeropoint
+% \doverbatimnobreak
+% \doflushverbatimline
+% \global\let\savedverbatimline\empty
+% \doemptyverbatimline
+% \global\chardef\verbatimstatus\plustwo
+% \fi}
+
+\chardef\verbatimemptylinemode\zerocount
\def\presetemptyverbatimline
{\ifcase\verbatimstatus
\global\chardef\verbatimstatus\plusone
\or
+ \ifcase\verbatimemptylinemode\or\or
+ \doemptyverbatimline
+ \fi
\or
- \donextemptyverbatimline
+ \ifcase\verbatimemptylinemode\else
+ \doemptyverbatimline
+ \fi
\or
\doflushverbatimline
\global\let\savedverbatimline\empty
@@ -417,13 +444,28 @@
\fi
\global\let\savedverbatimline\verbatimline}
+% \def\presetlastverbatimline
+% {\ifcase\verbatimstatus \or \or \or
+% \doflushverbatimline
+% \else
+% \kern\zeropoint
+% \doverbatimnobreak
+% \doflushverbatimline
+% \fi}
+
\def\presetlastverbatimline
- {\ifcase\verbatimstatus \or \or \or
+ {\ifcase \verbatimstatus
+ \or
+ \or
+ \or
\doflushverbatimline
\else
- \kern\zeropoint
+ \kern \zeropoint
\doverbatimnobreak
\doflushverbatimline
+ \fi
+ \ifcase\verbatimemptylinemode\or\else
+ \kern \zeropoint
\fi}
%D \macros
@@ -830,8 +872,14 @@
{\setbox0\hbox{\the\everyline}}%
\global\linepartrue}
-\def\obeyemptylines
- {\let\donextemptyverbatimline\doemptyverbatimline}
+% \def\obeyemptylines
+% {\let\donextemptyverbatimline\doemptyverbatimline}
+
+\def\obeyemptylines % tricky, only in verbatim (should be token list)!
+ {\chardef\verbatimemptylinemode\plusone}
+
+\def\obeyallemptylines % tricky, only in verbatim (should be token list)!
+ {\chardef\verbatimemptylinemode\plustwo}
%D \TEX\ does not offer \type{\everyline}, which is a direct
%D result of its advanced multi||pass paragraph typesetting
diff --git a/tex/context/base/x-contml.tex b/tex/context/base/x-contml.tex
index 9f3fe6fd2..e1dda06c1 100644
--- a/tex/context/base/x-contml.tex
+++ b/tex/context/base/x-contml.tex
@@ -42,9 +42,18 @@
{\doifsomethingXMLop{name}
{\processaction
[\XMLop{type}]
- [xml=>\readfile{\XMLop{name}}\donothing,
+ [xml=>\readfile{\XMLop{name}}\donothing\donothing,
tex=>{{\disableXML\readfile{\XMLop{name}}\donothing\donothing}},
- txt=>{{\disableXML\typefile{\XMLop{name}}\donothing\donothing}}]}}
+ txt=>{{\disableXML\typefile{\XMLop{name}}}}]}}
+
+% or, nicer:
+%
+% \defineXMLsingular [context:include] [name=unknown,type=txt]
+% {\XMLval{include:type}{\XMLop{type}}{}}
+%
+% \mapXMLvalue {include:type} {xml} {\readfile{\XMLop{name}}\donothing\donothing}
+% \mapXMLvalue {include:type} {tex} {{\disableXML\readfile{\XMLop{name}}\donothing\donothing}}
+% \mapXMLvalue {include:type} {txt} {{\disableXML\typefile{\XMLop{name}}}}
%D \elements {compound}
%D
diff --git a/tex/context/interface/cont-cz.xml b/tex/context/interface/cont-cz.xml
index 548f59f0a..cbc1bb632 100644
--- a/tex/context/interface/cont-cz.xml
+++ b/tex/context/interface/cont-cz.xml
@@ -864,6 +864,11 @@
<cd:constant type="ne"/>
<cd:constant type="hyphenated"/>
</cd:parameter>
+ <cd:parameter name="prazdne">
+ <cd:constant type="ano"/>
+ <cd:constant type="vse"/>
+ <cd:constant type="ne"/>
+ </cd:parameter>
</cd:assignments>
</cd:arguments>
</cd:command>
@@ -6243,6 +6248,9 @@
<cd:constant type="naokraji"/>
<cd:constant type="uvod"/>
<cd:constant type="sloupce"/>
+ <cd:constant type="text"/>
+ <cd:constant type="odstavec"/>
+ <cd:constant type="opakovat"/>
</cd:keywords>
<cd:assignments optional="yes" list="yes">
<cd:inherit name="setupitemgroup"/>
diff --git a/tex/context/interface/cont-de.xml b/tex/context/interface/cont-de.xml
index 9170b8bb7..6d916958c 100644
--- a/tex/context/interface/cont-de.xml
+++ b/tex/context/interface/cont-de.xml
@@ -864,6 +864,11 @@
<cd:constant type="nein"/>
<cd:constant type="hyphenate"/>
</cd:parameter>
+ <cd:parameter name="leer">
+ <cd:constant type="ja"/>
+ <cd:constant type="alles"/>
+ <cd:constant type="nein"/>
+ </cd:parameter>
</cd:assignments>
</cd:arguments>
</cd:command>
@@ -6243,6 +6248,9 @@
<cd:constant type="imrand"/>
<cd:constant type="intro"/>
<cd:constant type="spalten"/>
+ <cd:constant type="text"/>
+ <cd:constant type="absatz"/>
+ <cd:constant type="wiederholen"/>
</cd:keywords>
<cd:assignments optional="yes" list="yes">
<cd:inherit name="setupitemgroup"/>
diff --git a/tex/context/interface/cont-en.xml b/tex/context/interface/cont-en.xml
index fe72edfe2..1e12929ec 100644
--- a/tex/context/interface/cont-en.xml
+++ b/tex/context/interface/cont-en.xml
@@ -864,6 +864,11 @@
<cd:constant type="no"/>
<cd:constant type="hyphenated"/>
</cd:parameter>
+ <cd:parameter name="empty">
+ <cd:constant type="yes"/>
+ <cd:constant type="all"/>
+ <cd:constant type="no"/>
+ </cd:parameter>
</cd:assignments>
</cd:arguments>
</cd:command>
@@ -6243,6 +6248,9 @@
<cd:constant type="inmargin"/>
<cd:constant type="intro"/>
<cd:constant type="columns"/>
+ <cd:constant type="text"/>
+ <cd:constant type="paragraph"/>
+ <cd:constant type="repeat"/>
</cd:keywords>
<cd:assignments optional="yes" list="yes">
<cd:inherit name="setupitemgroup"/>
diff --git a/tex/context/interface/cont-fr.xml b/tex/context/interface/cont-fr.xml
index c177fc403..84e9172a2 100644
--- a/tex/context/interface/cont-fr.xml
+++ b/tex/context/interface/cont-fr.xml
@@ -864,6 +864,11 @@
<cd:constant type="non"/>
<cd:constant type="hyphenated"/>
</cd:parameter>
+ <cd:parameter name="vide">
+ <cd:constant type="oui"/>
+ <cd:constant type="tout"/>
+ <cd:constant type="non"/>
+ </cd:parameter>
</cd:assignments>
</cd:arguments>
</cd:command>
@@ -6243,6 +6248,9 @@
<cd:constant type="dansmarge"/>
<cd:constant type="intro"/>
<cd:constant type="colonnes"/>
+ <cd:constant type="texte"/>
+ <cd:constant type="paragraphe"/>
+ <cd:constant type="repete"/>
</cd:keywords>
<cd:assignments optional="yes" list="yes">
<cd:inherit name="setupitemgroup"/>
diff --git a/tex/context/interface/cont-it.xml b/tex/context/interface/cont-it.xml
index 0ee663431..631277f54 100644
--- a/tex/context/interface/cont-it.xml
+++ b/tex/context/interface/cont-it.xml
@@ -864,6 +864,11 @@
<cd:constant type="no"/>
<cd:constant type="sillabato"/>
</cd:parameter>
+ <cd:parameter name="vuoto">
+ <cd:constant type="si"/>
+ <cd:constant type="tutti"/>
+ <cd:constant type="no"/>
+ </cd:parameter>
</cd:assignments>
</cd:arguments>
</cd:command>
@@ -6243,6 +6248,9 @@
<cd:constant type="inmargine"/>
<cd:constant type="intro"/>
<cd:constant type="colonne"/>
+ <cd:constant type="testo"/>
+ <cd:constant type="capoverso"/>
+ <cd:constant type="ripeti"/>
</cd:keywords>
<cd:assignments optional="yes" list="yes">
<cd:inherit name="setupitemgroup"/>
diff --git a/tex/context/interface/cont-nl.xml b/tex/context/interface/cont-nl.xml
index 97b03f596..cc7e7d77e 100644
--- a/tex/context/interface/cont-nl.xml
+++ b/tex/context/interface/cont-nl.xml
@@ -864,6 +864,11 @@
<cd:constant type="nee"/>
<cd:constant type="afgebroken"/>
</cd:parameter>
+ <cd:parameter name="leeg">
+ <cd:constant type="ja"/>
+ <cd:constant type="alles"/>
+ <cd:constant type="nee"/>
+ </cd:parameter>
</cd:assignments>
</cd:arguments>
</cd:command>
@@ -6243,6 +6248,9 @@
<cd:constant type="inmarge"/>
<cd:constant type="intro"/>
<cd:constant type="kolommen"/>
+ <cd:constant type="tekst"/>
+ <cd:constant type="alinea"/>
+ <cd:constant type="herhaal"/>
</cd:keywords>
<cd:assignments optional="yes" list="yes">
<cd:inherit name="stelitemgroepin"/>
diff --git a/tex/context/interface/cont-ro.xml b/tex/context/interface/cont-ro.xml
index 39823b0bf..c8f30aa32 100644
--- a/tex/context/interface/cont-ro.xml
+++ b/tex/context/interface/cont-ro.xml
@@ -864,6 +864,11 @@
<cd:constant type="nu"/>
<cd:constant type="despsilabe"/>
</cd:parameter>
+ <cd:parameter name="gol">
+ <cd:constant type="da"/>
+ <cd:constant type="tot"/>
+ <cd:constant type="nu"/>
+ </cd:parameter>
</cd:assignments>
</cd:arguments>
</cd:command>
@@ -6243,6 +6248,9 @@
<cd:constant type="inmargine"/>
<cd:constant type="intro"/>
<cd:constant type="coloane"/>
+ <cd:constant type="text"/>
+ <cd:constant type="paragraf"/>
+ <cd:constant type="repetat"/>
</cd:keywords>
<cd:assignments optional="yes" list="yes">
<cd:inherit name="setupitemgroup"/>
diff --git a/tex/context/interface/keys-cz.xml b/tex/context/interface/keys-cz.xml
index bf799ff95..b0910bb68 100644
--- a/tex/context/interface/keys-cz.xml
+++ b/tex/context/interface/keys-cz.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="cz" version="2006.02.03 21:03">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="cz" version="2006.02.15 17:41">
<cd:variables>
<cd:variable name="one" value="jedna"/>
diff --git a/tex/context/interface/keys-de.xml b/tex/context/interface/keys-de.xml
index 68f17ba84..e3bff4c65 100644
--- a/tex/context/interface/keys-de.xml
+++ b/tex/context/interface/keys-de.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="de" version="2006.02.03 21:03">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="de" version="2006.02.15 17:41">
<cd:variables>
<cd:variable name="one" value="eins"/>
diff --git a/tex/context/interface/keys-en.xml b/tex/context/interface/keys-en.xml
index bb4f774ef..6d953803a 100644
--- a/tex/context/interface/keys-en.xml
+++ b/tex/context/interface/keys-en.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="en" version="2006.02.03 21:03">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="en" version="2006.02.15 17:41">
<cd:variables>
<cd:variable name="one" value="one"/>
diff --git a/tex/context/interface/keys-fr.xml b/tex/context/interface/keys-fr.xml
index 252c2dcfb..7db7ff4aa 100644
--- a/tex/context/interface/keys-fr.xml
+++ b/tex/context/interface/keys-fr.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="fr" version="2006.02.03 21:03">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="fr" version="2006.02.15 17:41">
<cd:variables>
<cd:variable name="one" value="un"/>
diff --git a/tex/context/interface/keys-it.xml b/tex/context/interface/keys-it.xml
index 7ad542f75..f2ed3e237 100644
--- a/tex/context/interface/keys-it.xml
+++ b/tex/context/interface/keys-it.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="it" version="2006.02.03 21:03">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="it" version="2006.02.15 17:41">
<cd:variables>
<cd:variable name="one" value="uno"/>
diff --git a/tex/context/interface/keys-nl.xml b/tex/context/interface/keys-nl.xml
index a7ce91052..c9ef3ea26 100644
--- a/tex/context/interface/keys-nl.xml
+++ b/tex/context/interface/keys-nl.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="nl" version="2006.02.03 21:03">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="nl" version="2006.02.15 17:41">
<cd:variables>
<cd:variable name="one" value="een"/>
diff --git a/tex/context/interface/keys-ro.xml b/tex/context/interface/keys-ro.xml
index ee57d0d47..ca6535388 100644
--- a/tex/context/interface/keys-ro.xml
+++ b/tex/context/interface/keys-ro.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="ro" version="2006.02.03 21:03">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="ro" version="2006.02.15 17:41">
<cd:variables>
<cd:variable name="one" value="unu"/>