From dd7b0113318332d153bf0b8cddbdfef4e1e9f90f Mon Sep 17 00:00:00 2001 From: Context Git Mirror Bot Date: Fri, 30 Jan 2015 16:15:05 +0100 Subject: 2015-01-30 15:30:00 --- tex/context/base/attr-ini.lua | 2 +- tex/context/base/bibl-bib.mkiv | 2 +- tex/context/base/catc-ini.mkiv | 6 +- tex/context/base/catc-sym.mkiv | 8 +- tex/context/base/cont-log.mkiv | 12 +- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4386 -> 4383 bytes tex/context/base/context.mkiv | 2 +- tex/context/base/font-inj.lua | 3 + tex/context/base/grph-inc.lua | 4 +- tex/context/base/lang-mis.mkiv | 229 +++++++++------------ tex/context/base/luat-ini.mkiv | 2 +- tex/context/base/m-oldnum.mkiv | 26 +-- tex/context/base/meta-tex.mkiv | 4 +- tex/context/base/mult-prm.lua | 1 + tex/context/base/node-aux.lua | 3 +- tex/context/base/page-set.mkiv | 4 +- tex/context/base/publ-aut.lua | 82 +++++--- tex/context/base/publ-dat.lua | 28 ++- tex/context/base/publ-ini.lua | 2 + tex/context/base/publ-tra.lua | 103 ++++++++- tex/context/base/publ-tra.mkiv | 6 +- tex/context/base/s-fonts-ligatures.mkiv | 28 +-- tex/context/base/s-inf-01.mkvi | 12 +- tex/context/base/s-typesetting-kerning.mkiv | 61 +++--- tex/context/base/spac-chr.lua | 2 +- tex/context/base/status-files.pdf | Bin 24954 -> 24616 bytes tex/context/base/status-lua.pdf | Bin 333217 -> 333293 bytes tex/context/base/strc-tag.mkiv | 50 ++--- tex/context/base/supp-box.mkiv | 4 +- tex/context/base/syst-ini.mkiv | 10 +- tex/context/base/tabl-ntb.mkiv | 101 ++++++--- tex/context/base/type-run.mkiv | 2 +- tex/generic/context/luatex/luatex-fonts-inj.lua | 3 + tex/generic/context/luatex/luatex-fonts-merged.lua | 5 +- 35 files changed, 494 insertions(+), 315 deletions(-) (limited to 'tex') diff --git a/tex/context/base/attr-ini.lua b/tex/context/base/attr-ini.lua index aaa599d58..177eb30eb 100644 --- a/tex/context/base/attr-ini.lua +++ b/tex/context/base/attr-ini.lua @@ -58,7 +58,7 @@ ranges of numbers for them. Of course a the end a private attri accessible too, so a private attribute can have a public appearance.

