diff options
Diffstat (limited to 'tex/context/modules/mkiv')
-rw-r--r-- | tex/context/modules/mkiv/m-steps.lua | 19 | ||||
-rw-r--r-- | tex/context/modules/mkiv/m-steps.mkvi | 73 | ||||
-rw-r--r-- | tex/context/modules/mkiv/m-visual.mkiv | 3 |
3 files changed, 72 insertions, 23 deletions
diff --git a/tex/context/modules/mkiv/m-steps.lua b/tex/context/modules/mkiv/m-steps.lua index c02e8f1c1..7fbb58370 100644 --- a/tex/context/modules/mkiv/m-steps.lua +++ b/tex/context/modules/mkiv/m-steps.lua @@ -62,7 +62,7 @@ local chart = nil local steps = { } local count = 0 -local function step_start_chart(name) +local function step_start_chart(name,alternative) name = name or "" steps = table.setmetatableindex(function(t,k) local v = { -- could be metatable @@ -81,8 +81,9 @@ local function step_start_chart(name) end) count = 0 chart = { - steps = steps, - count = count, + steps = steps, + count = count, + alternative = alternative, } charts[name] = chart end @@ -176,7 +177,15 @@ local function step_make_chart(settings) start() flush("step_begin_chart ;") -- - local alternative = utilities.parsers.settings_to_hash(chartsettings.alternative) + print(chartsettings.alternative) + local alternative = chartsettings.alternative + if not alternative or alternative == "" then + alternative = chart.alternative + end + if not alternative or alternative == "" then + alternative = variables.horizontal + end + local alternative = utilities.parsers.settings_to_hash(alternative) local vertical = alternative[variables.vertical] local align = alternative[variables.three] local category = chartsettings.category @@ -391,7 +400,7 @@ end interfaces.implement { name = "step_start_chart", - arguments = "string", + arguments = { "string", "string" }, actions = step_start_chart, } diff --git a/tex/context/modules/mkiv/m-steps.mkvi b/tex/context/modules/mkiv/m-steps.mkvi index e03ffa5ef..ce018a0d1 100644 --- a/tex/context/modules/mkiv/m-steps.mkvi +++ b/tex/context/modules/mkiv/m-steps.mkvi @@ -29,25 +29,22 @@ \stopMPdefinitions \installcorenamespace {stepcharts} -\installcorenamespace {steptables} \installcorenamespace {stepcells} \installcorenamespace {steptexts} \installcorenamespace {steplines} \installstylisticautosetuphandler \??stepcharts {STEPchart} \??stepcharts -\installstylisticautosetuphandler \??steptables {STEPtable} \??steptables \installstylisticautosetuphandler \??stepcells {STEPcell} \??stepcells \installstylisticautosetuphandler \??steptexts {STEPtext} \??steptexts \installstylisticautosetuphandler \??steplines {STEPline} \??steplines \let\setupSTEPcharts\setupSTEPchart -\let\setupSTEPtables\setupSTEPtable +\let\setupSTEPtables\setupSTEPchart % one can define categories so no need \let\setupSTEPcells \setupSTEPcell \let\setupSTEPtexts \setupSTEPtext \let\setupSTEPlines \setupSTEPline \let\setSTEPchartsparameter\setSTEPchartparameter -\let\setSTEPtablesparameter\setSTEPtableparameter \let\setSTEPcellsparameter \setSTEPcellparameter \let\setSTEPtextsparameter \setSTEPtextparameter \let\setSTEPlinesparameter \setSTEPlineparameter @@ -56,21 +53,12 @@ % numeric step_distance ; step_distance := 20pt ; \setupSTEPcharts - [\c!alternative=\v!horizontal, + [%c!alternative=\v!horizontal, % travels with stored so dealt with in lua %\c!offset=.15\bodyfontsize %\c!height=2ex \c!before=\blank, \c!after=\blank] -% \setupSTEPtables -% [\c!before=\blank, -% \c!after=\blank, -% \c!distance=.25em, -% \c!voffset=1ex, -% \c!method=1, -% \c!width=4em, -% \c!offset=.15\bodyfontsize] - \setupSTEPcells [\c!alternative=24, \c!style=, @@ -150,10 +138,12 @@ \setupcurrentSTEPchart[#name]% \def\module_steps_flush_chart{\module_steps_chart[][#name]}} {\edef\currentSTEPchart{#name}% + \setupcurrentSTEPchart[#settings]% \let\m_module_steps_category\currentSTEPchart \resetboxesincache{\??stepcharts\m_module_steps_category}% - \setupcurrentSTEPchart[#settings]% - \let\module_steps_flush_chart\relax}% settings are not stored + \doifelse{\STEPchartparameter\c!buffer}\v!no + {\def\module_steps_flush_chart{\STEPchart[#name]}} + {\let\module_steps_flush_chart\relax}}% \else \let\currentSTEPchart\empty \def\module_steps_flush_chart{\module_steps_chart[][]}% @@ -167,7 +157,7 @@ \checkSTEPlineparent \the\everySTEPchart \startnointerference - \clf_step_start_chart{\currentSTEPchart}} + \clf_step_start_chart{\currentSTEPchart}{\STEPchartparameter\c!alternative}} \unexpanded\def\stopSTEPchart {\clf_step_stop_chart @@ -615,4 +605,53 @@ \page +\setupSTEPchart + [mytable] + [before={\blank[2*big]}, + after={\blank[2*big]}] + +\starttext + +\startSTEPaligntable[mytable] + \cells {$2c$} {$=$} {$2a+3b$} + \text {with $a=5$} + \cells {$2c$}{$=$} {$10+3b$} + \text {and $b=6$} + \cells {$2c$} {$=$} {$10+18$} + \text {we get} + \cells {$2c$} {$=$} {$28$} + \text {and therefore} + \cells {$c$} {$=$} {$28/2$} + \text {which reduces to} + \cells {$c$} {$=$} {$14$} +\stopSTEPaligntable + +\input tufte + +\STEPchart[mytable] + +\input tufte + +\setupSTEPchart + [mytable] + [buffer=no] + +\startSTEPaligntable[mytable] + \cells {$2c$} {$=$} {$2a+3b$} + \text {with $a=5$} + \cells {$2c$}{$=$} {$10+3b$} + \text {and $b=6$} + \cells {$2c$} {$=$} {$10+18$} + \text {we get} + \cells {$2c$} {$=$} {$28$} + \text {and therefore} + \cells {$c$} {$=$} {$28/2$} + \text {which reduces to} + \cells {$c$} {$=$} {$14$} +\stopSTEPaligntable + +\input tufte + +\STEPchart[mytable] + \stoptext diff --git a/tex/context/modules/mkiv/m-visual.mkiv b/tex/context/modules/mkiv/m-visual.mkiv index 17d679452..6ec0a52b0 100644 --- a/tex/context/modules/mkiv/m-visual.mkiv +++ b/tex/context/modules/mkiv/m-visual.mkiv @@ -81,7 +81,8 @@ fr8c=darkorange] \unexpanded\def\onlyfakewords#1#2% min max / 10 40 - {\ifvmode\noindentation\fi + {\dontleavehmode + \ifvmode\noindentation\fi \getrandomcount\scratchcounter{\ifcase0#1 10\else#1\fi}{\ifcase0#2 40\else#2\fi}% \dofakewords\scratchcounter } % no \par |