diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base')
27 files changed, 444 insertions, 395 deletions
diff --git a/Master/texmf-dist/tex/context/base/cont-new.mkiv b/Master/texmf-dist/tex/context/base/cont-new.mkiv index 7aaabd8b0bf..ec97951b750 100644 --- a/Master/texmf-dist/tex/context/base/cont-new.mkiv +++ b/Master/texmf-dist/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2015.05.10 20:08} +\newcontextversion{2015.05.12 17:57} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/Master/texmf-dist/tex/context/base/context-version.pdf b/Master/texmf-dist/tex/context/base/context-version.pdf Binary files differindex 2c9b4c63eac..73287d37573 100644 --- a/Master/texmf-dist/tex/context/base/context-version.pdf +++ b/Master/texmf-dist/tex/context/base/context-version.pdf diff --git a/Master/texmf-dist/tex/context/base/context.mkiv b/Master/texmf-dist/tex/context/base/context.mkiv index 3b70cecc2aa..de3e6c701d0 100644 --- a/Master/texmf-dist/tex/context/base/context.mkiv +++ b/Master/texmf-dist/tex/context/base/context.mkiv @@ -39,7 +39,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2015.05.10 20:08} +\edef\contextversion{2015.05.12 17:57} \edef\contextkind {beta} %D For those who want to use this: diff --git a/Master/texmf-dist/tex/context/base/enco-ini.mkiv b/Master/texmf-dist/tex/context/base/enco-ini.mkiv index b2e7efd3e5e..ef0ebef4ebb 100644 --- a/Master/texmf-dist/tex/context/base/enco-ini.mkiv +++ b/Master/texmf-dist/tex/context/base/enco-ini.mkiv @@ -55,6 +55,8 @@ \unexpanded\def\enco_define_accent#1#2#3% no spaces, used low level {\setvalue{\??accents\string#1\string#2\empty}{#3}} +% the following dirty trick is needed to catch \asciimath{\^{1/5}log}: + \def\enco_handle_accent#1#2% expandable because we want them in the tuc file {\csname\??accents \ifcsname\??accents\string#1#2\empty\endcsname @@ -62,10 +64,12 @@ \else\ifcsname\??accents\string#1\string#2\empty\endcsname \string#1\string#2\empty \else - \empty + \endcsname#2\csname\??accents % very dirty trick: ignore accent but keep char \fi\fi \endcsname} +\letvalue{\??accents}\empty + \unexpanded\def\enco_define_command#1#2% {\setuvalue{\string#1}{#2}} diff --git a/Master/texmf-dist/tex/context/base/font-pre.mkiv b/Master/texmf-dist/tex/context/base/font-pre.mkiv index 0bf0f6f791e..157b4585a3f 100644 --- a/Master/texmf-dist/tex/context/base/font-pre.mkiv +++ b/Master/texmf-dist/tex/context/base/font-pre.mkiv @@ -561,11 +561,17 @@ \definealternativestyle [\v!smaller] [\setsmallbodyfont\tf] [] \definealternativestyle [\v!sans,\v!sansserif] [\ss] [] -\definealternativestyle [\v!sansbold] [\ss\bf] [] \definealternativestyle [\v!roman,\v!serif,\v!regular] [\rm] \definealternativestyle [\v!handwritten] [\hw] \definealternativestyle [\v!calligraphic] [\cg] +\definealternativestyle [\v!sansnormal] [\ss\tf] [] +\definealternativestyle [\v!sansbold] [\ss\bf] [] +\definealternativestyle [\v!serifnormal] [\rm\tf] [] +\definealternativestyle [\v!serifbold] [\rm\bf] [] +\definealternativestyle [\v!mononormal] [\tt\tf] [] +\definealternativestyle [\v!monobold] [\tt\bf] [] + % % maybe we need interface neutral as well (for use in cld): % % \letcscsname\mediaeval \csname\v!mediaeval \endcsname diff --git a/Master/texmf-dist/tex/context/base/lang-txt.lua b/Master/texmf-dist/tex/context/base/lang-txt.lua index 298e05db4be..2938550eef3 100644 --- a/Master/texmf-dist/tex/context/base/lang-txt.lua +++ b/Master/texmf-dist/tex/context/base/lang-txt.lua @@ -181,6 +181,11 @@ data.labels={ sk="cotg", }, }, + diff={ + labels={ + en="d", + }, + }, deg={ labels={ cz="deg", diff --git a/Master/texmf-dist/tex/context/base/math-def.mkiv b/Master/texmf-dist/tex/context/base/math-def.mkiv index 0888081f065..8247ac00849 100644 --- a/Master/texmf-dist/tex/context/base/math-def.mkiv +++ b/Master/texmf-dist/tex/context/base/math-def.mkiv @@ -67,6 +67,7 @@ \definemathcommand [sup] [limop] {\mfunctionlabeltext{sup}} \definemathcommand [tanh] [nolop] {\mfunctionlabeltext{tanh}} \definemathcommand [tan] [nolop] {\mfunctionlabeltext{tan}} +\definemathcommand [diff] {\mfunctionlabeltext{diff}} \let\normalmatharg\arg % todo: maybe automatically diff --git a/Master/texmf-dist/tex/context/base/math-fen.mkiv b/Master/texmf-dist/tex/context/base/math-fen.mkiv index ee82d89d19b..b2f64890c23 100644 --- a/Master/texmf-dist/tex/context/base/math-fen.mkiv +++ b/Master/texmf-dist/tex/context/base/math-fen.mkiv @@ -133,6 +133,11 @@ \definemathfence [solidus] [\c!left="2044,\c!right="2044] \definemathfence [ceil] [\c!left="2308,\c!right="2309] \definemathfence [floor] [\c!left="230A,\c!right="230B] +\definemathfence [moustache] [\c!left="23B0,\c!right="23B1] +\definemathfence [uppercorner] [\c!left="231C,\c!right="231D] +\definemathfence [lowercorner] [\c!left="231E,\c!right="231F] +\definemathfence [group] [\c!left="27EE,\c!right="27EF] +\definemathfence [openbracket] [\c!left="27E6,\c!right="27E7] \definemathfence [nothing] @@ -147,38 +152,54 @@ \definemathfence [mirroredangle] [mirrored] [\c!right="27E8,\c!left="27E9] \definemathfence [mirroreddoubleangle] [mirrored] [\c!right="27EA,\c!left="27EB] \definemathfence [mirroredsolidus] [mirrored] [\c!right="2044,\c!left="2044] +\definemathfence [mirroredceil] [mirrored] [\c!right="2308,\c!left="2309] +\definemathfence [mirroredfloor] [mirrored] [\c!right="230A,\c!left="230B] +\definemathfence [mirroredmoustache] [mirrored] [\c!right="23B0,\c!left="23B1] +\definemathfence [mirroreduppercorner] [mirrored] [\c!right="231C,\c!left="231D] +\definemathfence [mirroredlowercorner] [mirrored] [\c!right="231E,\c!left="231F] +\definemathfence [mirroredgroup] [mirrored] [\c!right="27EE,\c!left="27EF] +\definemathfence [mirroredopenbracket] [mirrored] [\c!right="27E6,\c!left="27E7] + \definemathfence [mirrorednothing] [mirrored] %D A bonus: -\unexpanded\def\Lparent {\math_fenced_fenced_start{parenthesis}} \unexpanded\def\Rparent {\math_fenced_fenced_stop{parenthesis}} -\unexpanded\def\Lbracket {\math_fenced_fenced_start{bracket}} \unexpanded\def\Rbracket {\math_fenced_fenced_stop{bracket}} -\unexpanded\def\Lbrace {\math_fenced_fenced_start{brace}} \unexpanded\def\Rbrace {\math_fenced_fenced_stop{brace}} -\unexpanded\def\Langle {\math_fenced_fenced_start{angle}} \unexpanded\def\Rangle {\math_fenced_fenced_stop{angle}} -\unexpanded\def\Ldoubleangle {\math_fenced_fenced_start{doubleangle}} \unexpanded\def\Rdoubleangle {\math_fenced_fenced_stop{doubleangle}} -\unexpanded\def\Lbar {\math_fenced_fenced_start{bar}} \unexpanded\def\Rbar {\math_fenced_fenced_stop{bar}} -\unexpanded\def\Ldoublebar {\math_fenced_fenced_start{doublebar}} \unexpanded\def\Rdoublebar {\math_fenced_fenced_stop{doublebar}} -\unexpanded\def\Ltriplebar {\math_fenced_fenced_start{triplebar}} \unexpanded\def\Rtriplebar {\math_fenced_fenced_stop{triplebar}} -\unexpanded\def\Lsolidus {\math_fenced_fenced_start{solidus}} \unexpanded\def\Rsolidus {\math_fenced_fenced_stop{solidus}} -\unexpanded\def\Lnothing {\math_fenced_fenced_start{nothing}} \unexpanded\def\Rnothing {\math_fenced_fenced_stop{nothing}} -\unexpanded\def\Lfloor {\math_fenced_fenced_start{floor}} \unexpanded\def\Rfloor {\math_fenced_fenced_stop{floor}} -\unexpanded\def\Lceil {\math_fenced_fenced_start{ceil}} \unexpanded\def\Rceil {\math_fenced_fenced_stop{ceil}} - -\unexpanded\def\Lparentmirrored {\math_fenced_fenced_stop{mirroredparenthesis}} \unexpanded\def\Rparentmirrored {\math_fenced_fenced_start{mirroredparenthesis}} -\unexpanded\def\Lbracketmirrored {\math_fenced_fenced_stop{mirroredbracket}} \unexpanded\def\Rbracketmirrored {\math_fenced_fenced_start{mirroredbracket}} -\unexpanded\def\Lbracemirrored {\math_fenced_fenced_stop{mirroredbrace}} \unexpanded\def\Rbracemirrored {\math_fenced_fenced_start{mirroredbrace}} -\unexpanded\def\Langlemirrored {\math_fenced_fenced_stop{mirroredangle}} \unexpanded\def\Ranglemirrored {\math_fenced_fenced_start{mirroredangle}} -\unexpanded\def\Ldoubleanglemirrored {\math_fenced_fenced_stop{mirroreddoubleangle}} \unexpanded\def\Rdoubleanglemirrored {\math_fenced_fenced_start{mirroreddoubleangle}} -\unexpanded\def\Lbarmirrored {\math_fenced_fenced_stop{mirroredbar}} \unexpanded\def\Rbarmirrored {\math_fenced_fenced_start{mirroredbar}} -\unexpanded\def\Ldoublebarmirrored {\math_fenced_fenced_stop{mirroreddoublebar}} \unexpanded\def\Rdoublebarmirrored {\math_fenced_fenced_start{mirroreddoublebar}} -\unexpanded\def\Ltriplebarmirrored {\math_fenced_fenced_stop{mirroredtriplebar}} \unexpanded\def\Rtriplebarmirrored {\math_fenced_fenced_start{mirroredtriplebar}} -\unexpanded\def\Lsolidusmirrored {\math_fenced_fenced_stop{mirroredsolidus}} \unexpanded\def\Rsolidusmirrored {\math_fenced_fenced_start{mirroredsolidus}} -\unexpanded\def\Lnothingmirrored {\math_fenced_fenced_stop{mirrorednothing}} \unexpanded\def\Rnothingmirrored {\math_fenced_fenced_start{mirrorednothing}} - -%D And another one: +\unexpanded\def\Lparent {\math_fenced_fenced_start{parenthesis}} \unexpanded\def\Rparent {\math_fenced_fenced_stop {parenthesis}} +\unexpanded\def\Lbracket {\math_fenced_fenced_start{bracket}} \unexpanded\def\Rbracket {\math_fenced_fenced_stop {bracket}} +\unexpanded\def\Lbrace {\math_fenced_fenced_start{brace}} \unexpanded\def\Rbrace {\math_fenced_fenced_stop {brace}} +\unexpanded\def\Langle {\math_fenced_fenced_start{angle}} \unexpanded\def\Rangle {\math_fenced_fenced_stop {angle}} +\unexpanded\def\Ldoubleangle {\math_fenced_fenced_start{doubleangle}} \unexpanded\def\Rdoubleangle {\math_fenced_fenced_stop {doubleangle}} +\unexpanded\def\Lbar {\math_fenced_fenced_start{bar}} \unexpanded\def\Rbar {\math_fenced_fenced_stop {bar}} +\unexpanded\def\Ldoublebar {\math_fenced_fenced_start{doublebar}} \unexpanded\def\Rdoublebar {\math_fenced_fenced_stop {doublebar}} +\unexpanded\def\Ltriplebar {\math_fenced_fenced_start{triplebar}} \unexpanded\def\Rtriplebar {\math_fenced_fenced_stop {triplebar}} +\unexpanded\def\Lsolidus {\math_fenced_fenced_start{solidus}} \unexpanded\def\Rsolidus {\math_fenced_fenced_stop {solidus}} +\unexpanded\def\Lfloor {\math_fenced_fenced_start{floor}} \unexpanded\def\Rfloor {\math_fenced_fenced_stop {floor}} +\unexpanded\def\Lceil {\math_fenced_fenced_start{ceil}} \unexpanded\def\Rceil {\math_fenced_fenced_stop {ceil}} +\unexpanded\def\Lmoustache {\math_fenced_fenced_start{moustache}} \unexpanded\def\Rmoustache {\math_fenced_fenced_stop {moustache}} +\unexpanded\def\Luppercorner {\math_fenced_fenced_start{uppercorner}} \unexpanded\def\Ruppercorner {\math_fenced_fenced_stop {uppercorner}} +\unexpanded\def\Llowercorner {\math_fenced_fenced_start{lowercorner}} \unexpanded\def\Rlowercorner {\math_fenced_fenced_stop {lowercorner}} +\unexpanded\def\Lgroup {\math_fenced_fenced_start{group}} \unexpanded\def\Rgroup {\math_fenced_fenced_stop {group}} +\unexpanded\def\Lopenbracket {\math_fenced_fenced_start{openbracket}} \unexpanded\def\Ropenbracket {\math_fenced_fenced_stop {openbracket}} +\unexpanded\def\Lnothing {\math_fenced_fenced_start{nothing}} \unexpanded\def\Rnothing {\math_fenced_fenced_stop {nothing}} + +\unexpanded\def\Lparentmirrored {\math_fenced_fenced_stop {mirroredparenthesis}} \unexpanded\def\Rparentmirrored {\math_fenced_fenced_start{mirroredparenthesis}} +\unexpanded\def\Lbracketmirrored {\math_fenced_fenced_stop {mirroredbracket}} \unexpanded\def\Rbracketmirrored {\math_fenced_fenced_start{mirroredbracket}} +\unexpanded\def\Lbracemirrored {\math_fenced_fenced_stop {mirroredbrace}} \unexpanded\def\Rbracemirrored {\math_fenced_fenced_start{mirroredbrace}} +\unexpanded\def\Langlemirrored {\math_fenced_fenced_stop {mirroredangle}} \unexpanded\def\Ranglemirrored {\math_fenced_fenced_start{mirroredangle}} +\unexpanded\def\Ldoubleanglemirrored {\math_fenced_fenced_stop {mirroreddoubleangle}} \unexpanded\def\Rdoubleanglemirrored {\math_fenced_fenced_start{mirroreddoubleangle}} +\unexpanded\def\Lbarmirrored {\math_fenced_fenced_stop {mirroredbar}} \unexpanded\def\Rbarmirrored {\math_fenced_fenced_start{mirroredbar}} +\unexpanded\def\Ldoublebarmirrored {\math_fenced_fenced_stop {mirroreddoublebar}} \unexpanded\def\Rdoublebarmirrored {\math_fenced_fenced_start{mirroreddoublebar}} +\unexpanded\def\Ltriplebarmirrored {\math_fenced_fenced_stop {mirroredtriplebar}} \unexpanded\def\Rtriplebarmirrored {\math_fenced_fenced_start{mirroredtriplebar}} +\unexpanded\def\Lsolidusmirrored {\math_fenced_fenced_stop {mirroredsolidus}} \unexpanded\def\Rsolidusmirrored {\math_fenced_fenced_start{mirroredsolidus}} +\unexpanded\def\Lfloormirrored {\math_fenced_fenced_stop {mirroredfloor}} \unexpanded\def\Rfloormirrored {\math_fenced_fenced_start{mirroredfloor}} +\unexpanded\def\Lceilmirrored {\math_fenced_fenced_stop {mirroredceil}} \unexpanded\def\Rceilmirrored {\math_fenced_fenced_start{mirroredceil}} +\unexpanded\def\Lmoustachemirrored {\math_fenced_fenced_stop {mirroredmoustache}} \unexpanded\def\Rmoustachemirrored {\math_fenced_fenced_start{mirroredmoustache}} +\unexpanded\def\Luppercornermirrored {\math_fenced_fenced_stop {mirroreduppercorner}} \unexpanded\def\Ruppercornermirrored {\math_fenced_fenced_start{mirroreduppercorner}} +\unexpanded\def\Llowercornermirrored {\math_fenced_fenced_stop {mirroredlowercorner}} \unexpanded\def\Rlowercornermirrored {\math_fenced_fenced_start{mirroredlowercorner}} +\unexpanded\def\Lgroupmirrored {\math_fenced_fenced_stop {mirroredgroup}} \unexpanded\def\Rgroupmirrored {\math_fenced_fenced_start{mirroredgroup}} +\unexpanded\def\Lopenbracketmirrored {\math_fenced_fenced_stop {mirroredopenbracket}} \unexpanded\def\Ropenbracketmirrored {\math_fenced_fenced_start{mirroredopenbracket}} +\unexpanded\def\Lnothingmirrored {\math_fenced_fenced_stop {mirrorednothing}} \unexpanded\def\Rnothingmirrored {\math_fenced_fenced_start{mirrorednothing}} -% \setupmathfences[color=darkgreen] -% % \startformula % \left{ \frac{1}{a} \right} % \left[ \frac{1}{b} \right] @@ -198,6 +219,8 @@ \newconditional\c_math_fenced_done \newconditional\c_math_fenced_unknown \settrue\c_math_fenced_unknown +% maybe use \detokenize ... + \def\math_left {\settrue\c_math_fenced_done \edef\m_math_left{\meaning\nexttoken}% @@ -213,6 +236,21 @@ \edef\m_math_middle{\meaning\nexttoken}% \csname\??mathmiddle\ifcsname\??mathmiddle\m_math_middle\endcsname\m_math_middle\else\s!unknown\fi\endcsname} +\unexpanded\def\lfence#1% + {\settrue\c_math_fenced_done + \edef\m_math_left{\meaning#1}% + \csname\??mathleft\ifcsname\??mathleft\m_math_left\endcsname\m_math_left\else\s!unknown\fi\endcsname} + +\unexpanded\def\rfence#1% + {\settrue\c_math_fenced_done + \edef\m_math_right{\meaning#1}% + \csname\??mathright\ifcsname\??mathright\m_math_right\endcsname\m_math_right\else\s!unknown\fi\endcsname} + +\unexpanded\def\mfence#1% + {\settrue\c_math_fenced_done + \edef\m_math_middle{\meaning#1}% + \csname\??mathmiddle\ifcsname\??mathmiddle\m_math_middle\endcsname\m_math_middle\else\s!unknown\fi\endcsname} + \setvalue{\??mathleft \s!unknown}{\setfalse\c_math_fenced_done\ifconditional\c_math_fenced_unknown\normalleft \nexttoken\fi} \setvalue{\??mathright \s!unknown}{\setfalse\c_math_fenced_done\ifconditional\c_math_fenced_unknown\normalright \nexttoken\fi} \setvalue{\??mathmiddle\s!unknown}{\setfalse\c_math_fenced_done\ifconditional\c_math_fenced_unknown\normalmiddle\nexttoken\fi} @@ -221,75 +259,75 @@ {\expandafter\let\csname\??mathleft \meaning#1\endcsname#2% \expandafter\let\csname\??mathright\meaning#3\endcsname#4} -\expandafter\let\csname\??mathleft \meaning [\endcsname\Lbracket -\expandafter\let\csname\??mathleft \meaning (\endcsname\Lparent -\expandafter\let\csname\??mathleft \meaning <\endcsname\Langle -\expandafter\let\csname\??mathleft \meaning ⟨\endcsname\Langle -\expandafter\let\csname\??mathleft \meaning ⟪\endcsname\Ldoubleangle -\expandafter\let\csname\??mathleft \meaning {\endcsname\Lbrace -\expandafter\let\csname\??mathleft \meaning |\endcsname\Lbar -\expandafter\let\csname\??mathleft \meaning ‖\endcsname\Ldoublebar -\expandafter\let\csname\??mathleft \meaning ⦀\endcsname\Ltriplebar -\expandafter\let\csname\??mathleft \meaning /\endcsname\Lsolidus -\expandafter\let\csname\??mathleft \meaning .\endcsname\Lnothing - -\expandafter\let\csname\??mathright\meaning ]\endcsname\Rbracket -\expandafter\let\csname\??mathright\meaning )\endcsname\Rparent -\expandafter\let\csname\??mathright\meaning >\endcsname\Rangle -\expandafter\let\csname\??mathright\meaning ⟩\endcsname\Rangle -\expandafter\let\csname\??mathright\meaning ⟫\endcsname\Rdoubleangle -\expandafter\let\csname\??mathright\meaning }\endcsname\Rbrace -\expandafter\let\csname\??mathright\meaning |\endcsname\Rbar -\expandafter\let\csname\??mathright\meaning ‖\endcsname\Rdoublebar -\expandafter\let\csname\??mathright\meaning ⦀\endcsname\Rtriplebar -\expandafter\let\csname\??mathright\meaning /\endcsname\Rsolidus -\expandafter\let\csname\??mathright\meaning .\endcsname\Rnothing - -\expandafter\let\csname\??mathright\meaning [\endcsname\Lbracketmirrored -\expandafter\let\csname\??mathright\meaning (\endcsname\Lparentmirrored -\expandafter\let\csname\??mathright\meaning <\endcsname\Langlemirrored -\expandafter\let\csname\??mathright\meaning ⟨\endcsname\Langlemirrored -\expandafter\let\csname\??mathright\meaning ⟪\endcsname\Ldoubleanglemirrored -\expandafter\let\csname\??mathright\meaning {\endcsname\Lbracemirrored -%expandafter\let\csname\??mathright\meaning |\endcsname\Lbarmirrored -%expandafter\let\csname\??mathright\meaning ‖\endcsname\Ldoublebarmirrored -%expandafter\let\csname\??mathright\meaning ⦀\endcsname\Ltriplebarmirrored -\expandafter\let\csname\??mathright\meaning /\endcsname\Lsolidusmirrored -\expandafter\let\csname\??mathright\meaning .\endcsname\Lnothingmirrored - -\expandafter\let\csname\??mathleft \meaning ]\endcsname\Rbracketmirrored -\expandafter\let\csname\??mathleft \meaning )\endcsname\Rparentmirrored -\expandafter\let\csname\??mathleft \meaning >\endcsname\Ranglemirrored -\expandafter\let\csname\??mathleft \meaning ⟩\endcsname\Ranglemirrored -\expandafter\let\csname\??mathleft \meaning ⟫\endcsname\Rdoubleanglemirrored -\expandafter\let\csname\??mathleft \meaning }\endcsname\Rbracemirrored -%expandafter\let\csname\??mathleft \meaning |\endcsname\Rbarmirrored -%expandafter\let\csname\??mathleft \meaning ‖\endcsname\Rdoublebarmirrored -%expandafter\let\csname\??mathleft \meaning ⦀\endcsname\Rtriplebarmirrored -\expandafter\let\csname\??mathleft \meaning /\endcsname\Rsolidusmirrored -\expandafter\let\csname\??mathleft \meaning .\endcsname\Rnothingmirrored - -\expandafter\let\csname\??mathleft \meaning ⌊\endcsname\Lfloor -\expandafter\let\csname\??mathright\meaning ⌋\endcsname\Rfloor -\expandafter\let\csname\??mathleft \meaning ⌈\endcsname\Lceil -\expandafter\let\csname\??mathright\meaning ⌉\endcsname\Rceil +\normalexpanded{\installmathfencepair {|\detokenize {|}} \Ldoublebar {|\detokenize {|}} \Rdoublebar} +\normalexpanded{\installmathfencepair {|\detokenize{||}} \Ltriplebar {|\detokenize{||}} \Rtriplebar} + +\installmathfencepair \bgroup \Lbrace \egroup \Rbrace +\installmathfencepair \egroup \Rbracemirrored \bgroup \Lbracemirrored + +\installmathfencepair . \Lnothing . \Rnothing +\installmathfencepair . \Rnothingmirrored . \Lnothingmirrored + +\installmathfencepair [ \Lbracket ] \Rbracket +\installmathfencepair ] \Rbracketmirrored [ \Lbracketmirrored + +\installmathfencepair ( \Lparent ) \Rparent +\installmathfencepair ) \Rparentmirrored ( \Lparentmirrored + +\installmathfencepair < \Langle > \Rangle +\installmathfencepair > \Ranglemirrored < \Langlemirrored + +\installmathfencepair / \Lsolidus / \Rsolidus +%installmathfencepair / \Rsolidusmirrored / \Lsolidusmirrored + +\installmathfencepair | \Lbar | \Rbar +%installmathfencepair | \Rbarmirrored | \Lbarmirrored + +\installmathfencepair ⌊ \Lfloor ⌋ \Rfloor +\installmathfencepair ⌋ \Rfloormirrored ⌊ \Lfloormirrored +\installmathfencepair ⌈ \Lceil ⌉ \Rceil +\installmathfencepair ⌉ \Rceilmirrored ⌈ \Lceilmirrored + +\installmathfencepair ⟨ \Langle ⟩ \Rangle +\installmathfencepair ⟩ \Ranglemirrored ⟨ \Langlemirrored + +\installmathfencepair ⟪ \Ldoubleangle ⟫ \Rdoubleangle +\installmathfencepair ⟫ \Rdoubleanglemirrored ⟪ \Ldoubleanglemirrored + +\installmathfencepair ‖ \Ldoublebar ‖ \Rdoublebar +%installmathfencepair ‖ \Rdoublebarmirrored ‖ \Ldoublebarmirrored + +\installmathfencepair ⦀ \Ltriplebar ⦀ \Rtriplebar +%installmathfencepair ⦀ \Rtriplebarmirrored ⦀ \Ltriplebarmirrored + +% \installmathfencepair { \Lbrace } \Rbrace +% \installmathfencepair } \Rbracemirrored { \Lbracemirrored % todo paren parent \let\lbrack\lbracket \let\rbrack\rbracket -\installmathfencepair \lbrace \Lbrace \rbrace \Rbrace -\installmathfencepair \lbracket \Lbracket \rbracket \Rbracket -\installmathfencepair \lparen \Lparen \rparen \Rparen -\installmathfencepair \lparent \Lparent \rparent \Rparent -\installmathfencepair \langle \Langle \rangle \Rangle -%installmathfencepair \lrangle \Ldoubleangle \rrangle \Rdoubleangle -%installmathfencepair \lbar \Lbar \rbar \Rbar -\installmathfencepair \vert \Lbar \vert \Rbar -\installmathfencepair \solidus \Lsolidus \solidus \Rsolidus -\installmathfencepair \lfloor \Lfloor \rfloor \Rfloor -\installmathfencepair \lceil \Lceil \rceil \Rceil +\installmathfencepair \lbrace \Lbrace \rbrace \Rbrace +\installmathfencepair \lbracket \Lbracket \rbracket \Rbracket +\installmathfencepair \lparen \Lparen \rparen \Rparen +\installmathfencepair \lparent \Lparent \rparent \Rparent +\installmathfencepair \langle \Langle \rangle \Rangle +\installmathfencepair \lrangle \Ldoubleangle \rrangle \Rdoubleangle +\installmathfencepair \lbar \Lbar \rbar \Rbar +\installmathfencepair \lVert \Ldoublebar \rVert \Rdoublebar +\installmathfencepair \vert \Lbar \vert \Rbar +\installmathfencepair \solidus \Lsolidus \solidus \Rsolidus +\installmathfencepair \lfloor \Lfloor \rfloor \Rfloor +\installmathfencepair \lceil \Lceil \rceil \Rceil + +\installmathfencepair \ulcorner \Luppercorner \ulcorner \Ruppercorner +\installmathfencepair \llcorner \Llowercorner \llcorner \Rlowercorner +\installmathfencepair \lmoustache \Lmoustache \lmoustache \Rmoustache +\installmathfencepair \llbracket \Lopenbracket \llbracket \Ropenbracket +\installmathfencepair \lgroup \Lgroup \lgroup \Rgroup + +% \setupmathfences[color=darkgreen] \unexpanded\def\{{\mathortext\lbrace \letterleftbrace } % or maybe a chardef \unexpanded\def\}{\mathortext\rbrace \letterrightbrace } % or maybe a chardef diff --git a/Master/texmf-dist/tex/context/base/math-ini.mkiv b/Master/texmf-dist/tex/context/base/math-ini.mkiv index d18c66812c0..16efd35a3de 100644 --- a/Master/texmf-dist/tex/context/base/math-ini.mkiv +++ b/Master/texmf-dist/tex/context/base/math-ini.mkiv @@ -603,6 +603,9 @@ \box\scratchbox \endgroup} +\unexpanded\def\mtext#1% + {\text{\usemathematicsstyleandcolor\c!textstyle\c!textcolor#1}} + %D The next hack is needed needed for sine, cosine etc. \let\mathfunction\firstofoneunexpanded @@ -803,6 +806,13 @@ % \activatemathcharacter\primeasciicode +% not needed: +% +% \activatemathcharacter\barasciicode +% \appendtoks +% \let |\letterbar +% \to \everymathematics + % not used: % % \mathcode\spaceasciicode\activemathcharcode diff --git a/Master/texmf-dist/tex/context/base/mult-def.mkiv b/Master/texmf-dist/tex/context/base/mult-def.mkiv index cea2a6a6a1d..b2fc1cfcffa 100644 --- a/Master/texmf-dist/tex/context/base/mult-def.mkiv +++ b/Master/texmf-dist/tex/context/base/mult-def.mkiv @@ -34,6 +34,13 @@ % start todo in mult-def.lua: +\def\v!serifnormal {serifnormal} +\def\v!serifbold {serifbold} +\def\v!sansnormal {sansnormal} +%def\v!sansbold {sansbold} +\def\v!mononormal {mononormal} +\def\v!monobold {monobold} + \def\c!functionstyle {functionstyle} \def\c!functioncolor {functioncolor} diff --git a/Master/texmf-dist/tex/context/base/page-sid.mkiv b/Master/texmf-dist/tex/context/base/page-sid.mkiv index 42c676be5c9..cbee4da20f7 100644 --- a/Master/texmf-dist/tex/context/base/page-sid.mkiv +++ b/Master/texmf-dist/tex/context/base/page-sid.mkiv @@ -661,14 +661,39 @@ \global\settrue\c_page_floats_room \fi} +% \def\page_sides_prepare_space +% {\par +% % no longer needed \whitespace +% \begingroup +% \forgetall +% \reseteverypar +% \verticalstrut +% \vskip-\struttotal +% \endgroup} + +\installtextracker + {sidefloats.anchor} + {\let\page_sides_anchor\page_sides_anchor_yes} + {\let\page_sides_anchor\page_sides_anchor_nop} + +\def\page_sides_anchor_yes + {\darkred + \hskip-5\emwidth + \vrule\s!height.05\exheight\s!depth.05\exheight\s!width10\emwidth} + +\def\page_sides_anchor_nop + {\strut} + +\let\page_sides_anchor\page_sides_anchor_nop + \def\page_sides_prepare_space {\par - % no longer needed \whitespace \begingroup - \forgetall \reseteverypar - \verticalstrut + \dontleavehmode\hbox to \zeropoint{\page_sides_anchor\hss\strut}% + \vskip-\parskip \vskip-\struttotal + \inhibitblank \endgroup} \def\page_sides_handle_float#1% grid (4) is rather experimental diff --git a/Master/texmf-dist/tex/context/base/publ-aut.lua b/Master/texmf-dist/tex/context/base/publ-aut.lua index 4c95d002521..185d99efcec 100644 --- a/Master/texmf-dist/tex/context/base/publ-aut.lua +++ b/Master/texmf-dist/tex/context/base/publ-aut.lua @@ -261,9 +261,7 @@ local function splitauthor(author) end local function splitauthorstring(str) - if str then - -- str = lpegmatch(cleaner,str) - else + if not str or str == "" then return end nofused = nofused + 1 @@ -284,7 +282,7 @@ local function splitauthorstring(str) -- we could cache these too but it can become messy .. leave that for later - local authors = lpegmatch(andsplitter,str) + local authors = lpegmatch(andsplitter,str) or { } -- maybe fake an author local nofauthors = #authors for i=1,nofauthors do authors[i] = splitauthor(authors[i]) @@ -763,7 +761,7 @@ authorhashers.short = function(authors) return concat(t) end else - return utfsub(authors,1,4) + return utfsub(authors,1,3) end end @@ -854,7 +852,7 @@ publications.components.author = components publications.sortmethods.authoryear = { sequence = { - { field = "key", default = "", unknown = "" }, + { field = "key", default = "ZZZZ", unknown = "ZZZZ" }, { field = "author", default = "", unknown = "" }, { field = "year", default = "9998", unknown = "9999" }, -- { field = "suffix", default = " ", unknown = " " }, diff --git a/Master/texmf-dist/tex/context/base/publ-dat.lua b/Master/texmf-dist/tex/context/base/publ-dat.lua index 1e651c45bcd..5d19003ce64 100644 --- a/Master/texmf-dist/tex/context/base/publ-dat.lua +++ b/Master/texmf-dist/tex/context/base/publ-dat.lua @@ -327,30 +327,33 @@ function publications.parenttag(dataset,tag) local parent = tags[1] local current = datasets[dataset] local luadata = current.luadata + local details = current.details local first = luadata[parent] if first then - local combined = first.combined - if not combined then - combined = { } - first.combined = combined + local detail = details[parent] + local children = detail.children + if not children then + children = { } + detail.children = children end -- add new ones but only once for i=2,#tags do local tag = tags[i] - for j=1,#combined do - if combined[j] == tag then + for j=1,#children do + if children[j] == tag then tag = false end end if tag then local entry = luadata[tag] if entry then - combined[#combined+1] = tag - if combined[tag] then - report("error in combination, dataset %a, tag %a, parent %a, ignored %a",dataset,tag,combined[tag],parent) + local detail = details[tag] + children[#children+1] = tag + if detail.parent then + report("error in combination, dataset %a, tag %a, parent %a, ignored %a",dataset,tag,detail.parent,parent) else report("combining, dataset %a, tag %a, parent %a",dataset,tag,parent) - current.combined[tag] = parent + detail.parent = parent end end end @@ -388,7 +391,6 @@ function publications.new(name) -- used specifications }, suffixed = false, - combined = { }, } -- we delay details till we need it (maybe we just delay the -- individual fields but that is tricky as there can be some diff --git a/Master/texmf-dist/tex/context/base/publ-imp-apa.mkvi b/Master/texmf-dist/tex/context/base/publ-imp-apa.mkvi index d2eae8e9bf8..cf35a4b809e 100644 --- a/Master/texmf-dist/tex/context/base/publ-imp-apa.mkvi +++ b/Master/texmf-dist/tex/context/base/publ-imp-apa.mkvi @@ -91,7 +91,12 @@ \definebtx [apa:\s!list:\s!page] [apa:\s!list] - [\c!pagecommand={\wordright}] + [\c!separator:2={,\space}, + \c!separator:3={,\space\btxlabeltext{apa:and}\space}, + \c!separator:4={\space\btxlabeltext{apa:and}\space}, + \c!left={\btxleftparenthesis}, + \c!right={\btxrightparenthesis}, + \c!command={\wordright}] \definebtx [apa:\s!list:numbering] @@ -124,11 +129,18 @@ \definebtx [apa:\s!list:journal] + [apa:\s!list] [\c!style=\v!italic] %command=\btxexpandedjournal] % btxabbreviatedjournal \definebtx + [apa:\s!list:volume] + [apa:\s!list] + [\c!style=\v!italic] + +\definebtx [apa:\s!list:title] + [apa:\s!list] [\c!style=\v!italic, \c!command=\Word, \c!translate=\v!yes] @@ -595,11 +607,15 @@ % The following differs from the default returning n.d. if year is empty +\startsetups btx:apa:nd + \btxlabeltext{apa:nd} +\stopsetups + \startsetups btx:apa:cite:author:year \texdefinition{\s!btx:\s!cite:concat} %\btxparameter\c!left \ifx\currentbtxfirst\empty - \btxlabeltext{apa:nd} + \fastsetup{btx:apa:nd} \else \texdefinition {\s!btx:\s!cite:inject} { \btxcitereference @@ -620,37 +636,15 @@ \fastsetup{btx:apa:cite:author:year} \stopsetups -% The following differs from the default by including the labels p. and pp. +% used in publ-imp-page.mkvi -\startsetups btx:apa:list:page - \fastsetup{\s!btx:\s!page:concat} +\startsetups [btx:apa:list:page-or-pages] \ifx\currentbtxlastpage\empty \btxlabeltext{apa:page} \else \btxlabeltext{apa:pages} \fi \btxnbsp - \ifconditional\btxinteractive - \goto { - \currentbtxfirstpage - } [ - internal(\currentbtxfirstinternal) - ] - \ifx\currentbtxlastpage\empty \else - \btxparameter\c!pageconnector - \goto { - \currentbtxlastpage - } [ - internal(\currentbtxlastinternal) - ] - \fi - \else - \currentbtxfirstpage - \ifx\currentbtxlastpage\empty \else - \btxparameter\c!pageconnector - \currentbtxlastpage - \fi - \fi \stopsetups % The sameauthor feature may not be APA compliant @@ -670,7 +664,6 @@ \c!height=1.5\linewidth]% \linewidth is just too thin with respect to font strokes... \stopsetups - \startsetups [apa:list:sameauthor:\v!empty] \kern\dimexpr\listparameter\c!margin-\interwordspace\relax \stopsetups @@ -717,7 +710,7 @@ \begingroup \language[\mainbtxlanguage] \btxleftbracket - \btxusecommand [apa:list:title:\currentbtxcategory] { + \btxusecommand [apa:\s!list:title:\currentbtxcategory] { \btxflush{#title:\mainbtxlanguage} } \btxrightbracket @@ -727,20 +720,22 @@ \stoptexdefinition \starttexdefinition btx:apa:composed-title #title - \begingroup - \language[\currentbtxlanguage] - \btxusecommand [apa:list:title:\currentbtxcategory] { - \btxflush{#title} - \btxdoif {sub#title} { - \btxcolon - \btxflush{sub#title} + \btxstartstyleandcolor [apa:\s!list:title:\currentbtxcategory] + \begingroup + \language[\currentbtxlanguage] + \btxusecommand [apa:\s!list:title:\currentbtxcategory] { + \btxflush{#title} + \btxdoif {sub#title} { + \btxcolon + \btxflush{sub#title} + } } - } - \endgroup - % which namespace? - %\doif{\btxparameter{translate}}\v!yes { - \texdefinition{btx:apa:translated-title}{#title} - %} + \endgroup + % which namespace? + %\doif{\btxparameter{translate}}\v!yes { + \texdefinition{btx:apa:translated-title}{#title} + %} + \btxstopstyleandcolor \stoptexdefinition \starttexdefinition btx:apa:title @@ -750,14 +745,10 @@ \texdefinition{btx:format:inject} {url(file:\btxflush{file})} { - \btxstartstyleandcolor [apa:list:title:\currentbtxcategory] - \texdefinition{btx:apa:composed-title}{title} - \btxstopstyleandcolor + \texdefinition{btx:apa:composed-title}{title} } } { - \btxstartstyleandcolor [apa:list:title:\currentbtxcategory] - \texdefinition{btx:apa:composed-title}{title} - \btxstopstyleandcolor + \texdefinition{btx:apa:composed-title}{title} } \btxdoif {title} { \btxperiod @@ -869,9 +860,7 @@ \texdefinition{btx:apa:author-or-editor} {editor} } \btxspace - \btxstartstyleandcolor[apa:list:title] - \texdefinition{btx:apa:composed-title} {booktitle} - \btxstopstyleandcolor + \texdefinition{btx:apa:composed-title} {booktitle} \btxperiod } \stoptexdefinition @@ -893,7 +882,7 @@ \doif {\currentbtxcategory} {techreport} { \texdefinition{btx:apa:leftparenthesis-or-comma} \btxdoifelse {type} { - \btxusecommand [apa:list:type] { + \btxusecommand [apa:\s!list:type] { \btxflush{type} } } { @@ -937,26 +926,35 @@ } \stoptexdefinition +\starttexdefinition btx:apa:journal + \btxstartstyleandcolor[apa:\s!list:journal] + \btxusecommand [apa:\s!list:journal] { + \btxflush{journal} + } + \btxstopstyleandcolor +\stoptexdefinition + +\starttexdefinition btx:apa:volume + \btxstartstyleandcolor[apa:\s!list:volume] + \btxflush{volume} + \btxstopstyleandcolor +\stoptexdefinition + % this could be simplified! \starttexdefinition btx:apa:journal-volume-number-pages \btxdoif {journal} { \btxspace - \btxstartstyleandcolor[apa:list:journal] - \btxusecommand [apa:list:journal] { - \btxflush{journal} - } + \texdefinition{btx:apa:journal} \btxdoifelse {volume} { \btxcomma - \btxflush{volume} - \btxstopstyleandcolor + \texdefinition{btx:apa:volume} \btxdoif {number} { %\btxleftparenthesis (\btxflush{number} \btxrightparenthesis } } { - \btxstopstyleandcolor \btxdoif {number} { \btxcomma \btxleftparenthesis @@ -1219,7 +1217,7 @@ \texdefinition{btx:apa:title-if-not-placed} \btxleftparenthesis \btxdoifelse {type} { - \btxusecommand [apa:list:type] { + \btxusecommand [apa:\s!list:type] { \btxflush{type} } } { diff --git a/Master/texmf-dist/tex/context/base/publ-imp-aps.mkvi b/Master/texmf-dist/tex/context/base/publ-imp-aps.mkvi index 11104a7eb5d..9772fbb8751 100644 --- a/Master/texmf-dist/tex/context/base/publ-imp-aps.mkvi +++ b/Master/texmf-dist/tex/context/base/publ-imp-aps.mkvi @@ -83,7 +83,12 @@ \definebtx [aps:\s!list:\s!page] [aps:\s!list] - [\c!left={\space}] + [\c!separator:2={,\space}, + \c!separator:3={,\space\btxlabeltext{aps:and}\space}, + \c!separator:4={\space\btxlabeltext{aps:and}\space}, + \c!left={\btxleftparenthesis}, + \c!right={\btxrightparenthesis}, + \c!command={\wordright}] \definebtx [aps:\s!list:numbering] @@ -114,15 +119,18 @@ \definebtx [aps:\s!list:journal] + [aps:\s!list] [\c!style=\v!italic] %command=\btxexpandedjournal] % btxabbreviatedjournal \definebtx [aps:\s!list:volume] + [aps:\s!list] [\c!style=\v!bold] \definebtx [aps:\s!list:title] + [aps:\s!list] [\c!style=\v!italic, \c!command=\Word] @@ -558,35 +566,15 @@ \fastsetup{btx:aps:cite:author:year} \stopsetups -\startsetups [btx:aps:list:page] - \fastsetup{\s!btx:\s!page:concat} +% used in publ-imp-page.mkvi + +\startsetups [btx:aps:list:page-or-pages] \ifx\currentbtxlastpage\empty \btxlabeltext{aps:page} \else \btxlabeltext{aps:pages} \fi \btxnbsp - \ifconditional\btxinteractive - \goto { - \currentbtxfirstpage - } [ - internal(\currentbtxfirstinternal) - ] - \ifx\currentbtxlastpage\empty \else - \btxparameter\c!pageconnector - \goto { - \currentbtxlastpage - } [ - internal(\currentbtxlastinternal) - ] - \fi - \else - \currentbtxfirstpage - \ifx\currentbtxlastpage\empty \else - \btxparameter\c!pageconnector - \currentbtxlastpage - \fi - \fi \stopsetups %D Instead of texdefinitions without arguments, we could have used setups but in my @@ -610,16 +598,18 @@ %D author or editor or publisher or title or "" \starttexdefinition btx:aps:composed-title #title - \begingroup - \language[\currentbtxlanguage] - \btxusecommand [aps:list:title:\currentbtxcategory] { - \btxflush{#title} - \btxdoif {sub#title} { - \btxcolon - \btxflush{sub#title} + \btxstartstyleandcolor [aps:\s!list:title:\currentbtxcategory] + \begingroup + \language[\currentbtxlanguage] + \btxusecommand [aps:\s!list:title:\currentbtxcategory] { + \btxflush{#title} + \btxdoif {sub#title} { + \btxcolon + \btxflush{sub#title} + } } - } - \endgroup + \endgroup + \btxstopstyleandcolor \stoptexdefinition \starttexdefinition btx:aps:title @@ -629,14 +619,10 @@ \texdefinition{btx:format:inject} {url(file:\btxflush{file})} { - \btxstartstyleandcolor [aps:list:title:\currentbtxcategory] - \texdefinition{btx:aps:composed-title}{title} - \btxstopstyleandcolor + \texdefinition{btx:aps:composed-title}{title} } } { - \btxstartstyleandcolor [aps:list:title:\currentbtxcategory] - \texdefinition{btx:aps:composed-title}{title} - \btxstopstyleandcolor + \texdefinition{btx:aps:composed-title}{title} } \btxcomma } @@ -692,9 +678,7 @@ \texdefinition{btx:aps:author-or-editor} {editor} } \btxspace - \btxstartstyleandcolor[aps:list:title] - \texdefinition{btx:aps:composed-title} {booktitle} - \btxstopstyleandcolor + \texdefinition{btx:aps:composed-title} {booktitle} \btxcomma } \stoptexdefinition @@ -746,11 +730,13 @@ \starttexdefinition btx:aps:journal-volume-year \btxdoif {journal} { - % expandedjournal abbreviatedjournal - \btxflush{expandedjournal -> journal} + \btxstartstyleandcolor [aps:\s!list:journal] + % expandedjournal abbreviatedjournal + \btxflush{expandedjournal -> journal} + \btxstopstyleandcolor \btxdoifelse {volume} { \btxspace - \btxstartstyleandcolor [aps:list:volume] + \btxstartstyleandcolor [aps:\s!list:volume] \btxflush{volume} \btxstopstyleandcolor \btxdoif {number} { @@ -769,10 +755,10 @@ \btxspace \btxflush{pages} } - \btxleftparenthesis - \texdefinition{btx:aps:year} - \btxrightparenthesis } + \btxleftparenthesis + \texdefinition{btx:aps:year} + \btxrightparenthesis \stoptexdefinition \starttexdefinition btx:aps:publisher-wherefrom-year @@ -981,7 +967,9 @@ \btxflush{country} } } - \btxperiod + \btxleftparenthesis + \texdefinition{btx:aps:year} + \btxrightparenthesis \texdefinition{btx:aps:note} \stopsetups @@ -1075,8 +1063,10 @@ \btxdoif {howpublished} { \btxspace \btxflush{howpublished} - \btxperiod } + \btxleftparenthesis + \texdefinition{btx:aps:year} + \btxrightparenthesis \texdefinition{btx:aps:note} \stopsetups @@ -1093,14 +1083,8 @@ % Optional fields: author, title, howpublished, month, year, note. \startsetups btx:aps:list:misc - \texdefinition{btx:aps:author} - \texdefinition{btx:aps:title} - \btxdoif {howpublished} { - \btxspace - \btxflush{howpublished} - \btxperiod - } - \texdefinition{btx:aps:note} + \fastsetup{btx:aps:list:electronic} + % Note that organization is an "ignored" field. \stopsetups % If all else fails to match: diff --git a/Master/texmf-dist/tex/context/base/publ-imp-default.mkvi b/Master/texmf-dist/tex/context/base/publ-imp-default.mkvi index 2fc58ef99c8..73520c7ffd1 100644 --- a/Master/texmf-dist/tex/context/base/publ-imp-default.mkvi +++ b/Master/texmf-dist/tex/context/base/publ-imp-default.mkvi @@ -17,11 +17,6 @@ \startbtxrenderingdefinitions[\s!default] -%?? \definebtx [\s!default:\s!page ] [\s!page] -%?? \definebtx [\s!default:\s!cite ] [\s!cite] -%?? \definebtx [\s!default:\s!list ] [\s!list] -%?? \definebtx [\s!default:\s!author] [\s!author] - \definebtxrendering [\s!default] [\c!specification=\s!default, @@ -56,7 +51,11 @@ \definebtx [\s!default:\s!list:\s!page] [\s!default:\s!list] - [\c!left={\space}] + [\c!separator:2={,\space}, + \c!separator:3={,\space\btxlabeltext{default:and}\space}, + \c!separator:4={\space\btxlabeltext{default:and}\space}, + \c!left={\btxleftparenthesis}, + \c!right={\btxrightparenthesis}] \definebtx [\s!default:\s!list:numbering] diff --git a/Master/texmf-dist/tex/context/base/publ-imp-page.mkvi b/Master/texmf-dist/tex/context/base/publ-imp-page.mkvi index f0b92c88cc5..2d9040b105a 100644 --- a/Master/texmf-dist/tex/context/base/publ-imp-page.mkvi +++ b/Master/texmf-dist/tex/context/base/publ-imp-page.mkvi @@ -13,45 +13,17 @@ \unprotect -\definebtx - [\s!page] % or just outer level - [\c!pagestate=\v!stop, - \c!pageleft=\btxleftparenthesis, % see below!! - \c!pageright=\btxrightparenthesis, - \c!pagesep={,\space}, - \c!lastpagesep={,\space\btxlabeltext{\currentbtxspecification:and}\space}, - \c!finalpagesep={\space\btxlabeltext{\currentbtxspecification:and}\space}, - \c!pageconnector=\endash] - -\definebtx - [\s!page:\s!list] - [\s!page] - [\c!pagecommand={\wordright}] - -\startsetups \s!btx:\s!page:concat +\startsetups \s!btx:\s!list:\s!page:concat \ifcase\currentbtxoverflow - \ifcase\currentbtxconcat - \or % first - \or % second - \btxparameter\c!pagesep - \or % second of two - \btxparameter\c!lastpagesep - \or % last - \btxparameter\c!finalpagesep - \fi + \btxparameter{\c!separator:\number\currentbtxconcat} \fi \stopsetups % for the moment we have only one variant \startsetups [\s!btx:\s!list:\s!page] - \fastsetup{\s!btx:\s!page:concat} - % \ifx\currentbtxlastpage\empty - % p. - % \else - % pp. - % \fi - % \btxnbsp + \fastsetup{\s!btx:\s!list:\s!page:concat} + \fastsetup{\s!btx:\currentbtxspecification:\s!list:page-or-pages} \ifconditional\btxinteractive \goto { \currentbtxfirstpage @@ -59,7 +31,8 @@ internal(\currentbtxfirstinternal) ] \ifx\currentbtxlastpage\empty \else - \btxparameter\c!pageconnector + %\btxparameter\c!pageconnector + \btxparameter\c!range \goto { \currentbtxlastpage } [ @@ -69,7 +42,7 @@ \else \currentbtxfirstpage \ifx\currentbtxlastpage\empty \else - \btxparameter\c!pageconnector + \btxparameter\c!range \currentbtxlastpage \fi \fi diff --git a/Master/texmf-dist/tex/context/base/publ-ini.lua b/Master/texmf-dist/tex/context/base/publ-ini.lua index 04a3f1cc116..4f7dd44130a 100644 --- a/Master/texmf-dist/tex/context/base/publ-ini.lua +++ b/Master/texmf-dist/tex/context/base/publ-ini.lua @@ -486,29 +486,27 @@ local findallused do local tags = not find and settings_to_array(reference) local todo = { } local okay = { } -- only if mark - local set = usedentries[dataset] - local valid = current.luadata + local allused = usedentries[dataset] or { } + local luadata = current.luadata + local details = current.details local ordered = current.ordered - local combined = current.combined if set then local registered = { } local function register(tag) - if registered[tag] then - return - else - registered[tag] = true - end - local entry = set[tag] + local entry = allused[tag] if not entry then - local parent = combined[tag] + local parent = details[tag].parent if parent then - entry = set[parent] + entry = allused[parent] end if entry then report("using reference of parent %a for %a",parent,tag) tag = parent end end + if registered[tag] then + return + end if entry then -- only once in a list but at some point we can have more (if we -- decide to duplicate) @@ -547,6 +545,7 @@ local findallused do okay[#okay+1] = entry end todo[tag] = true + registered[tag] = true return tag end if reference == "*" then @@ -573,7 +572,7 @@ local findallused do else for i=1,#tags do local tag = tags[i] - if valid[tag] then + if luadata[tag] then tag = register(tag) tags[i] = tag elseif not reported[tag] then @@ -589,7 +588,7 @@ local findallused do local entry = ordered[i] if find(entry) then local tag = entry.tag - local parent = combined[tag] + local parent = details[tag].parent if parent then tag = parent end @@ -604,12 +603,12 @@ local findallused do else for i=1,#tags do local tag = tags[i] - local parent = combined[tag] + local parent = details[tag].parent if parent then tag = parent tags[i] = tag end - if valid[tag] then + if luadata[tag] then todo[tag] = true elseif not reported[tag] then reported[tag] = true @@ -1549,7 +1548,7 @@ do function publications.loaddefinitionfile(name) -- a more specific name resolvers.uselibrary { - name = string.gsub(name,"^publ%-",""), + name = gsub(name,"^publ%-",""), patterns = patterns, action = action, failure = failure, @@ -1563,7 +1562,7 @@ do function publications.loadreplacementfile(name) -- a more specific name resolvers.uselibrary { - name = string.gsub(name,"^publ%-",""), + name = gsub(name,"^publ%-",""), patterns = patterns, action = publications.loaders.registercleaner, failure = failure, @@ -1825,7 +1824,6 @@ do local current = datasets[dataset] local luadata = current.luadata local details = current.details - local combined = current.combined local newlist = { } local lastreferencenumber = groups[group] -- current.lastreferencenumber or 0 for i=1,#list do @@ -1847,51 +1845,36 @@ do else list = newlist end --- local combined = { } - local newlist = { } --- for i=1,#list do --- local userdata = list[i][4] --- if userdata then --- local com = userdata.btxcom --- if com then --- com = settings_to_array(com) --- for i=1,#com do --- local c = com[i] --- if not combined[c] then --- report("ignoring list entry for tag %a due to combined usage in %a ",c,tag) --- combined[c] = true --- end --- end --- end --- end --- end - local tagtolistindex = { } + local newlist = { } + local tagtolistindex = { } rendering.tagtolistindex = tagtolistindex for i=1,#list do local li = list[i] local tag = li[1] - if not combined[tag] then - local entry = luadata[tag] - if entry then - local detail = details[tag] - if detail then - local referencenumber = detail.referencenumber - if not referencenumber then - lastreferencenumber = lastreferencenumber + 1 - referencenumber = lastreferencenumber - detail.referencenumber = lastreferencenumber - end - li[3] = referencenumber - else - report("missing details for tag %a in dataset %a (enhanced: %s)",tag,dataset,current.enhanced and "yes" or "no") - -- weird, this shouldn't happen .. all have a detail - lastreferencenumber = lastreferencenumber + 1 - details[tag] = { referencenumber = lastreferencenumber } - li[3] = lastreferencenumber + local entry = luadata[tag] + if entry then + local detail = details[tag] + if not detail then + -- fatal error + report("fatal error, missing details for tag %a in dataset %a (enhanced: %s)",tag,dataset,current.enhanced and "yes" or "no") + -- lastreferencenumber = lastreferencenumber + 1 + -- details[tag] = { referencenumber = lastreferencenumber } + -- li[3] = lastreferencenumber + -- tagtolistindex[tag] = i + -- newlist[#newlist+1] = li + elseif detail.parent then + -- skip this one + else + local referencenumber = detail.referencenumber + if not referencenumber then + lastreferencenumber = lastreferencenumber + 1 + referencenumber = lastreferencenumber + detail.referencenumber = lastreferencenumber end + li[3] = referencenumber tagtolistindex[tag] = i + newlist[#newlist+1] = li end - newlist[#newlist+1] = li end end groups[group] = lastreferencenumber @@ -2108,10 +2091,10 @@ do ctx_btxstartlistentry() ctx_btxsetcurrentlistentry(i) -- redundant ctx_btxsetcurrentlistindex(listindex or 0) - local combined = entry.combined + local children = detail.children local language = entry.language - if combined then - ctx_btxsetcombis(concat(combined,",")) + if children then + ctx_btxsetcombis(concat(children,",")) end ctx_btxsetcategory(entry.category or "unknown") ctx_btxsettag(tag) @@ -2513,7 +2496,7 @@ do language = ldata.language, dataset = dataset, tag = tag, - combis = entry.userdata.btxcom, + -- combis = entry.userdata.btxcom, -- luadata = ldata, } setter(data,dataset,tag,entry) @@ -2560,10 +2543,10 @@ do if language then ctx_btxsetlanguage(language) end -local combis = entry.combis -if combis then - ctx_btxsetcombis(combis) -end + -- local combis = entry.combis + -- if combis then + -- ctx_btxsetcombis(combis) + -- end if not getter(entry,last,nil,specification) then ctx_btxsetfirst("") -- (f_missing(tag)) end diff --git a/Master/texmf-dist/tex/context/base/publ-ini.mkiv b/Master/texmf-dist/tex/context/base/publ-ini.mkiv index 6d57a233d02..2d55832f9c2 100644 --- a/Master/texmf-dist/tex/context/base/publ-ini.mkiv +++ b/Master/texmf-dist/tex/context/base/publ-ini.mkiv @@ -624,20 +624,16 @@ \setbtxlist % probably already set \btx_reset_page \setbtxparameterset\s!list\s!page - \btxparameter\c!pagecommand + \btxparameter\c!command {\usebtxstyleandcolor\c!style\c!color - \btxparameter\c!pageleft + \btxparameter\c!left \clf_btxflushpages{\currentbtxdataset}{\currentbtxtag}% - \btxparameter\c!pageright}% + \btxparameter\c!right}% \endgroup} -\unexpanded\def\btxpagesetup#1% nothing yet +\unexpanded\def\btxpagesetup#1% there will b eno left|right|command|style at this inner level {\begingroup - %\setbtxparameterset{\c!page:\s!default}\currentbtxnumbering - \btxparameter\c!left - % \btxparameter\c!command{\publ_fast_setup\plusfive\s!list\s!page}% \publ_fast_setup\plusfive\s!list\s!page - \btxparameter\c!right \endgroup \btx_reset_page} % probably not needed @@ -655,6 +651,7 @@ \unexpanded\def\btx_entry_inject {\begingroup + \redoconvertfont % see (**) in strc-lst, this will become an configuration option \edef\currentbtxcategory{\btxfield{category}}% \ignorespaces \ifconditional\c_btx_list_texts @@ -1361,6 +1358,12 @@ \let\nocite \btxnocitation \let\nocitation\btxnocitation +\unexpanded\def\cite {\doifelsenextoptionalcs\btxcitation \btxdirectcite} +\unexpanded\def\nocite{\doifelsenextoptionalcs\btxnocitation\btxdirectnocite} + +\unexpanded\def\btxdirectcite #1{\btxcitation [#1]\relax} % no optional arguments +\unexpanded\def\btxdirectnocite#1{\btxnocitation[#1]\relax} % no optional arguments + %D Setup helpers, beware, we need to wrap this .. now we need to know %D how setups are implemented. @@ -1738,8 +1741,6 @@ %\c!saveinlist=\v!no, % maybe for before/after \c!textstate=\v!start, \c!width=\v!auto, - %\c!pageright=, - %\c!pageleft=, \c!separator={;\space}, \c!distance=1.5\emwidth] @@ -1771,7 +1772,8 @@ \c!separator:names:4=\btxparameter{\c!separator:2}, % between only two names \c!separator:2={;\space}, % aka pubsep - separates multiple objects \c!separator:3=\btxparameter{separator:2}, % before last object in a list - \c!separator:4=\btxparameter{separator:2}] % between only two objects + \c!separator:4=\btxparameter{separator:2}, % between only two objects + \c!pagestate=\v!stop] % Do we want these in the format? Loading them delayed is somewhat messy. diff --git a/Master/texmf-dist/tex/context/base/status-files.pdf b/Master/texmf-dist/tex/context/base/status-files.pdf Binary files differindex a1f5582c450..bc804670a3d 100644 --- a/Master/texmf-dist/tex/context/base/status-files.pdf +++ b/Master/texmf-dist/tex/context/base/status-files.pdf diff --git a/Master/texmf-dist/tex/context/base/status-lua.pdf b/Master/texmf-dist/tex/context/base/status-lua.pdf Binary files differindex 7903adbdca5..99c615fd951 100644 --- a/Master/texmf-dist/tex/context/base/status-lua.pdf +++ b/Master/texmf-dist/tex/context/base/status-lua.pdf diff --git a/Master/texmf-dist/tex/context/base/strc-flt.mkvi b/Master/texmf-dist/tex/context/base/strc-flt.mkvi index 76b587f09f2..cf75d3338c2 100644 --- a/Master/texmf-dist/tex/context/base/strc-flt.mkvi +++ b/Master/texmf-dist/tex/context/base/strc-flt.mkvi @@ -981,6 +981,12 @@ \setvalue{\??floatmovement+\v!hang}{\strc_floats_move_down_hang\plusone} \setvalue{\??floatmovement-\v!hang}{\strc_floats_move_down_hang\minusone} +\setvalue{\??floatmovement-2*\v!line}{\strc_floats_move_down_line{-2}} +\setvalue{\??floatmovement+2*\v!line}{\strc_floats_move_down_line{2}} +\setvalue{\??floatmovement 2*\v!line}{\strc_floats_move_down_line{2}} + +\unexpanded\def\installfloatmovement#1#2{\setvalue{\??floatmovement#1}{#2}} + \def\strc_floats_move_down#setting% {\csname\??floatmovement \ifcsname\??floatmovement#setting\endcsname#setting\fi diff --git a/Master/texmf-dist/tex/context/base/strc-lst.lua b/Master/texmf-dist/tex/context/base/strc-lst.lua index 4c9a7217e7e..fd79bbd7a9c 100644 --- a/Master/texmf-dist/tex/context/base/strc-lst.lua +++ b/Master/texmf-dist/tex/context/base/strc-lst.lua @@ -1210,8 +1210,8 @@ implement { } implement { - name = "savedlistprefixednumber", - actions = savedlistprefixednumber, + name = "savedlistprefixednumber", + actions = savedlistprefixednumber, arguments = { "string", "integer" } } diff --git a/Master/texmf-dist/tex/context/base/strc-lst.mkvi b/Master/texmf-dist/tex/context/base/strc-lst.mkvi index 803e6b813fb..71fc0982964 100644 --- a/Master/texmf-dist/tex/context/base/strc-lst.mkvi +++ b/Master/texmf-dist/tex/context/base/strc-lst.mkvi @@ -339,6 +339,10 @@ \def\currentlistmethod {entry} % typesetting \def\currentlistindex {0} % typesetting (maybe also a real counter) +\unexpanded\def\savedlistnumber #1#2{\clf_savedlistnumber {#1}\numexpr#2\relax} +\unexpanded\def\savedlisttitle #1#2{\clf_savedlisttitle {#1}\numexpr#2\relax} +\unexpanded\def\savedlistprefixednumber#1#2{\clf_savedlistprefixednumber{#1}\numexpr#2\relax} + \def\structurelistlocation {\clf_listlocation\numexpr\currentlistindex\relax} @@ -773,7 +777,7 @@ % better is to use a special list entry but we keep this for compatibility \let\\=\space % so expanding this token register has to come *after* the font switch - \dontconvertfont + \dontconvertfont % (**) this has to become an option (see publ) \to \t_lists_every_renderingtext \appendtoks diff --git a/Master/texmf-dist/tex/context/base/tabl-xtb.mkvi b/Master/texmf-dist/tex/context/base/tabl-xtb.mkvi index 876abef8c8f..a8f205f4a2e 100644 --- a/Master/texmf-dist/tex/context/base/tabl-xtb.mkvi +++ b/Master/texmf-dist/tex/context/base/tabl-xtb.mkvi @@ -351,7 +351,8 @@ % in text flow: headers and footers only once \setvalue{\??xtableflushsplit\v!no}% - {\noindent % \dontleavehmode % else no leftskip etc + {\noindentation % better than \noindent (no \dontleavehmode here) % else no leftskip etc + %\ignorespaces \clf_x_table_flush method {\v!normal}% \relax diff --git a/Master/texmf-dist/tex/context/base/x-asciimath.lua b/Master/texmf-dist/tex/context/base/x-asciimath.lua index 932c9a1b470..efa6a7736d6 100644 --- a/Master/texmf-dist/tex/context/base/x-asciimath.lua +++ b/Master/texmf-dist/tex/context/base/x-asciimath.lua @@ -714,16 +714,19 @@ for k, v in next, characters.data do reserved[name] = { true, utfchar(k) } end local spec = v.mathspec --- if spec then --- for i=1,#spec do --- local name = spec[i].name --- if name and not reserved[name] then --- reserved[name] = { true, utfchar(k) } --- end --- end --- end + -- if spec then + -- for i=1,#spec do + -- local name = spec[i].name + -- if name and not reserved[name] then + -- reserved[name] = { true, utfchar(k) } + -- end + -- end + -- end end +reserved.P = nil +reserved.S = nil + local isbinary = { ["\\frac"] = true, ["\\root"] = true, @@ -954,18 +957,9 @@ for k, v in sortedhash(reserved) do k_reserved_different[#k_reserved_different+1] = k end end - -for k, v in next, entities do - if not k_unicode[k] then - k_unicode[k] = v - k_unicode["\\"..k] = v + if not find(k,"[^[a-zA-Z]+$]") then + k_unicode["\\"..k] = k -- dirty trick, no real unicode end -end - -if not find(k,"[^[a-zA-Z]+$]") then - k_unicode["\\"..k] = k -- dirty trick, no real unicode -end - if not find(k,"[^a-zA-Z]") then k_reserved_words[#k_reserved_words+1] = k end @@ -978,6 +972,8 @@ local p_reserved = local p_unicode = lpeg.utfchartabletopattern(table.keys(k_unicode)) / k_unicode +-- inspect(k_reserved_different) + local p_texescape = patterns.texescape local function texescaped(s) @@ -1027,8 +1023,8 @@ local m_right = { ["]"] = s_rbracket, ["}"] = s_rbrace, ["⟩"] = s_rangle, - ["⌉"] = s_rceil, - ["⌋"] = s_rfloor, + ["⌉"] = s_rceil, + ["⌋"] = s_rfloor, -- [">>"] = s_rangle, -- why not :> -- ["~|"] = s_rceil, @@ -1085,12 +1081,6 @@ local p_special = -- open | close :: {: | :} --- local e_parser = Cs ( ( --- p_entity + --- p_utf_base --- )^0 ) - - local u_parser = Cs ( ( patterns.doublequoted + P("text") * p_spaces^0 * P("(") * (1-P(")"))^0 * P(")") + -- -- todo: balanced @@ -1122,9 +1112,8 @@ local function show_state(t,level,state) report_asciimath(serialize(t,f_state(level,state))) end -local function show_result(original,entified,unicoded,texcoded) +local function show_result(original,unicoded,texcoded) report_asciimath("original > %s",original) - report_asciimath("entified > %s",entified) report_asciimath("unicoded > %s",unicoded) report_asciimath("texcoded > %s",texcoded) end @@ -1298,9 +1287,10 @@ local function collapse_signs(t) if isunary[current] then local one = t[i+1] if not one then - m = m + 1 +-- m = m + 1 t[m] = current .. "{}" -- error - break +return t +-- break end if type(one) == "table" then if isleft[one[1]] and isright[one[#one]] then @@ -1368,7 +1358,8 @@ local function collapse_binaries(t) local two = t[i+2] if not one then t[m] = current .. "{}{}" -- error - break +return t +-- break end if type(one) == "table" then if isleft[one[1]] and isright[one[#one]] then @@ -1379,7 +1370,8 @@ local function collapse_binaries(t) end if not two then t[m] = current .. "{" .. one .. "}{}" - break +return t +-- break end if type(two) == "table" then if isleft[two[1]] and isright[two[#two]] then @@ -1665,11 +1657,10 @@ local ctx_type = context and context.type or function() end local ctx_inleft = context and context.inleft or function() end local function convert(str,totex) - local entified = str -- lpegmatch(e_parser,str) or str -- when used in text - local unicoded = lpegmatch(u_parser,entified) or entified + local unicoded = lpegmatch(u_parser,str) or str local texcoded = collapse(lpegmatch(a_parser,unicoded)) if trace_mapping then - show_result(str,entified,unicoded,texcoded) + show_result(str,unicoded,texcoded) end if totex then ctx_mathematics(texcoded) @@ -1817,16 +1808,24 @@ asciimath.cleanedup = cleanedup -- sin(x) = 1 : 3.3 uncached 1.2 cached , so no real gain (better optimize the converter then) +local uncrapped = { + ["%"] = "\\mathpercent", + ["&"] = "\\mathampersand", + ["#"] = "\\mathhash", + ["$"] = "\\mathdollar", + ["^"] = "\\Hat{\\enspace}", -- terrible hack ... tex really does it sbest to turn any ^ into a superscript + ["_"] = "\\underline{\\enspace}", +} + local function convert(str) if #str > 0 then - local entified = str -- lpegmatch(e_parser,str) or str -- when used in text - local unicoded = lpegmatch(u_parser,entified) or entified + local unicoded = lpegmatch(u_parser,str) or str if lpegmatch(p_onechar,unicoded) then - ctx_mathematics(unicoded) + ctx_mathematics(uncrapped[unicoded] or unicoded) else local texcoded = collapse(lpegmatch(a_parser,unicoded)) if trace_mapping then - show_result(str,entified,unicoded,texcoded) + show_result(str,unicoded,texcoded) end if #texcoded == 0 then report_asciimath("error in asciimath: %s",str) @@ -1843,6 +1842,7 @@ local function convert(str) end end + local context = context if not context then @@ -1855,6 +1855,10 @@ if not context then -- report_asciimath(cleanedup([[a "α" b]])) -- report_asciimath(cleanedup([[//4]])) +-- convert([[\^{1/5}log]]) +-- convert("sqrt") +-- convert("^") + -- convert("\\frac{a}{b}") -- convert("frac{a}{b}") -- convert("\\sin{a}{b}") @@ -2087,5 +2091,3 @@ end function show.save(name) table.save(name ~= "" and name or "dummy.lua",collected) end - --- inspect(sortedkeys(reserved)) diff --git a/Master/texmf-dist/tex/context/base/x-calcmath.lua b/Master/texmf-dist/tex/context/base/x-calcmath.lua index 1394f34504c..c96d8d0ac51 100644 --- a/Master/texmf-dist/tex/context/base/x-calcmath.lua +++ b/Master/texmf-dist/tex/context/base/x-calcmath.lua @@ -16,6 +16,8 @@ local calcmath = { } local moduledata = moduledata or { } moduledata.calcmath = calcmath +local context = context + local list_1 = { "median", "min", "max", "round", "ln", "log", "sin", "cos", "tan", "sinh", "cosh", "tanh" @@ -46,8 +48,8 @@ local function freeze() for k=1,#list_2 do local v = list_2[k] list_2_1[v .. "%((.-),(.-),(.-)%)"] = "\\" .. upper(v) .. "^{%1}_{%2}{%3}" - list_2_2[v .. "%((.-),(.-)%)"] = "\\" .. upper(v) .. "^{%1}{%2}" - list_2_3[v .. "%((.-)%)"] = "\\" .. upper(v) .. "{%1}" + list_2_2[v .. "%((.-),(.-)%)"] = "\\" .. upper(v) .. "^{%1}{%2}" + list_2_3[v .. "%((.-)%)"] = "\\" .. upper(v) .. "{%1}" end for k=1,#list_4 do local v = list_4[k] @@ -192,7 +194,6 @@ if false then -- Df Dg {\rm f}^{\prime} -- f() g() {\rm f}() - -- valid utf8 local S, P, R, C, V, Cc, Ct = lpeg.S, lpeg.P, lpeg.R, lpeg.C, lpeg.V, lpeg.Cc, lpeg.Ct |