--ldx]]-- -sharedstorage.attributes_last_private = sharedstorage.attributes_last_private or 127 -- very private +sharedstorage.attributes_last_private = sharedstorage.attributes_last_private or 127 -- very private (can become 15) sharedstorage.attributes_last_public = sharedstorage.attributes_last_public or 1024 -- less private function attributes.private(name) -- at the lua end (hidden from user) diff --git a/tex/context/base/bibl-bib.mkiv b/tex/context/base/bibl-bib.mkiv index 9af409158..0a410987f 100644 --- a/tex/context/base/bibl-bib.mkiv +++ b/tex/context/base/bibl-bib.mkiv @@ -320,7 +320,7 @@ % [\c!sorttype=\v!cite, % \c!sort=no] -% \long\unexpanded\def\startpublication#1\stoppublication +% \unexpanded\def\startpublication#1\stoppublication % {\blank % todo % \blank} diff --git a/tex/context/base/catc-ini.mkiv b/tex/context/base/catc-ini.mkiv index 581fbfec3..26cef30de 100644 --- a/tex/context/base/catc-ini.mkiv +++ b/tex/context/base/catc-ini.mkiv @@ -120,7 +120,7 @@ \catcode\commentasciicode \othercatcode \catcode\delasciicode \othercatcode} -\long\normalprotected\def\startcatcodetable#1#2\stopcatcodetable +\normalprotected\def\startcatcodetable#1#2\stopcatcodetable {\begingroup \catcodetable\inicatcodes \the\everysetdefaultcatcodes @@ -130,7 +130,7 @@ \let\stopcatcodetable\relax -\long\normalprotected\def\startextendcatcodetable#1#2\stopextendcatcodetable +\normalprotected\def\startextendcatcodetable#1#2\stopextendcatcodetable {\begingroup \catcodetable#1\relax \globaldefs\plusone @@ -147,7 +147,7 @@ % == % -% \long\normalprotected\def\startextendcatcodetable#1#2\stopextendcatcodetable +% \normalprotected\def\startextendcatcodetable#1#2\stopextendcatcodetable % {\bgroup % \scratchcounter\the\catcodetable % \catcodetable #1 #2 diff --git a/tex/context/base/catc-sym.mkiv b/tex/context/base/catc-sym.mkiv index 425a5393c..71e02f31d 100644 --- a/tex/context/base/catc-sym.mkiv +++ b/tex/context/base/catc-sym.mkiv @@ -177,12 +177,12 @@ %D %D \getbuffer[c] -\long\def\rescan#1{\scantokens{#1\ignorespaces}} -\long\def\rescanwithsetup#1#2{\begingroup\directsetup{#1}\scantokens{#2\ignorespaces}\endgroup} +\def\rescan #1{\scantokens{#1\ignorespaces}} +\def\rescanwithsetup#1#2{\begingroup\directsetup{#1}\scantokens{#2\ignorespaces}\endgroup} \ifx\scantextokens\undefined \else - \long\def\rescan#1{\scantextokens{#1}} - \long\def\rescanwithsetup#1#2{\begingroup\directsetup{#1}\scantextokens{#2}\endgroup} + \def\rescan #1{\scantextokens{#1}} + \def\rescanwithsetup#1#2{\begingroup\directsetup{#1}\scantextokens{#2}\endgroup} \fi \endinput diff --git a/tex/context/base/cont-log.mkiv b/tex/context/base/cont-log.mkiv index cb3b6a58e..9e148690a 100644 --- a/tex/context/base/cont-log.mkiv +++ b/tex/context/base/cont-log.mkiv @@ -103,15 +103,15 @@ \let\logofont\nullfont -\loadmapfile[original-base.map] % stil needed? +\loadmapfile[original-base.map] % stil needed? not if we assume afm \unexpanded\def\setMFPfont% more sensitive for low level changes {\font\logofont=logo% - \ifx\fontalternative\s!bf\else - \ifx\fontalternative\s!it\else - \ifx\fontalternative\s!sl\else - \ifx\fontalternative\s!bi\else - \ifx\fontalternative\s!bs\else + \ifx\fontalternative\s!bf\s!bf\else + \ifx\fontalternative\s!it\s!sl\else + \ifx\fontalternative\s!sl\s!sl\else + \ifx\fontalternative\s!bi\s!bf\else + \ifx\fontalternative\s!bs\s!bf\else \fi\fi\fi\fi\fi 10 at \currentfontscale\bodyfontsize % there is no afm in the minimals yet \logofont} diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 56e5e989d..1d8a82cc7 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{2015.01.26 11:39} +\newcontextversion{2015.01.30 15:28} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf index 0a67b7040..8994c342a 100644 Binary files a/tex/context/base/context-version.pdf and b/tex/context/base/context-version.pdf differ diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 867768c0b..56bb004b4 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -28,7 +28,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2015.01.26 11:39} +\edef\contextversion{2015.01.30 15:28} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/font-inj.lua b/tex/context/base/font-inj.lua index d0b073db4..87330a393 100644 --- a/tex/context/base/font-inj.lua +++ b/tex/context/base/font-inj.lua @@ -479,6 +479,9 @@ local function inject_marks(marks,nofmarks) local px = getfield(p,"xoffset") local ox = 0 local pp = rawget(properties,p) + if pp then + pp = pp.injections + end local rightkern = pp and pp.rightkern if rightkern then -- x and w ~= 0 if pn.markdir < 0 then diff --git a/tex/context/base/grph-inc.lua b/tex/context/base/grph-inc.lua index 0d76d306f..56581ddf3 100644 --- a/tex/context/base/grph-inc.lua +++ b/tex/context/base/grph-inc.lua @@ -1431,8 +1431,10 @@ local function runprogram(binary,argument,variables) local found = nil if type(binary) == "table" then for i=1,#binary do - found = os.which(binary[i]) + local b = binary[i] + found = os.which(b) if found then + binary = b break end end diff --git a/tex/context/base/lang-mis.mkiv b/tex/context/base/lang-mis.mkiv index 0c4bc3ac4..2b886b3ce 100644 --- a/tex/context/base/lang-mis.mkiv +++ b/tex/context/base/lang-mis.mkiv @@ -20,35 +20,28 @@ \unprotect -%D One of \TEX's strong points in building paragraphs is the way -%D hyphenations are handled. Although for real good hyphenation -%D of non||english languages some extensions to the program are -%D needed, fairly good results can be reached with the standard -%D mechanisms and an additional macro, at least in Dutch. - -%D \CONTEXT\ originates in the wish to typeset educational -%D materials, especially in a technical environment. In -%D production oriented environments, a lot of compound words -%D are used. Because the Dutch language poses no limits on -%D combining words, we often favor putting dashes between those -%D words, because it facilitates reading, at least for those -%D who are not that accustomed to it. -%D -%D In \TEX\ compound words, separated by a hyphen, are not -%D hyphenated at all. In spite of the multiple pass paragraph -%D typesetting this can lead to parts of words sticking into -%D the margin. The solution lays in saying \type -%D {spoelwater||terugwinunit} instead of \type -%D {spoelwater-terugwinunit}. By using a one character command -%D like \type {|}, delimited by the same character \type {|}, -%D we get ourselves both a decent visualization (in \TEXEDIT\ -%D and colored verbatim we color these commands yellow) and an -%D efficient way of combining words. -%D -%D The sequence \type{||} simply leads to two words connected by -%D a hyphen. Because we want to distinguish such a hyphen from -%D the one inserted when \TEX\ hyphenates a word, we use a bit -%D longer one. +%D One of \TEX's strong points in building paragraphs is the way hyphenations are +%D handled. Although for real good hyphenation of non||english languages some +%D extensions to the program are needed, fairly good results can be reached with the +%D standard mechanisms and an additional macro, at least in Dutch. +%D +%D \CONTEXT\ originates in the wish to typeset educational materials, especially in +%D a technical environment. In production oriented environments, a lot of compound +%D words are used. Because the Dutch language poses no limits on combining words, we +%D often favor putting dashes between those words, because it facilitates reading, +%D at least for those who are not that accustomed to it. +%D +%D In \TEX\ compound words, separated by a hyphen, are not hyphenated at all. In +%D spite of the multiple pass paragraph typesetting this can lead to parts of words +%D sticking into the margin. The solution lays in saying \type +%D {spoelwater||terugwinunit} instead of \type {spoelwater-terugwinunit}. By using a +%D one character command like \type {|}, delimited by the same character \type {|}, +%D we get ourselves both a decent visualization (in \TEXEDIT\ and colored verbatim +%D we color these commands yellow) and an efficient way of combining words. +%D +%D The sequence \type{||} simply leads to two words connected by a hyphen. Because +%D we want to distinguish such a hyphen from the one inserted when \TEX\ hyphenates +%D a word, we use a bit longer one. %D %D \hyphenation {spoel-wa-ter te-rug-win-unit} %D @@ -56,9 +49,8 @@ %D \test {spoelwater||terugwinunit} %D \stoptest %D -%D As we already said, the \type{|} is a command. This commands -%D accepts an optional argument before it's delimiter, which is -%D also a \type{|}. +%D As we already said, the \type{|} is a command. This commands accepts an optional +%D argument before it's delimiter, which is also a \type{|}. %D %D \hyphenation {po-ly-meer che-mie} %D @@ -66,8 +58,8 @@ %D \test {polymeer|*|chemie} %D \stoptest %D -%D Arguments like \type{*} are not interpreted and inserted -%D directly, in contrary to arguments like: +%D Arguments like \type{*} are not interpreted and inserted directly, in contrary to +%D arguments like: %D %D \starttest %D \test {polymeer|~|chemie} @@ -75,22 +67,21 @@ %D \test {polymeer|(|chemie|)| } %D \stoptest %D -%D Although such situations seldom occur |<|we typeset thousands -%D of pages before we encountered one that forced us to enhance -%D this mechanism|>| we also have to take care of comma's. +%D Although such situations seldom occur |<|we typeset thousands of pages before we +%D encountered one that forced us to enhance this mechanism|>| we also have to take +%D care of comma's. %D -%D \hyphenation {uit-stel-len} +%D \hyphenation {uit-stel-len} %D -%D \starttest -%D \test {op||, in|| en uitstellen} -%D \stoptest +%D \starttest +%D \test {op||, in|| en uitstellen} +%D \stoptest %D -%D The next special case (concerning quotes) was brought to my -%D attention by Piet Tutelaers, one of the driving forces -%D behind rebuilding hyphenation patterns for the dutch -%D language.\footnote{In 1996 the spelling of the dutch -%D language has been slightly reformed which made this topic -%D actual again.} We'll also take care of this case. +%D The next special case (concerning quotes) was brought to my attention by Piet +%D Tutelaers, one of the driving forces behind rebuilding hyphenation patterns for +%D the dutch language.\footnote{In 1996 the spelling of the dutch language has been +%D slightly reformed which made this topic actual again.} We'll also take care of +%D this case. %D %D \starttest %D \test {AOW|'|er} @@ -99,8 +90,7 @@ %D \test {rock|-|'n|-|roller} %D \stoptest %D -%D Tobias Burnus pointed out that I should also support -%D something like +%D Tobias Burnus pointed out that I should also support something like %D %D \starttest %D \test {well|_|known} @@ -117,11 +107,10 @@ %D \macros %D {installdiscretionaries} %D -%D The mechanism described here is one of the older inner parts -%D of \CONTEXT. The most recent extensions concerns some -%D special cases as well as the possibility to install other -%D characters as delimiters. The prefered way of specifying -%D compound words is using \type{||}, which is installed by: +%D The mechanism described here is one of the older inner parts of \CONTEXT. The +%D most recent extensions concerns some special cases as well as the possibility to +%D install other characters as delimiters. The prefered way of specifying compound +%D words is using \type{||}, which is installed by: %D %D \starttyping %D \installdiscretionary | - @@ -153,20 +142,18 @@ %D {compoundhyphen, %D beginofsubsentence,endofsubsentence} %D -%D Now let's go to the macros. First we define some variables. -%D In the main \CONTEXT\ modules these can be tuned by a setup -%D command. Watch the (maybe) better looking compound hyphen. +%D Now let's go to the macros. First we define some variables. In the main \CONTEXT\ +%D modules these can be tuned by a setup command. Watch the (maybe) better looking +%D compound hyphen. \ifx\compoundhyphen \undefined \unexpanded\def\compoundhyphen {\hbox{-\kern-.25ex-}} \fi \ifx\beginofsubsentence\undefined \unexpanded\def\beginofsubsentence{\hbox{\emdash}} \fi \ifx\endofsubsentence \undefined \unexpanded\def\endofsubsentence {\hbox{\emdash}} \fi -%D The last two variables are needed for subsentences -%D |<|like this one|>| which we did not yet mention. -%D -%D We want to enable breaking but at the same time don't want -%D compound characters like |-| or || to be separated from the -%D words. \TEX\ hackers will recognise the next two macro's: +%D The last two variables are needed for subsentences |<|like this one|>| which we +%D did not yet mention. We want to enable breaking but at the same time don't want +%D compound characters like |-| or || to be separated from the words. \TEX\ hackers +%D will recognise the next two macro's: \ifx\prewordbreak \undefined \unexpanded\def\prewordbreak {\penalty\plustenthousand\hskip\zeropoint\relax} \fi \ifx\postwordbreak\undefined \unexpanded\def\postwordbreak {\penalty\zerocount \hskip\zeropoint\relax} \fi @@ -177,19 +164,17 @@ %D \macros %D {beginofsubsentencespacing,endofsubsentencespacing} %D -%D In the previous macros we provided two hooks which can be -%D used to support nested sub||sentences. In \CONTEXT\ these -%D hooks are used to insert a small space when needed. +%D In the previous macros we provided two hooks which can be used to support nested +%D sub||sentences. In \CONTEXT\ these hooks are used to insert a small space when +%D needed. \ifx\beginofsubsentencespacing\undefined \let\beginofsubsentencespacing\relax \fi \ifx\endofsubsentencespacing \undefined \let\endofsubsentencespacing \relax \fi -%D The following piece of code is a torture test compound -%D hndling. The \type {\relax} before the \type {\ifmmode} is -%D needed because of the alignment scanner (in \ETEX\ this -%D problem is not present because there a protected macro is -%D not expanded. Thanks to Tobias Burnus for providing this -%D example. +%D The following piece of code is a torture test compound handling. The \type +%D {\relax} before the \type {\ifmmode} is needed because of the alignment scanner +%D (in \ETEX\ this problem is not present because there a protected macro is not +%D expanded. Thanks to Tobias Burnus for providing this example. %D %D \startformula %D \left|f(x_n)-{1\over2}\right| = @@ -234,10 +219,9 @@ \def\lang_discretionaries_process_none#1% {\detokenize{#1}} -%D The macro \type{\lang_discretionaries_check_before} takes care -%D of loners like \type{||word}, while it counterpart \type -%D {\lang_discretionaries_check_after} is responsible for handling -%D the comma. +%D The macro \type{\lang_discretionaries_check_before} takes care of loners like +%D \type{||word}, while it counterpart \type {\lang_discretionaries_check_after} is +%D responsible for handling the comma. \newsignal\compoundbreakpoint @@ -327,8 +311,8 @@ %D \macros %D {directdiscretionary} %D -%D In those situations where the nature of characters is -%D less predictable, we can use the more direct approach: +%D In those situations where the nature of characters is less predictable, we can +%D use the more direct approach: \unexpanded\def\directdiscretionary {\csname @@ -450,10 +434,9 @@ %D \macros %D {fakecompoundhyphen} %D -%D In headers and footers as well as in active pieces of text -%D we need a dirty hack. Try to imagine what is needed to -%D savely break the next text across a line and at the same -%D time make the words interactive. +%D In headers and footers as well as in active pieces of text we need a dirty hack. +%D Try to imagine what is needed to savely break the next text across a line and at +%D the same time make the words interactive. %D %D \starttyping %D \goto{Some||Long||Word} @@ -471,10 +454,9 @@ %D {midworddiscretionary} %D %D If needed, one can add a discretionary hyphen using \type -%D {\midworddiscretionary}. This macro does the same as -%D \PLAIN\ \TEX's \type {\-}, but, like the ones implemented -%D earlier, this one also looks ahead for spaces and grouping -%D tokens. +%D {\midworddiscretionary}. This macro does the same as \PLAIN\ \TEX's \type {\-}, +%D but, like the ones implemented earlier, this one also looks ahead for spaces and +%D grouping tokens. \unexpanded\def\midworddiscretionary {\futurelet\nexttoken\lang_discretionaries_mid_word} @@ -489,15 +471,13 @@ %D \macros %D {installcompoundcharacter} %D -%D When Tobias Burnus started translating the dutch manual of -%D \PPCHTEX\ into german, he suggested to let \CONTEXT\ support -%D the \type{german.sty} method of handling compound -%D characters, especially the umlaut. This package is meant for -%D use with \PLAIN\ \TEX\ as well as \LATEX. +%D When Tobias Burnus started translating the dutch manual of \PPCHTEX\ into german, +%D he suggested to let \CONTEXT\ support the \type{german.sty} method of handling +%D compound characters, especially the umlaut. This package is meant for use with +%D \PLAIN\ \TEX\ as well as \LATEX. %D -%D I decided to implement compound character support as -%D versatile as possible. As a result one can define his own -%D compound character support, like: +%D I decided to implement compound character support as versatile as possible. As a +%D result one can define his own compound character support, like: %D %D \starttyping %D \installcompoundcharacter "a {\"a} @@ -515,25 +495,24 @@ %D \installcompoundcharacter "ff {\discretionary{ff-}{f}{ff}} %D \stoptyping %D -%D The support is not limited to alphabetic characters, so the -%D next definition is also valid. +%D The support is not limited to alphabetic characters, so the next definition is +%D also valid. %D %D \starttyping %D \installcompoundcharacter ". {.\doifnextcharelse{\spacetoken}{}{\kern.125em}} %D \stoptyping %D -%D The implementation looks familiar and uses the same tricks as -%D mentioned earlier in this module. We take care of two -%D arguments, which complicates things a bit. +%D The implementation looks familiar and uses the same tricks as mentioned earlier +%D in this module. We take care of two arguments, which complicates things a bit. \installcorenamespace{compoundnormal} \installcorenamespace{compoundsingle} \installcorenamespace{compoundmultiple} \installcorenamespace{compounddefinition} -%D When we started working on MK IV code, we needed a different -%D approach for defining the active character itself. In MK II as -%D well as in MK IV we now use the catcode vectors. +%D When I started working on \MKIV\ code, we needed a different approach for +%D defining the active character itself. In \MKII\ as well as in \MKIV\ we now use +%D the catcode vectors. \setnewconstant\compoundcharactermode\plusone @@ -551,22 +530,19 @@ \expandafter\letcatcodecommand\expandafter\ctxcatcodes\expandafter\c_lang_compounds_character\csname\??compounddefinition\detokenize{#1}\endcsname \fi} -%D We can also ignore definitions (needed in for instance \XML). Beware, -%D this macro is supposed to be used grouped! +%D We can also ignore definitions (needed in for instance \XML). Beware, this macro +%D is supposed to be used grouped! \def\ignorecompoundcharacter {\compoundcharactermode\zerocount} -%D In handling the compound characters we have to take care of -%D \type{\bgroup} and \type{\egroup} tokens, so we end up with -%D a multi||step interpretation macro. We look ahead for a -%D \type{\bgroup}, \type{\egroup} or \type{\blankspace}. Being -%D no user of this mechanism, the credits for testing them goes -%D to Tobias Burnus, the first german user of \CONTEXT. +%D In handling the compound characters we have to take care of \type {\bgroup} and +%D \type {\egroup} tokens, so we end up with a multi||step interpretation macro. We +%D look ahead for a \type {\bgroup}, \type {\egroup} or \type {\blankspace}. Being +%D no user of this mechanism, the credits for testing them goes to Tobias Burnus, +%D the first german user of \CONTEXT. %D -%D We define these macros as \type{\long} because we can -%D expect \type{\par} tokens. We need to look into the future -%D with \type{\futurelet} to prevent spaces from +%D We need to look into the future with \type{\futurelet} to prevent spaces from %D disappearing. \def\lang_compounds_handle_character#1% @@ -604,12 +580,11 @@ \tripleexpandafter\lang_compounds_handle_character_two \fi\fi\fi} -%D Besides taken care of the grouping and space tokens, we have -%D to deal with three situations. First we look if the next -%D character equals the first one, if so, then we just insert -%D the original. Next we look if indeed a compound character is -%D defined. We either execute the compound character or just -%D insert the first. So we have +%D Besides taken care of the grouping and space tokens, we have to deal with three +%D situations. First we look if the next character equals the first one, if so, then +%D we just insert the original. Next we look if indeed a compound character is +%D defined. We either execute the compound character or just insert the first. So we +%D have %D %D \starttyping %D @@ -639,8 +614,8 @@ \fi\fi\fi \next} -%D For very obscure applications (see for an application \type -%D {lang-sla.tex}) we provide: +%D For very obscure applications (see for an application \type {lang-sla.tex}) we +%D provide: \def\simplifiedcompoundcharacter#1#2% {\ifcsname\??compoundsingle\string#1\string#2\endcsname @@ -652,8 +627,8 @@ %D \macros %D {disablediscretionaries,disablecompoundcharacter} %D -%D Occasionally we need to disable this mechanism. For the -%D moment we assume that \type {|} is used. +%D Occasionally we need to disable this mechanism. For the moment we assume that +%D \type {|} is used. \let\disablediscretionaries \ignorediscretionaries \let\disablecompoundcharacters\ignorecompoundcharacter @@ -668,9 +643,8 @@ %D \macros %D {compound} %D -%D We will overload the already active \type {|} so we have -%D to save its meaning in order to be able to use this handy -%D macro. +%D We will overload the already active \type {|} so we have to save its meaning in +%D order to be able to use this handy macro. %D %D \starttyping %D so test\compound{}test can be used instead of test||test @@ -688,8 +662,7 @@ \egroup -%D Here we hook some code into the clean up mechanism needed -%D for verbatim data. +%D Here we hook some code into the clean up mechanism needed for verbatim data. \appendtoks \disablecompoundcharacters diff --git a/tex/context/base/luat-ini.mkiv b/tex/context/base/luat-ini.mkiv index 7823ebd5a..e47e8f74b 100644 --- a/tex/context/base/luat-ini.mkiv +++ b/tex/context/base/luat-ini.mkiv @@ -196,7 +196,7 @@ %D for it: %D %D \starttyping -%D \long\edef\luaescapestring#1{\!!bs#1\!!es} +%D \edef\luaescapestring#1{\!!bs#1\!!es} %D \stoptyping \def\setdocumentfilename #1#2{\ctxlua{document.setfilename(#1,"#2")}} diff --git a/tex/context/base/m-oldnum.mkiv b/tex/context/base/m-oldnum.mkiv index efc0af472..55ee59027 100644 --- a/tex/context/base/m-oldnum.mkiv +++ b/tex/context/base/m-oldnum.mkiv @@ -73,8 +73,8 @@ \chardef\digitoutputmode=1 % 0..6 \chardef\digitsignmode =0 % 0..3 -\def\setdigitmode{\chardef\digitoutputmode} -\def\setdigitsign{\chardef\digitsignmode} +\unexpanded\def\setdigitmode{\chardef\digitoutputmode} +\unexpanded\def\setdigitsign{\chardef\digitsignmode} %D The digit modes are: %D @@ -118,7 +118,7 @@ \ifx\normalmathshift\undefined \let\normalmathshift=$ \fi -\def\scandigit +\unexpanded\def\scandigit {\ifx\next\blankspace \let\next\handledigits \else\ifx\next\nextobeyedline % the indirect one @@ -139,10 +139,10 @@ %D typeset it in superscript. The space placeholders are %D replaced by a \type {@}. -\def\savedigit#1#2% +\unexpanded\def\savedigit#1#2% {\edef#1{#1\saveddigits#2}\let\saveddigits\empty} -\long\def\collectdigit#1% +\unexpanded\def\collectdigit#1% {\ifx#1~% \savedigit\collecteddigits @% \else\if#1_% tricky as can be several catcodes ... will become lua code anyway @@ -173,7 +173,7 @@ \let\handlemathdigits\firstofoneargument \let\handletextdigits\mathematics -\def\handledigits +\unexpanded\def\handledigits {%\ifcase\powerdigits % \edef\collecteddigits{\collecteddigits\saveddigits}% %\else @@ -235,7 +235,7 @@ % 0,- is invalid, should be = % 0,-- is invalid, should be == -\def\digitzeroamount +\unexpanded\def\digitzeroamount {\digitsgn\zeroamount \def\digitzeroamount {\hphantom @@ -243,7 +243,7 @@ \hskip-\wd\scratchbox}% \let\digitzeroamount\empty}} -\def\scandigits#1% +\unexpanded\def\scandigits#1% {\if#1.\digitsep1\else \if#1,\digitsep2\else \if#1@\digitnop \else @@ -261,7 +261,7 @@ \newbox\digitsepbox \chardef\autodigitmode=1 -\def\digitsep#1% +\unexpanded\def\digitsep#1% {\ifcase\autodigitmode \doscandigit#1% \else @@ -277,7 +277,7 @@ % % while this works -\def\digitnop +\unexpanded\def\digitnop {\hbox{\hphantom{\box\digitsepbox}}% \hphantom{0}\chardef\skipdigit1\relax} @@ -287,7 +287,7 @@ % {\hphantom{\box\digitsepbox0}% % \chardef\skipdigit1\relax} -\def\digitsgn#1% +\unexpanded\def\digitsgn#1% {\ifcase\digitsignmode#1\else \hbox {\setbox\scratchbox\hbox{0}% @@ -404,11 +404,11 @@ %D \digittemplate 12.000.000,00 % \digittemplate ., %D \stoptyping -\def\digittemplate #1 % +\unexpanded\def\digittemplate #1 % {\chardef\digitinputmode\zerocount \handletokens#1\with\scandigittemplate} -\def\scandigittemplate#1% +\unexpanded\def\scandigittemplate#1% {\if #1.\ifcase\digitinputmode\chardef\digitinputmode\plusone \fi% period \else\if#1,\ifcase\digitinputmode\chardef\digitinputmode\plustwo \fi% comma \fi\fi} diff --git a/tex/context/base/meta-tex.mkiv b/tex/context/base/meta-tex.mkiv index e7ed59727..431ae6ffe 100644 --- a/tex/context/base/meta-tex.mkiv +++ b/tex/context/base/meta-tex.mkiv @@ -116,8 +116,8 @@ % % \unexpanded\def\definetextext[#1]#2{\setvalue{@@st@@#1}{#2}} % -% \long\def\sometxt #1#{\dosometxt{#1}} % grab optional [args] -% \long\def\dosometxt #1#2{\ctxlua{metapost.sometxt(\!!bs#1\!!es,\!!bs#2\!!es)}} +% \def\sometxt #1#{\dosometxt{#1}} % grab optional [args] +% \def\dosometxt #1#2{\ctxlua{metapost.sometxt(\!!bs#1\!!es,\!!bs#2\!!es)}} % % \def\sometxta #1{textext.drt("#1")} % \def\sometxtb #1#2{textext.drt("\getvalue{@@st@@#1}{#2}")} diff --git a/tex/context/base/mult-prm.lua b/tex/context/base/mult-prm.lua index f0b850a5c..c1d5f90ee 100644 --- a/tex/context/base/mult-prm.lua +++ b/tex/context/base/mult-prm.lua @@ -253,6 +253,7 @@ return { "suppressifcsnameerror", "suppresslongerror", "suppressoutererror", + "suppressmathparerror", "synctex", }, ["omega"]={ diff --git a/tex/context/base/node-aux.lua b/tex/context/base/node-aux.lua index 499116258..36e6ec27c 100644 --- a/tex/context/base/node-aux.lua +++ b/tex/context/base/node-aux.lua @@ -352,7 +352,8 @@ local function tonodes(str,fnt,attr) -- (str,template_glyph) -- moved from blob- n = new_glyph(fnt,s) end if attr then -- normally false when template - setfield(n,"attr",copy_node_list(attr)) +-- setfield(n,"attr",copy_node_list(attr)) + setfield(n,"attr",attr) end if head then insert_node_after(head,tail,n) diff --git a/tex/context/base/page-set.mkiv b/tex/context/base/page-set.mkiv index 9c232f535..0617a71df 100644 --- a/tex/context/base/page-set.mkiv +++ b/tex/context/base/page-set.mkiv @@ -387,7 +387,7 @@ {\advance\scratchcounter\plusone}}% \popmacro\columnmaxcells} -\long\def\OTRSETrecurseRL#1% +\def\OTRSETrecurseRL#1% {\dostepwiserecurse\nofcolumns\plusone\minusone {#1\hskip\namedcolumnsetparameter{\currentcolumnset:\recurselevel}\c!distance}} @@ -2379,7 +2379,7 @@ \unexpanded\def\setupcolumntextareatext {\dotripleempty\dosetupcolumntextareatext} -\long\def\dosetupcolumntextareatext[#1][#2][#3]% +\def\dosetupcolumntextareatext[#1][#2][#3]% {\ifthirdargument \doifelse{#2}\v!both {\setvalue{\??mt#1\v!left }{#3}% diff --git a/tex/context/base/publ-aut.lua b/tex/context/base/publ-aut.lua index 791b65294..7045ca41f 100644 --- a/tex/context/base/publ-aut.lua +++ b/tex/context/base/publ-aut.lua @@ -40,6 +40,13 @@ local report = logs.reporter("publications","authors") -- } -- end +-- authorlist = { authorspec and authorspec and authorspec } +-- authorspec = composedname +-- authorspec = surnames, firstnames +-- authorspec = von, surnames, firstnames +-- authorspec = von, surnames, jr, firstnames +-- authorspec = von, surnames, jr, firstnames, initials + local space = P(" ") local comma = P(",") local period = P(".") @@ -52,13 +59,15 @@ local p_space = space^1 local p_shortone = C((utf8character -dash-period)^1) local p_longone = C( utf8character) * (1-dash-period)^0 +local p_empty = P("{}")/"" * #(p_space^0 * (P(-1) + P(","))) + local andsplitter = Ct { "start", start = (Cs((V("inner") + (1-p_and))^1) + p_and)^1, inner = P("{") * ((V("inner") + P(1-P("}")))^1) * P("}"), } local commasplitter = Ct { "start", - start = Cs(V("outer")) + (Cs((V("inner") + (1-p_comma))^1) + p_comma)^1, + start = Cs(V("outer")) + (p_empty + Cs((V("inner") + (1-p_comma))^1) + p_comma)^1, outer = (P("{")/"") * ((V("inner") + P(1-P("}")))^1) * (P("}")/""), inner = P("{") * ((V("inner") + P(1-P("}")))^1) * P("}"), } @@ -83,6 +92,16 @@ local cache = { } -- 33% reuse on tugboat.bib local nofhits = 0 local nofused = 0 +local function makeinitials(firstnames) + if firstnames and #firstnames > 0 then + local initials = { } + for i=1,#firstnames do + initials[i] = lpegmatch(initialsplitter,firstnames[i]) + end + return initials + end +end + local function splitauthorstring(str) if not str then return @@ -106,6 +125,10 @@ local function splitauthorstring(str) local firstnames, vons, surnames, initials, juniors local split = lpegmatch(commasplitter,author) local n = #split + detail = { + original = author, + snippets = n, + } if n == 1 then -- First von Last local words = lpegmatch(spacesplitter,author) @@ -137,11 +160,13 @@ local function splitauthorstring(str) else -- mess end - -- safeguard if #surnames == 0 then + -- safeguard firstnames = { } vons = { } surnames = { author } + else + initials = makeinitials(firstnames) end elseif n == 2 then -- von Last, First @@ -173,33 +198,38 @@ local function splitauthorstring(str) while i <= n do vons[#vons+1], i = words[i], i + 1 end - else + if surnames and firstnames and #surnames == 0 then + -- safeguard + surnames[1] = firstnames[#firstnames] + firstnames[#firstnames] = nil + end + initials = makeinitials(firstnames) + elseif n == 3 then -- von Last, Jr ,First - firstnames = lpegmatch(spacesplitter,split[1]) + surnames = lpegmatch(spacesplitter,split[1]) juniors = lpegmatch(spacesplitter,split[2]) - surnames = lpegmatch(spacesplitter,split[3]) - if n > 3 then - -- error - end - end - if #surnames == 0 then - surnames[1] = firstnames[#firstnames] - firstnames[#firstnames] = nil + firstnames = lpegmatch(spacesplitter,split[3]) + initials = makeinitials(firstnames) + elseif n == 4 then + -- von, Last, Jr, First + vons = lpegmatch(spacesplitter,split[1]) + surnames = lpegmatch(spacesplitter,split[2]) + juniors = lpegmatch(spacesplitter,split[3]) + firstnames = lpegmatch(spacesplitter,split[4]) + initials = makeinitials(firstnames) + elseif n >= 5 then + -- von, Last, Jr, First, Initials + vons = lpegmatch(spacesplitter,split[1]) + surnames = lpegmatch(spacesplitter,split[2]) + juniors = lpegmatch(spacesplitter,split[3]) + firstnames = lpegmatch(spacesplitter,split[4]) + initials = lpegmatch(spacesplitter,split[5]) end - if firstnames then - initials = { } - for i=1,#firstnames do - initials[i] = lpegmatch(initialsplitter,firstnames[i]) - end - end - detail = { - original = author, - firstnames = firstnames, - vons = vons, - surnames = surnames, - initials = initials, - juniors = juniors, - } + if firstnames and #firstnames > 0 then detail.firstnames = firstnames end + if vons and #vons > 0 then detail.vons = vons end + if surnames and #surnames > 0 then detail.surnames = surnames end + if initials and #initials > 0 then detail.initials = initials end + if juniors and #juniors > 0 then detail.juniors = juniors end cache[author] = detail nofhits = nofhits + 1 end diff --git a/tex/context/base/publ-dat.lua b/tex/context/base/publ-dat.lua index c6b2cb105..97ff543ca 100644 --- a/tex/context/base/publ-dat.lua +++ b/tex/context/base/publ-dat.lua @@ -25,7 +25,7 @@ end local chardata = characters.data local lowercase = characters.lower -local lower, find = string.lower, string.find +local lower, find, sub = string.lower, string.find, string.sub local concat, copy = table.concat, table.copy local next, type, rawget = next, type, rawget local utfchar = utf.char @@ -39,7 +39,7 @@ local setmetatableindex = table.setmetatableindex -- todo: more allocate -local P, R, S, V, C, Cc, Cs, Ct, Carg, Cmt = lpeg.P, lpeg.R, lpeg.S, lpeg.V, lpeg.C, lpeg.Cc, lpeg.Cs, lpeg.Ct, lpeg.Carg, lpeg.Cmt +local P, R, S, V, C, Cc, Cs, Ct, Carg, Cmt, Cp = lpeg.P, lpeg.R, lpeg.S, lpeg.V, lpeg.C, lpeg.Cc, lpeg.Cs, lpeg.Ct, lpeg.Carg, lpeg.Cmt, lpeg.Cp local p_whitespace = lpegpatterns.whitespace @@ -529,12 +529,13 @@ do local spacing = space^0 local equal = P("=") ----- collapsed = (space^1)/ " " - local collapsed = (p_whitespace^1)/" " + local collapsed = p_whitespace^1/" " + local nospaces = p_whitespace^1/"" - ----- balanced = lpegpatterns.balanced + local p_left = (p_whitespace^0 * left * p_whitespace^0) / "" + local p_right = (p_whitespace^0 * right * p_whitespace^0) / "" local balanced = P { - -- [1] = ((escape * (left+right)) + (collapsed + 1 - (left+right)) + V(2))^0, [1] = ((escape * (left+right)) + collapsed + (1 - (left+right))^1 + V(2))^0, [2] = left * V(1) * right, } @@ -552,8 +553,21 @@ do local s_quoted = ((escape*single) + collapsed + (1-single))^0 local d_quoted = ((escape*double) + collapsed + (1-double))^0 - local b_value = (left /"") * balanced * (right /"") - local u_value = (left /"") * unbalanced * (right /"") -- get rid of outer { } + -- local p_strip = C((1-(p_whitespace * P(-1)))^1) + -- + -- local function stripendspace(s) + -- return lpegmatch(p_strip,s) or s + -- end + + local p_strip = (Cp() * p_whitespace^1 * P(-1) + 1)^1 + + local function stripendspace(s) + local p = lpegmatch(p_strip,s) + return p and sub(s,1,p-1) or s + end + + local b_value = p_left * (Cs(balanced)/stripendspace) * p_right + local u_value = p_left * unbalanced * p_right -- get rid of outer { } local s_value = (single/"") * (u_value + s_quoted) * (single/"") local d_value = (double/"") * (u_value + d_quoted) * (double/"") local r_value = reference * Carg(1) /resolve diff --git a/tex/context/base/publ-ini.lua b/tex/context/base/publ-ini.lua index 1b6c708a5..fe1007d88 100644 --- a/tex/context/base/publ-ini.lua +++ b/tex/context/base/publ-ini.lua @@ -764,6 +764,8 @@ local function getdirect(dataset,data,field,catspec) -- no field check, no datas end end +publications.getfield = getfield +publications.getdetail = getdetail publications.getcasted = getcasted publications.getfaster = getfaster publications.getdirect = getdirect diff --git a/tex/context/base/publ-tra.lua b/tex/context/base/publ-tra.lua index 7ab81da66..2b5d63a83 100644 --- a/tex/context/base/publ-tra.lua +++ b/tex/context/base/publ-tra.lua @@ -6,24 +6,35 @@ if not modules then modules = { } end modules ['publ-tra'] = { license = "see context related readme files" } +-- todo: use context.tt .. more efficient, less code + local next, type = next, type -local sortedhash, sortedkeys = table.sortedhash, table.sortedkeys +local sortedhash = table.sortedhash +local sortedkeys = table.sortedkeys local settings_to_array = utilities.parsers.settings_to_array -local formatters = string.formatters +local formatters = string.formatters +local concat = table.concat + +local context = context +local commands = commands -local context = context -local commands = commands +local publications = publications +local tracers = publications.tracers +local tables = publications.tables +local datasets = publications.datasets +local specifications = publications.specifications -local publications = publications -local tracers = publications.tracers -local tables = publications.tables -local datasets = publications.datasets -local specifications = publications.specifications +local getfield = publications.getfield +local getcasted = publications.getcasted -local ctx_NC, ctx_NR, ctx_HL, ctx_FL, ctx_ML, ctx_LL = context.NC, context.NR, context.HL, context.FL, context.ML, context.LL +local ctx_NC, ctx_NR, ctx_HL, ctx_FL, ctx_ML, ctx_LL, ctx_EQ = context.NC, context.NR, context.HL, context.FL, context.ML, context.LL, context.EQ local ctx_bold, ctx_monobold, ctx_rotate, ctx_llap, ctx_rlap = context.bold, context.formatted.monobold, context.rotate, context.llap, context.rlap -local ctx_starttabulate, ctx_stoptabulate = context.starttabulate, context.stoptabulate + +local ctx_starttabulate = context.starttabulate +local ctx_stoptabulate = context.stoptabulate + +local ctx_verbatim = context.verbatim local privates = tables.privates local specials = tables.specials @@ -309,7 +320,77 @@ function tracers.showtables(settings) end end +function tracers.showdatasetauthors(settings) + + local dataset = settings.dataset + local field = settings.field + + if not dataset or dataset == "" then dataset = "standard" end + if not field or field == "" then field = "author" end + + local function flush(ai,k,i) + local v = ai[k] + if v then + ctx_NC() + if i then + ctx_verbatim(i) + end + ctx_NC() + ctx_verbatim(k) + ctx_EQ() + if type(v) == "table" then + ctx_verbatim(concat(v, " | ")) + else + ctx_verbatim(v) + end + ctx_NC() + ctx_NR() + end + end + + local function row(key,value) + ctx_NC() ctx_rlap(function() ctx_verbatim(key) end) + ctx_NC() + ctx_EQ() ctx_verbatim(value) + ctx_NC() ctx_NR() + end + + local d = datasets[dataset].luadata + + for tag, entry in sortedhash(d) do + + local a = getcasted(dataset,tag,field) + + if a then + context.start() + context.tt() + context.starttabulate { "|B|Bl|p|" } + ctx_FL() + row("tag",tag) + row("field",field) + row("content",getfield(dataset,tag,field)) + for i=1,#a do + ctx_ML() + local ai = a[i] + flush(ai,"original",i) + flush(ai,"snippets") + flush(ai,"initials") + flush(ai,"firstnames") + flush(ai,"vons") + flush(ai,"surnames") + flush(ai,"juniors") + end + ctx_LL() + context.stoptabulate() + context.stop() + end + + end + +end + commands.showbtxdatasetfields = tracers.showdatasetfields commands.showbtxdatasetcompleteness = tracers.showdatasetcompleteness commands.showbtxfields = tracers.showfields commands.showbtxtables = tracers.showtables +commands.showbtxdatasetauthors = tracers.showdatasetauthors diff --git a/tex/context/base/publ-tra.mkiv b/tex/context/base/publ-tra.mkiv index 6f4167d83..f4e7e867e 100644 --- a/tex/context/base/publ-tra.mkiv +++ b/tex/context/base/publ-tra.mkiv @@ -22,6 +22,7 @@ \unexpanded\def\showbtxdatasetfields {\dosingleempty\publ_show_dataset_fields} \unexpanded\def\showbtxdatasetcompleteness{\dosingleempty\publ_show_dataset_completeness} +\unexpanded\def\showbtxdatasetauthors {\dosingleempty\publ_show_dataset_authors} \unexpanded\def\showbtxfields {\dosingleempty\publ_show_fields} \unexpanded\def\showbtxtables {\dosingleempty\publ_show_tables} @@ -29,6 +30,7 @@ {\begingroup \setdummyparameter\c!specification{\btxparameter\c!specification}% \setdummyparameter\c!dataset {\currentbtxdataset}% + \letdummyparameter\c!field \empty \iffirstargument \doifassignmentelse{#2} {\getdummyparameters[#2]}% @@ -39,13 +41,15 @@ % \publ_specification_push{"\dummyparameter\c!specification}% \ctxcommand{#1{ dataset = "\dummyparameter\c!dataset", - specification = "\dummyparameter\c!specification" + specification = "\dummyparameter\c!specification", + field = "\dummyparameter\c!field", }}% % \publ_specification_pop \endgroup} \def\publ_show_dataset_fields {\publ_show_dataset_whatever{showbtxdatasetfields}} \def\publ_show_dataset_completeness{\publ_show_dataset_whatever{showbtxdatasetcompleteness}} +\def\publ_show_dataset_authors {\publ_show_dataset_whatever{showbtxdatasetauthors}} \def\publ_show_fields[#1]% {\begingroup diff --git a/tex/context/base/s-fonts-ligatures.mkiv b/tex/context/base/s-fonts-ligatures.mkiv index 1b8ab30d8..21d8efe34 100644 --- a/tex/context/base/s-fonts-ligatures.mkiv +++ b/tex/context/base/s-fonts-ligatures.mkiv @@ -39,7 +39,7 @@ \registerhyphenationexception[xffid] \starttexdefinition showotfligaturescaption #1 - \bTD [width=18em,align={flushleft,lohi},nx=3] + \bTD [align={flushleft,lohi},nx=3] \nohyphens \ttbf #1 @@ -72,17 +72,17 @@ \starttexdefinition showotfligaturesbanner #1 \bTR[frame=off] - \bTD [nx=12,align={middle,lohi},height=4ex] + \bTD [nx=12,width=18em,align={middle,lohi},height=4ex] \tttf #1 \eTD \eTR \stoptexdefinition \starttexdefinition showotfligaturescaptions #1 - \bTR[height=3ex,align={middle,lohi},nx=3,bottomframe=off] + \bTR[height=3ex,align={middle,lohi},bottomframe=off] \processcommalist[#1]\showotfligaturescaption \eTR - \bTR[height=3ex,align={middle,lohi},nx=3,topframe=off] + \bTR[height=3ex,align={middle,lohi},topframe=off] \processcommalist[#1]\showotfligatureslegend \eTR \stoptexdefinition @@ -119,20 +119,20 @@ \stoptexdefinition \starttexdefinition showotfligaturesparagraphs #1 - \bTR[cheight=12ex,topframe=off] + \bTR[topframe=off] \processcommalist[#1]\showotfligaturesparagraphset \eTR \stoptexdefinition \starttexdefinition showotfligaturesextremes #1 - \bTR[cheight=12ex,topframe=off] + \bTR[topframe=off] \processcommalist[#1]\showotfligaturesextremeset \eTR \stoptexdefinition \starttexdefinition showotfligaturesdefaults \bTR - \bTD [nx=12,align=middle,height=4ex,frame=off] + \bTD [nx=12,width=18em,align=middle,height=4ex,frame=off] \start \LigatureFont fb \stop \quad \start \LigatureFont ff \stop \quad \start \LigatureFont fi \stop \quad @@ -184,13 +184,13 @@ \starttext - \startTEXpage \showotfligatures[font=lmroman10-regular.otf, features=default] \stopTEXpage - \startTEXpage \showotfligatures[font=dejavu-serif.ttf, features=default] \stopTEXpage - \startTEXpage \showotfligatures[font=minionpro.otf, features=default] \stopTEXpage - \startTEXpage \showotfligatures[font=minionpro.otf, features=smallcaps] \stopTEXpage - \startTEXpage \showotfligatures[font=brill.otf, features=default] \stopTEXpage - \startTEXpage \showotfligatures[font=gentiumplus-r.ttf, features=default] \stopTEXpage - \startTEXpage \showotfligatures[font=cambria, features=default] \stopTEXpage + \startTEXpage[offset=10pt] \showotfligatures[font=lmroman10-regular.otf, features=default] \stopTEXpage + \startTEXpage[offset=10pt] \showotfligatures[font=dejavu-serif.ttf, features=default] \stopTEXpage + \startTEXpage[offset=10pt] \showotfligatures[font=minionpro.otf, features=default] \stopTEXpage + \startTEXpage[offset=10pt] \showotfligatures[font=minionpro.otf, features=smallcaps] \stopTEXpage + \startTEXpage[offset=10pt] \showotfligatures[font=brill.otf, features=default] \stopTEXpage + \startTEXpage[offset=10pt] \showotfligatures[font=gentiumplus-r.ttf, features=default] \stopTEXpage + \startTEXpage[offset=10pt] \showotfligatures[font=cambria, features=default] \stopTEXpage \stoptext diff --git a/tex/context/base/s-inf-01.mkvi b/tex/context/base/s-inf-01.mkvi index 8263413ac..2c0c1681e 100644 --- a/tex/context/base/s-inf-01.mkvi +++ b/tex/context/base/s-inf-01.mkvi @@ -126,6 +126,8 @@ return max, what, function(n) return (max == 0 and 0) or (n == 0 and 0) or n/max end end + local f_norm = string.formatters["%0.3f"] + function document.context_state_1(what) local max, what, norm = prepare(what) context.starttabulate { "|Tl|T|T|T|T|T|" } @@ -154,9 +156,15 @@ (used.mkvi[k] and "vi") or "~~", k ) + -- context("%s\\enspace %s\\quad %s\\quad %s", + -- (used.mkii[k] and "ii") or "\\quad", + -- (used.mkiv[k] and "iv") or "\\quad", + -- (used.mkvi[k] and "vi") or "\\quad", + -- k + -- ) context.NC() for i=1,#types do - context.Bar(types[i],v[i],c[i],norm(v[i])) + context.Bar(types[i],v[i],c[i],f_norm(norm(v[i]))) context.NC() end context.NR() @@ -170,7 +178,7 @@ local c = (what == size and comp[k]) or nope context.StartUp(k) for i=1,#types do - context.Up(types[i],norm(v[i])) + context.Up(types[i],f_norm(norm(v[i]))) end context.StopUp() end diff --git a/tex/context/base/s-typesetting-kerning.mkiv b/tex/context/base/s-typesetting-kerning.mkiv index 96e17b7c0..48d81ce36 100644 --- a/tex/context/base/s-typesetting-kerning.mkiv +++ b/tex/context/base/s-typesetting-kerning.mkiv @@ -123,38 +123,48 @@ \setbox4=\ruledhbox{\setcharacterkerning[crap]\showfontkerns\showglyphs#1} \xdef\KerningStepPercentage{\ctxlua{context("\letterpercent 0.2f",(1-\number\wd0/\number\wd2)*100)}} \scratchwidth\wd0 - \hbox{\box0\hskip-\scratchwidth\box2} - \par - \box4 + \vtop\bgroup + \hbox{\box0\hskip-\scratchwidth\box2} + \par + \box4 + \egroup \stoptexdefinition \starttexdefinition showcharacterkerningsteps [#1] - \startTEXpage[\c!offset=1ex] + \start + + \getdummyparameters + [\s!font=Regular, + \c!sample={Wat een bende, rommelen met het font design!}, + \c!text={rommelen}, + \c!first=00, + \c!last=95, + \c!step=05, + \c!option=, % \v!page + #1] + + \doif{\dummyparameter\c!option}\v!page { + \startTEXpage[\c!offset=1ex] + } \definecolor[color-1][r=1,t=.5,a=1] \definecolor[color-2][b=1,t=.5,a=1] - \getdummyparameters - [\s!font=Regular, - \c!sample={Wat een bende, rommelen met het font design!}, -% \c!text={een}, - \c!text={rommelen}, - #1] - \definedfont[\dummyparameter\s!font*default sa 1] - \begingroup - \tttf \dummyparameter\s!font\space @ default - \endgroup - - \blank + \doif {\dummyparameter\c!option}\v!page { + \begingroup + \tttf \dummyparameter\s!font\space @ default + \endgroup + \blank + } - \starttabulate[|cT|p|cT|p|cT|] + \starttabulate[|cT|l|cT|l|cT|] \NC \tt\bf factor \NC \tt\bf sample \NC \tt\bf \letterpercent \NC \tt\bf text \NC \tt\bf \letterpercent \NC \NR \HL - \dostepwiserecurse {00} {95} {05} { + \dostepwiserecurse {\dummyparameter\c!first} {\dummyparameter\c!last} {\dummyparameter\c!step} { \NC \xdef\KerningStepFactor{\ctxlua{context("\letterpercent 0.3f",####1/1000)}} \KerningStepFactor @@ -168,9 +178,14 @@ \KerningStepPercentage \NC \NR } + \stoptabulate - \stopTEXpage + \doif{\dummyparameter\c!option}\v!page { + \stopTEXpage + } + + \stop \stoptexdefinition @@ -182,10 +197,10 @@ % \showcharacterkerning - \showcharacterkerningsteps[font=file:FuturaStd-Book.otf] - \showcharacterkerningsteps[font=file:FuturaStd-Medium.otf] - \showcharacterkerningsteps[font=file:FuturaStd-Bold.otf] - \showcharacterkerningsteps[font=file:FuturaStd-heavy.otf] + \showcharacterkerningsteps[font=file:FuturaStd-Book.otf,option=page] + \showcharacterkerningsteps[font=file:FuturaStd-Medium.otf,option=page] + \showcharacterkerningsteps[font=file:FuturaStd-Bold.otf,option=page] + \showcharacterkerningsteps[font=file:FuturaStd-heavy.otf,option=page] \stoptext diff --git a/tex/context/base/spac-chr.lua b/tex/context/base/spac-chr.lua index 81c0ce98b..e3fa6d099 100644 --- a/tex/context/base/spac-chr.lua +++ b/tex/context/base/spac-chr.lua @@ -117,7 +117,7 @@ local function inject_nobreak_space(unicode,head,current,space,spacestretch,spac local penalty = new_penalty(10000) setfield(glue,"attr",attr) setfield(current,"attr",nil) - setattr(glue,a_character,unicode) + setattr(glue,a_character,unicode) -- bombs head, current = insert_node_after(head,current,penalty) if trace_nbsp then local rule = new_rule(space) diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index 7b2d5f398..35d1d9880 100644 Binary files a/tex/context/base/status-files.pdf and b/tex/context/base/status-files.pdf differ diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf index 0e1bb5d3a..a133c3289 100644 Binary files a/tex/context/base/status-lua.pdf and b/tex/context/base/status-lua.pdf differ diff --git a/tex/context/base/strc-tag.mkiv b/tex/context/base/strc-tag.mkiv index 33cd442d5..e538eff2d 100644 --- a/tex/context/base/strc-tag.mkiv +++ b/tex/context/base/strc-tag.mkiv @@ -371,36 +371,36 @@ \c!style=] \unexpanded\def\startparagraph - {\dodoubleempty\paragraph_start} + {\dodoubleempty\paragraph_start} \def\paragraph_start - {\endgraf % we end before the group - \begingroup - \iffirstargument - \ifsecondargument - \doubleexpandafter\paragraph_start_two - \else - \doubleexpandafter\paragraph_start_one - \fi - \else - \expandafter\paragraph_start_zero - \fi} + {\endgraf % we end before the group + \begingroup + \iffirstargument + \ifsecondargument + \doubleexpandafter\paragraph_start_two + \else + \doubleexpandafter\paragraph_start_one + \fi + \else + \expandafter\paragraph_start_zero + \fi} \def\paragraph_start_two[#1][#2]% - {\edef\currentparagraph{#1}% - \setupcurrentparagraph[#2]% - \paragraph_start_indeed} + {\edef\currentparagraph{#1}% + \setupcurrentparagraph[#2]% + \paragraph_start_indeed} \def\paragraph_start_one[#1][#2]% - {\doifassignmentelse{#1} - {\let\currentparagraph\empty - \setupcurrentparagraph[#1]} - {\edef\currentparagraph{#1}}% - \paragraph_start_indeed} + {\doifassignmentelse{#1} + {\let\currentparagraph\empty + \setupcurrentparagraph[#1]} + {\edef\currentparagraph{#1}}% + \paragraph_start_indeed} \def\paragraph_start_zero[#1][#2]% - {\let\currentparagraph\empty - \paragraph_start_indeed} + {\let\currentparagraph\empty + \paragraph_start_indeed} \def\paragraph_start_indeed {\useparagraphstyleandcolor\c!style\c!color @@ -409,9 +409,9 @@ \dostarttagged\t!paragraph\currentparagraph} \unexpanded\def\stopparagraph - {\dostoptagged - \endgraf % we end inside the group - \endgroup} + {\dostoptagged + \endgraf % we end inside the group + \endgroup} \let\startpar\startparagraph \let\stoppar \stopparagraph diff --git a/tex/context/base/supp-box.mkiv b/tex/context/base/supp-box.mkiv index 5c4157bd1..26609443b 100644 --- a/tex/context/base/supp-box.mkiv +++ b/tex/context/base/supp-box.mkiv @@ -658,8 +658,8 @@ %D A slower but more versatile implementation is: %D %D \starttyping -%D \long\def\dowithnextbox#1#2% -%D {\long\def\syst_boxes_with_next_box{#1}% +%D \unexpanded\def\dowithnextbox#1#2% +%D {\def\syst_boxes_with_next_box{#1}% %D \ifx#2\hbox %D \afterassignment\syst_boxes_with_next_box_indeed %D \else\ifx#2\vbox diff --git a/tex/context/base/syst-ini.mkiv b/tex/context/base/syst-ini.mkiv index 73904cf63..7628788d2 100644 --- a/tex/context/base/syst-ini.mkiv +++ b/tex/context/base/syst-ini.mkiv @@ -116,8 +116,12 @@ %D Handy. -\suppresslongerror = 1 -\suppressoutererror = 1 + +\suppresslongerror = 1 +\suppressoutererror = 1 +%suppressmathparerror = 1 + +\ifdefined\suppressmathparerror \suppressmathparerror = 1 \fi %D \ETEX\ has a not so handy way of telling you the version number, i.e. the revision %D number has a period in it: @@ -198,7 +202,7 @@ \countdef \c_syst_last_allocated_language = 41 \c_syst_last_allocated_language = \c_syst_min_allocated_language % not used in context \countdef \c_syst_last_allocated_insertion = 42 \c_syst_last_allocated_insertion = \c_syst_min_allocated_insert \countdef \c_syst_last_allocated_family = 43 \c_syst_last_allocated_family = \c_syst_min_allocated_family % not used in context -\countdef \c_syst_last_allocated_attribute = 44 \c_syst_last_allocated_attribute = \c_syst_min_allocated_attribute +\countdef \c_syst_last_allocated_attribute = 44 \c_syst_last_allocated_attribute = \c_syst_min_allocated_attribute % not used in context \countdef \c_syst_min_counter_value = 125 \c_syst_min_counter_value = -"7FFFFFFF % beware, we use index 125 at the lua end \countdef \c_syst_max_counter_value = 126 \c_syst_max_counter_value = "7FFFFFFF % beware, we use index 126 at the lua end diff --git a/tex/context/base/tabl-ntb.mkiv b/tex/context/base/tabl-ntb.mkiv index 667a90bac..51564f825 100644 --- a/tex/context/base/tabl-ntb.mkiv +++ b/tex/context/base/tabl-ntb.mkiv @@ -235,6 +235,7 @@ \installcorenamespace{naturaltablehei} \installcorenamespace{naturaltabledis} \installcorenamespace{naturaltableaut} +\installcorenamespace{naturaltablefwd} % forcedwidth \installcorenamespace{naturaltabletxt} \installcorenamespace{naturaltablespn} \installcorenamespace{naturaltableref} @@ -1284,7 +1285,7 @@ \global\c_tabl_ntb_row\zerocount \global\advance\c_tabl_ntb_row\minusone \dostarttaggedchained\t!table\empty\??naturaltable - \registerparoptions + %\registerparoptions % (*) triggers max hsize \the\t_tabl_ntb \dostoptagged} @@ -1312,14 +1313,12 @@ \setvalue{\??naturaltablecell\the\c_tabl_ntb_none}#1#2% {\scratchcounter\tabl_ntb_get_col{#1}{#2}\relax - \normalexpanded - {\t_tabl_ntb_row - {\the\t_tabl_ntb_row - \ifnum\scratchcounter>\zerocount - \tabl_ntb_span{\the\scratchcounter}% - \else - \tabl_ntb_plus - \fi}}} + \ifnum\scratchcounter>\zerocount + \normalexpanded + {\t_tabl_ntb_row + {\the\t_tabl_ntb_row + \tabl_ntb_span{\the\scratchcounter}}}% + \fi} \setvalue{\??naturaltablecell\the\c_tabl_ntb_cell}#1#2% {\t_tabl_ntb_row\expandafter{\the\t_tabl_ntb_row\tabl_ntb_pass #1 #2 }% space delimited -> less tokens @@ -1569,6 +1568,14 @@ {\setbox\b_tabl_ntb_final\vbox{\tabl_ntb_flush_content}% \postprocessTABLEbox\b_tabl_ntb_final \beforeTABLEbox + % packaging prevents max hsized box + % \hbox{\registerparoptions\box\b_tabl_ntb_final}% (*) better here + % better : + \ifinsidefloat + % nothing, else we get a \hsized box + \else + \registerparoptions % (*) better here + \fi \box\b_tabl_ntb_final \afterTABLEbox} @@ -1799,6 +1806,55 @@ % problem: when span doesn't break we can have a span that is the sum of % cells but still to small .. chicken egg problem ... for that we should % also have a smallest width run +% +% nilling the background makes a run upto 25% faster + +\def\tabl_ntb_cell_process_a_check_span_one + {\ifautosqueezeTBLspan + \edef\p_width{\naturaltablelocalparameter\c!width}% + \csname\??naturaltablesqueeze\ifcsname\??naturaltablesqueeze\p_width\endcsname\p_width\fi\endcsname + \else + \donetrue + \fi + \ifdone % brr, 0 + \ifnum\scratchcounter>\plusone + \tabl_ntb_set_spn\c_tabl_ntb_col + \fi + \fi} + +\def\tabl_ntb_cell_process_a_check_span_two_yes + {\iftightTBLcolspan + \donefalse + \else + \ifnum\scratchcounter>\plusone + \begingroup + \edef\p_width{\naturaltablelocalparameter\c!width}% + \csname\??naturaltablesqueeze\ifcsname\??naturaltablesqueeze\p_width\endcsname\p_width\fi\endcsname + \ifdone + \endgroup + \edef\p_option{\naturaltablelocalparameter\c!option}% + \ifx\p_option\v!tight\donefalse\else\donetrue\fi + \else + % a dimension + \endgroup + \donefalse + \fi + \else + \edef\p_option{\naturaltablelocalparameter\c!option}% + \ifx\p_option\v!tight\donefalse\else\donetrue\fi + \fi + \fi} + + +% \let\tabl_ntb_cell_process_a_check_span_two_nop\donetrue + +\def\tabl_ntb_cell_process_a_check_span_two_nop + {\ifnum\scratchcounter>\plusone + \edef\p_width{\naturaltablelocalparameter\c!width}% + \csname\??naturaltablesqueeze\ifcsname\??naturaltablesqueeze\p_width\endcsname\p_width\fi\endcsname + \else + \donetrue + \fi} \unexpanded\def\tabl_ntb_cell_process_a#1#2[#3]#4% grouping added ! ! ! {\bgroup @@ -1808,41 +1864,20 @@ \letnaturaltablelocalparameter\c!background\empty \letnaturaltablelocalparameter\c!frame\v!off \scratchcounter\tabl_ntb_get_col{#1}{#2}\relax - \ifnum\scratchcounter>\plusone - \letnaturaltablelocalparameter\c!width\v!fit % compatible with extreme tables - \fi \setbox\scratchbox\hbox {\scratchdimen\naturaltablelocalparameter\c!distance\relax \ifdim\scratchdimen>\tabl_ntb_get_dis{#2}\relax \tabl_ntb_set_dis{#2}{\the\scratchdimen}% \fi - % nilling the background is some 25% faster - % % \setupcurrentnaturaltablelocal[#3,\c!background=,\c!frame=\v!off]% - % \setupcurrentnaturaltablelocal[#3]% 25% faster - % \letnaturaltablelocalparameter\c!background\empty - % \letnaturaltablelocalparameter\c!frame\v!off \inheritednaturaltablelocalframed{\tabl_ntb_cell_start\tabl_ntb_char_align{#1}{#2}#4\tabl_ntb_cell_stop\tabl_ntb_cell_finalize}}% \scratchdimen\tabl_ntb_get_wid\c_tabl_ntb_col\relax \ifdim\wd\scratchbox>\scratchdimen \ifsqueezeTBLspan - \ifautosqueezeTBLspan - \edef\p_width{\naturaltablelocalparameter\c!width}% - \csname\??naturaltablesqueeze\ifcsname\??naturaltablesqueeze\p_width\endcsname\p_width\fi\endcsname - \else - \donetrue - \fi - \ifdone % brr, 0 - \ifnum\scratchcounter>\plusone \tabl_ntb_set_spn\c_tabl_ntb_col\fi - \fi + \tabl_ntb_cell_process_a_check_span_one \fi \tabl_ntb_spn_doifelse\c_tabl_ntb_col - {\iftightTBLcolspan - \donefalse - \else - \edef\p_option{\naturaltablelocalparameter\c!option}% - \ifx\p_option\v!tight\donefalse\else\donetrue\fi - \fi}% - \donetrue + \tabl_ntb_cell_process_a_check_span_two_yes + \tabl_ntb_cell_process_a_check_span_two_nop \ifdone \ifdim\tabl_ntb_get_wid\c_tabl_ntb_col<\wd\scratchbox \tabl_ntb_set_wid\c_tabl_ntb_col{\the\wd\scratchbox}% diff --git a/tex/context/base/type-run.mkiv b/tex/context/base/type-run.mkiv index 4da633371..a61321375 100644 --- a/tex/context/base/type-run.mkiv +++ b/tex/context/base/type-run.mkiv @@ -30,7 +30,7 @@ \obeylines % else we loose the first line due to lookahead \dotripleempty\dostarttypescript} \def\dostarttypescript[##1][##2][##3]% - {\long\def\next####1\stoptypescript{\egroup} + {\def\next####1\stoptypescript{\egroup} \dochecktypescript{##1}\typescriptone \ifdone \dochecktypescript{##2}\typescripttwo \ifdone \dochecktypescript{##3}\typescriptthree\ifdone diff --git a/tex/generic/context/luatex/luatex-fonts-inj.lua b/tex/generic/context/luatex/luatex-fonts-inj.lua index 3b933829d..b1dce8cab 100644 --- a/tex/generic/context/luatex/luatex-fonts-inj.lua +++ b/tex/generic/context/luatex/luatex-fonts-inj.lua @@ -481,6 +481,9 @@ local function inject_marks(marks,nofmarks) local px = getfield(p,"xoffset") local ox = 0 local pp = rawget(properties,p) + if pp then + pp = pp.injections + end local rightkern = pp and pp.rightkern if rightkern then -- x and w ~= 0 if pn.markdir < 0 then diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 246dba7f2..ff3230b5f 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 : 01/26/15 11:39:16 +-- merge date : 01/30/15 15:28:21 do -- begin closure to overcome local limits and interference @@ -10257,6 +10257,9 @@ local function inject_marks(marks,nofmarks) local px=getfield(p,"xoffset") local ox=0 local pp=rawget(properties,p) + if pp then + pp=pp.injections + end local rightkern=pp and pp.rightkern if rightkern then if pn.markdir<0 then -- cgit v1.2.3