From 659b8f28e591006b6d0669c05d809d6ccf60cec0 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Thu, 5 Jan 2023 20:22:55 +0100 Subject: 2023-01-05 17:46:00 --- .../general/manuals/luametafun/luametafun-mesh.tex | 2 + .../sources/general/manuals/math/math-mkiv.tex | 1 + .../sources/general/manuals/math/math-notdone.tex | 139 ++++++++++++++ metapost/context/base/mpxl/mp-mlib.mpxl | 26 ++- scripts/context/lua/mtxrun.lua | 6 +- scripts/context/stubs/mswin/mtxrun.lua | 6 +- scripts/context/stubs/unix/mtxrun | 6 +- scripts/context/stubs/win64/mtxrun.lua | 6 +- source/luametatex/source/luarest/lmtbasexxlib.c | 2 +- source/luametatex/source/tex/texmaincontrol.c | 17 +- source/luametatex/source/tex/texmath.c | 64 +++---- tex/context/base/mkii/cont-new.mkii | 2 +- tex/context/base/mkii/context.mkii | 2 +- tex/context/base/mkii/mult-fr.mkii | 1 + tex/context/base/mkiv/cont-new.mkiv | 2 +- tex/context/base/mkiv/context.mkiv | 2 +- tex/context/base/mkiv/grph-raw.lua | 7 +- tex/context/base/mkiv/status-files.pdf | Bin 24596 -> 24606 bytes tex/context/base/mkiv/status-lua.pdf | Bin 264787 -> 264792 bytes tex/context/base/mkiv/util-tab.lua | 2 +- tex/context/base/mkxl/cont-new.mkxl | 2 +- tex/context/base/mkxl/context.mkxl | 2 +- tex/context/base/mkxl/lpdf-grp.lmt | 201 +++++++++++++++------ tex/context/base/mkxl/lpdf-lmt.lmt | 5 +- tex/context/base/mkxl/meta-ini.mkxl | 2 +- tex/context/base/mkxl/mlib-pps.lmt | 25 ++- tex/context/base/mkxl/mlib-pps.mkxl | 17 ++ tex/context/base/mkxl/spac-chr.lmt | 9 + tex/context/base/mkxl/syst-aux.mkxl | 14 +- tex/context/base/mkxl/tabl-tbl.mkxl | 5 +- tex/context/interface/mkii/keys-fr.xml | 1 + tex/context/modules/mkxl/m-tikz-pgfplots.tex | 46 +++++ tex/context/modules/mkxl/m-tikz-pgfplotstable.tex | 12 ++ tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 34 files changed, 475 insertions(+), 161 deletions(-) create mode 100644 doc/context/sources/general/manuals/math/math-notdone.tex create mode 100644 tex/context/modules/mkxl/m-tikz-pgfplots.tex create mode 100644 tex/context/modules/mkxl/m-tikz-pgfplotstable.tex diff --git a/doc/context/sources/general/manuals/luametafun/luametafun-mesh.tex b/doc/context/sources/general/manuals/luametafun/luametafun-mesh.tex index 98b9a86b7..e70514dba 100644 --- a/doc/context/sources/general/manuals/luametafun/luametafun-mesh.tex +++ b/doc/context/sources/general/manuals/luametafun/luametafun-mesh.tex @@ -3,6 +3,8 @@ \environment luametafun-style \environment luametafun-mesh-examples +% runtime + \doiffileelse{luatex-mesh-examples.pdf} { % okay } { diff --git a/doc/context/sources/general/manuals/math/math-mkiv.tex b/doc/context/sources/general/manuals/math/math-mkiv.tex index ad842a618..a816b7915 100644 --- a/doc/context/sources/general/manuals/math/math-mkiv.tex +++ b/doc/context/sources/general/manuals/math/math-mkiv.tex @@ -47,6 +47,7 @@ \component math-grouping \ifcase \contextlmtxmode \else \component math-fun + % \component math-notdone \fi \stopbodymatter diff --git a/doc/context/sources/general/manuals/math/math-notdone.tex b/doc/context/sources/general/manuals/math/math-notdone.tex new file mode 100644 index 000000000..757cebbe2 --- /dev/null +++ b/doc/context/sources/general/manuals/math/math-notdone.tex @@ -0,0 +1,139 @@ +% language=us runpath=texruns:manuals/math + +\environment math-layout + +% goes to oddities + +\startcomponent math-notdone + +\startchapter[title=Why we don't do this] + +The \TEX\ engine has two math modes: inline and display. What exactly happens +before we do that depends on what mode we are in. + +\startitemize + \startitem + When we are in horizontal mode, single dollar signs makes us go into + inline math mode. Double dollars on the other hand trigger display math + and one of the first things that does is flush the current vertical list + contributions. As we are in horizontal mode it is likely that something + shows up. + \stopitem + \startitem + When we are in vertical mode the engine will trigger a new paragraph in + the hard way: the initial par state node gets added as well as the + indentation and everything that \type {\everypar} likes to inject. Inline + math then stays inline but display math starts out with flushing the + current paragraph and that happens to be the state, indentation and + everything else injected at the beginning. Often nothing is sees, just + an empty line sits there. + \stopitem + \startitem + In math mode the engine will check if we ended the right way and then + render and inject the formula. + \stopitem +\stopitemize + +Especially the second case is tricky. The \quote {empty} line is placed with +proper \type {\parskip}, \type {\parindent} and whatever. That can end up with a +lot of supposedly whitespace of which is not really clear (for the user) what +comes from where: interline space, whitespace, line height, display spacing, etc. +To that you can add that empty lines are special themselves: in \MKII\ we relax +\type {\par}, in \MKIV\ we setup {\LUATEX} to accept \type {\par} equivalents and +\LUAMETATEX\ has no checks at all. \footnote {The same can be told about \type +{\outer}.} + +Before We show some examples of this we have to make clear that \CONTEXT\ users +don't do this have to worry about all this. We don't follow the (Plain and +\LATEX) \AMS\ policy of \quotation {no empty lines before display math} and +\quotation {no empty lines in display math}. We don't even use the display skip +parameters and we do compensate for these empty line issues. The basics haven't +changed between \MKII, \MKIV\ and \LMTX\ but it has become leaner and meaner deep +down. We could actually remove display mode (not to be confused with \type +{\displaystyle}) from the engine but then we could not show the examples below. + +\startbuffer[zero] +\dorecurse{10}{test #1 } +\startformula + x = \the\mathdisplayskipmode + \the\mathdisplaymode +\stopformula +\dorecurse{10}{test #1 } +\stopbuffer + +\startbuffer[one] +\dorecurse{10}{test #1 } \par +$$ x = \the\mathdisplayskipmode + \the\mathdisplaymode $$ \par +\dorecurse{10}{test #1 } \par +\stopbuffer + +\startbuffer[two] +\dorecurse{10}{test #1 } +$$ x = \the\mathdisplayskipmode + \the\mathdisplaymode $$ +\dorecurse{10}{test #1 } +\stopbuffer + +We use this as example: + +\typebuffer[one] + +as well as this: + +\typebuffer[two] + +In \CONTEXT\ one does this: + +\typebuffer[zero] + +and get: + +{\showmakeup[line] \getbuffer[zero]} + +% \predisplaysize + +For the examples with dollars we use this setup: + +\startbuffer[setup] +\everypar {!} +\mathdisplaymode 0 +\normalizelinemode 0 +\parindent 30pt +\parskip 40pt +\abovedisplayskip 20pt +\belowdisplayskip \abovedisplayskip +\abovedisplayshortskip \abovedisplayskip +\belowdisplayshortskip \abovedisplayshortskip +\stopbuffer + +\typebuffer[setup] + +We make sure that we get something typeset when we start a paragraph, just in +order that we don't necessarily get empty lines: there can be many. The two modes +make sure that we operate in regular \TEX\ mode, the way other macro packages do. + +First we show what we get with \typ {\mathdisplayskipmode 1}. This makes the +engine behave like other engines. We don't show what we get with \typ +{\mathdisplayskipmode 2} where zero skips are ignored but we don't have these +here. Last we show what we get with \typ {\mathdisplayskipmode 3}. In this +example the math specific skips are completely ignored. + +In both shown cases you will notice that the \type {\parskip} and \type +{\baselineskip} interfere which in turn demonstrates why in \CONTEXT\ we always +did things differently. It is possible to enhance the engine to deal with this +but because in \CONTEXT\ we don't need it and because it is unlikely that other +macro packages will use it no time will be wasted on this. + +\startbuffer +\page +\start +\showmakeup[line] +\getbuffer[setup,one,two] +\stop +\page +\stopbuffer + +{\mathdisplayskipmode 1 \getbuffer} +{\mathdisplayskipmode 3 \getbuffer} + +\stopchapter + +\stopcomponent diff --git a/metapost/context/base/mpxl/mp-mlib.mpxl b/metapost/context/base/mpxl/mp-mlib.mpxl index 411095e5d..26aacb35d 100644 --- a/metapost/context/base/mpxl/mp-mlib.mpxl +++ b/metapost/context/base/mpxl/mp-mlib.mpxl @@ -1371,13 +1371,25 @@ permanent verbatim ; % New -def bitmapimage(expr xresolution, yresolution, data) = - image ( - addto currentpicture doublepath unitsquare - withprescript "bm_xresolution=" & decimal xresolution - withprescript "bm_yresolution=" & decimal yresolution - withpostscript data ; - ) +% def bitmapimage(expr xresolution, yresolution, data) = +% image ( +% addto currentpicture doublepath unitsquare +% withprescript "bm_xresolution=" & decimal xresolution +% withprescript "bm_yresolution=" & decimal yresolution +% withpostscript data ; +% ) +% enddef ; + +vardef bitmapimage(expr xresolution, yresolution, data) = + save p ; picture p ; p := nullpicture ; + addto p doublepath unitsquare +% xscaled xresolution +% yscaled yresolution + withprescript "bm_xresolution=" & decimal xresolution + withprescript "bm_yresolution=" & decimal yresolution + withpostscript data + ; + p enddef ; permanent bitmapimage ; diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 4cd71b7a1..179111edf 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -7499,7 +7499,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-tab"] = package.loaded["util-tab"] or true --- original size: 34149, stripped down to: 18420 +-- original size: 34148, stripped down to: 18419 if not modules then modules={} end modules ['util-tab']={ version=1.001, @@ -7837,7 +7837,7 @@ else local v=t[0] if v then m=m+1 - r[m]="[0]='" + r[m]="[0]=" if type(v)=="table" then fastserialize(v) else @@ -26070,7 +26070,7 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua libs-ini.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1034829 +-- original bytes : 1034828 -- stripped bytes : 407834 -- end library merge diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index 4cd71b7a1..179111edf 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -7499,7 +7499,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-tab"] = package.loaded["util-tab"] or true --- original size: 34149, stripped down to: 18420 +-- original size: 34148, stripped down to: 18419 if not modules then modules={} end modules ['util-tab']={ version=1.001, @@ -7837,7 +7837,7 @@ else local v=t[0] if v then m=m+1 - r[m]="[0]='" + r[m]="[0]=" if type(v)=="table" then fastserialize(v) else @@ -26070,7 +26070,7 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua libs-ini.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1034829 +-- original bytes : 1034828 -- stripped bytes : 407834 -- end library merge diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index 4cd71b7a1..179111edf 100644 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -7499,7 +7499,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-tab"] = package.loaded["util-tab"] or true --- original size: 34149, stripped down to: 18420 +-- original size: 34148, stripped down to: 18419 if not modules then modules={} end modules ['util-tab']={ version=1.001, @@ -7837,7 +7837,7 @@ else local v=t[0] if v then m=m+1 - r[m]="[0]='" + r[m]="[0]=" if type(v)=="table" then fastserialize(v) else @@ -26070,7 +26070,7 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua libs-ini.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1034829 +-- original bytes : 1034828 -- stripped bytes : 407834 -- end library merge diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua index 4cd71b7a1..179111edf 100644 --- a/scripts/context/stubs/win64/mtxrun.lua +++ b/scripts/context/stubs/win64/mtxrun.lua @@ -7499,7 +7499,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-tab"] = package.loaded["util-tab"] or true --- original size: 34149, stripped down to: 18420 +-- original size: 34148, stripped down to: 18419 if not modules then modules={} end modules ['util-tab']={ version=1.001, @@ -7837,7 +7837,7 @@ else local v=t[0] if v then m=m+1 - r[m]="[0]='" + r[m]="[0]=" if type(v)=="table" then fastserialize(v) else @@ -26070,7 +26070,7 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua libs-ini.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1034829 +-- original bytes : 1034828 -- stripped bytes : 407834 -- end library merge diff --git a/source/luametatex/source/luarest/lmtbasexxlib.c b/source/luametatex/source/luarest/lmtbasexxlib.c index fca7fcef8..9a723060e 100644 --- a/source/luametatex/source/luarest/lmtbasexxlib.c +++ b/source/luametatex/source/luarest/lmtbasexxlib.c @@ -14,7 +14,7 @@ First I had a mix of own code and LHF code (base64 and base85) but in the end I decided to reuse some of pplibs code. Performance is ok, although we can speed up the base16 coders. When needed, - we can have a few more bur normally pure \LUA\ is quite ok for our purpose. + we can have a few more but normally pure \LUA\ is quite ok for our purpose. */ diff --git a/source/luametatex/source/tex/texmaincontrol.c b/source/luametatex/source/tex/texmaincontrol.c index a5f3b5334..8b9250444 100644 --- a/source/luametatex/source/tex/texmaincontrol.c +++ b/source/luametatex/source/tex/texmaincontrol.c @@ -3487,8 +3487,8 @@ static int tex_aux_valid_arithmic(int cmd, int *index, int *level, int *varcmd, *original = eq_value(*index); return 1; case register_cmd: - *index = tex_aux_get_register_index(*level); *level = cur_chr; + *index = tex_aux_get_register_index(cur_chr); *original = eq_value(*index); return 1; case integer_cmd: @@ -3603,30 +3603,30 @@ static void tex_aux_arithmic_register(int a, int code) halfword original = 0; if (tex_aux_valid_arithmic(cmd, &index, &level, &varcmd, &simple, &original)) { halfword value = null; - lmt_scanner_state.arithmic_error = 0; + // lmt_scanner_state.arithmic_error = 0; switch (code) { case advance_code: tex_scan_optional_keyword("by"); case advance_by_code: { - value = tex_aux_get_register_value(level, 0); + halfword amount = tex_aux_get_register_value(level, 0); switch (level) { case int_val_level: case attr_val_level: case dimen_val_level: - if (value) { - value += original; + if (amount) { + value = original + amount; break; } else { return; } case glue_val_level: case mu_val_level: - if (tex_glue_is_zero(value)) { + if (tex_glue_is_zero(amount)) { return; } else { /* Compute the sum of two glue specs */ - halfword newvalue = tex_new_glue_spec_node(value); + halfword newvalue = tex_new_glue_spec_node(amount); tex_flush_node(value); glue_amount(newvalue) += glue_amount(original); if (glue_stretch(newvalue) == 0) { @@ -3667,9 +3667,11 @@ static void tex_aux_arithmic_register(int a, int code) case multiply_by_code: { halfword amount = tex_scan_int(0, NULL); + halfword value = 0; if (amount == 1) { return; } else { + lmt_scanner_state.arithmic_error = 0; switch (level) { case int_val_level: case attr_val_level: @@ -3710,6 +3712,7 @@ static void tex_aux_arithmic_register(int a, int code) if (amount == 1) { return; } else { + lmt_scanner_state.arithmic_error = 0; switch (level) { case int_val_level: case attr_val_level: diff --git a/source/luametatex/source/tex/texmath.c b/source/luametatex/source/tex/texmath.c index 134399c53..d2c0ff413 100644 --- a/source/luametatex/source/tex/texmath.c +++ b/source/luametatex/source/tex/texmath.c @@ -1233,7 +1233,7 @@ static void tex_aux_push_math(quarterword group, int style) update_tex_math_right_class(unset_noad_class); } -static void tex_aux_enter_ordinary_math(int style) +static void tex_aux_enter_inline_math(int style) { tex_aux_push_math(math_shift_group, style); update_tex_family(0, unused_math_family); @@ -1264,16 +1264,16 @@ void tex_run_math_initialize(void) tex_aux_enter_display_math(math_shift_cmd); } else { tex_back_input(cur_tok); - tex_aux_enter_ordinary_math(text_style); + tex_aux_enter_inline_math(text_style); } break; case math_shift_cs_cmd: if (cur_chr == begin_math_mode_code) { - tex_aux_enter_ordinary_math(tex_scan_math_style_identifier(0, 0)); + tex_aux_enter_inline_math(tex_scan_math_style_identifier(0, 0)); } else if (cur_chr == begin_display_math_code && cur_list.mode > nomode) { tex_aux_enter_display_math(begin_display_math_code); } else if (cur_chr == begin_inline_math_code) { - tex_aux_enter_ordinary_math(text_style); + tex_aux_enter_inline_math(text_style); } else { tex_you_cant_error("math shift 1"); } @@ -1298,7 +1298,7 @@ void tex_run_math_equation_number(void) { if (cur_group == math_shift_group) { tex_set_saved_record(saved_equation_number_item_location, equation_number_location_save_type, 0, cur_chr); lmt_save_state.save_stack_data.ptr += saved_equation_number_n_of_items; - tex_aux_enter_ordinary_math(text_style); + tex_aux_enter_inline_math(text_style); } else { tex_off_save(); } @@ -4285,49 +4285,26 @@ static void tex_aux_resume_after_display(void) */ -inline static void tex_aux_inject_display_skip_before(quarterword param, quarterword subtype) +static void tex_aux_inject_display_skip(quarterword param, quarterword subtype) { if (param > 0) { switch (display_skip_mode_par) { case display_skip_default : case display_skip_always : - tex_tail_append(tex_new_param_glue_node(param, subtype)); break; case display_skip_non_zero: - if (! tex_glue_is_zero(glue_parameter(param))) { - tex_tail_append(tex_new_param_glue_node(param, subtype)); - } - break; - case display_skip_ignore: - break; - default: - /*tex > 3 reserved for future use */ - tex_tail_append(tex_new_param_glue_node(param, subtype)); - break; - } - } -} - -inline static void tex_aux_inject_display_skip_after(quarterword param, quarterword subtype) -{ - if (param > 0) { - switch (display_skip_mode_par) { - case display_skip_default : - case display_skip_always : - tex_tail_append(tex_new_param_glue_node(param, subtype)); - break; - case display_skip_non_zero: - if (! tex_glue_is_zero(glue_parameter(param))) { - tex_tail_append(tex_new_param_glue_node(param, subtype)); + if (tex_glue_is_zero(glue_parameter(param))) { + return; + } else { + break; } - break; case display_skip_ignore: - break; + return; default: /*tex > 3 reserved for future use */ - tex_tail_append(tex_new_param_glue_node(param, subtype)); break; } + tex_tail_append(tex_new_param_glue_node(param, subtype)); } } @@ -4478,7 +4455,7 @@ static void tex_aux_finish_displayed_math(int atleft, halfword eqnumber, halfwor tex_append_to_vlist(eqnumber, lua_key_index(equation_number), NULL); tex_tail_append(tex_new_penalty_node(infinite_penalty, equation_number_penalty_subtype)); } else { - tex_aux_inject_display_skip_before(glue_above, subtype_above); + tex_aux_inject_display_skip(glue_above, subtype_above); } if (number_width != 0) { scaled shift = line_width - equation_width - number_width - displacement; @@ -4542,7 +4519,7 @@ static void tex_aux_finish_displayed_math(int atleft, halfword eqnumber, halfwor box_shift_amount(equation_box) = indent + displacement; } /*tex check for prev: */ - tex_append_to_vlist(equation_box, lua_key_index(equation), NULL); + tex_append_to_vlist(equation_box, lua_key_index(equation), NULL); /* eqbox has the formula */ if (eqnumber && number_width == 0 && ! atleft) { tex_tail_append(tex_new_penalty_node(infinite_penalty, equation_number_penalty_subtype)); /* if (math_direction_par == dir_lefttoright) { */ @@ -4575,7 +4552,7 @@ static void tex_aux_finish_displayed_math(int atleft, halfword eqnumber, halfwor cur_list.tail = pre_migrate_tail; } tex_tail_append(tex_new_penalty_node(post_display_penalty_par, after_display_penalty_subtype)); - tex_aux_inject_display_skip_after(glue_below, subtype_below); + tex_aux_inject_display_skip(glue_below, subtype_below); tex_aux_resume_after_display(); } @@ -4591,7 +4568,8 @@ static void tex_aux_finish_displayed_math(int atleft, halfword eqnumber, halfwor */ -void tex_run_math_shift(void) { +void tex_run_math_shift(void) +{ if (cur_group == math_shift_group) { /*tex box containing equation number */ halfword eqnumber = null; @@ -4613,7 +4591,7 @@ void tex_run_math_shift(void) { break; } } - if (cur_list.mode == -mode) { + if (cur_list.mode == -mode) { // todo: symbolic /*tex end of equation number */ AGAIN: switch (cur_cmd) { @@ -4641,7 +4619,7 @@ void tex_run_math_shift(void) { tex_confusion("after math"); } } - if (mode < 0) { + if (mode < 0) { // mode == inline_mmode /*tex The |unsave| is done after everything else here; hence an appearance of |\mathsurround| @@ -4780,13 +4758,13 @@ void tex_finish_display_alignment(halfword head, halfword tail, halfword prevdep } tex_pop_nest(); tex_tail_append(tex_new_penalty_node(pre_display_penalty_par, before_display_penalty_subtype)); - tex_aux_inject_display_skip_before(above_display_skip_code, above_display_skip_glue); + tex_aux_inject_display_skip(above_display_skip_code, above_display_skip_glue); node_next(cur_list.tail) = head; if (head && tail) { cur_list.tail = tail; } tex_tail_append(tex_new_penalty_node(post_display_penalty_par, after_display_penalty_subtype)); - tex_aux_inject_display_skip_after(below_display_skip_code, below_display_skip_glue); + tex_aux_inject_display_skip(below_display_skip_code, below_display_skip_glue); cur_list.prev_depth = prevdepth; tex_aux_resume_after_display(); } diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index e0d82c85c..7a8df6ecd 100644 --- a/tex/context/base/mkii/cont-new.mkii +++ b/tex/context/base/mkii/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2023.01.04 11:32} +\newcontextversion{2023.01.05 17:43} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/mkii/context.mkii b/tex/context/base/mkii/context.mkii index d238a096c..5d3930dec 100644 --- a/tex/context/base/mkii/context.mkii +++ b/tex/context/base/mkii/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2023.01.04 11:32} +\edef\contextversion{2023.01.05 17:43} %D For those who want to use this: diff --git a/tex/context/base/mkii/mult-fr.mkii b/tex/context/base/mkii/mult-fr.mkii index c78135316..aa5c33391 100644 --- a/tex/context/base/mkii/mult-fr.mkii +++ b/tex/context/base/mkii/mult-fr.mkii @@ -591,6 +591,7 @@ \setinterfacevariable{temporary}{temporaire} \setinterfacevariable{test}{test} \setinterfacevariable{text}{texte} +\setinterfacevariable{textdisplay}{textdisplay} \setinterfacevariable{textnote}{notetexte} \setinterfacevariable{three}{trois} \setinterfacevariable{thursday}{jeudi} diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 4d1a5f344..a05a08583 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2023.01.04 11:32} +\newcontextversion{2023.01.05 17:43} %D This file is loaded at runtime, thereby providing an excellent place for hacks, %D patches, extensions and new features. There can be local overloads in cont-loc diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index 6df85ce83..e9ae230e4 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -49,7 +49,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2023.01.04 11:32} +\edef\contextversion{2023.01.05 17:43} %D Kind of special: diff --git a/tex/context/base/mkiv/grph-raw.lua b/tex/context/base/mkiv/grph-raw.lua index 62e96fcc9..73f0d5175 100644 --- a/tex/context/base/mkiv/grph-raw.lua +++ b/tex/context/base/mkiv/grph-raw.lua @@ -22,7 +22,8 @@ function figures.bitmapimage(t) local xresolution = tonumber(t.xresolution) local yresolution = tonumber(t.yresolution) if data and xresolution and yresolution then - local width, height = t.width or "", t.height or "" + local width = t.width or "" + local height = t.height or "" local n = backends.nodeinjections.injectbitmap { xresolution = xresolution, yresolution = yresolution, @@ -30,9 +31,11 @@ function figures.bitmapimage(t) height = height ~= "" and texsp(height) or nil, data = data, colorspace = t.colorspace, + format = t.format, } if n then - context.hbox(n) + -- context.hpack(n) + context(nodes.hpack(n)) else report_bitmap("format no supported by backend") end diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf index f634b088d..0b5d11035 100644 Binary files a/tex/context/base/mkiv/status-files.pdf and b/tex/context/base/mkiv/status-files.pdf differ diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf index e46cc1d23..ee5dbae6e 100644 Binary files a/tex/context/base/mkiv/status-lua.pdf and b/tex/context/base/mkiv/status-lua.pdf differ diff --git a/tex/context/base/mkiv/util-tab.lua b/tex/context/base/mkiv/util-tab.lua index 64fa1af4f..58ca3bcb1 100644 --- a/tex/context/base/mkiv/util-tab.lua +++ b/tex/context/base/mkiv/util-tab.lua @@ -432,7 +432,7 @@ else local v = t[0] if v then m = m + 1 - r[m] = "[0]='" + r[m] = "[0]=" if type(v) == "table" then fastserialize(v) else diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl index 1a0c93600..c6fec2f2e 100644 --- a/tex/context/base/mkxl/cont-new.mkxl +++ b/tex/context/base/mkxl/cont-new.mkxl @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2023.01.04 11:32} +\newcontextversion{2023.01.05 17:43} %D This file is loaded at runtime, thereby providing an excellent place for hacks, %D patches, extensions and new features. There can be local overloads in cont-loc diff --git a/tex/context/base/mkxl/context.mkxl b/tex/context/base/mkxl/context.mkxl index af85d279a..b84e3b86d 100644 --- a/tex/context/base/mkxl/context.mkxl +++ b/tex/context/base/mkxl/context.mkxl @@ -29,7 +29,7 @@ %D {YYYY.MM.DD HH:MM} format. \immutable\edef\contextformat {\jobname} -\immutable\edef\contextversion{2023.01.04 11:32} +\immutable\edef\contextversion{2023.01.05 17:43} %overloadmode 1 % check frozen / warning %overloadmode 2 % check frozen / error diff --git a/tex/context/base/mkxl/lpdf-grp.lmt b/tex/context/base/mkxl/lpdf-grp.lmt index 7c4001467..48853ab83 100644 --- a/tex/context/base/mkxl/lpdf-grp.lmt +++ b/tex/context/base/mkxl/lpdf-grp.lmt @@ -106,70 +106,155 @@ end -- we could derive the colorspace if we strip the data -- and divide by x*y -local template = "q BI %s ID %s > EI Q" -local factor = 72/300 +-- todo: map onto png -function nodeinjections.injectbitmap(t) - -- encoding is ascii hex, no checking here - local xresolution, yresolution = t.xresolution or 0, t.yresolution or 0 - if xresolution == 0 or yresolution == 0 then - return -- fatal error - end - local colorspace = t.colorspace - if colorspace ~= "rgb" and colorspace ~= "cmyk" and colorspace ~= "gray" then - -- not that efficient but ok - local d = gsub(t.data,"[^0-9a-f]","") - local b = math.round(#d / (xresolution * yresolution)) - if b == 2 then - colorspace = "gray" - elseif b == 6 then - colorspace = "rgb" - elseif b == 8 then - colorspace = "cmyk" + +do + + local template = "q BI %s ID %s > EI Q" + local factor = 72/300 + + local methods = { } + + methods.hex = function(t) + -- encoding is ascii hex, no checking here + local xresolution, yresolution = t.xresolution or 0, t.yresolution or 0 + if xresolution == 0 or yresolution == 0 then + return -- fatal error + end + local colorspace = t.colorspace + if colorspace ~= "rgb" and colorspace ~= "cmyk" and colorspace ~= "gray" then + -- not that efficient but ok + local d = gsub(t.data,"[^0-9a-f]","") + local b = round(#d / (xresolution * yresolution)) + if b == 2 then + colorspace = "gray" + elseif b == 6 then + colorspace = "rgb" + elseif b == 8 then + colorspace = "cmyk" + end + end + colorspace = lpdf.colorspaceconstants[colorspace] + if not colorspace then + return -- fatal error end + --the original length L is required for pdf 2.0 (4096 max) + local d = pdfdictionary { + W = xresolution, + H = yresolution, + CS = colorspace, + BPC = 8, + F = pdfconstant("AHx"), + -- CS = nil, + -- BPC = 1, + -- IM = true, + } + -- for some reasons it only works well if we take a 1bp boundingbox + local urx, ury = 1/basepoints, 1/basepoints + -- urx = (xresolution/300)/basepoints + -- ury = (yresolution/300)/basepoints + local width, height = t.width or 0, t.height or 0 + if width == 0 and height == 0 then + width = factor * xresolution / basepoints + height = factor * yresolution / basepoints + elseif width == 0 then + width = height * xresolution / yresolution + elseif height == 0 then + height = width * yresolution / xresolution + end + local a = pdfdictionary { + BBox = pdfarray { 0, 0, round(urx * basepoints), round(ury * basepoints) } + } + local image = createimage { + stream = formatters[template](d(),t.data), + width = width, + height = height, + bbox = { 0, 0, round(urx), round(ury) }, + attr = a(), + nobbox = true, + } + return wrapimage(image) end - colorspace = lpdf.colorspaceconstants[colorspace] - if not colorspace then - return -- fatal error + + local zlibcompress = xzip.compress + local lpegmatch = lpeg.match + local compresslevel = 3 + local pattern = lpeg.Cs((lpeg.patterns.space/"" + lpeg.patterns.hextobyte)^0) + + methods.png = function(t) + -- encoding is ascii hex, no checking here + local xresolution = t.xresolution or 0 + local yresolution = t.yresolution or 0 + local data = t.data or "" + if xresolution == 0 or yresolution == 0 or data == "" then + return -- fatal error + end + local colorspace = t.colorspace + local colordepth = 8 + local colors = 1 + if colorspace ~= "rgb" and colorspace ~= "gray" then + -- not that efficient but ok + local d = gsub(t.data,"[^0-9a-f]","") + local b = round(#d / (xresolution * yresolution)) + if b == 2 then + colorspace = "gray" + colors = 1 + elseif b == 6 then + colorspace = "rgb" + colors = 3 + elseif b == 8 then + return -- for now, todo: convert + end + end + colorspace = lpdf.colorspaceconstants[colorspace] + if not colorspace then + return -- fatal error + end + local width = t.width + local height = t.height + if width == 0 and height == 0 then + width = factor * xresolution / basepoints + height = factor * yresolution / basepoints + elseif width == 0 then + width = height * xresolution / yresolution + elseif height == 0 then + height = width * yresolution / xresolution + end + data = zlibcompress(lpegmatch(pattern,data),compresslevel) + local xobject = pdfdictionary { + Type = pdfconstant("XObject"), + Subtype = pdfconstant("Image"), + Width = xresolution, + Height = yresolution, + BitsPerComponent = 8, + ColorSpace = colorspace, + Length = #data, + Filter = pdfconstant("FlateDecode"), + } + local image = createimage { +-- bbox = { 0, 0, round(width/xresolution), round(height/yresolution) }, -- mandate + bbox = { 0, 0, round(width), round(height) }, -- mandate + width = round(width), + height = round(height), + nolength = true, + nobbox = true, + notype = true, + stream = data, + attr = xobject(), + } + return wrapimage(image) end - local d = pdfdictionary { - W = xresolution, - H = yresolution, - CS = colorspace, - BPC = 8, - F = pdfconstant("AHx"), - -- CS = nil, - -- BPC = 1, - -- IM = true, - } - -- for some reasons it only works well if we take a 1bp boundingbox - local urx, ury = 1/basepoints, 1/basepoints - -- urx = (xresolution/300)/basepoints - -- ury = (yresolution/300)/basepoints - local width, height = t.width or 0, t.height or 0 - if width == 0 and height == 0 then - width = factor * xresolution / basepoints - height = factor * yresolution / basepoints - elseif width == 0 then - width = height * xresolution / yresolution - elseif height == 0 then - height = width * yresolution / xresolution + + function nodeinjections.injectbitmap(t) + if t.colorspace == "cmyk" then + return methods.hex(t) + else + return (methods[t.format or "hex"] or methods.hex)(t) + end end - local a = pdfdictionary { - BBox = pdfarray { 0, 0, urx * basepoints, ury * basepoints } - } - local image = createimage { - stream = formatters[template](d(),t.data), - width = width, - height = height, - bbox = { 0, 0, urx, ury }, - attr = a(), - nobbox = true, - } - return wrapimage(image) -end --- general graphic helpers +end function codeinjections.setfigurealternative(data,figure) local request = data.request diff --git a/tex/context/base/mkxl/lpdf-lmt.lmt b/tex/context/base/mkxl/lpdf-lmt.lmt index 57f5b6037..a8608cc7b 100644 --- a/tex/context/base/mkxl/lpdf-lmt.lmt +++ b/tex/context/base/mkxl/lpdf-lmt.lmt @@ -1268,8 +1268,8 @@ local flushimage do usedxforms[objnum] = true pdf_goto_pagemode() calc_pdfpos(pos_h,pos_v) - tx = cmtx * bpfactor - ty = cmty * bpfactor + local tx = cmtx * bpfactor + local ty = cmty * bpfactor b = b + 1 ; buffer[b] = s_b -- b = b + 1 ; buffer[b] = f_cm(rx,0,0,ry,tx,ty) b = b + 1 ; buffer[b] = f_cz(rx, ry,tx,ty) @@ -1456,7 +1456,6 @@ local flushimage do -- to be sorted out -- local ty = pos_v - depth local ty = pos_v -- we assume that depth is dealt with in the caller (for now) - usedximages[index] = objnum pdf_goto_pagemode() diff --git a/tex/context/base/mkxl/meta-ini.mkxl b/tex/context/base/mkxl/meta-ini.mkxl index 9a8b3f7f7..16b97e8cc 100644 --- a/tex/context/base/mkxl/meta-ini.mkxl +++ b/tex/context/base/mkxl/meta-ini.mkxl @@ -850,7 +850,7 @@ \expandafter\startMPoverlaydata_yes \fi} -\permanent\protected\def\startMPoverlaydata_nop#0\stopMPoverlaydata +\permanent\protected\def\startMPoverlaydata_nop#-\stopMPoverlaydata {} \permanent\protected\def\startMPoverlaydata_yes#1\stopMPoverlaydata diff --git a/tex/context/base/mkxl/mlib-pps.lmt b/tex/context/base/mkxl/mlib-pps.lmt index 209656fbe..b8f448964 100644 --- a/tex/context/base/mkxl/mlib-pps.lmt +++ b/tex/context/base/mkxl/mlib-pps.lmt @@ -1339,18 +1339,25 @@ end local function bm_process(object,prescript,before,after) local bm_xresolution = prescript.bm_xresolution + local bm_yresolution = prescript.bm_yresolution if bm_xresolution then - before[#before+1] = f_cm_b(cm(object)) +-- before[#before+1] = f_cm_b(cm(object)) +local sx, rx, ry, sy, tx, ty = cm(object) +local postscript = object.postscript before[#before+1] = function() - figures.bitmapimage { - xresolution = tonumber(bm_xresolution), - yresolution = tonumber(prescript.bm_yresolution), - width = 1/basepoints, - height = 1/basepoints, - data = object.postscript - } +context.MPLIBscaledcm(function() + figures.bitmapimage { + xresolution = tonumber(bm_xresolution), + yresolution = tonumber(bm_yresolution), + width = 1/basepoints, + height = 1/basepoints, + data = postscript, + format = "png", + } + end +, sx, rx, ry, sy, tx, ty) end - before[#before+1] = s_cm_e +-- before[#before+1] = s_cm_e object.path = false object.color = false object.grouped = true diff --git a/tex/context/base/mkxl/mlib-pps.mkxl b/tex/context/base/mkxl/mlib-pps.mkxl index 39dafb2f6..521865e08 100644 --- a/tex/context/base/mkxl/mlib-pps.mkxl +++ b/tex/context/base/mkxl/mlib-pps.mkxl @@ -172,6 +172,23 @@ \box\MPbox \endgroup} +\permanent\protected\def\MPLIBscaledcm#1#2#3#4#5#6#7% 2-7: sx,rx,ry,sy,tx,ty + {\begingroup +% \setbox\MPbox + \hpack\bgroup + \dotransformnextbox{#2}{#3}{#4}{#5}{#6}{#7}% + %\dotransformnextbox{\luaexpr{#2/10}}{\luaexpr{#3/10}}{\luaexpr{#4/10}}{\luaexpr{#5/10}}{\luaexpr{#6/10}}{\luaexpr{#7/10}}% + \vpack to \zeropoint\bgroup + \vss + \hcontainer to \zeropoint \bgroup + #1\hss % used for mp bitmaps + %\fastsxsy{10}{10}{#1}\hss + \egroup + \egroup + \egroup +% \smashbox\MPbox\box\MPbox + \endgroup} + \permanent\protected\def\MPLIBgraphictext#1% use at mp end {\startTEXpage[\c!scale=10000]#1\stopTEXpage} diff --git a/tex/context/base/mkxl/spac-chr.lmt b/tex/context/base/mkxl/spac-chr.lmt index 7c8e02fb6..58071c431 100644 --- a/tex/context/base/mkxl/spac-chr.lmt +++ b/tex/context/base/mkxl/spac-chr.lmt @@ -193,6 +193,7 @@ local methods = { [0x001E] = function(head,current) -- kind of special local next = getnext(current) if next and getid(next) == glue_code and getsubtype(next) == spaceskip_code then + -- remove when no valid character following local nextnext = getnext(next) if nextnext then local char, font = isglyph(nextnext) @@ -200,6 +201,14 @@ local methods = { remove_node(head,next,true) end end + else + -- insert when valid character following + local char, font = isglyph(next) + if char and canhavespace[char] then + local p = fontparameters[font] + head, current = insertnodebefore(head,current,new_glue(p.space,p.spacestretch,p.spaceshrink)) + end + end return head, current end, diff --git a/tex/context/base/mkxl/syst-aux.mkxl b/tex/context/base/mkxl/syst-aux.mkxl index cf39c1cf8..2b87f4b3d 100644 --- a/tex/context/base/mkxl/syst-aux.mkxl +++ b/tex/context/base/mkxl/syst-aux.mkxl @@ -876,9 +876,9 @@ \popmacro\commalistcommand} % \let\syst_helpers_process_comma_item_next_a \syst_helpers_process_comma_item_next -% \def\syst_helpers_process_comma_item_next_b#0\ignorearguments{\let\syst_helpers_process_comma_item_next\syst_helpers_process_comma_item_next_a} -% \def\syst_helpers_process_comma_item_next_c#0\ignorearguments{\let\syst_helpers_process_comma_item_next\syst_helpers_process_comma_item_next_b} -% \def\syst_helpers_process_comma_item_gobble#0\ignorearguments{} +% \def\syst_helpers_process_comma_item_next_b#-\ignorearguments{\let\syst_helpers_process_comma_item_next\syst_helpers_process_comma_item_next_a} +% \def\syst_helpers_process_comma_item_next_c#-\ignorearguments{\let\syst_helpers_process_comma_item_next\syst_helpers_process_comma_item_next_b} +% \def\syst_helpers_process_comma_item_gobble#-\ignorearguments{} \let\syst_helpers_process_comma_item_next_a \syst_helpers_process_comma_item_next \def\syst_helpers_process_comma_item_next_b#-\ignorearguments{\let\syst_helpers_process_comma_item_next\syst_helpers_process_comma_item_next_a} @@ -1237,7 +1237,7 @@ % \fi}% % \normalexpanded{\syst_helpers_do_do_if_not_in_string#1}\s!e_o_t_token\ignorearguments\ignorearguments} % -% \def\syst_helpers_do_if_in_string_else_yes#0\ignorearguments\ignorearguments#2#0{#2} +% \def\syst_helpers_do_if_in_string_else_yes#0\ignorearguments\ignorearguments#2#0{#2} % of #- and #1 % \def\syst_helpers_do_if_in_string_else_nop#0\ignorearguments#0#3{#3} % \def\syst_helpers_do_if_in_string_yes #0\ignorearguments\ignorearguments#2{#2} % \def\syst_helpers_do_if_in_string_nop #0\ignorearguments#0{} @@ -3360,7 +3360,7 @@ {\normalexpanded{\recurseaction{\recurselevel}{\the\outerrecurse}}% \endofloop} -\protected\def\syst_helpers_loop_nop#0% +\protected\def\syst_helpers_loop_nop#-% {\enforced\let\endofloop\syst_helpers_loop \globalpopmacro\recurselevel \globalpopmacro\recurseaction @@ -3369,7 +3369,7 @@ \permanent\protected\def\exitloop % \exitloop quits at end {\enforced\let\endofloop\syst_helpers_loop_nop} -\permanent\protected\def\exitloopnow#0\endofloop % \exitloopnow quits directly +\permanent\protected\def\exitloopnow#-\endofloop % \exitloopnow quits directly {\syst_helpers_loop_nop} %D The loop is executed at least once, so beware of situations like: @@ -6854,7 +6854,7 @@ %D %D \typebuffer \startpacked \getbuffer \stoppacked -\def\syst_helpers_wipe_tokens_nop#0^^04{}% +\def\syst_helpers_wipe_tokens_nop#-^^04{}% \permanent\def\wipetokens#1#2% {\beginlocalcontrol diff --git a/tex/context/base/mkxl/tabl-tbl.mkxl b/tex/context/base/mkxl/tabl-tbl.mkxl index 253d3c411..eec1edf9c 100644 --- a/tex/context/base/mkxl/tabl-tbl.mkxl +++ b/tex/context/base/mkxl/tabl-tbl.mkxl @@ -2704,12 +2704,11 @@ {} \appendtoks - \enforced\let\TB\tabl_tabulate_TB_yes + \enforced\let\TB\tabl_tabulate_TB_nop \to \t_tabl_tabulate_initializers_first - \appendtoks - \enforced\let\TB\tabl_tabulate_TB_nop + \enforced\let\TB\tabl_tabulate_TB_yes \to \t_tabl_tabulate_initializers_second % %D Between alignment lines certain rules apply, and even a simple test can mess diff --git a/tex/context/interface/mkii/keys-fr.xml b/tex/context/interface/mkii/keys-fr.xml index 89a549482..f5474769a 100644 --- a/tex/context/interface/mkii/keys-fr.xml +++ b/tex/context/interface/mkii/keys-fr.xml @@ -594,6 +594,7 @@ + diff --git a/tex/context/modules/mkxl/m-tikz-pgfplots.tex b/tex/context/modules/mkxl/m-tikz-pgfplots.tex new file mode 100644 index 000000000..1dd06b8b2 --- /dev/null +++ b/tex/context/modules/mkxl/m-tikz-pgfplots.tex @@ -0,0 +1,46 @@ +%D See m-tikz.mkxl for comments. + +\startmodule [pgfplots] + +\writestatus{loading}{ConTeXt User Module / Pgfplots} + +\tikzinputfile{pgfplots.revision.tex} + +\usetikzlibrary[plotmarks] + +\tikzinputfile{pgfplots.code.tex} + +\def\pgfplotsincludegraphics[#1]#2% + {\externalfigure[#2][#1]} + +\starttikzsettings + \pgfkeys{/pgfplots/plot graphics/includegraphics cmd=\pgfplotsincludegraphics} +\stoptikzsettings + +\unprotect + +\let\pgfplots@ORIG@tikz@installcommands@before@context\tikz@installcommands + +\def\tikz@installcommands{% + \pgfplots@ORIG@tikz@installcommands@before@context + % + \let\startaxis=\pgfplots@environment@axis + \let\stopaxis=\endpgfplots@environment@axis + % + \let\startsemilogxaxis=\pgfplots@environment@semilogxaxis + \let\stopsemilogxaxis=\endpgfplots@environment@semilogxaxis + % + \let\startsemilogyaxis=\pgfplots@environment@semilogyaxis + \let\stopsemilogyaxis=\endpgfplots@environment@semilogyaxis + % + \let\startloglogaxis=\pgfplots@environment@loglogaxis + \let\stoploglogaxis=\endpgfplots@environment@loglogaxis + % + \def\startpgfplotsinterruptdatabb{\pgfplotsinterruptdatabb}% + \def\stoppgfplotsinterruptdatabb{\endpgfplotsinterruptdatabb}% +} + +\protect + +\stopmodule + diff --git a/tex/context/modules/mkxl/m-tikz-pgfplotstable.tex b/tex/context/modules/mkxl/m-tikz-pgfplotstable.tex new file mode 100644 index 000000000..acc3309a1 --- /dev/null +++ b/tex/context/modules/mkxl/m-tikz-pgfplotstable.tex @@ -0,0 +1,12 @@ +%D See m-tikz.mkxl for comments. + +\startmodule [pgfplotstable] + +\writestatus{loading}{ConTeXt User Module / Pgfplotstable} + +\usemodule[pgfplots] + +\tikzinputfile{pgfplotstable.code.tex}% + +\stopmodule + diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index df0e9399b..ee3ab219c 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 : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua --- merge date : 2023-01-04 11:32 +-- merge date : 2023-01-05 17:43 do -- begin closure to overcome local limits and interference -- cgit v1.2.3