diff options
author | Marius <mariausol@gmail.com> | 2013-10-07 13:20:14 +0300 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2013-10-07 13:20:14 +0300 |
commit | 44c1fc0eda825190cd117b7b16b60398d96a4cb7 (patch) | |
tree | 44544f401027add2f8f46c5c6e3e750e17971835 /tex | |
parent | 498eb3a0485c5510695edfd678d587f07afe19c8 (diff) | |
download | context-44c1fc0eda825190cd117b7b16b60398d96a4cb7.tar.gz |
beta 2013.10.07 12:02
Diffstat (limited to 'tex')
-rw-r--r-- | tex/context/base/buff-ver.mkiv | 49 | ||||
-rw-r--r-- | tex/context/base/cldf-ini.lua | 8 | ||||
-rw-r--r-- | tex/context/base/cldf-ini.mkiv | 1 | ||||
-rw-r--r-- | tex/context/base/cont-new.mkiv | 12 | ||||
-rw-r--r-- | tex/context/base/context-version.pdf | bin | 4115 -> 4112 bytes | |||
-rw-r--r-- | tex/context/base/context.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/lang-ini.mkiv | 4 | ||||
-rw-r--r-- | tex/context/base/mlib-run.lua | 34 | ||||
-rw-r--r-- | tex/context/base/status-files.pdf | bin | 24712 -> 24695 bytes | |||
-rw-r--r-- | tex/context/base/status-lua.log | 2 | ||||
-rw-r--r-- | tex/generic/context/luatex/luatex-fonts-merged.lua | 2 |
11 files changed, 85 insertions, 29 deletions
diff --git a/tex/context/base/buff-ver.mkiv b/tex/context/base/buff-ver.mkiv index 8d5fc3220..dcea15496 100644 --- a/tex/context/base/buff-ver.mkiv +++ b/tex/context/base/buff-ver.mkiv @@ -45,8 +45,10 @@ \unexpanded\def\specialcontrolspace{\hskip\zeropoint\fastcontrolspace\hskip\zeropoint} -\setvalue{\??typinglines\v!yes }{\obeybreakpoints} -\setvalue{\??typinglines\v!hyphenated}{\obeyhyphens} +\setvalue{\??typinglines\v!no }{\buff_verbatim_ignore_hyphens} +\setvalue{\??typinglines\v!normal }{\buff_verbatim_ignore_hyphens} +\setvalue{\??typinglines\v!yes }{\buff_verbatim_obey_breakpoints} +\setvalue{\??typinglines\v!hyphenated}{\buff_verbatim_obey_hyphens} \setvalue{\??typingspace\v!on }{\let\obeyedspace\specialcontrolspace} \setvalue{\??typingspace\v!stretch }{\let\obeyedspace\specialstretchedspace} @@ -61,15 +63,36 @@ \setvalue{\??typingblank\v!line }{\baselineskip} \setvalue{\??typingblank\v!none }{\zeropoint} +\unexpanded\def\buff_verbatim_obey_hyphens + {} + +\unexpanded\def\buff_verbatim_obey_breakpoints + {\language\minusone % tricky as this affects the pagebuilder + \veryraggedright} + +\unexpanded\def\buff_verbatim_ignore_hyphens + {\language\minusone} % tricky as this affects the pagebuilder + +\def\buff_verbatim_initialize_breaks % order matters + {\spaceskip.5\emwidth\relax + \let\obeyedspace\specialobeyedspace + \let\controlspace\specialcontrolspace + \edef\p_buff_lines{\typeparameter\c!lines}% + \ifcsname\??typinglines\p_buff_lines\endcsname % sets \obeyedspace, \controlspace, + \csname\??typinglines\p_buff_lines\endcsname + \fi + \edef\p_buff_space{\typeparameter\c!space}% + \ifcsname\??typingspace\p_buff_space\endcsname % sets \obeyedspace + \csname\??typingspace\p_buff_space\endcsname + \fi} + \def\buff_verbatim_initialize_type_one {\let\obeylines\ignorelines - \ignorehyphens % default \usetypestyleandcolor\c!style\c!color \setcatcodetable\vrbcatcodes} \def\buff_verbatim_initialize_type_two - {\let\obeyedspace\specialobeyedspace - \csname\??typingspace\typeparameter\c!space\endcsname + {\buff_verbatim_initialize_breaks \relax\the\everyinitializeverbatim\relax} \unexpanded\def\doinitializeverbatim % for use elsewhere .. temp hack (see lxml-ini) @@ -98,13 +121,10 @@ {\switchtobodyfont[\typingparameter\c!bodyfont]% can be low level call \buff_verbatim_check_margins \usetypingstyleandcolor\c!style\c!color - \doifsomething{\typingparameter\c!align}{\setupalign[\typingparameter\c!align]}% - \ignorehyphens} % default + \doifsomething{\typingparameter\c!align}{\setupalign[\typingparameter\c!align]}} \def\buff_verbatim_initialize_typing_two - {\let\obeyedspace\specialobeyedspace - \csname\??typingspace\typingparameter\c!space\endcsname - \csname\??typinglines\typingparameter\c!lines\endcsname + {\buff_verbatim_initialize_breaks \relax\the\everyinitializeverbatim\relax} %D \macros @@ -255,7 +275,7 @@ {\dontleavehmode \bgroup \edef\currenttype{#1}% - \lettypeparameter\v!lines\v!hyphenated + \lettypeparameter\c!lines\v!hyphenated \let\specialobeyedspace\specialstretchedspace \doifnextoptionalelse\buff_verbatim_type_yes\buff_verbatim_type_nop} @@ -335,7 +355,7 @@ \unexpanded\def\specialfixedspace {\kern\interwordspace\relax} \unexpanded\def\specialobeyedspace {\hskip\interwordspace\relax} % better than spaceskip -\unexpanded\def\specialstretchedspace{\hskip.5\interwordspace\s!plus.125\interwordstretch\relax} % more but not less +\unexpanded\def\specialstretchedspace{\hskip.5\interwordspace\s!plus.125\interwordspace\relax} % \interwordstretch can be zero \unexpanded\def\specialcontrolspace {\hskip\zeropoint\hbox{\normalcontrolspace}\hskip\zeropoint\relax} \unexpanded\def\obeyhyphens @@ -351,7 +371,7 @@ {\language\minusone % extra bonus, the \null should do the job too \let\obeyedspace \specialobeyedspace \let\controlspace\specialcontrolspace - \spaceskip.5em\relax} + \spaceskip.5\emwidth\relax} %D \macros %D {tex,arg,mat,dis,astype} @@ -643,6 +663,7 @@ %\c!bodyfont=, %\c!color=, \c!space=\v!off, + \c!lines=\v!no, \c!page=\v!no, \c!tab=\v!yes, % what is this: \s!ascii ? \c!option=\v!none, @@ -655,7 +676,6 @@ \c!blank=\v!line, %\c!escape=, % yes | no | {START,STOP} | default when yes: {BTEX,ETEX} \c!numbering=\v!no, - %\c!lines=, %\c!range=, \c!start=1, %\c!stop=, @@ -672,6 +692,7 @@ \setuptype [\c!space=\v!off, + \c!lines=\v!no, %\c!color=, \c!style=\tt, %\c!option=\v!normal, diff --git a/tex/context/base/cldf-ini.lua b/tex/context/base/cldf-ini.lua index d9bb9bd31..0b89053a2 100644 --- a/tex/context/base/cldf-ini.lua +++ b/tex/context/base/cldf-ini.lua @@ -28,12 +28,14 @@ local tex = tex context = context or { } local context = context -local format, gsub, validstring = string.format, string.gsub, string.valid +local format, gsub, validstring, stripstring = string.format, string.gsub, string.valid, string.strip local next, type, tostring, tonumber, setmetatable, unpack, select = next, type, tostring, tonumber, setmetatable, unpack, select local insert, remove, concat = table.insert, table.remove, table.concat local lpegmatch, lpegC, lpegS, lpegP, lpegCc, patterns = lpeg.match, lpeg.C, lpeg.S, lpeg.P, lpeg.Cc, lpeg.patterns local formatters = string.formatters -- using formatteds is slower in this case +local loaddata = io.loaddata + local texsprint = tex.sprint local textprint = tex.tprint local texprint = tex.print @@ -799,6 +801,10 @@ function context.runfile(filename) end end +function context.loadfile(filename) + context(stripstring(loaddata(resolvers.findfile(filename)))) +end + -- some functions function context.direct(first,...) diff --git a/tex/context/base/cldf-ini.mkiv b/tex/context/base/cldf-ini.mkiv index 77948e058..258409d7a 100644 --- a/tex/context/base/cldf-ini.mkiv +++ b/tex/context/base/cldf-ini.mkiv @@ -37,6 +37,7 @@ \def\cldn#1{\directlua{_cldn_(#1)}} % global (nodes) \normalprotected\def\cldprocessfile#1{\directlua{context.runfile("#1")}} + \def\cldloadfile #1{\directlua{context.loadfile("#1")}} \def\cldcontext #1{\directlua{context(#1)}} \def\cldcommand #1{\directlua{context.#1}} % \def\cldverbatim #1{\directlua{context.verbatim.#1}} % maybe make verbatim global diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 7cc4fa14d..5c1d3dfab 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2013.10.07 09:47} +\newcontextversion{2013.10.07 12:02} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. @@ -27,16 +27,6 @@ \unexpanded\def\tightvbox{\dowithnextbox{\dp\nextbox\zeropoint\box\nextbox}\vbox} \unexpanded\def\tightvtop{\dowithnextbox{\ht\nextbox\zeropoint\box\nextbox}\vtop} -%D Maybe: - -% \startluacode -% function context.loadfile(filename) -% context(string.strip(io.loaddata(resolvers.findfile(filename)))) -% end -% \stopluacode -% -% \edef\tufte{\cldcommand{loadfile("tufte.tex")}} - %D Needs some work: \unexpanded\def\startgridcorrection diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf Binary files differindex 21d1f6a85..300e54312 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 7d9c9f602..6bf94d34b 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -25,7 +25,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2013.10.07 09:47} +\edef\contextversion{2013.10.07 12:02} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/lang-ini.mkiv b/tex/context/base/lang-ini.mkiv index 1297fe23e..a6ba21f39 100644 --- a/tex/context/base/lang-ini.mkiv +++ b/tex/context/base/lang-ini.mkiv @@ -492,6 +492,10 @@ \fi \mainlanguagenumber\normallanguage} +\appendtoks + \normallanguage\mainlanguagenumber +\to \everybeforepagebody + %D New (see nomarking and nolist): \def\splitsequence#1#2% diff --git a/tex/context/base/mlib-run.lua b/tex/context/base/mlib-run.lua index 1fc36dd80..e2585998e 100644 --- a/tex/context/base/mlib-run.lua +++ b/tex/context/base/mlib-run.lua @@ -589,3 +589,37 @@ function metapost.directrun(formatname,filename,outputformat,astable,mpdata) end end end + +-- goodie + +function metapost.quickanddirty(mpxformat,data) + if not data then + mpxformat = "metafun" + data = mpxformat + end + local code, bbox + local flusher = { + startfigure = function(n,llx,lly,urx,ury) + code = { } + bbox = { llx, lly, urx, ury } + end, + flushfigure = function(t) + for i=1,#t do + code[#code+1] = t[i] + end + end, + stopfigure = function() + end + } + local data = format("; beginfig(1) ;\n %s\n ; endfig ;",data) + metapost.process(mpxformat, { data }, false, flusher, false, false, "all") + if code then + return { + bbox = bbox or { 0, 0, 0, 0 }, + code = code, + data = data, + } + else + report_metapost("invalid quick and dirty run") + end +end diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf Binary files differindex aff94fb26..054703a76 100644 --- a/tex/context/base/status-files.pdf +++ b/tex/context/base/status-files.pdf diff --git a/tex/context/base/status-lua.log b/tex/context/base/status-lua.log index 47c4cb270..c65fcd67e 100644 --- a/tex/context/base/status-lua.log +++ b/tex/context/base/status-lua.log @@ -1,6 +1,6 @@ (cont-yes.mkiv -ConTeXt ver: 2013.10.07 09:47 MKIV beta fmt: 2013.10.7 int: english/english +ConTeXt ver: 2013.10.07 12:02 MKIV beta fmt: 2013.10.7 int: english/english system > 'cont-new.mkiv' loaded (cont-new.mkiv) diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index ccc52b8c0..103249c29 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 10/07/13 09:47:33 +-- merge date : 10/07/13 12:02:11 do -- begin closure to overcome local limits and interference |