From 128e5756b60274b62fa31304324abd31c48d711a Mon Sep 17 00:00:00 2001
From: Hans Hagen
Date: Sat, 7 Nov 2009 17:59:00 +0100
Subject: beta 2009.11.07 17:59
---
context/data/scite/cont-cs-scite.properties | 122 ++--
context/data/scite/cont-de-scite.properties | 138 ++---
context/data/scite/cont-fr-scite.properties | 72 +--
context/data/scite/cont-it-scite.properties | 72 +--
context/data/scite/cont-nl-scite.properties | 150 ++---
context/data/scite/cont-pe-scite.properties | 82 +--
context/data/scite/cont-ro-scite.properties | 178 +++---
scripts/context/lua/mtxrun.lua | 119 ++--
scripts/context/stubs/mswin/mtxrun.lua | 119 ++--
scripts/context/stubs/unix/mtxrun | 119 ++--
tex/context/base/buff-ini.lua | 53 +-
tex/context/base/buff-ini.mkiv | 4 +-
tex/context/base/buff-ver.mkiv | 29 +-
tex/context/base/char-def.lua | 2 +
tex/context/base/cont-new.tex | 2 +-
tex/context/base/context.mkiv | 1 +
tex/context/base/context.tex | 2 +-
tex/context/base/core-fnt.mkiv | 175 ------
tex/context/base/core-ini.mkiv | 2 +-
tex/context/base/core-uti.mkiv | 2 +
tex/context/base/data-lua.lua | 6 +-
tex/context/base/font-ini.lua | 12 +
tex/context/base/font-otf.lua | 4 +
tex/context/base/font-otn.lua | 27 +-
tex/context/base/font-tfm.lua | 3 +
tex/context/base/l-aux.lua | 12 +-
tex/context/base/l-dimen.lua | 2 +-
tex/context/base/l-table.lua | 6 +-
tex/context/base/lxml-aux.lua | 84 ++-
tex/context/base/lxml-lpt.lua | 10 +-
tex/context/base/lxml-tex.lua | 20 +-
tex/context/base/lxml-xml.lua | 19 +-
tex/context/base/math-ali.mkiv | 235 ++++++++
tex/context/base/math-for.mkiv | 7 +-
tex/context/base/mult-de.tex | 14 +-
tex/context/base/mult-def.lua | 126 +++--
tex/context/base/mult-en.tex | 14 +-
tex/context/base/mult-fr.tex | 14 +-
tex/context/base/mult-it.tex | 14 +-
tex/context/base/mult-nl.tex | 14 +-
tex/context/base/mult-ro.tex | 14 +-
tex/context/base/node-bck.lua | 1 -
tex/context/base/node-rul.lua | 157 +++++
tex/context/base/node-rul.mkiv | 202 +++++++
tex/context/base/node-seq.lua | 59 +-
tex/context/base/node-tra.lua | 5 +-
tex/context/base/node-tsk.lua | 35 +-
tex/context/base/page-lin.lua | 15 +-
tex/context/base/page-lin.mkiv | 18 +-
tex/context/base/spac-gen.mkii | 25 +-
tex/context/base/spac-hor.mkiv | 79 ++-
tex/context/base/spac-ver.lua | 38 +-
tex/context/base/strc-doc.lua | 4 +-
tex/context/base/strc-lnt.mkiv | 52 +-
tex/context/base/strc-lst.lua | 20 +-
tex/context/base/strc-mat.mkiv | 848 +++++++++++-----------------
tex/context/base/strc-not.mkiv | 2 +-
tex/context/base/strc-num.lua | 3 +-
tex/context/base/strc-num.mkiv | 4 +-
tex/context/base/strc-ref.mkiv | 6 +-
tex/context/base/strc-reg.lua | 10 +-
tex/context/base/strc-syn.mkiv | 2 +-
tex/context/base/supp-mis.mkii | 27 +-
tex/context/base/syst-gen.mkii | 10 +-
tex/context/base/task-ini.lua | 33 +-
tex/context/interface/cont-cs.xml | 17 +-
tex/context/interface/cont-de.xml | 17 +-
tex/context/interface/cont-en.xml | 5 +
tex/context/interface/cont-fr.xml | 13 +-
tex/context/interface/cont-it.xml | 17 +-
tex/context/interface/cont-nl.xml | 17 +-
tex/context/interface/cont-pe.xml | 17 +-
tex/context/interface/cont-ro.xml | 17 +-
tex/context/interface/keys-cs.xml | 14 +-
tex/context/interface/keys-de.xml | 14 +-
tex/context/interface/keys-en.xml | 14 +-
tex/context/interface/keys-fr.xml | 14 +-
tex/context/interface/keys-it.xml | 14 +-
tex/context/interface/keys-nl.xml | 14 +-
tex/context/interface/keys-pe.xml | 14 +-
tex/context/interface/keys-ro.xml | 14 +-
tex/generic/context/luatex-fonts-merged.lua | 56 +-
82 files changed, 2396 insertions(+), 1647 deletions(-)
create mode 100644 tex/context/base/node-rul.lua
create mode 100644 tex/context/base/node-rul.mkiv
diff --git a/context/data/scite/cont-cs-scite.properties b/context/data/scite/cont-cs-scite.properties
index fbc653e57..da0cab1b2 100644
--- a/context/data/scite/cont-cs-scite.properties
+++ b/context/data/scite/cont-cs-scite.properties
@@ -22,69 +22,69 @@ jazyk jdidolu jdina jdinabox klonujpole komentar \
konvertujcislo kopirujpole korekcebilehomista labeling listsymbol loadsorts \
loadsynonyms mapfontsize marginalnilinka marginalnitext matematika mediaeval \
meritko mesic mezera mrizka nadpis nadruhyokraj \
-nadtrzeni nadtrzeno name naokraj nastavbarvu nastavbarvy \
-nastavbilamista nastavblok nastavbloksekce nastavbuffer nastavcernelinky nastavcislonadpisu \
-nastavcislostrany nastavcislovani nastavcislovaniodstavcu nastavcislovaniradku nastavcislovanistran nastavcitaci \
-nastavdefinicipoznamekpodcarou nastavdeleniplvoucichobjektu nastavdelitko nastavdolnitexty nastavexterniobrazy nastavhorejsek \
-nastavhornitexty nastavinterakci nastavinterakcnilistu nastavinterakcnimenu nastavinterakcniobrazovku nastavjazyk \
-nastavkapitalky nastavkombinovanyseznam nastavkomentar nastavlegendu nastavmarginalie nastavmarginalniblok \
-nastavmarginalnilinky nastavmeziradkovoumezeru nastavnadpis nastavnadpisy nastavodkazovani nastavodsazeni \
-nastavodsazovani nastavodstavce nastavopis nastavoramovanetexty nastavoramovani nastavorez \
-nastavotoceni nastavpaletu nastavplvouciobjekt nastavplvouciobjekty nastavpodcislostrany nastavpodtrzeni \
-nastavpole nastavpolozky nastavpopisek nastavpopisky nastavpopisy nastavpozadi \
-nastavpozadi nastavpoznamkypodcarou nastavprechodstrany nastavpreskok nastavprofily nastavprogramy \
-nastavprostredizakladnihofontu nastavpublikace nastavradkovani nastavradky nastavrastr nastavrejstrik \
-nastavrovnice nastavsadusymbolu nastavsekci nastavseznam nastavseznamodkazu nastavsirkucary \
-nastavsloupce nastavspodek nastavspojeni nastavsynchronizaci nastavsynchronizacnilistu nastavsynonyma \
-nastavsystem nastavtab nastavtabelaci nastavtabulky nastavtenkelinky nastavtext \
-nastavtexthlavicky nastavtextovelinky nastavtextpopisku nastavtexttexty nastavtextyupati nastavtextyzahlavi \
-nastavtlacitka nastavtoleranci nastavtrideni nastavtype nastavumisteniprotejsku nastavumistovani \
-nastavupati nastavupravu nastavurl nastavusporadani nastavvelikostpapiru nastavverze \
-nastavvsechnapole nastavvycty nastavvyplnovelinky nastavvyplnoveradky nastavvystup nastavvzhled \
-nastavzahlavi nastavzakladnifont nastavzarovnani nastavznaceni nastavzuzeni nastrane \
-nejakyradek nekde nextsection nivy nizky nocap \
-nop obrazovka odkaz odkaz odkaznadatum odkaznastranu \
-odkaznatext odsazovani okr opis opissoubor oramovani \
-oref orez otocit oznacverzi paragraph parovastrana \
-part pis placefloat placelistoffloats placelistofsorts placelistofsynonyms \
-placereferencelist podtrzeni podtrzeno pol pole polozka \
+name naokraj nastavbarvu nastavbarvy nastavbilamista nastavblok \
+nastavbloksekce nastavbuffer nastavcernelinky nastavcislonadpisu nastavcislostrany nastavcislovani \
+nastavcislovaniodstavcu nastavcislovaniradku nastavcislovanistran nastavcitaci nastavdefinicipoznamekpodcarou nastavdeleniplvoucichobjektu \
+nastavdelitko nastavdolnitexty nastavexterniobrazy nastavhorejsek nastavhornitexty nastavinterakci \
+nastavinterakcnilistu nastavinterakcnimenu nastavinterakcniobrazovku nastavjazyk nastavkapitalky nastavkombinovanyseznam \
+nastavkomentar nastavlegendu nastavmarginalie nastavmarginalniblok nastavmarginalnilinky nastavmeziradkovoumezeru \
+nastavnadpis nastavnadpisy nastavodkazovani nastavodsazeni nastavodsazovani nastavodstavce \
+nastavopis nastavoramovanetexty nastavoramovani nastavorez nastavotoceni nastavpaletu \
+nastavplvouciobjekt nastavplvouciobjekty nastavpodcislostrany nastavpodtrzeni nastavpole nastavpolozky \
+nastavpopisek nastavpopisky nastavpopisy nastavpozadi nastavpozadi nastavpoznamkypodcarou \
+nastavprechodstrany nastavpreskok nastavprofily nastavprogramy nastavprostredizakladnihofontu nastavpublikace \
+nastavradkovani nastavradky nastavrastr nastavrejstrik nastavrovnice nastavsadusymbolu \
+nastavsekci nastavseznam nastavseznamodkazu nastavsirkucary nastavsloupce nastavspodek \
+nastavspojeni nastavsynchronizaci nastavsynchronizacnilistu nastavsynonyma nastavsystem nastavtab \
+nastavtabelaci nastavtabulky nastavtenkelinky nastavtext nastavtexthlavicky nastavtextovelinky \
+nastavtextpopisku nastavtexttexty nastavtextyupati nastavtextyzahlavi nastavtlacitka nastavtoleranci \
+nastavtrideni nastavtype nastavumisteniprotejsku nastavumistovani nastavupati nastavupravu \
+nastavurl nastavusporadani nastavvelikostpapiru nastavverze nastavvsechnapole nastavvycty \
+nastavvyplnovelinky nastavvyplnoveradky nastavvystup nastavvzhled nastavzahlavi nastavzakladnifont \
+nastavzarovnani nastavznaceni nastavzuzeni nastrane nejakyradek nekde \
+nextsection nivy nizky nocap nop obrazovka \
+odkaz odkaz odkaznadatum odkaznastranu odkaznatext odsazovani \
+okr opis opissoubor oramovani oref orez \
+otocit overbar overbars overstrike overstrikes oznacverzi \
+paragraph parovastrana part pis placefloat placelistoffloats \
+placelistofsorts placelistofsynonyms placereferencelist pol pole polozka \
polozky popisky porovnejpaletu porovnejskupinubarev pozadi pozice \
poznamka poznamkapodcarou pref prelozit premistinamrizku prepninazakladnifont \
-preskoc preskrtnuti preskrtnuto prizpusobivepole prizpusobvzhled program \
-propojeneznaceni propojenydokument propojenyrejstrik publikace ran ref \
-register reservefloat reset resettextcontent resetznaceni rimskecislice \
-rozdelplvouciobjekt rozpojeneznaceni roztazene schovejbloky section sedabarva \
-seeregister settextcontent setupfonthandling setupfontsynonym setupforms setupinterlinespace2 \
-setupitemgroup setuplistalternative setuppaper setupstrut sloupec slovovpravo \
-sort spodek stanovcharakteristickuseznamu stanovcislonadpisu startalignment startbarva \
-startbuffer startbuffer startcitace startcolumns startcombination startdescription \
-startdocument startenumeration startfakt startfigure startfloattext startformula \
-startframedtext starthiding startinteraktivnimenu startitemgroup startkomentar startkomponenta \
-startlegend startline startlinecorrection startlinenumbering startlines startlocal \
-startlocalenvironment startlocalfootnotes startmakeup startmarginalnilinka startmarginblock startnamemakeup \
-startnarrower startopposite startoverlay startoverview startparagraph startpositioning \
-startpostponing startpozadi startprodukt startprofile startprojekt startprostredi \
-startregister startsymbolset startsynchronization starttable starttables starttabulate \
-starttextovalinka starttyping startunpacked startverze startzhustene stopalignment \
-stopbarva stopbuffer stopbuffer stopcitace stopcolumns stopcombination \
-stopdescription stopdocument stopenumeration stopfakt stopfigure stopfloattext \
-stopformula stopframedtext stophiding stopinteraktivnimenu stopitemgroup stopkomentar \
-stopkomponenta stoplegend stopline stoplinecorrection stoplinenumbering stoplines \
-stoplocal stoplocalenvironment stoplocalfootnotes stopmakeup stopmarginalnilinka stopmarginblock \
-stopnamemakeup stopnarrower stopopposite stopoverlay stopoverview stopparagraph \
-stoppositioning stoppostponing stoppozadi stopprodukt stopprofile stopprojekt \
-stopprostredi stopsymbolset stopsynchronization stoptable stoptables stoptabulate \
-stoptextovalinka stoptyping stopunpacked stopverze stopzhustene strana \
-sub subject subsection subsubject subsubsection subsubsubject \
-sym symbol synchronizacnilista synchronizovat synonym tab \
-tecky tenkalinka tenkelinky tex texthlavicky textovalinka \
-textpopisku title tlacitko tref tvrdemezery typebuffer \
-typstrany ukazbarvu ukazexterniobrazy ukazmrizku ukaznastaveni ukazpaletu \
-ukazpodpery ukazpole ukazpostredizakladnihofontu ukazramecek ukazsadusymbolu ukazskupinubarev \
-ukazupravu ukazvytisk ukazvzhled ukazzakladnifont umistikombinovanyseznam umistikombinovanyseznam \
-umistilegendu umistiloga umistilokalnipoznamkypodcarou umistinadsebe umistinamrizku umistipodrovnici \
-umistipoznamkypodcarou umistirejstrik umistirejstrik umistirovnici umistiseznam umistivedlesebe \
-umistizalozky usedirectory usetypescript usetypescriptfile uzijURL uzijbloky \
+preskoc prizpusobivepole prizpusobvzhled program propojeneznaceni propojenydokument \
+propojenyrejstrik publikace ran ref register reservefloat \
+reset resettextcontent resetznaceni rimskecislice rozdelplvouciobjekt rozpojeneznaceni \
+roztazene schovejbloky section sedabarva seeregister settextcontent \
+setupfonthandling setupfontsynonym setupforms setupinterlinespace2 setupitemgroup setuplistalternative \
+setuppaper setupstrut sloupec slovovpravo sort spodek \
+stanovcharakteristickuseznamu stanovcislonadpisu startalignment startbarva startbuffer startbuffer \
+startcitace startcolumns startcombination startdescription startdocument startenumeration \
+startfakt startfigure startfloattext startformula startframedtext starthiding \
+startinteraktivnimenu startitemgroup startkomentar startkomponenta startlegend startline \
+startlinecorrection startlinenumbering startlines startlocal startlocalenvironment startlocalfootnotes \
+startmakeup startmarginalnilinka startmarginblock startnamemakeup startnarrower startopposite \
+startoverlay startoverview startparagraph startpositioning startpostponing startpozadi \
+startprodukt startprofile startprojekt startprostredi startregister startsymbolset \
+startsynchronization starttable starttables starttabulate starttextovalinka starttyping \
+startunpacked startverze startzhustene stopalignment stopbarva stopbuffer \
+stopbuffer stopcitace stopcolumns stopcombination stopdescription stopdocument \
+stopenumeration stopfakt stopfigure stopfloattext stopformula stopframedtext \
+stophiding stopinteraktivnimenu stopitemgroup stopkomentar stopkomponenta stoplegend \
+stopline stoplinecorrection stoplinenumbering stoplines stoplocal stoplocalenvironment \
+stoplocalfootnotes stopmakeup stopmarginalnilinka stopmarginblock stopnamemakeup stopnarrower \
+stopopposite stopoverlay stopoverview stopparagraph stoppositioning stoppostponing \
+stoppozadi stopprodukt stopprofile stopprojekt stopprostredi stopsymbolset \
+stopsynchronization stoptable stoptables stoptabulate stoptextovalinka stoptyping \
+stopunpacked stopverze stopzhustene strana sub subject \
+subsection subsubject subsubsection subsubsubject sym symbol \
+synchronizacnilista synchronizovat synonym tab tecky tenkalinka \
+tenkelinky tex texthlavicky textovalinka textpopisku title \
+tlacitko tref tvrdemezery typebuffer typstrany ukazbarvu \
+ukazexterniobrazy ukazmrizku ukaznastaveni ukazpaletu ukazpodpery ukazpole \
+ukazpostredizakladnihofontu ukazramecek ukazsadusymbolu ukazskupinubarev ukazupravu ukazvytisk \
+ukazvzhled ukazzakladnifont umistikombinovanyseznam umistikombinovanyseznam umistilegendu umistiloga \
+umistilokalnipoznamkypodcarou umistinadsebe umistinamrizku umistipodrovnici umistipoznamkypodcarou umistirejstrik \
+umistirejstrik umistirovnici umistiseznam umistivedlesebe umistizalozky underbar \
+underbars usedirectory usetypescript usetypescriptfile uzijURL uzijbloky \
uzijexternidokument uzijexterniobraz uzijexternisoubor uzijexternisoubory uzijexternizvuk uzijkodovani \
uzijmodul uzijodkazy uzijprikazy uzijspeciality uzijsymbol verze \
vl vlasovalinka vlevo vpravo vradku vsedniden \
diff --git a/context/data/scite/cont-de-scite.properties b/context/data/scite/cont-de-scite.properties
index f749bfe97..8f27d5256 100644
--- a/context/data/scite/cont-de-scite.properties
+++ b/context/data/scite/cont-de-scite.properties
@@ -18,75 +18,75 @@ definierereferenzliste definiereregister definiereschrift definieresortieren def
definieresymbol definieresynonyme definieretabellenvorlage definieretabulator definieretext definieretippen \
definiereueberschrift definiereumbruch definiereumrahmt definiereumrahmtertext definiereversion definierezusammengestellteliste \
description doppelseite doppelseitigespapier drehen duennelinie duennerumriss \
-durchgestrichen durchstreichen einezeile einziehen emptylines entknuepfebeschriftung \
-enumeration externeabbildung farbe feld feldstapel festesspatium \
-folgeprofil folgeprofilversion folgeversion footnotetext forceblocks format \
-framedtext fussnote gefuelltesrechteck gefuelltezeile gestreckt gitter \
-graufarbe haarlinie hauptsprache heutigesdatum heutigeskopfnummer hintergrund \
-hl hoch holebeschriftung holepuffer imlinken imrechten \
-imumriss in inaktiviereinteraktionsmenue inanderermarginale indentation ininner \
-inmarginalie inouter installieresprache interaktionsbalken interaktionsknopfe inzeile \
-irgendwo its keinebeschriftung keinebloeckemehr keinedateienmehr keinekopfundfusszeilen \
-keineliste keinspatium keinzeilenobenundunten keinzwischenraum kleinerdurchschuss klonierefeld \
-knopf kommentar konvertierezahl kopf kopfnummer kopierefeld \
-korrigierezwischenraum labeling labels labeltext linksbuendig listsymbol \
-loadsorts loadsynonyms mapfontsize mar marginallinie marginaltext \
-mathematik mediaeval monat nachunten name nextsection \
-nichteinziehen nocap nop notiz paragraph part \
-passelayoutan passendfeld placefloat placelistoffloats placelistofsorts placelistofsynonyms \
-placereferencelist platzierebookmarks platziereformel platzierefussnoten platzierelegende platziereliste \
-platzierelogo platzierelokalefussnoten platzierenebeneinander platziereregister platziereregister platziereuntereinander \
-platziereunterformel platzierezusammengestellteliste platzierezusammengestellteliste pos position posten \
-programm publikation punkt ran rechteck rechtecke \
-rechtsbuendig ref referenz register registrierefelder reservefloat \
-resettextcontent roemischezahlen ruecksetzten ruecksetztenbeschriftung schreibezumregister schreibezurliste \
-schreibezurreferenzliste schreibezwischenliste section seeregister seite seitenreferenz \
-seitentyp settext setupfonthandling setupfontsynonym setupforms setupinterlinespace2 \
-setupitemgroup setuplistalternative setuppaper setupstrut showsymbolset sort \
-spalte spatium spiegeln sprache startalignment startbuffer \
-startbuffer startcolumns startcombination startdescription startdocument startenumeration \
-startfarbe startfigure startfloattext startformula startframedtext startgeg \
-starthiding starthintergrund startinteraktionsmenue startitemgroup startkleinerdurchschuss startkommentar \
-startkomponente startlegend startline startlinecorrection startlinenumbering startlines \
-startlocal startlocalenvironment startlocalfootnotes startmakeup startmarginallinie startmarginblock \
-startnamemakeup startnarrower startopposite startoverlay startoverview startparagraph \
-startpositioning startpostponing startprodukt startprofile startprojekt startregister \
-startsymbolset startsynchronization starttable starttables starttabulate starttextlinie \
-starttyping startumgebung startunpacked startversion startzitat stelleabsaetzeein \
-stelleabsatznummerierungein stelleabschnittein stelleabschnittsblockein stelleanordnenein stelleausgabeein stelleausrichtungein \
-stelleausschnittein stellebeschreibungein stellebeschriftungein stellebilderunterschriftein stellebildunterschriftein stellebindestrichein \
-stelleblankoein stelleblockein stelledrehenein stelleduennerumrissein stelleeinziehenein stelleeinzuegein \
-stelleengerein stelleexterneabbildungenein stellefarbeein stellefarbenein stellefeldein stellefelderin \
-stellefliesstextein stellefliesstextumgebungein stelleformelnein stellefussnotendefinitionein stellefussnotenein stellefusszeileein \
-stellefusszeilentextein stellegefuelltesrechteckein stellegefuelltezeileein stellegegenueberplatzierenein stellegleitobjekteein stellegleitobjektein \
-stellehintergruendeein stellehintergrundein stelleinmarginalieein stelleinteraktionein stelleinteraktionsbalkenein stelleinteraktionsbildschirmein \
-stelleinteraktionsmenueein stelleknopfein stellekombinationein stellekommentarein stellekopfzahlein stellekopfzeileein \
-stellekopfzeilentextein stellelabeltextein stellelayoutein stellelegendeein stellelinienbreiteein stellelisteein \
-stellemarginalblockein stellemarginallinieein stellenobenein stellenummerierungein stellepaletteein stellepapierformatein \
-stelleplatziegeteiltegleitobjekt stellepositionierenein stellepostenein stelleprofilein stelleprogrammein stellepublikationein \
-stellepufferein stellerasterein stellerechteckein stellereferenzierenein stellereferenzlisteein stelleregisterein \
-stelleseitennummerein stelleseitennummeriernungein stelleseitenuebergangein stellesortierenein stellespaltenein stellespatiumein \
-stellespracheein stellesymbolsetein stellesynchronisationein stellesynchronisationsbalkenein stellesynonymein stellesystemein \
-stelletabein stelletabellenein stelletabulatorein stelletextein stelletextobenein stelletexttexteein \
-stelletextumrissein stelletextuntenein stelletipein stelletippenein stelletoleranzein stelleueberschriftein \
-stelleueberschriftenein stelleueberschrifttextein stelleumbruchein stelleumrahmtein stelleumrahmtetexteein stelleuntenein \
-stelleunterseitennummerein stelleunterstreichenein stelleurlein stelleversalienein stelleversionein stellezeilenabstandein \
-stellezeilenein stellezeilennumerierungein stellezitierenein stellezusammengestelltelisteein stellezwischenraumein stopalignment \
-stopbuffer stopbuffer stopcolumns stopcombination stopdescription stopdocument \
-stopenumeration stopfarbe stopfigure stopfloattext stopformula stopframedtext \
-stopgeg stophiding stophintergrund stopinteraktionsmenue stopitemgroup stopkleinerdurchschuss \
-stopkommentar stopkomponente stoplegend stopline stoplinecorrection stoplinenumbering \
-stoplines stoplocal stoplocalenvironment stoplocalfootnotes stopmakeup stopmarginallinie \
-stopmarginblock stopnamemakeup stopnarrower stopopposite stopoverlay stopoverview \
-stopparagraph stoppositioning stoppostponing stopprodukt stopprofile stopprojekt \
-stopsymbolset stopsynchronization stoptable stoptables stoptabulate stoptextlinie \
-stoptyping stopumgebung stopunpacked stopversion stopzitat sub \
-subject subsection subsubject subsubsection subsubsubject sym \
-symbol synchronisationsbalken synchronisieren synonym tab teilegleitobjekt \
-tex textlinie textreferenz tief tiho tip \
-tippedatei tippen tippepuffer title tooltip ueber \
-ueberschrifttext uebersetzten ueberstreichen ueberstrichen umrahmt unterstreichen \
-unterstrichen usedirectory usetypescript usetypescriptfile verbergebloecke vergleichefarbengruppe \
+einezeile einziehen emptylines entknuepfebeschriftung enumeration externeabbildung \
+farbe feld feldstapel festesspatium folgeprofil folgeprofilversion \
+folgeversion footnotetext forceblocks format framedtext fussnote \
+gefuelltesrechteck gefuelltezeile gestreckt gitter graufarbe haarlinie \
+hauptsprache heutigesdatum heutigeskopfnummer hintergrund hl hoch \
+holebeschriftung holepuffer imlinken imrechten imumriss in \
+inaktiviereinteraktionsmenue inanderermarginale indentation ininner inmarginalie inouter \
+installieresprache interaktionsbalken interaktionsknopfe inzeile irgendwo its \
+keinebeschriftung keinebloeckemehr keinedateienmehr keinekopfundfusszeilen keineliste keinspatium \
+keinzeilenobenundunten keinzwischenraum kleinerdurchschuss klonierefeld knopf kommentar \
+konvertierezahl kopf kopfnummer kopierefeld korrigierezwischenraum labeling \
+labels labeltext linksbuendig listsymbol loadsorts loadsynonyms \
+mapfontsize mar marginallinie marginaltext mathematik mediaeval \
+monat nachunten name nextsection nichteinziehen nocap \
+nop notiz overbar overbars overstrike overstrikes \
+paragraph part passelayoutan passendfeld placefloat placelistoffloats \
+placelistofsorts placelistofsynonyms placereferencelist platzierebookmarks platziereformel platzierefussnoten \
+platzierelegende platziereliste platzierelogo platzierelokalefussnoten platzierenebeneinander platziereregister \
+platziereregister platziereuntereinander platziereunterformel platzierezusammengestellteliste platzierezusammengestellteliste pos \
+position posten programm publikation punkt ran \
+rechteck rechtecke rechtsbuendig ref referenz register \
+registrierefelder reservefloat resettextcontent roemischezahlen ruecksetzten ruecksetztenbeschriftung \
+schreibezumregister schreibezurliste schreibezurreferenzliste schreibezwischenliste section seeregister \
+seite seitenreferenz seitentyp settext setupfonthandling setupfontsynonym \
+setupforms setupinterlinespace2 setupitemgroup setuplistalternative setuppaper setupstrut \
+showsymbolset sort spalte spatium spiegeln sprache \
+startalignment startbuffer startbuffer startcolumns startcombination startdescription \
+startdocument startenumeration startfarbe startfigure startfloattext startformula \
+startframedtext startgeg starthiding starthintergrund startinteraktionsmenue startitemgroup \
+startkleinerdurchschuss startkommentar startkomponente startlegend startline startlinecorrection \
+startlinenumbering startlines startlocal startlocalenvironment startlocalfootnotes startmakeup \
+startmarginallinie startmarginblock startnamemakeup startnarrower startopposite startoverlay \
+startoverview startparagraph startpositioning startpostponing startprodukt startprofile \
+startprojekt startregister startsymbolset startsynchronization starttable starttables \
+starttabulate starttextlinie starttyping startumgebung startunpacked startversion \
+startzitat stelleabsaetzeein stelleabsatznummerierungein stelleabschnittein stelleabschnittsblockein stelleanordnenein \
+stelleausgabeein stelleausrichtungein stelleausschnittein stellebeschreibungein stellebeschriftungein stellebilderunterschriftein \
+stellebildunterschriftein stellebindestrichein stelleblankoein stelleblockein stelledrehenein stelleduennerumrissein \
+stelleeinziehenein stelleeinzuegein stelleengerein stelleexterneabbildungenein stellefarbeein stellefarbenein \
+stellefeldein stellefelderin stellefliesstextein stellefliesstextumgebungein stelleformelnein stellefussnotendefinitionein \
+stellefussnotenein stellefusszeileein stellefusszeilentextein stellegefuelltesrechteckein stellegefuelltezeileein stellegegenueberplatzierenein \
+stellegleitobjekteein stellegleitobjektein stellehintergruendeein stellehintergrundein stelleinmarginalieein stelleinteraktionein \
+stelleinteraktionsbalkenein stelleinteraktionsbildschirmein stelleinteraktionsmenueein stelleknopfein stellekombinationein stellekommentarein \
+stellekopfzahlein stellekopfzeileein stellekopfzeilentextein stellelabeltextein stellelayoutein stellelegendeein \
+stellelinienbreiteein stellelisteein stellemarginalblockein stellemarginallinieein stellenobenein stellenummerierungein \
+stellepaletteein stellepapierformatein stelleplatziegeteiltegleitobjekt stellepositionierenein stellepostenein stelleprofilein \
+stelleprogrammein stellepublikationein stellepufferein stellerasterein stellerechteckein stellereferenzierenein \
+stellereferenzlisteein stelleregisterein stelleseitennummerein stelleseitennummeriernungein stelleseitenuebergangein stellesortierenein \
+stellespaltenein stellespatiumein stellespracheein stellesymbolsetein stellesynchronisationein stellesynchronisationsbalkenein \
+stellesynonymein stellesystemein stelletabein stelletabellenein stelletabulatorein stelletextein \
+stelletextobenein stelletexttexteein stelletextumrissein stelletextuntenein stelletipein stelletippenein \
+stelletoleranzein stelleueberschriftein stelleueberschriftenein stelleueberschrifttextein stelleumbruchein stelleumrahmtein \
+stelleumrahmtetexteein stelleuntenein stelleunterseitennummerein stelleunterstreichenein stelleurlein stelleversalienein \
+stelleversionein stellezeilenabstandein stellezeilenein stellezeilennumerierungein stellezitierenein stellezusammengestelltelisteein \
+stellezwischenraumein stopalignment stopbuffer stopbuffer stopcolumns stopcombination \
+stopdescription stopdocument stopenumeration stopfarbe stopfigure stopfloattext \
+stopformula stopframedtext stopgeg stophiding stophintergrund stopinteraktionsmenue \
+stopitemgroup stopkleinerdurchschuss stopkommentar stopkomponente stoplegend stopline \
+stoplinecorrection stoplinenumbering stoplines stoplocal stoplocalenvironment stoplocalfootnotes \
+stopmakeup stopmarginallinie stopmarginblock stopnamemakeup stopnarrower stopopposite \
+stopoverlay stopoverview stopparagraph stoppositioning stoppostponing stopprodukt \
+stopprofile stopprojekt stopsymbolset stopsynchronization stoptable stoptables \
+stoptabulate stoptextlinie stoptyping stopumgebung stopunpacked stopversion \
+stopzitat sub subject subsection subsubject subsubsection \
+subsubsubject sym symbol synchronisationsbalken synchronisieren synonym \
+tab teilegleitobjekt tex textlinie textreferenz tief \
+tiho tip tippedatei tippen tippepuffer title \
+tooltip ueber ueberschrifttext uebersetzten umrahmt underbar \
+underbars usedirectory usetypescript usetypescriptfile verbergebloecke vergleichefarbengruppe \
vergleichepalette verknuepfebeschriftung verknuepfedokument verknuepfregister version verweis \
verweisdatum verwendeURL verwendebefehl verwendebloecke verwendeexteresdokument verwendeexterneabbildung \
verwendeexternedatei verwendeexternedateien verwendeexternestonstueck verwendemodul verwendereferenzen verwendesymbole \
diff --git a/context/data/scite/cont-fr-scite.properties b/context/data/scite/cont-fr-scite.properties
index caa7069db..4aa4d8a86 100644
--- a/context/data/scite/cont-fr-scite.properties
+++ b/context/data/scite/cont-fr-scite.properties
@@ -36,38 +36,38 @@ montrecouleur montredisposition montreedition montreenvironnementpolicecorps mon
montregroupecouleur montrejeusymboles montremakeup montrepalette montrepolicecorps montrereglages \
montrestruts motdroit name nextsection nocap nop \
note notepdp numeros numerotete numerotetecourant obtientmarquage \
-oriente overbar overbars page pagedouble paragraph \
-part pasplusdeblocs pasplusdefichiers periodes pilechamp placecoteacote \
-placeflottant placeformule placelegende placelesunsaudessusdesautres placeliste placelisteinmbriquee \
-placelisteinmbriquee placelistereference placelistoffloats placelistofsorts placelistofsynonyms placelogos \
-placemarquespages placenotespdp placenotespdplocales placeregistre placeregistre placesousformule \
-placesurgrille position prendbuffer programme publication qqpart \
-ran raz razmarquage recommandation ref reference \
-referencepage referencetexte reflete register reglealignement reglealineas \
-reglearrangement reglearriereplan reglearriereplans reglebarreinteraction reglebarresynchronisation reglebloc \
-regleblocmarge regleblocsection regleboutons reglebuffer reglecapitales reglechamp \
-reglechamps regleclipping reglecolonnes reglecombinaisons reglecommentaire reglecompoetroite \
-reglecomposeenalinea reglecouleur reglecouleurs regledactylo regledansmarge regledescriptions \
-regledisposition regleecraninteraction regleecrans regleelements regleencadre regleentete \
-regleenumerations regleenvironnementpolicecorps regleepaisseurligne regleespaceblanc regleespacement regleespacementinterligne \
-reglefiguresexternes regleflottant regleflottants regleformulaires regleformules regleinf \
-regleinteraction regleintitule regleintitules reglejeusymboles reglelabeltexte reglelangue \
-reglelegende reglelignes reglelignesnoires reglelignesreglestexte regleliste reglelisteimbriquee \
-reglelistereference reglemakeup reglemargereglee reglemarquage reglemarquagehyphenation reglemenuinteraction \
-reglenotepdp reglenumeropage reglenumerotation reglenumerotationligne reglenumerotationpage reglenumerotationparagraphe \
-reglenumerotete regleoriente reglepalette reglepapier regleparagraphes reglepdp \
-regleplacementopposition reglepolicecorps reglepositionnement regleprofils regleprogrammes reglepublications \
-reglereferencage regleregistre regleremplitligne regleremplitlignesreglees reglesection regleseparationflottant \
-reglesortie reglesouslignage reglesousnumeropage reglestrut reglesup reglesynchronisation \
-reglesynonymes reglesysteme regletab regletableaux regletabulation regletaillepapier \
-regletete regletetes regletexte regletextesentete regletextesinf regletextespdp \
-regletextessup regletextestexte regletextetete regletolerance regletraitsfins regletransitionspage \
-regletri regletype regleurl regleversions remplitchamp remplitligne \
-remplitlignesreglees remplittexte reservefloat resettextcontent sansalinea sansespace \
-sansespaceblanc sanslignesenteteetpdp sanslignessupetinf sansliste sansmarquage sauteblocs \
-section seeregister selectionneblocs selectionnepapier selectionneversion separeflottant \
-settext setupfonthandling setupfontsynonym setupframedtexts setupinterlinespace2 setupitemgroup \
-setuplistalternative sort sousligne souslignetout startalignment startarriereplan \
+oriente overbar overbars overstrike overstrikes page \
+pagedouble paragraph part pasplusdeblocs pasplusdefichiers periodes \
+pilechamp placecoteacote placeflottant placeformule placelegende placelesunsaudessusdesautres \
+placeliste placelisteinmbriquee placelisteinmbriquee placelistereference placelistoffloats placelistofsorts \
+placelistofsynonyms placelogos placemarquespages placenotespdp placenotespdplocales placeregistre \
+placeregistre placesousformule placesurgrille position prendbuffer programme \
+publication qqpart ran raz razmarquage recommandation \
+ref reference referencepage referencetexte reflete register \
+reglealignement reglealineas reglearrangement reglearriereplan reglearriereplans reglebarreinteraction \
+reglebarresynchronisation reglebloc regleblocmarge regleblocsection regleboutons reglebuffer \
+reglecapitales reglechamp reglechamps regleclipping reglecolonnes reglecombinaisons \
+reglecommentaire reglecompoetroite reglecomposeenalinea reglecouleur reglecouleurs regledactylo \
+regledansmarge regledescriptions regledisposition regleecraninteraction regleecrans regleelements \
+regleencadre regleentete regleenumerations regleenvironnementpolicecorps regleepaisseurligne regleespaceblanc \
+regleespacement regleespacementinterligne reglefiguresexternes regleflottant regleflottants regleformulaires \
+regleformules regleinf regleinteraction regleintitule regleintitules reglejeusymboles \
+reglelabeltexte reglelangue reglelegende reglelignes reglelignesnoires reglelignesreglestexte \
+regleliste reglelisteimbriquee reglelistereference reglemakeup reglemargereglee reglemarquage \
+reglemarquagehyphenation reglemenuinteraction reglenotepdp reglenumeropage reglenumerotation reglenumerotationligne \
+reglenumerotationpage reglenumerotationparagraphe reglenumerotete regleoriente reglepalette reglepapier \
+regleparagraphes reglepdp regleplacementopposition reglepolicecorps reglepositionnement regleprofils \
+regleprogrammes reglepublications reglereferencage regleregistre regleremplitligne regleremplitlignesreglees \
+reglesection regleseparationflottant reglesortie reglesouslignage reglesousnumeropage reglestrut \
+reglesup reglesynchronisation reglesynonymes reglesysteme regletab regletableaux \
+regletabulation regletaillepapier regletete regletetes regletexte regletextesentete \
+regletextesinf regletextespdp regletextessup regletextestexte regletextetete regletolerance \
+regletraitsfins regletransitionspage regletri regletype regleurl regleversions \
+remplitchamp remplitligne remplitlignesreglees remplittexte reservefloat resettextcontent \
+sansalinea sansespace sansespaceblanc sanslignesenteteetpdp sanslignessupetinf sansliste \
+sansmarquage sauteblocs section seeregister selectionneblocs selectionnepapier \
+selectionneversion separeflottant settext setupfonthandling setupfontsynonym setupframedtexts \
+setupinterlinespace2 setupitemgroup setuplistalternative sort startalignment startarriereplan \
startbuffer startbuffer startcitation startcolumns startcombination startcommentaire \
startcomposant startcouleur startdescription startdocument startenumeration startenvironement \
startfait startfigure startfloattext startformula startframedtext startgroupe \
@@ -87,10 +87,10 @@ stopopposite stopoverlay stopoverview stopparagraph stoppositioning stoppostponi
stopproduit stopprofile stopprojet stopsymbolset stopsynchronization stoptable \
stoptables stoptabulate stoptyping stopunpacked stopversion sub \
subject subsection subsubject subsubsection subsubsubject suggestion \
-suivantprofil suivantversion suivantversionprofil surligne surlignetout sym \
-symbole synchronise synonym tab tapebuffer tapepage \
-tete tex textemarge textenotepdp textetete title \
-traduire traiteblocs traitepage traitfin traitsfins typ \
+suivantprofil suivantversion suivantversionprofil sym symbole synchronise \
+synonym tab tapebuffer tapepage tete tex \
+textemarge textenotepdp textetete title traduire traiteblocs \
+traitepage traitfin traitsfins typ underbar underbars \
uneligne usedirectory usetypescript usetypescriptfile utiliseURL utiliseblocs \
utilisecommandes utilisedocumentexterne utiliseencodage utilisefichierexterne utilisefichiersexternes utilisefigureexterne \
utilisemodule utilisepsiteaudioexterne utilisereferences utilisespecialites utilisesymboles va \
diff --git a/context/data/scite/cont-it-scite.properties b/context/data/scite/cont-it-scite.properties
index 0a6a31425..7cd230772 100644
--- a/context/data/scite/cont-it-scite.properties
+++ b/context/data/scite/cont-it-scite.properties
@@ -56,42 +56,42 @@ mostraimpostazioni mostralyout mostramakeup mostrasetsimboli mostrastampa mostra
mostratavolozza name nascondiblocchi nextsection nienteelenco nientelineecimafondo \
nientelineintestazionepdp nientemarcatura nienterientro nientespazio nientespaziobianco nocap \
nop nota notapdp numeri numeriromani numerotesta \
-numerotestacorrente pagina paragraph paroladestra part ped \
-pedap placefloat placelistoffloats placelistofsorts placelistofsynonyms placereferencelist \
-posizione prendibuffer prendimarcatura programma pubblicazione pulsante \
-pulsantinterazione punti qualcheriga ran referral register \
-reimposta reimpostamarcatura reservefloat resettextcontent rientro rif \
-riferimento riferimentopagina riferimentotesto riflessione rigariempimento rigovuoto \
-ruota saltablocchi sbarrati sbarrato scala schermo \
-scrividentroelenco scriviinelenco scriviinlistariferimenti scriviinregistro section seeregister \
-segnalibro seguiprofilo seguiversione seguiversioneprofilo selezionablocchi selezionacarta \
-selezionaversione separamarcatura settext setupfonthandling setupfontsynonym setupinterlinespace2 \
-setupitemgroup setuplistalternative setuppaper sfondo sim simbolo \
-sincronizza sopralinea sopralinee sort sottolinea sottolinee \
-spazifissi spazio spaziobianco spezzaoggettomobile spostaagriglia stackcampi \
-startalignment startambiente startbuffer startbuffer startcitazione startcolore \
-startcolumns startcombination startcommento startcomponenet startdescription startdocument \
-startenumeration startfatto startfigure startfloattext startformula startframedtext \
-starthiding startimpaccato startitemgroup startlegend startline startlineamargine \
-startlineatesto startlinecorrection startlinenumbering startlines startlocal startlocalenvironment \
-startlocalfootnotes startmakeup startmarginblock startmenuinterattivo startnamemakeup startnarrower \
-startopposite startoverlay startoverview startparagraph startpositioning startpostponing \
-startprodotto startprofile startprogetto startregister startsfondo startsymbolset \
-startsynchronization starttable starttables starttabulate starttyping startunpacked \
-startversione stirato stopalignment stopambiente stopbuffer stopbuffer \
-stopcitazione stopcolore stopcolumns stopcombination stopcommento stopcomponenet \
-stopdescription stopdocument stopenumeration stopfatto stopfigure stopfloattext \
-stopformula stopframedtext stophiding stopimpaccato stopitemgroup stoplegend \
-stopline stoplineamargine stoplineatesto stoplinecorrection stoplinenumbering stoplines \
-stoplocal stoplocalenvironment stoplocalfootnotes stopmakeup stopmarginblock stopmenuinterattivo \
-stopnamemakeup stopnarrower stopopposite stopoverlay stopoverview stopparagraph \
-stoppositioning stoppostponing stopprodotto stopprofile stopprogetto stopsfondo \
-stopsymbolset stopsynchronization stoptable stoptables stoptabulate stoptyping \
-stopunpacked stopversione sub subject subsection subsubject \
-subsubsection subsubsubject synonym tab testa testoetichetta \
-testoinmargine testoinstestazioni testonotapdp testoriempimento tex tieniblocchi \
-tipopagina title tooltip traduci typ type \
-typebuffer typefile usaURL usablocco usacodifica usacolonnasonoraesterna \
+numerotestacorrente overbar overbars overstrike overstrikes pagina \
+paragraph paroladestra part ped pedap placefloat \
+placelistoffloats placelistofsorts placelistofsynonyms placereferencelist posizione prendibuffer \
+prendimarcatura programma pubblicazione pulsante pulsantinterazione punti \
+qualcheriga ran referral register reimposta reimpostamarcatura \
+reservefloat resettextcontent rientro rif riferimento riferimentopagina \
+riferimentotesto riflessione rigariempimento rigovuoto ruota saltablocchi \
+scala schermo scrividentroelenco scriviinelenco scriviinlistariferimenti scriviinregistro \
+section seeregister segnalibro seguiprofilo seguiversione seguiversioneprofilo \
+selezionablocchi selezionacarta selezionaversione separamarcatura settext setupfonthandling \
+setupfontsynonym setupinterlinespace2 setupitemgroup setuplistalternative setuppaper sfondo \
+sim simbolo sincronizza sort spazifissi spazio \
+spaziobianco spezzaoggettomobile spostaagriglia stackcampi startalignment startambiente \
+startbuffer startbuffer startcitazione startcolore startcolumns startcombination \
+startcommento startcomponenet startdescription startdocument startenumeration startfatto \
+startfigure startfloattext startformula startframedtext starthiding startimpaccato \
+startitemgroup startlegend startline startlineamargine startlineatesto startlinecorrection \
+startlinenumbering startlines startlocal startlocalenvironment startlocalfootnotes startmakeup \
+startmarginblock startmenuinterattivo startnamemakeup startnarrower startopposite startoverlay \
+startoverview startparagraph startpositioning startpostponing startprodotto startprofile \
+startprogetto startregister startsfondo startsymbolset startsynchronization starttable \
+starttables starttabulate starttyping startunpacked startversione stirato \
+stopalignment stopambiente stopbuffer stopbuffer stopcitazione stopcolore \
+stopcolumns stopcombination stopcommento stopcomponenet stopdescription stopdocument \
+stopenumeration stopfatto stopfigure stopfloattext stopformula stopframedtext \
+stophiding stopimpaccato stopitemgroup stoplegend stopline stoplineamargine \
+stoplineatesto stoplinecorrection stoplinenumbering stoplines stoplocal stoplocalenvironment \
+stoplocalfootnotes stopmakeup stopmarginblock stopmenuinterattivo stopnamemakeup stopnarrower \
+stopopposite stopoverlay stopoverview stopparagraph stoppositioning stoppostponing \
+stopprodotto stopprofile stopprogetto stopsfondo stopsymbolset stopsynchronization \
+stoptable stoptables stoptabulate stoptyping stopunpacked stopversione \
+sub subject subsection subsubject subsubsection subsubsubject \
+synonym tab testa testoetichetta testoinmargine testoinstestazioni \
+testonotapdp testoriempimento tex tieniblocchi tipopagina title \
+tooltip traduci typ type typebuffer typefile \
+underbar underbars usaURL usablocco usacodifica usacolonnasonoraesterna \
usacomandi usadocumentoesterno usafiguraesterna usafileesterni usafileesterno usamodulo \
usariferimenti usasimboli usaspecialita usedirectory usetypescript usetypescriptfile \
vaia vaiabox vaigiu versione vl
\ No newline at end of file
diff --git a/context/data/scite/cont-nl-scite.properties b/context/data/scite/cont-nl-scite.properties
index e3254a5b4..4aee5bf20 100644
--- a/context/data/scite/cont-nl-scite.properties
+++ b/context/data/scite/cont-nl-scite.properties
@@ -16,81 +16,81 @@ definieerreferentieformaat definieerreferentielijst definieerregister definieers
definieersorteren definieerstartstop definieersubveld definieersymbool definieersynoniemen definieertabelvorm \
definieertabulatie definieertekst definieertype definieertypen definieeruitvoer definieerveld \
definieerveldstapel definieerversie description doordefinieren doorlabelen doornummeren \
-doorspringen doorstreep doorstrepen dunnelijn dunnelijnen eenregel \
-enumeration ergens externfiguur forceerblokken framedtext gebruikURL \
-gebruikblokken gebruikcommandos gebruikexterndocument gebruikexternefile gebruikexternefiles gebruikexternfiguur \
-gebruikexterngeluidsfragment gebruikmodule gebruikreferenties gebruikspecials gebruiksymbolen gebruiktypescript \
-gebruiktypescriptfile geenblokkenmeer geenbovenenonderregels geenfilesmeer geenhoofdenvoetregels geenlijst \
-geenmarkering geenspatie geenwitruimte grijskleur haalbuffer haalmarkering \
-haarlijn handhaafblokken hl hoofdtaal hoog huidigedatum \
-huidigekopnummer in inanderemarge inbinnen inbuiten indentation \
-inlijnd inlinker inmarge inrechter inregel inspringen \
-installeertaal interactiebalk interactiebuttons invullijnen invulregel invultekst \
-invulveld items its kantlijn kenmerk kenmerkdatum \
-kleur kloonveld kolom kop kopnummer koppeldocument \
-koppelmarkering koppelpagina koppelpapier koppelregister koptekst laag \
-labeling labels labeltekst laho legeregels letter \
-letters lijstsymbool loadsorts loadsynonyms maand mapfontsize \
-mar margetekst markeer markeerversie mediaeval naar \
-naarbox name nextsection nietinspringen nocap noot \
-nop omlaag omlijnd onderstreep onderstrepen ontkoppelmarkering \
-op opelkaar oppagina overstreep overstrepen pagina \
-paginareferentie paragraph part paslayoutaan passeerblokken passendveld \
-plaatsbeeldmerken plaatsbookmarks plaatsformule plaatslegenda plaatslijst plaatslokalevoetnoten \
-plaatsnaastelkaar plaatsonderelkaar plaatsopgrid plaatsplaatsblok plaatsreferentielijst plaatsregister \
-plaatsregister plaatssamengesteldelijst plaatssamengesteldelijst plaatssubformule plaatsvoetnoten placelistoffloats \
-placelistofsorts placelistofsynonyms positioneer programma publicatie punten \
-ran ref referentie regellinks regelmidden regelrechts \
-register registreervelden reservefloat reset resetmarkering resettextcontent \
-romeins rooster roteer schaal scherm schrijfnaarlijst \
-schrijfnaarreferentielijst schrijfnaarregister schrijftussenlijst section seeregister selecteerblokken \
-selecteerpapier selecteerversie setupfonthandling setupfontsynonym setupinterlinespace2 setuplistalternative \
-som soortpagina sort spatie spiegel splitsplaatsblok \
-startachtergrond startalignment startbuffer startbuffer startcitaat startcolumns \
-startcombination startcommentaar startdescription startdocument startenumeration startfigure \
-startfloattext startformula startframedtext startgeg starthiding startinteractiemenu \
-startitemgroup startkantlijn startkleur startlegend startline startlinecorrection \
-startlinenumbering startlines startlocal startlocalenvironment startlocalfootnotes startmakeup \
-startmarginblock startnamemakeup startnarrower startomgeving startonderdeel startopelkaar \
-startopposite startoverlay startoverview startparagraph startpositioning startpostponing \
-startprodukt startprofile startprojekt startregister startsymbolset startsynchronization \
-starttable starttables starttabulate starttekstlijn starttyping startunpacked \
-startversie stelachtergrondenin stelachtergrondin stelalineasin stelarrangerenin stelblankoin \
-stelblokin stelblokjesin stelblokkopjein stelblokkopjesin stelbovenin stelboventekstenin \
-stelbufferin stelbuttonsin stelciterenin stelclipin stelcombinatiesin stelcommentaarin \
-steldoordefinierenin steldoornummerenin steldoorspringenin steldunnelijnenin stelexternefigurenin stelformulesin \
-stelformulierenin stelhoofdin stelhoofdtekstenin stelinmargein stelinspringenin stelinteractiebalkin \
-stelinteractiein stelinteractiemenuin stelinteractieschermin stelinterliniein stelinvullijnenin stelinvulregelsin \
-stelitemgroepin stelitemsin stelkadertekstenin stelkantlijnin stelkapitalenin stelkleurenin \
-stelkleurin stelkolommenin stelkopin stelkopnummerin stelkoppeltekenin stelkoppenin \
-stelkoptekstin stelkorpsin stelkorpsomgevingin stellabeltekstin stellayoutin stellegendain \
-stellijndiktein stellijstin stelmargeblokkenin stelmarkeringin stelnaastplaatsenin stelnummerenin \
-stelomlijndin stelonderin stelonderstrepenin stelondertekstenin stelopmaakin stelpaginanummerin \
-stelpaginanummeringin stelpaginaovergangenin stelpaletin stelpapierformaatin stelpapierin stelparagraafnummerenin \
-stelplaatsblokin stelplaatsblokkenin stelplaatsbloksplitsenin stelpositionerenin stelprofielenin stelprogrammasin \
-stelpublicatiesin stelrastersin stelreferentielijstin stelrefererenin stelregelnummerenin stelregelsin \
-stelregisterin stelroterenin stelsamengesteldelijstin stelsectieblokin stelsectiein stelsmallerin \
-stelsorterenin stelspatieringin stelstrutin stelsubpaginanummerin stelsymboolsetin stelsynchronisatiebalkin \
-stelsynchronisatiein stelsynoniemenin stelsysteemin steltaalin steltabellenin steltabin \
-steltabulatiein steltekstin steltekstinhoudin steltekstlijnenin stelteksttekstenin steltolerantiein \
-steltypein steltypenin steluitlijnenin steluitvoerin stelurlin stelveldenin \
-stelveldin stelversiesin stelvoetin stelvoetnootdefinitiein stelvoetnotenin stelvoettekstenin \
-stelwitruimtein stopachtergrond stopalignment stopbuffer stopbuffer stopcitaat \
-stopcolumns stopcombination stopcommentaar stopdescription stopdocument stopenumeration \
-stopfigure stopfloattext stopformula stopframedtext stopgeg stophiding \
-stopinteractiemenu stopitemgroup stopkantlijn stopkleur stoplegend stopline \
-stoplinecorrection stoplinenumbering stoplines stoplocal stoplocalenvironment stoplocalfootnotes \
-stopmakeup stopmarginblock stopnamemakeup stopnarrower stopomgeving stoponderdeel \
-stopopelkaar stopopposite stopoverlay stopoverview stopparagraph stoppositioning \
-stoppostponing stopprodukt stopprofile stopprojekt stopsymbolset stopsynchronization \
-stoptable stoptables stoptabulate stoptekstlijn stoptyping stopunpacked \
-stopversie sub subject subsection subsubject subsubsection \
-subsubsubject suggestie switchnaarkorps sym symbool synchronisatiebalk \
-synchroniseer synonym taal tab tekstlijn tekstreferentie \
-tex title toonexternefiguren toongrid tooninstellingen toonkader \
-toonkleur toonkleurgroep toonkorps toonkorpsomgeving toonlayout toonopmaak \
-toonpalet toonprint toonstruts toonsymboolset toonvelden typ \
-type typebuffer typefile uit uitgerekt usecodering \
+doorspringen dunnelijn dunnelijnen eenregel enumeration ergens \
+externfiguur forceerblokken framedtext gebruikURL gebruikblokken gebruikcommandos \
+gebruikexterndocument gebruikexternefile gebruikexternefiles gebruikexternfiguur gebruikexterngeluidsfragment gebruikmodule \
+gebruikreferenties gebruikspecials gebruiksymbolen gebruiktypescript gebruiktypescriptfile geenblokkenmeer \
+geenbovenenonderregels geenfilesmeer geenhoofdenvoetregels geenlijst geenmarkering geenspatie \
+geenwitruimte grijskleur haalbuffer haalmarkering haarlijn handhaafblokken \
+hl hoofdtaal hoog huidigedatum huidigekopnummer in \
+inanderemarge inbinnen inbuiten indentation inlijnd inlinker \
+inmarge inrechter inregel inspringen installeertaal interactiebalk \
+interactiebuttons invullijnen invulregel invultekst invulveld items \
+its kantlijn kenmerk kenmerkdatum kleur kloonveld \
+kolom kop kopnummer koppeldocument koppelmarkering koppelpagina \
+koppelpapier koppelregister koptekst laag labeling labels \
+labeltekst laho legeregels letter letters lijstsymbool \
+loadsorts loadsynonyms maand mapfontsize mar margetekst \
+markeer markeerversie mediaeval naar naarbox name \
+nextsection nietinspringen nocap noot nop omlaag \
+omlijnd ontkoppelmarkering op opelkaar oppagina overbar \
+overbars overstrike overstrikes pagina paginareferentie paragraph \
+part paslayoutaan passeerblokken passendveld plaatsbeeldmerken plaatsbookmarks \
+plaatsformule plaatslegenda plaatslijst plaatslokalevoetnoten plaatsnaastelkaar plaatsonderelkaar \
+plaatsopgrid plaatsplaatsblok plaatsreferentielijst plaatsregister plaatsregister plaatssamengesteldelijst \
+plaatssamengesteldelijst plaatssubformule plaatsvoetnoten placelistoffloats placelistofsorts placelistofsynonyms \
+positioneer programma publicatie punten ran ref \
+referentie regellinks regelmidden regelrechts register registreervelden \
+reservefloat reset resetmarkering resettextcontent romeins rooster \
+roteer schaal scherm schrijfnaarlijst schrijfnaarreferentielijst schrijfnaarregister \
+schrijftussenlijst section seeregister selecteerblokken selecteerpapier selecteerversie \
+setupfonthandling setupfontsynonym setupinterlinespace2 setuplistalternative som soortpagina \
+sort spatie spiegel splitsplaatsblok startachtergrond startalignment \
+startbuffer startbuffer startcitaat startcolumns startcombination startcommentaar \
+startdescription startdocument startenumeration startfigure startfloattext startformula \
+startframedtext startgeg starthiding startinteractiemenu startitemgroup startkantlijn \
+startkleur startlegend startline startlinecorrection startlinenumbering startlines \
+startlocal startlocalenvironment startlocalfootnotes startmakeup startmarginblock startnamemakeup \
+startnarrower startomgeving startonderdeel startopelkaar startopposite startoverlay \
+startoverview startparagraph startpositioning startpostponing startprodukt startprofile \
+startprojekt startregister startsymbolset startsynchronization starttable starttables \
+starttabulate starttekstlijn starttyping startunpacked startversie stelachtergrondenin \
+stelachtergrondin stelalineasin stelarrangerenin stelblankoin stelblokin stelblokjesin \
+stelblokkopjein stelblokkopjesin stelbovenin stelboventekstenin stelbufferin stelbuttonsin \
+stelciterenin stelclipin stelcombinatiesin stelcommentaarin steldoordefinierenin steldoornummerenin \
+steldoorspringenin steldunnelijnenin stelexternefigurenin stelformulesin stelformulierenin stelhoofdin \
+stelhoofdtekstenin stelinmargein stelinspringenin stelinteractiebalkin stelinteractiein stelinteractiemenuin \
+stelinteractieschermin stelinterliniein stelinvullijnenin stelinvulregelsin stelitemgroepin stelitemsin \
+stelkadertekstenin stelkantlijnin stelkapitalenin stelkleurenin stelkleurin stelkolommenin \
+stelkopin stelkopnummerin stelkoppeltekenin stelkoppenin stelkoptekstin stelkorpsin \
+stelkorpsomgevingin stellabeltekstin stellayoutin stellegendain stellijndiktein stellijstin \
+stelmargeblokkenin stelmarkeringin stelnaastplaatsenin stelnummerenin stelomlijndin stelonderin \
+stelonderstrepenin stelondertekstenin stelopmaakin stelpaginanummerin stelpaginanummeringin stelpaginaovergangenin \
+stelpaletin stelpapierformaatin stelpapierin stelparagraafnummerenin stelplaatsblokin stelplaatsblokkenin \
+stelplaatsbloksplitsenin stelpositionerenin stelprofielenin stelprogrammasin stelpublicatiesin stelrastersin \
+stelreferentielijstin stelrefererenin stelregelnummerenin stelregelsin stelregisterin stelroterenin \
+stelsamengesteldelijstin stelsectieblokin stelsectiein stelsmallerin stelsorterenin stelspatieringin \
+stelstrutin stelsubpaginanummerin stelsymboolsetin stelsynchronisatiebalkin stelsynchronisatiein stelsynoniemenin \
+stelsysteemin steltaalin steltabellenin steltabin steltabulatiein steltekstin \
+steltekstinhoudin steltekstlijnenin stelteksttekstenin steltolerantiein steltypein steltypenin \
+steluitlijnenin steluitvoerin stelurlin stelveldenin stelveldin stelversiesin \
+stelvoetin stelvoetnootdefinitiein stelvoetnotenin stelvoettekstenin stelwitruimtein stopachtergrond \
+stopalignment stopbuffer stopbuffer stopcitaat stopcolumns stopcombination \
+stopcommentaar stopdescription stopdocument stopenumeration stopfigure stopfloattext \
+stopformula stopframedtext stopgeg stophiding stopinteractiemenu stopitemgroup \
+stopkantlijn stopkleur stoplegend stopline stoplinecorrection stoplinenumbering \
+stoplines stoplocal stoplocalenvironment stoplocalfootnotes stopmakeup stopmarginblock \
+stopnamemakeup stopnarrower stopomgeving stoponderdeel stopopelkaar stopopposite \
+stopoverlay stopoverview stopparagraph stoppositioning stoppostponing stopprodukt \
+stopprofile stopprojekt stopsymbolset stopsynchronization stoptable stoptables \
+stoptabulate stoptekstlijn stoptyping stopunpacked stopversie sub \
+subject subsection subsubject subsubsection subsubsubject suggestie \
+switchnaarkorps sym symbool synchronisatiebalk synchroniseer synonym \
+taal tab tekstlijn tekstreferentie tex title \
+toonexternefiguren toongrid tooninstellingen toonkader toonkleur toonkleurgroep \
+toonkorps toonkorpsomgeving toonlayout toonopmaak toonpalet toonprint \
+toonstruts toonsymboolset toonvelden typ type typebuffer \
+typefile uit uitgerekt underbar underbars usecodering \
usedirectory vastespaties veld veldstapel verbergblokken vergelijkkleurgroep \
vergelijkpalet verplaatsopgrid versie vertaal verwerkblokken verwerkpagina \
vl voetnoot voetnoottekst volgprofiel volgprofielversie volgversie \
diff --git a/context/data/scite/cont-pe-scite.properties b/context/data/scite/cont-pe-scite.properties
index a9756b04c..160067104 100644
--- a/context/data/scite/cont-pe-scite.properties
+++ b/context/data/scite/cont-pe-scite.properties
@@ -5,30 +5,31 @@ appendix cap chapter chem completecombinedlist completelistoffloats \
completelistofsorts completelistofsynonyms coupledregister crlf definebodyfontDEF definebodyfontREF \
definedfont definefontfeature definefonthandling definetypeface description enumeration \
framedtext indentation its labeling loadsorts loadsynonyms \
-mapfontsize mediaeval name nextsection nocap paragraph \
-part placelistoffloats placelistofsorts placelistofsynonyms ran register \
-reservefloat resettextcontent section seeregister setupcapitals setupfonthandling \
-setupfontsynonym setupinterlinespace2 setuplistalternative setupurl sort startalignment \
-startbuffer startbuffer startcolumns startcombination startdescription startdocument \
-startenumeration startfigure startfloattext startformula startframedtext starthiding \
-startitemgroup startlegend startline startlinecorrection startlinenumbering startlines \
-startlocal startlocalenvironment startlocalfootnotes startmakeup startmarginblock startnamemakeup \
-startnarrower startopposite startoverlay startoverview startparagraph startpositioning \
-startpostponing startprofile startregister startsymbolset startsynchronization starttable \
-starttables starttabulate starttyping startunpacked startتوضیح startتولید \
-startحقیقت startخطحاشیه startخطمتن startرنگ startفشرده startمحیط \
-startمنویپانل startمولفه startنسخه startنقلقول startپروژه startپسزمینه \
-stopalignment stopbuffer stopbuffer stopcolumns stopcombination stopdescription \
-stopdocument stopenumeration stopfigure stopfloattext stopformula stopframedtext \
-stophiding stopitemgroup stoplegend stopline stoplinecorrection stoplinenumbering \
-stoplines stoplocal stoplocalenvironment stoplocalfootnotes stopmakeup stopmarginblock \
-stopnamemakeup stopnarrower stopopposite stopoverlay stopoverview stopparagraph \
-stoppositioning stoppostponing stopprofile stopsymbolset stopsynchronization stoptable \
-stoptables stoptabulate stoptyping stopunpacked stopتوضیح stopتولید \
-stopحقیقت stopخطحاشیه stopخطمتن stopرنگ stopفشرده stopمحیط \
-stopمنویپانل stopمولفه stopنسخه stopنقلقول stopپروژه stopپسزمینه \
-sub subject subsection subsubject subsubsection subsubsubject \
-synonym title tooltip typ useURL usedirectory \
+mapfontsize mediaeval name nextsection nocap overbar \
+overbars overstrike overstrikes paragraph part placelistoffloats \
+placelistofsorts placelistofsynonyms ran register reservefloat resettextcontent \
+section seeregister setupcapitals setupfonthandling setupfontsynonym setupinterlinespace2 \
+setuplistalternative setupurl sort startalignment startbuffer startbuffer \
+startcolumns startcombination startdescription startdocument startenumeration startfigure \
+startfloattext startformula startframedtext starthiding startitemgroup startlegend \
+startline startlinecorrection startlinenumbering startlines startlocal startlocalenvironment \
+startlocalfootnotes startmakeup startmarginblock startnamemakeup startnarrower startopposite \
+startoverlay startoverview startparagraph startpositioning startpostponing startprofile \
+startregister startsymbolset startsynchronization starttable starttables starttabulate \
+starttyping startunpacked startتوضیح startتولید startحقیقت startخطحاشیه \
+startخطمتن startرنگ startفشرده startمحیط startمنویپانل startمولفه \
+startنسخه startنقلقول startپروژه startپسزمینه stopalignment stopbuffer \
+stopbuffer stopcolumns stopcombination stopdescription stopdocument stopenumeration \
+stopfigure stopfloattext stopformula stopframedtext stophiding stopitemgroup \
+stoplegend stopline stoplinecorrection stoplinenumbering stoplines stoplocal \
+stoplocalenvironment stoplocalfootnotes stopmakeup stopmarginblock stopnamemakeup stopnarrower \
+stopopposite stopoverlay stopoverview stopparagraph stoppositioning stoppostponing \
+stopprofile stopsymbolset stopsynchronization stoptable stoptables stoptabulate \
+stoptyping stopunpacked stopتوضیح stopتولید stopحقیقت stopخطحاشیه \
+stopخطمتن stopرنگ stopفشرده stopمحیط stopمنویپانل stopمولفه \
+stopنسخه stopنقلقول stopپروژه stopپسزمینه sub subject \
+subsection subsubject subsubsection subsubsubject synonym title \
+tooltip typ underbar underbars useURL usedirectory \
آیتم آیتمها آینه اجباربلوکها از ازکارانداختنمنویپانل \
استفادهبلوکها استفادهدستخطتایپ استفادهرمزینه استفادهشکلخارجی استفادهفرمانها استفادهقطعهموزیکخارجی \
استفادهمدول استفادهمرجعها استفادهنمادها استفادهنوشتارخارجی استفادهویژگیها استفادهپروندهخارجی \
@@ -70,23 +71,22 @@ synonym title tooltip typ useURL usedirectory \
تعیینشمارهسر تعیینمحتوایمتن تعیینمشخصاتلیست تغییربهقلمبدنه تنظیمراست تنظیمطرحبندی \
تنظیموسط تورفتگی توری توضیح تک ثبتزوج \
ثبتکامل جداسازینشانهگذاری حاش حرف حرفها حفظبلوکها \
-خالی خطهایسیاه خطهاینازک خطهاخالی خطحاشیه خطزدن \
-خطزدنها خطسیاه خطمتن خطمو خطنازک خا \
-خع در درجآرمها درجثبت درجثبت درجدرخط \
-درجدرخطها درجدرمتن درجدرمیدان درجدربالاییکدیگر درجدرتوری درجراهنما \
-درجزیرفرمول درجشناور درجفرمول درجلیست درجلیستمختلط درجلیستمختلط \
-درجلیستمرجع درجپانوشتها درجپانوشتهایموضعی درجچوبخط درجکناربهکنار درحاشیه \
-درحاشیهدیگر درخارجی درخط درداخلی درراست درصفحه \
-درقالبی درمورد درون درچپ دریافتبافر دریافتنشانه \
-دوران دکمه دکمهپانل رج رجوع رنگ \
-رنگخاکستری روزهفته ریاضی زبان زباناصلی ستون \
-سر شمارهسر شمارهسرجاری شمارهمبدل شمارهها شکافتنشناور \
-شکلخارجی صفحه صفحهزوج صفحهپردازش عبوربلوکها فشرده \
-فضا فضاهایثابت فضایسفید فضایسفیدصحیح قالبی لوحمقایسه \
-ماه متنبرچسب متنحاشیه متنسر متنپانوشت مرجع \
-مرجعصفحه مرجعمتن مقایسهگروهرنگ مقیاس منفی مکان \
-میدان میدانهایگزارش میدانشبیهسازی میدانپشته میدانکپی میلهتطابق \
-میلهرو میلهزیر میلههارو میلهپانل میلههایزیر نسخه \
+خالی خطهایسیاه خطهاینازک خطهاخالی خطحاشیه خطسیاه \
+خطمتن خطمو خطنازک خا خع در \
+درجآرمها درجثبت درجثبت درجدرخط درجدرخطها درجدرمتن \
+درجدرمیدان درجدربالاییکدیگر درجدرتوری درجراهنما درجزیرفرمول درجشناور \
+درجفرمول درجلیست درجلیستمختلط درجلیستمختلط درجلیستمرجع درجپانوشتها \
+درجپانوشتهایموضعی درجچوبخط درجکناربهکنار درحاشیه درحاشیهدیگر درخارجی \
+درخط درداخلی درراست درصفحه درقالبی درمورد \
+درون درچپ دریافتبافر دریافتنشانه دوران دکمه \
+دکمهپانل رج رجوع رنگ رنگخاکستری روزهفته \
+ریاضی زبان زباناصلی ستون سر شمارهسر \
+شمارهسرجاری شمارهمبدل شمارهها شکافتنشناور شکلخارجی صفحه \
+صفحهزوج صفحهپردازش عبوربلوکها فشرده فضا فضاهایثابت \
+فضایسفید فضایسفیدصحیح قالبی لوحمقایسه ماه متنبرچسب \
+متنحاشیه متنسر متنپانوشت مرجع مرجعصفحه مرجعمتن \
+مقایسهگروهرنگ مقیاس منفی مکان میدان میدانهایگزارش \
+میدانشبیهسازی میدانپشته میدانکپی میلهتطابق میلهپانل نسخه \
نسخهنشانه نشانهگذاری نشانهگذاریزوج نشر نصبزبان نقطهها \
نقل نقلقول نم نماد نمادلیست نمایشآرایش \
نمایشبارگذاریها نمایشبستها نمایشتوری نمایشرنگ نمایششکلهایخارجی نمایشطرحبندی \
diff --git a/context/data/scite/cont-ro-scite.properties b/context/data/scite/cont-ro-scite.properties
index da9af1b3a..2214c8085 100644
--- a/context/data/scite/cont-ro-scite.properties
+++ b/context/data/scite/cont-ro-scite.properties
@@ -5,93 +5,93 @@ adapteazaaspect adubuffer adumarcaje afiseazaaspect afiseazacampuri afiseazaculo
afiseazafiguriexterne afiseazafonttext afiseazagrid afiseazagrupculoare afiseazamakeup afiseazamediufonttext \
afiseazapaleta afiseazarama afiseazasetari afiseazasetsimboluri afiseazastruts afiseazatiparire \
aliniat aliniatcentru aliniatdreapta aliniatstanga appendix ascundeblocuri \
-barainteractiune barasincronizare barasus blanc but butoaneinteractiune \
-buton camp campumplere cap chapter chem \
-citat clip cloneazacamp coloana comentariu comparagrupculoare \
-comparapaleta completecombinedlist completelistoffloats completelistofsorts completelistofsynonyms completeregister \
-convertestenumar copiazacamp corecteazaspatiualb coupledregister crlf culoare \
-culoaregri cupleazadocument cupleazamarcaje cupleazaregistru cuvantdreapta data \
-datacurenta datareferit decupleazamarcaje definebodyfontDEF definebodyfontREF definedfont \
-definefontfeature definefonthandling defineste definestealiat definesteantet definesteblanc \
-definestebloc definesteblocsectiune definestebuffer definestecamp definesteconversie definesteculoare \
-definestedescriere definestedimensiunehartie definesteenumerare definesteeticheta definestefloat definestefont \
-definestefonttext definesteformatreferinte definestegrupculori definesteinconjurare definestelista definestelistacombinata \
-definestelistareferinte definestelogo definestemakeup definestemarcaje definestemediulfonttext definestemeniuinteractiune \
-definestemeniuinteractiune definesteoutput definesteoverlay definestepaleta definesteparagraf definesteprofil \
-definesteprogram definestereferinte definesteregistru definestesablontabel definestesectiune definestesimbol \
-definestesimbolfigura definestesinonim definestesinonimfont definestesortare definestestartstop definestestivacampuri \
-definestesubcamp definestetabulatori definestetext definestetexteinconjurate definestetextinconjurat definestetyping \
-definesteversiune definetype definetypeface description despre determinacaracteristicilelistei \
-determinanumartitlu dezactiveazameniuinteractiune din dute dutebox ecran \
-el element element emptylines enumeration etichete \
-faraaliniat farafisiere faraliniiantetsisubsol faraliniisussijos faralista faramarcaje \
-faraspatiu faraspatiualb figuraexterna firdepar folosesteURL folosestebloc \
-folosestecodificarea folosestecomenzi folosestedocumentextern folosestefiguraexterna folosestefisiereexterne folosestefisierextern \
-folosestemodul folosestemuzicaexterna folosestereferinte folosestesimboluri folosestespeciale footnotetext \
-forteazablocuri fractie framed framedtext fundal gatablocuri \
-grid hartiedubla hl impachetat impartefloat in \
-inalt inaltamargine indentation indreapta inframed ininner \
-injos inlinie inouter instalarelimba instanga intins \
-jos jossus la labeling lapagina limba \
-limbaprincipala liniemargine linieneagra liniepeste liniesubtire linieumplere \
-liniinegre liniipeste liniisubtiri listsymbol litera litere \
-loadsorts loadsynonyms logcampuri luna mapfontsize mar \
-marcaje marcheazaversiune marginal matematica mediaeval minicitat \
-mutapegrid name nextsection nocap nop nota \
-notasubsol numartitlu numartitlucurent numere numereromane olinie \
-pagina paginadubla paragraph part pastreazablocuri placefloat \
-placelistoffloats placelistofsorts placelistofsynonyms placereferencelist plaseazapegrid plaseazasemnecarte \
-potrivestecamp pozitie proceseazabloc proceseazapagina program publicatie \
-puncte punedeasuprafiecareia punefatainfata puneformula punelegenda punelista \
-punelistacombinata punelistacombinata punelogouri punenotesubsol punenotesubsollocale puneregistru \
-puneregistru punesubformula ran ref referinta referintapagina \
-referintatext referit reflexie register reservefloat reset \
-reseteazamarcaje resettextcontent riglatext rigleumplere roteste saripesteblocuri \
-scala scriebuffer scrieinlista scrieinlistareferinte scrieinregistru scrieintreliste \
-section seeregister selecteazablocuri selecteazahartie selecteazaversiune semncarte \
-setarebarasincronizare setarelimba setareoutput setarepozitie setaresincronizare seteazaaliniat \
-seteazaaliniate seteazaalinierea seteazaantet seteazaaranjareapag seteazaaspect seteazabarainteractiune \
-seteazablanc seteazabloc seteazablocsectiune seteazablocurimarginale seteazabuffer seteazabutoane \
-seteazacamp seteazacampuri seteazaclipping seteazacoloane seteazacombinari seteazacomentariu \
-seteazaculoare seteazaculori seteazadefinireanotasubsol seteazadescriere seteazadimensiunihartie seteazaecrane \
-seteazaecraninteractiune seteazaelemente seteazaenumerare seteazafiguriexterne seteazafloat seteazafloats \
-seteazafonttext seteazaformulare seteazaformule seteazafundal seteazafundaluri seteazagrosimelinie \
-seteazaimpartireafloat seteazainconjurat seteazaingust seteazainteractiunea seteazajos seteazalegenda \
-seteazalegenda seteazalegendele seteazaliniesilabe seteazaliniesubtire seteazalinii seteazaliniimargine \
-seteazaliniinegre seteazaliniiumplere seteazalista seteazalistacombinata seteazalistareferinte seteazamajuscule \
-seteazamakeup seteazamarcaje seteazamarginal seteazamediulfonttext seteazameniuinteractiune seteazaminicitat \
-seteazanotasubsol seteazanumarpagina seteazanumarsubpagina seteazanumartitlu seteazanumerotare seteazanumerotarelinii \
-seteazanumerotarepagina seteazanumerotareparagrafe seteazapaleta seteazaparagrafe seteazaplasareaopozita seteazaprofile \
-seteazaprograme seteazapublicatii seteazareferinte seteazaregistru seteazarigletext seteazarigleumplere \
-seteazarotare seteazasectiune seteazasimbol seteazasinonime seteazasistem seteazasortare \
-seteazaspatiu seteazaspatiualb seteazaspatiuinterliniar seteazastrut seteazasublinie seteazasubsol \
-seteazasus seteazatab seteazatabele seteazatabulatori seteazatext seteazatexteantet \
-seteazatextejos seteazatextesubsol seteazatextesus seteazatextetext seteazatexteticheta seteazatexttitlu \
-seteazatitlu seteazatitluri seteazatoleranta seteazatranzitiepagina seteazatype seteazatyping \
-seteazaurl seteazaversiuni settextcontent setupfonthandling setupfontsynonym setupinterlinespace2 \
-setupitemgroup setuplistalternative setuppaper sim simbol sincronizeaza \
-sort spatiifixate spatiu spatiualb startalignment startbuffer \
-startbuffer startcitat startcolumns startcombination startcomentariu startcomponenta \
-startculoare startdescription startdocument startenumeration startfact startfigure \
-startfloattext startformula startframedtext startfundal starthiding startimpachetat \
-startitemgroup startlegend startline startlinecorrection startlinenumbering startlines \
-startliniemargine startlocal startlocalenvironment startlocalfootnotes startmakeup startmarginblock \
-startmediu startmeniuinteractiune startnamemakeup startnarrower startopposite startoverlay \
-startoverview startparagraph startpositioning startpostponing startprodus startprofile \
-startproiect startregister startriglatext startsymbolset startsynchronization starttable \
-starttables starttabulate starttyping startunpacked startversiune stivacampuri \
-stopalignment stopbuffer stopbuffer stopcitat stopcolumns stopcombination \
-stopcomentariu stopcomponenta stopculoare stopdescription stopdocument stopenumeration \
-stopfact stopfigure stopfloattext stopformula stopframedtext stopfundal \
-stophiding stopimpachetat stopitemgroup stoplegend stopline stoplinecorrection \
-stoplinenumbering stoplines stopliniemargine stoplocal stoplocalenvironment stoplocalfootnotes \
-stopmakeup stopmarginblock stopmediu stopmeniuinteractiune stopnamemakeup stopnarrower \
-stopopposite stopoverlay stopoverview stopparagraph stoppositioning stoppostponing \
-stopprodus stopprofile stopproiect stopriglatext stopsymbolset stopsynchronization \
-stoptable stoptables stoptabulate stoptyping stopunpacked stopversiune \
-sub subject sublinie sublinii subsection subsubject \
-subsubsection subsubsubject supralinie synonym tab tex \
-texteticheta textmarginal texttitlu textumplere tippagina title \
-titlu tooltip traduce trecilafonttext typ type \
-typefile undeva urmeazaprofil urmeazaversiune urmeazaversiuneprofil usedirectory \
+barainteractiune barasincronizare blanc but butoaneinteractiune buton \
+camp campumplere cap chapter chem citat \
+clip cloneazacamp coloana comentariu comparagrupculoare comparapaleta \
+completecombinedlist completelistoffloats completelistofsorts completelistofsynonyms completeregister convertestenumar \
+copiazacamp corecteazaspatiualb coupledregister crlf culoare culoaregri \
+cupleazadocument cupleazamarcaje cupleazaregistru cuvantdreapta data datacurenta \
+datareferit decupleazamarcaje definebodyfontDEF definebodyfontREF definedfont definefontfeature \
+definefonthandling defineste definestealiat definesteantet definesteblanc definestebloc \
+definesteblocsectiune definestebuffer definestecamp definesteconversie definesteculoare definestedescriere \
+definestedimensiunehartie definesteenumerare definesteeticheta definestefloat definestefont definestefonttext \
+definesteformatreferinte definestegrupculori definesteinconjurare definestelista definestelistacombinata definestelistareferinte \
+definestelogo definestemakeup definestemarcaje definestemediulfonttext definestemeniuinteractiune definestemeniuinteractiune \
+definesteoutput definesteoverlay definestepaleta definesteparagraf definesteprofil definesteprogram \
+definestereferinte definesteregistru definestesablontabel definestesectiune definestesimbol definestesimbolfigura \
+definestesinonim definestesinonimfont definestesortare definestestartstop definestestivacampuri definestesubcamp \
+definestetabulatori definestetext definestetexteinconjurate definestetextinconjurat definestetyping definesteversiune \
+definetype definetypeface description despre determinacaracteristicilelistei determinanumartitlu \
+dezactiveazameniuinteractiune din dute dutebox ecran el \
+element element emptylines enumeration etichete faraaliniat \
+farafisiere faraliniiantetsisubsol faraliniisussijos faralista faramarcaje faraspatiu \
+faraspatiualb figuraexterna firdepar folosesteURL folosestebloc folosestecodificarea \
+folosestecomenzi folosestedocumentextern folosestefiguraexterna folosestefisiereexterne folosestefisierextern folosestemodul \
+folosestemuzicaexterna folosestereferinte folosestesimboluri folosestespeciale footnotetext forteazablocuri \
+fractie framed framedtext fundal gatablocuri grid \
+hartiedubla hl impachetat impartefloat in inalt \
+inaltamargine indentation indreapta inframed ininner injos \
+inlinie inouter instalarelimba instanga intins jos \
+jossus la labeling lapagina limba limbaprincipala \
+liniemargine linieneagra liniesubtire linieumplere liniinegre liniisubtiri \
+listsymbol litera litere loadsorts loadsynonyms logcampuri \
+luna mapfontsize mar marcaje marcheazaversiune marginal \
+matematica mediaeval minicitat mutapegrid name nextsection \
+nocap nop nota notasubsol numartitlu numartitlucurent \
+numere numereromane olinie overbar overbars overstrike \
+overstrikes pagina paginadubla paragraph part pastreazablocuri \
+placefloat placelistoffloats placelistofsorts placelistofsynonyms placereferencelist plaseazapegrid \
+plaseazasemnecarte potrivestecamp pozitie proceseazabloc proceseazapagina program \
+publicatie puncte punedeasuprafiecareia punefatainfata puneformula punelegenda \
+punelista punelistacombinata punelistacombinata punelogouri punenotesubsol punenotesubsollocale \
+puneregistru puneregistru punesubformula ran ref referinta \
+referintapagina referintatext referit reflexie register reservefloat \
+reset reseteazamarcaje resettextcontent riglatext rigleumplere roteste \
+saripesteblocuri scala scriebuffer scrieinlista scrieinlistareferinte scrieinregistru \
+scrieintreliste section seeregister selecteazablocuri selecteazahartie selecteazaversiune \
+semncarte setarebarasincronizare setarelimba setareoutput setarepozitie setaresincronizare \
+seteazaaliniat seteazaaliniate seteazaalinierea seteazaantet seteazaaranjareapag seteazaaspect \
+seteazabarainteractiune seteazablanc seteazabloc seteazablocsectiune seteazablocurimarginale seteazabuffer \
+seteazabutoane seteazacamp seteazacampuri seteazaclipping seteazacoloane seteazacombinari \
+seteazacomentariu seteazaculoare seteazaculori seteazadefinireanotasubsol seteazadescriere seteazadimensiunihartie \
+seteazaecrane seteazaecraninteractiune seteazaelemente seteazaenumerare seteazafiguriexterne seteazafloat \
+seteazafloats seteazafonttext seteazaformulare seteazaformule seteazafundal seteazafundaluri \
+seteazagrosimelinie seteazaimpartireafloat seteazainconjurat seteazaingust seteazainteractiunea seteazajos \
+seteazalegenda seteazalegenda seteazalegendele seteazaliniesilabe seteazaliniesubtire seteazalinii \
+seteazaliniimargine seteazaliniinegre seteazaliniiumplere seteazalista seteazalistacombinata seteazalistareferinte \
+seteazamajuscule seteazamakeup seteazamarcaje seteazamarginal seteazamediulfonttext seteazameniuinteractiune \
+seteazaminicitat seteazanotasubsol seteazanumarpagina seteazanumarsubpagina seteazanumartitlu seteazanumerotare \
+seteazanumerotarelinii seteazanumerotarepagina seteazanumerotareparagrafe seteazapaleta seteazaparagrafe seteazaplasareaopozita \
+seteazaprofile seteazaprograme seteazapublicatii seteazareferinte seteazaregistru seteazarigletext \
+seteazarigleumplere seteazarotare seteazasectiune seteazasimbol seteazasinonime seteazasistem \
+seteazasortare seteazaspatiu seteazaspatiualb seteazaspatiuinterliniar seteazastrut seteazasublinie \
+seteazasubsol seteazasus seteazatab seteazatabele seteazatabulatori seteazatext \
+seteazatexteantet seteazatextejos seteazatextesubsol seteazatextesus seteazatextetext seteazatexteticheta \
+seteazatexttitlu seteazatitlu seteazatitluri seteazatoleranta seteazatranzitiepagina seteazatype \
+seteazatyping seteazaurl seteazaversiuni settextcontent setupfonthandling setupfontsynonym \
+setupinterlinespace2 setupitemgroup setuplistalternative setuppaper sim simbol \
+sincronizeaza sort spatiifixate spatiu spatiualb startalignment \
+startbuffer startbuffer startcitat startcolumns startcombination startcomentariu \
+startcomponenta startculoare startdescription startdocument startenumeration startfact \
+startfigure startfloattext startformula startframedtext startfundal starthiding \
+startimpachetat startitemgroup startlegend startline startlinecorrection startlinenumbering \
+startlines startliniemargine startlocal startlocalenvironment startlocalfootnotes startmakeup \
+startmarginblock startmediu startmeniuinteractiune startnamemakeup startnarrower startopposite \
+startoverlay startoverview startparagraph startpositioning startpostponing startprodus \
+startprofile startproiect startregister startriglatext startsymbolset startsynchronization \
+starttable starttables starttabulate starttyping startunpacked startversiune \
+stivacampuri stopalignment stopbuffer stopbuffer stopcitat stopcolumns \
+stopcombination stopcomentariu stopcomponenta stopculoare stopdescription stopdocument \
+stopenumeration stopfact stopfigure stopfloattext stopformula stopframedtext \
+stopfundal stophiding stopimpachetat stopitemgroup stoplegend stopline \
+stoplinecorrection stoplinenumbering stoplines stopliniemargine stoplocal stoplocalenvironment \
+stoplocalfootnotes stopmakeup stopmarginblock stopmediu stopmeniuinteractiune stopnamemakeup \
+stopnarrower stopopposite stopoverlay stopoverview stopparagraph stoppositioning \
+stoppostponing stopprodus stopprofile stopproiect stopriglatext stopsymbolset \
+stopsynchronization stoptable stoptables stoptabulate stoptyping stopunpacked \
+stopversiune sub subject subsection subsubject subsubsection \
+subsubsubject synonym tab tex texteticheta textmarginal \
+texttitlu textumplere tippagina title titlu tooltip \
+traduce trecilafonttext typ type typefile underbar \
+underbars undeva urmeazaprofil urmeazaversiune urmeazaversiuneprofil usedirectory \
usetypescript usetypescriptfile versiune vl zidinsaptamana
\ No newline at end of file
diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua
index bcfb65d34..6440db64b 100644
--- a/scripts/context/lua/mtxrun.lua
+++ b/scripts/context/lua/mtxrun.lua
@@ -812,7 +812,8 @@ local function do_serialize(root,name,depth,level,indexed)
handle(format("%s %s,",depth,v))
end
elseif t == "string" then
- if reduce and (find(v,"^[%-%+]?[%d]-%.?[%d+]$") == 1) then
+--~ if reduce and (find(v,"^[%-%+]?[%d]-%.?[%d+]$") == 1) then
+ if reduce and tonumber(v) then
handle(format("%s %s,",depth,v))
else
handle(format("%s %q,",depth,v))
@@ -871,7 +872,8 @@ local function do_serialize(root,name,depth,level,indexed)
end
end
elseif t == "string" then
- if reduce and (find(v,"^[%-%+]?[%d]-%.?[%d+]$") == 1) then
+--~ if reduce and (find(v,"^[%-%+]?[%d]-%.?[%d+]$") == 1) then
+ if reduce and tonumber(v) then
--~ handle(format("%s %s=%s,",depth,key(k),v))
if type(k) == "number" then -- or find(k,"^%d+$") then
if hexify then
@@ -4847,7 +4849,9 @@ local lp_builtin = P (
) * ((spaces * P("(") * spaces * P(")"))/"")
local lp_attribute = (P("@") + P("attribute::")) / "" * Cc("(ll.at and ll.at['") * R("az","AZ","--","__")^1 * Cc("'])")
-local lp_fastpos = ((R("09","--","++")^1 * P(-1)) / function(s) return "l==" .. s end)
+local lp_fastpos_p = ((P("+")^0 * R("09")^1 * P(-1)) / function(s) return "l==" .. s end)
+local lp_fastpos_n = ((P("-") * R("09")^1 * P(-1)) / function(s) return "(" .. s .. "<0 and (#list+".. s .. "==l))" end)
+local lp_fastpos = lp_fastpos_n + lp_fastpos_p
local lp_reserved = C("and") + C("or") + C("not") + C("div") + C("mod") + C("true") + C("false")
local lp_lua_function = C(R("az","AZ","__")^1 * (P(".") * R("az","AZ","__")^1)^1) * ("(") / function(t) -- todo: better . handling
@@ -4899,11 +4903,11 @@ local content =
lp_child +
lp_any
-local converter = lpeg.Cs (
- lp_fastpos + (lpeg.P { lparent * (lpeg.V(1))^0 * rparent + content } )^0
+local converter = Cs (
+ lp_fastpos + (P { lparent * (V(1))^0 * rparent + content } )^0
)
-cleaner = lpeg.Cs ( (
+cleaner = Cs ( (
--~ lp_fastpos +
lp_reserved +
lp_string +
@@ -5647,6 +5651,21 @@ local type = type
local insert, remove = table.insert, table.remove
local gmatch, gsub = string.gmatch, string.gsub
+
+function xml.inheritedconvert(data,xmldata)
+ local settings = xmldata.settings
+ settings.parent_root = xmldata -- to be tested
+--~ settings.no_root = true
+ local xc = xmlconvert(data,settings)
+--~ xc.settings = nil
+--~ xc.entities = nil
+--~ xc.special = nil
+--~ xc.ri = nil
+--~ print(xc.tg)
+-- for k,v in pairs(xc) do print(k,tostring(v)) end
+ return xc
+end
+
local function withelements(e,handle,depth)
if e and handle then
local edt = e.dt
@@ -5774,24 +5793,33 @@ end
local no_root = { no_root = true }
+function xml.redo_ni(d)
+ for k=1,#d do
+ local dk = d[k]
+ if type(dk) == "table" then
+ dk.ni = k
+ end
+ end
+end
+
function xml.inject_element(root, pattern, element, prepend)
if root and element then
if type(element) == "string" then
- element = xmlconvert(element,no_root)
+--~ element = xmlconvert(element,no_root)
+ element = xml.inheritedconvert(element,root)
end
if element then
+ if element.ri then
+ element = element.dt[element.ri].dt
+ else
+ element = element.dt
+ end
+ -- we need to re-index
local collected = xmlparseapply({ root },pattern)
if collected then
for c=1,#collected do
local e = collected[c]
- local r = e.__p__
- local d = r.dt
- local k = e.ni
- if element.ri then
- element = element.dt[element.ri].dt
- else
- element = element.dt
- end
+ local r, d, k = e.__p__, r.dt, e.ni
local edt
if r.ri then
edt = r.dt[r.ri].dt
@@ -5802,8 +5830,11 @@ function xml.inject_element(root, pattern, element, prepend)
local be, af
if prepend then
be, af = xmlcopy(element), edt
+be.__p__ = e
+
else
be, af = edt, xmlcopy(element)
+af.__p__ = e
end
for i=1,#af do
be[#be+1] = af[i]
@@ -5816,6 +5847,7 @@ function xml.inject_element(root, pattern, element, prepend)
else
-- r.dt = element.dt -- todo
end
+xml.redo_ni(d)
end
end
end
@@ -5831,7 +5863,8 @@ function xml.insert_element(root, pattern, element, before) -- todo: element als
else
local matches, collect = { }, nil
if type(element) == "string" then
- element = xmlconvert(element,true)
+--~ element = xmlconvert(element,no_root)
+ element = xml.inheritedconvert(element,root)
end
if element and element.ri then
element = element.dt[element.ri]
@@ -5847,17 +5880,25 @@ function xml.insert_element(root, pattern, element, before) -- todo: element als
if not before then
k = k + 1
end
+ local ce = xmlcopy(element)
+ce.__p__ = r
if element.tg then
- insert(d,k,element) -- untested
+ insert(d,k,ce) -- untested
else
- local edt = element.dt
+ -- maybe bugged
+ local edt = ce.dt
if edt then
for i=1,#edt do
- insert(d,k,edt[i])
+local edti = edt[i]
+ insert(d,k,edti)
+if type(edti) == "table" then
+ edti.__p__ = r
+end
k = k + 1
end
end
end
+xml.redo_ni(d)
end
end
end
@@ -5882,10 +5923,11 @@ function xml.delete_element(root, pattern)
local p = e.__p__
if p then
if trace_manipulations then
- report('deleting',pattern,c,e)
+ report('deleting',pattern,c,tostring(e)) -- fails
end
- remove(p.dt,e.ni)
- e.ni = nil
+ local d = p.dt
+ remove(d,e.ni)
+xml.redo_ni(d)
end
end
end
@@ -5893,7 +5935,8 @@ end
function xml.replace_element(root, pattern, element)
if type(element) == "string" then
- element = xmlconvert(element,true)
+--~ element = xmlconvert(element,true)
+ element = xml.inheritedconvert(element,root)
end
if element and element.ri then
element = element.dt[element.ri]
@@ -5908,7 +5951,9 @@ function xml.replace_element(root, pattern, element)
if trace_manipulations then
report('replacing',pattern,c,e)
end
- p.dt[e.ni] = element.dt -- maybe not clever enough
+ local d = p.dt
+ d[e.ni] = element.dt -- maybe not clever enough
+--~ xml.redo_ni(d)
end
end
end
@@ -5944,9 +5989,10 @@ local function include(xmldata,pattern,attribute,recursive,loaddata)
-- for the moment hard coded
epdt[ek.ni] = xml.escaped(data) -- d[k] = xml.escaped(data)
else
- local settings = xmldata.settings
- settings.parent_root = xmldata -- to be tested
- local xi = xmlconvert(data,settings)
+--~ local settings = xmldata.settings
+--~ settings.parent_root = xmldata -- to be tested
+--~ local xi = xmlconvert(data,settings)
+ local xi = xml.inheritedconvert(element,xmldata)
if not xi then
epdt[ek.ni] = "" -- xml.empty(d,k)
else
@@ -6175,17 +6221,19 @@ local function chainattribute(collected,arguments) -- todo: optional levels
return ""
end
-local function raw(collected)
+local function raw(collected) -- hybrid
if collected then
- return xmlserialize(collected[1]) -- only first as we cannot concat function
+ local e = collected[1] or collected
+ return (e and xmlserialize(e)) or "" -- only first as we cannot concat function
else
return ""
end
end
-local function text(collected)
+local function text(collected) -- hybrid
if collected then
- return xmltostring(collected[1].dt) -- only first as we cannot concat function
+ local e = collected[1] or collected
+ return (e and xmltostring(e.dt)) or ""
else
return ""
end
@@ -6328,9 +6376,14 @@ end
function xml.text(id,pattern)
if pattern then
- return text(xmlfilter(id,pattern))
+ -- return text(xmlfilter(id,pattern))
+ local collected = xmlfilter(id,pattern)
+ return (collected and xmltostring(collected[1].dt)) or ""
+ elseif id then
+ -- return text(id)
+ return xmltostring(id.dt) or ""
else
- return text(id)
+ return ""
end
end
diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua
index bcfb65d34..6440db64b 100644
--- a/scripts/context/stubs/mswin/mtxrun.lua
+++ b/scripts/context/stubs/mswin/mtxrun.lua
@@ -812,7 +812,8 @@ local function do_serialize(root,name,depth,level,indexed)
handle(format("%s %s,",depth,v))
end
elseif t == "string" then
- if reduce and (find(v,"^[%-%+]?[%d]-%.?[%d+]$") == 1) then
+--~ if reduce and (find(v,"^[%-%+]?[%d]-%.?[%d+]$") == 1) then
+ if reduce and tonumber(v) then
handle(format("%s %s,",depth,v))
else
handle(format("%s %q,",depth,v))
@@ -871,7 +872,8 @@ local function do_serialize(root,name,depth,level,indexed)
end
end
elseif t == "string" then
- if reduce and (find(v,"^[%-%+]?[%d]-%.?[%d+]$") == 1) then
+--~ if reduce and (find(v,"^[%-%+]?[%d]-%.?[%d+]$") == 1) then
+ if reduce and tonumber(v) then
--~ handle(format("%s %s=%s,",depth,key(k),v))
if type(k) == "number" then -- or find(k,"^%d+$") then
if hexify then
@@ -4847,7 +4849,9 @@ local lp_builtin = P (
) * ((spaces * P("(") * spaces * P(")"))/"")
local lp_attribute = (P("@") + P("attribute::")) / "" * Cc("(ll.at and ll.at['") * R("az","AZ","--","__")^1 * Cc("'])")
-local lp_fastpos = ((R("09","--","++")^1 * P(-1)) / function(s) return "l==" .. s end)
+local lp_fastpos_p = ((P("+")^0 * R("09")^1 * P(-1)) / function(s) return "l==" .. s end)
+local lp_fastpos_n = ((P("-") * R("09")^1 * P(-1)) / function(s) return "(" .. s .. "<0 and (#list+".. s .. "==l))" end)
+local lp_fastpos = lp_fastpos_n + lp_fastpos_p
local lp_reserved = C("and") + C("or") + C("not") + C("div") + C("mod") + C("true") + C("false")
local lp_lua_function = C(R("az","AZ","__")^1 * (P(".") * R("az","AZ","__")^1)^1) * ("(") / function(t) -- todo: better . handling
@@ -4899,11 +4903,11 @@ local content =
lp_child +
lp_any
-local converter = lpeg.Cs (
- lp_fastpos + (lpeg.P { lparent * (lpeg.V(1))^0 * rparent + content } )^0
+local converter = Cs (
+ lp_fastpos + (P { lparent * (V(1))^0 * rparent + content } )^0
)
-cleaner = lpeg.Cs ( (
+cleaner = Cs ( (
--~ lp_fastpos +
lp_reserved +
lp_string +
@@ -5647,6 +5651,21 @@ local type = type
local insert, remove = table.insert, table.remove
local gmatch, gsub = string.gmatch, string.gsub
+
+function xml.inheritedconvert(data,xmldata)
+ local settings = xmldata.settings
+ settings.parent_root = xmldata -- to be tested
+--~ settings.no_root = true
+ local xc = xmlconvert(data,settings)
+--~ xc.settings = nil
+--~ xc.entities = nil
+--~ xc.special = nil
+--~ xc.ri = nil
+--~ print(xc.tg)
+-- for k,v in pairs(xc) do print(k,tostring(v)) end
+ return xc
+end
+
local function withelements(e,handle,depth)
if e and handle then
local edt = e.dt
@@ -5774,24 +5793,33 @@ end
local no_root = { no_root = true }
+function xml.redo_ni(d)
+ for k=1,#d do
+ local dk = d[k]
+ if type(dk) == "table" then
+ dk.ni = k
+ end
+ end
+end
+
function xml.inject_element(root, pattern, element, prepend)
if root and element then
if type(element) == "string" then
- element = xmlconvert(element,no_root)
+--~ element = xmlconvert(element,no_root)
+ element = xml.inheritedconvert(element,root)
end
if element then
+ if element.ri then
+ element = element.dt[element.ri].dt
+ else
+ element = element.dt
+ end
+ -- we need to re-index
local collected = xmlparseapply({ root },pattern)
if collected then
for c=1,#collected do
local e = collected[c]
- local r = e.__p__
- local d = r.dt
- local k = e.ni
- if element.ri then
- element = element.dt[element.ri].dt
- else
- element = element.dt
- end
+ local r, d, k = e.__p__, r.dt, e.ni
local edt
if r.ri then
edt = r.dt[r.ri].dt
@@ -5802,8 +5830,11 @@ function xml.inject_element(root, pattern, element, prepend)
local be, af
if prepend then
be, af = xmlcopy(element), edt
+be.__p__ = e
+
else
be, af = edt, xmlcopy(element)
+af.__p__ = e
end
for i=1,#af do
be[#be+1] = af[i]
@@ -5816,6 +5847,7 @@ function xml.inject_element(root, pattern, element, prepend)
else
-- r.dt = element.dt -- todo
end
+xml.redo_ni(d)
end
end
end
@@ -5831,7 +5863,8 @@ function xml.insert_element(root, pattern, element, before) -- todo: element als
else
local matches, collect = { }, nil
if type(element) == "string" then
- element = xmlconvert(element,true)
+--~ element = xmlconvert(element,no_root)
+ element = xml.inheritedconvert(element,root)
end
if element and element.ri then
element = element.dt[element.ri]
@@ -5847,17 +5880,25 @@ function xml.insert_element(root, pattern, element, before) -- todo: element als
if not before then
k = k + 1
end
+ local ce = xmlcopy(element)
+ce.__p__ = r
if element.tg then
- insert(d,k,element) -- untested
+ insert(d,k,ce) -- untested
else
- local edt = element.dt
+ -- maybe bugged
+ local edt = ce.dt
if edt then
for i=1,#edt do
- insert(d,k,edt[i])
+local edti = edt[i]
+ insert(d,k,edti)
+if type(edti) == "table" then
+ edti.__p__ = r
+end
k = k + 1
end
end
end
+xml.redo_ni(d)
end
end
end
@@ -5882,10 +5923,11 @@ function xml.delete_element(root, pattern)
local p = e.__p__
if p then
if trace_manipulations then
- report('deleting',pattern,c,e)
+ report('deleting',pattern,c,tostring(e)) -- fails
end
- remove(p.dt,e.ni)
- e.ni = nil
+ local d = p.dt
+ remove(d,e.ni)
+xml.redo_ni(d)
end
end
end
@@ -5893,7 +5935,8 @@ end
function xml.replace_element(root, pattern, element)
if type(element) == "string" then
- element = xmlconvert(element,true)
+--~ element = xmlconvert(element,true)
+ element = xml.inheritedconvert(element,root)
end
if element and element.ri then
element = element.dt[element.ri]
@@ -5908,7 +5951,9 @@ function xml.replace_element(root, pattern, element)
if trace_manipulations then
report('replacing',pattern,c,e)
end
- p.dt[e.ni] = element.dt -- maybe not clever enough
+ local d = p.dt
+ d[e.ni] = element.dt -- maybe not clever enough
+--~ xml.redo_ni(d)
end
end
end
@@ -5944,9 +5989,10 @@ local function include(xmldata,pattern,attribute,recursive,loaddata)
-- for the moment hard coded
epdt[ek.ni] = xml.escaped(data) -- d[k] = xml.escaped(data)
else
- local settings = xmldata.settings
- settings.parent_root = xmldata -- to be tested
- local xi = xmlconvert(data,settings)
+--~ local settings = xmldata.settings
+--~ settings.parent_root = xmldata -- to be tested
+--~ local xi = xmlconvert(data,settings)
+ local xi = xml.inheritedconvert(element,xmldata)
if not xi then
epdt[ek.ni] = "" -- xml.empty(d,k)
else
@@ -6175,17 +6221,19 @@ local function chainattribute(collected,arguments) -- todo: optional levels
return ""
end
-local function raw(collected)
+local function raw(collected) -- hybrid
if collected then
- return xmlserialize(collected[1]) -- only first as we cannot concat function
+ local e = collected[1] or collected
+ return (e and xmlserialize(e)) or "" -- only first as we cannot concat function
else
return ""
end
end
-local function text(collected)
+local function text(collected) -- hybrid
if collected then
- return xmltostring(collected[1].dt) -- only first as we cannot concat function
+ local e = collected[1] or collected
+ return (e and xmltostring(e.dt)) or ""
else
return ""
end
@@ -6328,9 +6376,14 @@ end
function xml.text(id,pattern)
if pattern then
- return text(xmlfilter(id,pattern))
+ -- return text(xmlfilter(id,pattern))
+ local collected = xmlfilter(id,pattern)
+ return (collected and xmltostring(collected[1].dt)) or ""
+ elseif id then
+ -- return text(id)
+ return xmltostring(id.dt) or ""
else
- return text(id)
+ return ""
end
end
diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun
index bcfb65d34..6440db64b 100755
--- a/scripts/context/stubs/unix/mtxrun
+++ b/scripts/context/stubs/unix/mtxrun
@@ -812,7 +812,8 @@ local function do_serialize(root,name,depth,level,indexed)
handle(format("%s %s,",depth,v))
end
elseif t == "string" then
- if reduce and (find(v,"^[%-%+]?[%d]-%.?[%d+]$") == 1) then
+--~ if reduce and (find(v,"^[%-%+]?[%d]-%.?[%d+]$") == 1) then
+ if reduce and tonumber(v) then
handle(format("%s %s,",depth,v))
else
handle(format("%s %q,",depth,v))
@@ -871,7 +872,8 @@ local function do_serialize(root,name,depth,level,indexed)
end
end
elseif t == "string" then
- if reduce and (find(v,"^[%-%+]?[%d]-%.?[%d+]$") == 1) then
+--~ if reduce and (find(v,"^[%-%+]?[%d]-%.?[%d+]$") == 1) then
+ if reduce and tonumber(v) then
--~ handle(format("%s %s=%s,",depth,key(k),v))
if type(k) == "number" then -- or find(k,"^%d+$") then
if hexify then
@@ -4847,7 +4849,9 @@ local lp_builtin = P (
) * ((spaces * P("(") * spaces * P(")"))/"")
local lp_attribute = (P("@") + P("attribute::")) / "" * Cc("(ll.at and ll.at['") * R("az","AZ","--","__")^1 * Cc("'])")
-local lp_fastpos = ((R("09","--","++")^1 * P(-1)) / function(s) return "l==" .. s end)
+local lp_fastpos_p = ((P("+")^0 * R("09")^1 * P(-1)) / function(s) return "l==" .. s end)
+local lp_fastpos_n = ((P("-") * R("09")^1 * P(-1)) / function(s) return "(" .. s .. "<0 and (#list+".. s .. "==l))" end)
+local lp_fastpos = lp_fastpos_n + lp_fastpos_p
local lp_reserved = C("and") + C("or") + C("not") + C("div") + C("mod") + C("true") + C("false")
local lp_lua_function = C(R("az","AZ","__")^1 * (P(".") * R("az","AZ","__")^1)^1) * ("(") / function(t) -- todo: better . handling
@@ -4899,11 +4903,11 @@ local content =
lp_child +
lp_any
-local converter = lpeg.Cs (
- lp_fastpos + (lpeg.P { lparent * (lpeg.V(1))^0 * rparent + content } )^0
+local converter = Cs (
+ lp_fastpos + (P { lparent * (V(1))^0 * rparent + content } )^0
)
-cleaner = lpeg.Cs ( (
+cleaner = Cs ( (
--~ lp_fastpos +
lp_reserved +
lp_string +
@@ -5647,6 +5651,21 @@ local type = type
local insert, remove = table.insert, table.remove
local gmatch, gsub = string.gmatch, string.gsub
+
+function xml.inheritedconvert(data,xmldata)
+ local settings = xmldata.settings
+ settings.parent_root = xmldata -- to be tested
+--~ settings.no_root = true
+ local xc = xmlconvert(data,settings)
+--~ xc.settings = nil
+--~ xc.entities = nil
+--~ xc.special = nil
+--~ xc.ri = nil
+--~ print(xc.tg)
+-- for k,v in pairs(xc) do print(k,tostring(v)) end
+ return xc
+end
+
local function withelements(e,handle,depth)
if e and handle then
local edt = e.dt
@@ -5774,24 +5793,33 @@ end
local no_root = { no_root = true }
+function xml.redo_ni(d)
+ for k=1,#d do
+ local dk = d[k]
+ if type(dk) == "table" then
+ dk.ni = k
+ end
+ end
+end
+
function xml.inject_element(root, pattern, element, prepend)
if root and element then
if type(element) == "string" then
- element = xmlconvert(element,no_root)
+--~ element = xmlconvert(element,no_root)
+ element = xml.inheritedconvert(element,root)
end
if element then
+ if element.ri then
+ element = element.dt[element.ri].dt
+ else
+ element = element.dt
+ end
+ -- we need to re-index
local collected = xmlparseapply({ root },pattern)
if collected then
for c=1,#collected do
local e = collected[c]
- local r = e.__p__
- local d = r.dt
- local k = e.ni
- if element.ri then
- element = element.dt[element.ri].dt
- else
- element = element.dt
- end
+ local r, d, k = e.__p__, r.dt, e.ni
local edt
if r.ri then
edt = r.dt[r.ri].dt
@@ -5802,8 +5830,11 @@ function xml.inject_element(root, pattern, element, prepend)
local be, af
if prepend then
be, af = xmlcopy(element), edt
+be.__p__ = e
+
else
be, af = edt, xmlcopy(element)
+af.__p__ = e
end
for i=1,#af do
be[#be+1] = af[i]
@@ -5816,6 +5847,7 @@ function xml.inject_element(root, pattern, element, prepend)
else
-- r.dt = element.dt -- todo
end
+xml.redo_ni(d)
end
end
end
@@ -5831,7 +5863,8 @@ function xml.insert_element(root, pattern, element, before) -- todo: element als
else
local matches, collect = { }, nil
if type(element) == "string" then
- element = xmlconvert(element,true)
+--~ element = xmlconvert(element,no_root)
+ element = xml.inheritedconvert(element,root)
end
if element and element.ri then
element = element.dt[element.ri]
@@ -5847,17 +5880,25 @@ function xml.insert_element(root, pattern, element, before) -- todo: element als
if not before then
k = k + 1
end
+ local ce = xmlcopy(element)
+ce.__p__ = r
if element.tg then
- insert(d,k,element) -- untested
+ insert(d,k,ce) -- untested
else
- local edt = element.dt
+ -- maybe bugged
+ local edt = ce.dt
if edt then
for i=1,#edt do
- insert(d,k,edt[i])
+local edti = edt[i]
+ insert(d,k,edti)
+if type(edti) == "table" then
+ edti.__p__ = r
+end
k = k + 1
end
end
end
+xml.redo_ni(d)
end
end
end
@@ -5882,10 +5923,11 @@ function xml.delete_element(root, pattern)
local p = e.__p__
if p then
if trace_manipulations then
- report('deleting',pattern,c,e)
+ report('deleting',pattern,c,tostring(e)) -- fails
end
- remove(p.dt,e.ni)
- e.ni = nil
+ local d = p.dt
+ remove(d,e.ni)
+xml.redo_ni(d)
end
end
end
@@ -5893,7 +5935,8 @@ end
function xml.replace_element(root, pattern, element)
if type(element) == "string" then
- element = xmlconvert(element,true)
+--~ element = xmlconvert(element,true)
+ element = xml.inheritedconvert(element,root)
end
if element and element.ri then
element = element.dt[element.ri]
@@ -5908,7 +5951,9 @@ function xml.replace_element(root, pattern, element)
if trace_manipulations then
report('replacing',pattern,c,e)
end
- p.dt[e.ni] = element.dt -- maybe not clever enough
+ local d = p.dt
+ d[e.ni] = element.dt -- maybe not clever enough
+--~ xml.redo_ni(d)
end
end
end
@@ -5944,9 +5989,10 @@ local function include(xmldata,pattern,attribute,recursive,loaddata)
-- for the moment hard coded
epdt[ek.ni] = xml.escaped(data) -- d[k] = xml.escaped(data)
else
- local settings = xmldata.settings
- settings.parent_root = xmldata -- to be tested
- local xi = xmlconvert(data,settings)
+--~ local settings = xmldata.settings
+--~ settings.parent_root = xmldata -- to be tested
+--~ local xi = xmlconvert(data,settings)
+ local xi = xml.inheritedconvert(element,xmldata)
if not xi then
epdt[ek.ni] = "" -- xml.empty(d,k)
else
@@ -6175,17 +6221,19 @@ local function chainattribute(collected,arguments) -- todo: optional levels
return ""
end
-local function raw(collected)
+local function raw(collected) -- hybrid
if collected then
- return xmlserialize(collected[1]) -- only first as we cannot concat function
+ local e = collected[1] or collected
+ return (e and xmlserialize(e)) or "" -- only first as we cannot concat function
else
return ""
end
end
-local function text(collected)
+local function text(collected) -- hybrid
if collected then
- return xmltostring(collected[1].dt) -- only first as we cannot concat function
+ local e = collected[1] or collected
+ return (e and xmltostring(e.dt)) or ""
else
return ""
end
@@ -6328,9 +6376,14 @@ end
function xml.text(id,pattern)
if pattern then
- return text(xmlfilter(id,pattern))
+ -- return text(xmlfilter(id,pattern))
+ local collected = xmlfilter(id,pattern)
+ return (collected and xmltostring(collected[1].dt)) or ""
+ elseif id then
+ -- return text(id)
+ return xmltostring(id.dt) or ""
else
- return text(id)
+ return ""
end
end
diff --git a/tex/context/base/buff-ini.lua b/tex/context/base/buff-ini.lua
index 39788d2e1..3cb4ccd36 100644
--- a/tex/context/base/buff-ini.lua
+++ b/tex/context/base/buff-ini.lua
@@ -25,9 +25,11 @@ local utf = unicode.utf8
local concat, texsprint, texprint, texwrite = table.concat, tex.sprint, tex.print, tex.write
local utfbyte, utffind, utfgsub = utf.byte, utf.find, utf.gsub
local type, next = type, next
+local huge = math.huge
local byte, sub, find, char, gsub, rep, lower = string.byte, string.sub, string.find, string.char, string.gsub, string.rep, string.lower
local utfcharacters, utfvalues = string.utfcharacters, string.utfvalues
local ctxcatcodes = tex.ctxcatcodes
+local variables = interfaces.variables
local data, commands, flags, hooks, visualizers = buffers.data, buffers.commands, buffers.flags, buffers.hooks, buffers.visualizers
@@ -47,6 +49,7 @@ function buffers.append(name, str)
data[name] = (data[name] or "") .. str
end
+
buffers.flags.store_as_table = true
-- to be sorted out: crlf + \ ; slow now
@@ -129,12 +132,16 @@ function buffers.strip(lines)
return first, last, last - first + 1
end
-function buffers.type(name)
+function buffers.type(name,realign)
local lines = data[name]
local action = buffers.typeline
if lines then
if type(lines) == "string" then
lines = lines:splitlines()
+ data[name] = lines
+ end
+ if realign then
+ lines = buffers.realign(lines,realign)
end
local line, n = 0, 0
local first, last, m = buffers.strip(lines)
@@ -156,10 +163,13 @@ function buffers.loaddata(filename) -- this one might go away
return str or ""
end
-function buffers.typefile(name) -- still somewhat messy, since name can be be suffixless
+function buffers.typefile(name,realign) -- still somewhat messy, since name can be be suffixless
local str = buffers.loaddata(name)
if str and str~= "" then
local lines = str:splitlines()
+ if realign then
+ lines = buffers.realign(lines,realign)
+ end
local line, n, action = 0, 0, buffers.typeline
local first, last, m = buffers.strip(lines)
hooks.begin_of_display()
@@ -546,6 +556,45 @@ function buffers.flush_result(result,nested)
end
end
+-- new
+
+function buffers.realign(name,forced_n) -- no, auto,
+ local n, d
+ if type(name) == "string" then
+ d = data[name]
+ if type(d) == "string" then
+ d = d:splitlines()
+ end
+ else
+ d = name -- already a buffer
+ end
+ forced_n = (forced_n == variables.auto and huge) or tonumber(forced_n)
+ if forced_n then
+ for i=1, #d do
+ local spaces = find(d[i],"%S")
+ if not spaces then
+ -- empty line
+ elseif not n then
+ n = spaces
+ elseif spaces == 0 then
+ n = 0
+ break
+ elseif n > spaces then
+ n = spaces
+ end
+ end
+ if n > 0 then
+ if n > forced_n then
+ n = forced_n
+ end
+ for i=1,#d do
+ d[i] = sub(d[i],n)
+ end
+ end
+ end
+ return d
+end
+
-- THIS WILL BECOME A FRAMEWORK: the problem with prety printing is that
-- we deal with snippets and therefore we need tolerant parsing
diff --git a/tex/context/base/buff-ini.mkiv b/tex/context/base/buff-ini.mkiv
index 1cdeaa844..001796cfe 100644
--- a/tex/context/base/buff-ini.mkiv
+++ b/tex/context/base/buff-ini.mkiv
@@ -192,13 +192,13 @@
\def\doprocessbufferverbatim
{\doinitializeverbatim
- \ctxlua{buffers.type("\currentbuffer")}}
+ \ctxlua{buffers.type("\currentbuffer","\typingparameter\c!strip")}}
\def\doprocessbufferlinesverbatim#1#2#3%
{#2%
% todo, set up numbers
\doinitializeverbatim
- \ctxlua{buffers.type("\currentbuffer")}
+ \ctxlua{buffers.type("\currentbuffer","\typingparameter\c!strip")}
#3}
\def\doifelsebuffer#1%
diff --git a/tex/context/base/buff-ver.mkiv b/tex/context/base/buff-ver.mkiv
index 1fa0fa447..58dbd2a8b 100644
--- a/tex/context/base/buff-ver.mkiv
+++ b/tex/context/base/buff-ver.mkiv
@@ -408,7 +408,7 @@
\veryraggedright}
\def\ignorehyphens
- {% \language\minusone % extra bonus, the \null should do the job too
+ {\language\minusone % extra bonus, the \null should do the job too
\let\obeyedspace \specialobeyedspace
\let\controlspace\specialcontrolspace
\spaceskip.5em\relax}
@@ -466,6 +466,14 @@
\unexpanded\def\mat{\groupedcommand{\setgroupedtype\$}{\$}}
\unexpanded\def\dis{\groupedcommand{\setgroupedtype\$\$}{\$\$}}
+\def\astype
+ {\groupedcommand\dorawtype\relax}
+
+\def\dorawtype
+ {\let\currenttypingclass\??ty
+ \normalverbatimcolor % \verbatimcolor
+ \dosetverbatimfont}
+
%D \macros
%D {starttyping}
%D
@@ -584,22 +592,22 @@
\def\dotypefileverbatim
{\doinitializeverbatim
- \ctxlua{buffers.typefile("\readfilename")}}
+ \ctxlua{buffers.typefile("\readfilename","\typingparameter\c!strip")}}
\def\dotypefilelinesverbatim#1#2%
{#1%
\doinitializeverbatim
- \ctxlua{buffers.typefile("\readfilename")}%
+ \ctxlua{buffers.typefile("\readfilename","\typingparameter\c!strip")}%
#2}
\unexpanded\def\dotypeblockverbatim#1#2%
- {\dowithbuffer{_typing_}{#1}{#2}
- {}
- {\doinitializeverbatim
- \beginofverbatimlines
- \ctxlua{buffers.type("_typing_")}%
- \endofverbatimlines
- \csname#2\endcsname}}
+ {\dowithbuffer{_typing_}{#1}{#2}
+ {}
+ {\doinitializeverbatim
+ \beginofverbatimlines
+ \ctxlua{buffers.type("_typing_","\typingparameter\c!strip")}%
+ \endofverbatimlines
+ \csname#2\endcsname}}
\def\dododostarttyping[#1]%
{\typingparameter\c!before
@@ -941,6 +949,7 @@
\c!stop=,
\c!step=1,
\c!continue=,
+ \c!strip=\v!no, % auto or number
\c!nlines=]
\definetyping[\v!typing]
diff --git a/tex/context/base/char-def.lua b/tex/context/base/char-def.lua
index 63a090986..3aec401f1 100644
--- a/tex/context/base/char-def.lua
+++ b/tex/context/base/char-def.lua
@@ -50145,6 +50145,8 @@ characters.data={
description="COMBINING THREE DOTS ABOVE",
direction="nsm",
linebreak="cm",
+ mathclass="accent",
+ mathname="dddot",
unicodeslot=0x20DB,
},
[0x20DC]={
diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex
index 5ba393a5c..0023eb812 100644
--- a/tex/context/base/cont-new.tex
+++ b/tex/context/base/cont-new.tex
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2009.11.02 21:31}
+\newcontextversion{2009.11.07 17:59}
%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/context.mkiv b/tex/context/base/context.mkiv
index 1b6f205c1..10f85ba59 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -297,6 +297,7 @@
\loadmarkfile{chem-str}
\loadmarkfile{core-fnt}
+\loadmarkfile{node-rul}
\loadmarkfile{strc-not}
\loadmarkfile{strc-lnt}
diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex
index 3fd243b7c..17c73013a 100644
--- a/tex/context/base/context.tex
+++ b/tex/context/base/context.tex
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2009.11.02 21:31}
+\edef\contextversion{2009.11.07 17:59}
%D For those who want to use this:
diff --git a/tex/context/base/core-fnt.mkiv b/tex/context/base/core-fnt.mkiv
index acc5eb752..e266b341c 100644
--- a/tex/context/base/core-fnt.mkiv
+++ b/tex/context/base/core-fnt.mkiv
@@ -150,172 +150,6 @@
\fi}%
\fi}
-%D \macros
-%D {underbar,underbars,
-%D overbar,overbars,
-%D overstrike,overstrikes,
-%D setupunderbar}
-%D
-%D In the rare case that we need undelined words, for instance
-%D because all font alternatives are already in use, one can
-%D use \type{\underbar} and \type{\overstrike} and their plural
-%D forms.
-%D
-%D \startbuffer
-%D \underbars{drawing \underbar{bars} under words is a typewriter leftover}
-%D \overstrikes{striking words makes them \overstrike{unreadable} but
-%D sometimes even \overbar{top lines} come into view.}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \startvoorbeeld
-%D \startlines
-%D \getbuffer
-%D \stoplines
-%D \stopvoorbeeld
-%D
-%D The next macros are derived from the \PLAIN\ \TEX\ one, but
-%D also supports nesting. The \type{$} keeps us in horizontal
-%D mode and at the same time applies grouping.
-%D
-%D \showsetup{underbar}
-%D \showsetup{underbars}
-%D \showsetup{overbar}
-%D \showsetup{overbars}
-%D \showsetup{overstrike}
-%D \showsetup{overstrikes}
-%D
-%D Although underlining is ill advised, we permit some
-%D alternatives, that can be set up by:
-%D
-%D \showsetup{setupunderbar}
-%D
-%D The alternatives show up as
-%D {\setupunderbar [alternative=a]\underbar{alternative a}},
-%D {\setupunderbar [alternative=b]\underbar{alternative b}},
-%D {\setupunderbar [alternative=c]\underbar{alternative c}}
-%D and
-%D {\setupunderbar [rulethickness=1pt]\underbar{1pt width}},
-%D {\setupunderbar [rulethickness=2pt]\underbar{2pt width}},
-%D or whatever. Because \type{\overstrike} uses the same
-%D method, the settings also apply to that macro.
-
-\newcount\underbarlevel
-
-\def\underbarmethoda#1#2#3% RULE
- {\hbox to #1{\vrule\!!width#1\!!height#2\!!depth#3}}
-
-\def\underbarmethodb#1#2#3% DASH
- {\hbox to #1
- {\hskip-.25em
- \xleaders
- \hbox{\hskip.25em\vrule\!!width.25em\!!height#2\!!depth#3}
- \hfil}}
-
-\def\underbarmethodc#1#2#3% PERIOD
- {\hbox to #1
- {\dimen4=\dimexpr#3+.2ex\relax
- \hskip-.25em
- \xleaders
- \hbox{\hskip.25em\lower\dimen4\hbox{.}}
- \hfil}}
-
-\def\dododounderbar#1#2#3%
- {\startmathmode
- \setbox0\hbox{#3}%
- \setbox2\hbox{\color[\@@onrulecolor]{\getvalue{underbarmethod\@@onalternative}{\wd0}{#1}{#2}}}%
- \wd0\zeropoint
- \ht2\ht0
- \dp2\dp0
- \box0\box2
- \stopmathmode}
-
-\unexpanded\def\dodounderbar#1%
- {\bgroup
- \dimen0=\underbarlevel\dimexpr\@@onbottomoffset\relax
- \ifdone \else
- \advance\dimen0 -\strutht
- \fi
- \dimen2\dimexpr\dimen0+\@@onrulethickness\relax
- \dododounderbar{-\dimen0}{\dimen2}{#1}%
- \egroup}
-
-\def\betweenunderbarwords
- {\bgroup
- \setbox0\hbox{\dodounderbar{\hskip\interwordspace}}%
- \nobreak
- \hskip\zeropoint\!!minus\interwordshrink
- \discretionary{}{}{\box0}%
- \egroup}
-
-\def\betweenunderbarspaces
- {\hskip\currentspaceskip}
-
-\unexpanded\def\underbar
- {\bgroup
- \advance\underbarlevel\plusone
- \donetrue
- \dounderbar\betweenunderbarwords}
-
-\unexpanded\def\dounderbar#1%
- {\let\betweenisolatedwords#1%
- \dosingleempty\redounderbar}
-
-\unexpanded\def\redounderbar[#1]#2%
- {\iffirstargument\setupunderbar[#1]\fi
- \processisolatedwords{#2}\dodounderbar
- \egroup}
-
-\unexpanded\def\underbars
- {\bgroup
- \advance\underbarlevel\plusone
- \donetrue
- \dounderbar\betweenunderbarspaces}
-
-\unexpanded\def\overbar
- {\bgroup
- \advance\underbarlevel\minusone
- \donefalse
- \dounderbar\betweenunderbarwords}
-
-\unexpanded\def\overbars
- {\bgroup
- \advance\underbarlevel\minusone
- \donefalse
- \dounderbar\betweenunderbarspaces}
-
-\def\dooverstrike#1%
- {\bgroup
- \dimen0=\@@ontopoffset
- \dimen2=\dimexpr\dimen0+\@@onrulethickness\relax
- \dododounderbar{\dimen2}{-\dimen0}{#1}%
- \egroup}
-
-\def\betweenoverstrikewords
- {\bgroup
- \setbox0\hbox{\dooverstrike{\hskip\interwordspace}}%
- \nobreak
- \hskip\zeropoint\!!minus\interwordshrink
- \discretionary{}{}{\box0}%
- \egroup}
-
-\unexpanded\def\overstrike#1%
- {\bgroup
- \let\betweenisolatedwords\betweenoverstrikewords
- \processisolatedwords{#1}\dooverstrike
- \egroup}
-
-\unexpanded\def\overstrikes#1%
- {\bgroup
- \processisolatedwords{#1}\dooverstrike
- \egroup}
-
-\def\underbarparameter#1{\csname\??on#1\csname}
-
-\def\setupunderbar
- {\dodoubleargument\getparameters[\??on]}
-
%D \macros
%D {shiftedword, shiftedwords}
%D
@@ -456,13 +290,4 @@
\let\checkinitial\CheckDroppedCaps
-%D This module has only a few setups:
-
-\setupunderbar
- [\c!alternative=a,
- \c!rulethickness=\linewidth,
- \c!bottomoffset=1.5pt,
- \c!topoffset=2.5pt,
- \c!rulecolor=]
-
\protect \endinput
diff --git a/tex/context/base/core-ini.mkiv b/tex/context/base/core-ini.mkiv
index a01abdd11..d6a72bb26 100644
--- a/tex/context/base/core-ini.mkiv
+++ b/tex/context/base/core-ini.mkiv
@@ -53,7 +53,7 @@
\appendtoks \removeunwantedspaces \to \everyendofpar
%appendtoks \strut \to \everyendofpar % option ?
\appendtoks \flushsyncresets \to \everyendofpar
-\appendtoks \setlastlinewidth \to \everyendofpar % must happen before endgraf
+%appendtoks \setlastlinewidth \to \everyendofpar % gone, will be done in lua
\appendtoks \endgraf \to \everyendofpar
% Todo: verbatim, xml, tex, move code to here
diff --git a/tex/context/base/core-uti.mkiv b/tex/context/base/core-uti.mkiv
index 29e6342be..6b2dae2c9 100644
--- a/tex/context/base/core-uti.mkiv
+++ b/tex/context/base/core-uti.mkiv
@@ -42,6 +42,8 @@
}%
\to \everystarttext
+\def\notuccompression{\ctxlua{job.pack=false}}
+
% cleaner, for the moment
% \appendtoks
diff --git a/tex/context/base/data-lua.lua b/tex/context/base/data-lua.lua
index 7ad5edd57..26e6c830d 100644
--- a/tex/context/base/data-lua.lua
+++ b/tex/context/base/data-lua.lua
@@ -6,7 +6,7 @@ if not modules then modules = { } end modules ['data-lua'] = {
license = "see context related readme files"
}
--- some loading stuff ... we might move this one to slot 1 depending
+-- some loading stuff ... we might move this one to slot 2 depending
-- on the developments (the loaders must not trigger kpse); we could
-- of course use a more extensive lib path spec
@@ -17,7 +17,7 @@ local gsub = string.gsub
local libformats = { 'luatexlibs', 'tex', 'texmfscripts', 'othertextfiles' }
local libpaths = file.split_path(package.path)
-package.loaders[#package.loaders+1] = function(name)
+package.loaders[2] = function(name) -- was [#package.loaders+1]
for i=1,#libformats do
local format = libformats[i]
local resolved = resolvers.find_file(name,format) or ""
@@ -29,7 +29,7 @@ package.loaders[#package.loaders+1] = function(name)
end
end
local simple = file.removesuffix(name)
- for i=1,#libpaths do
+ for i=1,#libpaths do -- package.path, might become option
local resolved = gsub(libpaths[i],"?",simple)
if resolvers.isreadable.file(resolved) then
if trace_locating then
diff --git a/tex/context/base/font-ini.lua b/tex/context/base/font-ini.lua
index 5cff22760..a4a38ed71 100644
--- a/tex/context/base/font-ini.lua
+++ b/tex/context/base/font-ini.lua
@@ -115,3 +115,15 @@ function fonts.show_font_parameters()
end
end
end
+
+local dimenfactors = number.dimenfactors
+
+function fonts.dimenfactor(unit,tfmdata)
+ if unit == "ex" then
+ return tfmdata.parameters.x_height
+ elseif unit == "em" then
+ return tfmdata.parameters.em_height
+ else
+ return dimenfactors[unit] or unit
+ end
+end
diff --git a/tex/context/base/font-otf.lua b/tex/context/base/font-otf.lua
index 55a77ad7d..b5f7cb431 100644
--- a/tex/context/base/font-otf.lua
+++ b/tex/context/base/font-otf.lua
@@ -19,6 +19,7 @@ local trace_dynamics = false trackers.register("otf.dynamics", function(v
local trace_sequences = false trackers.register("otf.sequences", function(v) trace_sequences = v end)
local trace_math = false trackers.register("otf.math", function(v) trace_math = v end)
local trace_unimapping = false trackers.register("otf.unimapping", function(v) trace_unimapping = v end)
+local trace_defining = false trackers.register("fonts.defining", function(v) trace_defining = v end)
--~ trackers.enable("otf.loading")
@@ -269,6 +270,9 @@ function otf.load(filename,format,sub,featurefile)
end
end
if data then
+ if trace_defining then
+ logs.report("define font","loading from cache: %s",hash)
+ end
otf.enhance("unpack",data,filename,false) -- no message here
otf.add_dimensions(data)
if trace_sequences then
diff --git a/tex/context/base/font-otn.lua b/tex/context/base/font-otn.lua
index f32531c9a..77d67d4b5 100644
--- a/tex/context/base/font-otn.lua
+++ b/tex/context/base/font-otn.lua
@@ -304,16 +304,29 @@ end
local function toligature(kind,lookupname,start,stop,char,markflag,discfound) -- brr head
if start ~= stop then
+--~ if discfound then
+--~ local lignode = copy_node(start)
+--~ lignode.font = start.font
+--~ lignode.char = char
+--~ lignode.subtype = 2
+--~ start = node.do_ligature_n(start, stop, lignode)
+--~ if start.id == disc then
+--~ local prev = start.prev
+--~ start = start.next
+--~ end
if discfound then
+ -- print("start->stop",nodes.tosequence(start,stop))
local lignode = copy_node(start)
- lignode.font = start.font
- lignode.char = char
- lignode.subtype = 2
- start = node.do_ligature_n(start, stop, lignode)
- if start.id == disc then
- local prev = start.prev
- start = start.next
+ lignode.font, lignode.char, lignode.subtype = start.font, char, 2
+ local next, prev = stop.next, start.prev
+ stop.next = nil
+ lignode = node.do_ligature_n(start, stop, lignode)
+ prev.next = lignode
+ if next then
+ next.prev = lignode
end
+ lignode.next, lignode.prev = next, prev
+ -- print("start->end",nodes.tosequence(start))
else -- start is the ligature
local deletemarks = markflag ~= "mark"
local n = copy_node(start)
diff --git a/tex/context/base/font-tfm.lua b/tex/context/base/font-tfm.lua
index 73412f821..14c4d0a2e 100644
--- a/tex/context/base/font-tfm.lua
+++ b/tex/context/base/font-tfm.lua
@@ -560,6 +560,9 @@ end
if not t.psname then
t.psname = t.fullname -- else bad luck
end
+ if trace_defining then
+ logs.report("define font","used for subsetting: %s ",t.fullname or "nofullname")
+ end
return t, delta
end
diff --git a/tex/context/base/l-aux.lua b/tex/context/base/l-aux.lua
index 8d74ec178..d74026f0f 100644
--- a/tex/context/base/l-aux.lua
+++ b/tex/context/base/l-aux.lua
@@ -55,9 +55,9 @@ function aux.make_settings_to_hash_pattern(set,how)
end
end
-function aux.settings_to_hash(str)
+function aux.settings_to_hash(str,existing)
if str and str ~= "" then
- hash = { }
+ hash = existing or { }
if moretolerant then
pattern_b_s:match(str)
else
@@ -69,9 +69,9 @@ function aux.settings_to_hash(str)
end
end
-function aux.settings_to_hash_tolerant(str)
+function aux.settings_to_hash_tolerant(str,existing)
if str and str ~= "" then
- hash = { }
+ hash = existing or { }
pattern_b_s:match(str)
return hash
else
@@ -79,9 +79,9 @@ function aux.settings_to_hash_tolerant(str)
end
end
-function aux.settings_to_hash_strict(str)
+function aux.settings_to_hash_strict(str,existing)
if str and str ~= "" then
- hash = { }
+ hash = existing or { }
pattern_c_s:match(str)
return next(hash) and hash
else
diff --git a/tex/context/base/l-dimen.lua b/tex/context/base/l-dimen.lua
index 32becb276..ba22ab5a8 100644
--- a/tex/context/base/l-dimen.lua
+++ b/tex/context/base/l-dimen.lua
@@ -89,7 +89,7 @@ alternative index function.
local mt = { } setmetatable(dimenfactors,mt)
mt.__index = function(t,s)
- error("wrong dimension: " .. s)
+ error("wrong dimension: " .. (s or "?"))
return 1
end
diff --git a/tex/context/base/l-table.lua b/tex/context/base/l-table.lua
index d7c2b0250..b788f2f51 100644
--- a/tex/context/base/l-table.lua
+++ b/tex/context/base/l-table.lua
@@ -11,7 +11,7 @@ table.join = table.concat
local concat, sort, insert, remove = table.concat, table.sort, table.insert, table.remove
local format, find, gsub, lower, dump = string.format, string.find, string.gsub, string.lower, string.dump
local getmetatable, setmetatable = getmetatable, setmetatable
-local type, next, tostring, ipairs = type, next, tostring, ipairs
+local type, next, tostring, tonumber, ipairs, pairs = type, next, tostring, tonumber, ipairs, pairs
function table.strip(tab)
local lst = { }
@@ -346,7 +346,7 @@ local function do_serialize(root,name,depth,level,indexed)
handle(format("%s %s,",depth,v))
end
elseif t == "string" then
- if reduce and (find(v,"^[%-%+]?[%d]-%.?[%d+]$") == 1) then
+ if reduce and tonumber(v) then
handle(format("%s %s,",depth,v))
else
handle(format("%s %q,",depth,v))
@@ -405,7 +405,7 @@ local function do_serialize(root,name,depth,level,indexed)
end
end
elseif t == "string" then
- if reduce and (find(v,"^[%-%+]?[%d]-%.?[%d+]$") == 1) then
+ if reduce and tonumber(v) then
--~ handle(format("%s %s=%s,",depth,key(k),v))
if type(k) == "number" then -- or find(k,"^%d+$") then
if hexify then
diff --git a/tex/context/base/lxml-aux.lua b/tex/context/base/lxml-aux.lua
index 9eab06e45..e52b3f629 100644
--- a/tex/context/base/lxml-aux.lua
+++ b/tex/context/base/lxml-aux.lua
@@ -17,6 +17,21 @@ local type = type
local insert, remove = table.insert, table.remove
local gmatch, gsub = string.gmatch, string.gsub
+
+function xml.inheritedconvert(data,xmldata)
+ local settings = xmldata.settings
+ settings.parent_root = xmldata -- to be tested
+--~ settings.no_root = true
+ local xc = xmlconvert(data,settings)
+--~ xc.settings = nil
+--~ xc.entities = nil
+--~ xc.special = nil
+--~ xc.ri = nil
+--~ print(xc.tg)
+-- for k,v in pairs(xc) do print(k,tostring(v)) end
+ return xc
+end
+
local function withelements(e,handle,depth)
if e and handle then
local edt = e.dt
@@ -144,24 +159,33 @@ end
local no_root = { no_root = true }
+function xml.redo_ni(d)
+ for k=1,#d do
+ local dk = d[k]
+ if type(dk) == "table" then
+ dk.ni = k
+ end
+ end
+end
+
function xml.inject_element(root, pattern, element, prepend)
if root and element then
if type(element) == "string" then
- element = xmlconvert(element,no_root)
+--~ element = xmlconvert(element,no_root)
+ element = xml.inheritedconvert(element,root)
end
if element then
+ if element.ri then
+ element = element.dt[element.ri].dt
+ else
+ element = element.dt
+ end
+ -- we need to re-index
local collected = xmlparseapply({ root },pattern)
if collected then
for c=1,#collected do
local e = collected[c]
- local r = e.__p__
- local d = r.dt
- local k = e.ni
- if element.ri then
- element = element.dt[element.ri].dt
- else
- element = element.dt
- end
+ local r, d, k = e.__p__, r.dt, e.ni
local edt
if r.ri then
edt = r.dt[r.ri].dt
@@ -172,8 +196,11 @@ function xml.inject_element(root, pattern, element, prepend)
local be, af
if prepend then
be, af = xmlcopy(element), edt
+be.__p__ = e
+
else
be, af = edt, xmlcopy(element)
+af.__p__ = e
end
for i=1,#af do
be[#be+1] = af[i]
@@ -186,6 +213,7 @@ function xml.inject_element(root, pattern, element, prepend)
else
-- r.dt = element.dt -- todo
end
+xml.redo_ni(d)
end
end
end
@@ -201,7 +229,8 @@ function xml.insert_element(root, pattern, element, before) -- todo: element als
else
local matches, collect = { }, nil
if type(element) == "string" then
- element = xmlconvert(element,true)
+--~ element = xmlconvert(element,no_root)
+ element = xml.inheritedconvert(element,root)
end
if element and element.ri then
element = element.dt[element.ri]
@@ -217,17 +246,25 @@ function xml.insert_element(root, pattern, element, before) -- todo: element als
if not before then
k = k + 1
end
+ local ce = xmlcopy(element)
+ce.__p__ = r
if element.tg then
- insert(d,k,element) -- untested
+ insert(d,k,ce) -- untested
else
- local edt = element.dt
+ -- maybe bugged
+ local edt = ce.dt
if edt then
for i=1,#edt do
- insert(d,k,edt[i])
+local edti = edt[i]
+ insert(d,k,edti)
+if type(edti) == "table" then
+ edti.__p__ = r
+end
k = k + 1
end
end
end
+xml.redo_ni(d)
end
end
end
@@ -252,10 +289,11 @@ function xml.delete_element(root, pattern)
local p = e.__p__
if p then
if trace_manipulations then
- report('deleting',pattern,c,e)
+ report('deleting',pattern,c,tostring(e)) -- fails
end
- remove(p.dt,e.ni)
- e.ni = nil
+ local d = p.dt
+ remove(d,e.ni)
+xml.redo_ni(d)
end
end
end
@@ -263,7 +301,8 @@ end
function xml.replace_element(root, pattern, element)
if type(element) == "string" then
- element = xmlconvert(element,true)
+--~ element = xmlconvert(element,true)
+ element = xml.inheritedconvert(element,root)
end
if element and element.ri then
element = element.dt[element.ri]
@@ -278,7 +317,9 @@ function xml.replace_element(root, pattern, element)
if trace_manipulations then
report('replacing',pattern,c,e)
end
- p.dt[e.ni] = element.dt -- maybe not clever enough
+ local d = p.dt
+ d[e.ni] = element.dt -- maybe not clever enough
+--~ xml.redo_ni(d)
end
end
end
@@ -314,9 +355,10 @@ local function include(xmldata,pattern,attribute,recursive,loaddata)
-- for the moment hard coded
epdt[ek.ni] = xml.escaped(data) -- d[k] = xml.escaped(data)
else
- local settings = xmldata.settings
- settings.parent_root = xmldata -- to be tested
- local xi = xmlconvert(data,settings)
+--~ local settings = xmldata.settings
+--~ settings.parent_root = xmldata -- to be tested
+--~ local xi = xmlconvert(data,settings)
+ local xi = xml.inheritedconvert(element,xmldata)
if not xi then
epdt[ek.ni] = "" -- xml.empty(d,k)
else
diff --git a/tex/context/base/lxml-lpt.lua b/tex/context/base/lxml-lpt.lua
index 7e5ef15b9..254076349 100644
--- a/tex/context/base/lxml-lpt.lua
+++ b/tex/context/base/lxml-lpt.lua
@@ -397,7 +397,9 @@ local lp_builtin = P (
) * ((spaces * P("(") * spaces * P(")"))/"")
local lp_attribute = (P("@") + P("attribute::")) / "" * Cc("(ll.at and ll.at['") * R("az","AZ","--","__")^1 * Cc("'])")
-local lp_fastpos = ((R("09","--","++")^1 * P(-1)) / function(s) return "l==" .. s end)
+local lp_fastpos_p = ((P("+")^0 * R("09")^1 * P(-1)) / function(s) return "l==" .. s end)
+local lp_fastpos_n = ((P("-") * R("09")^1 * P(-1)) / function(s) return "(" .. s .. "<0 and (#list+".. s .. "==l))" end)
+local lp_fastpos = lp_fastpos_n + lp_fastpos_p
local lp_reserved = C("and") + C("or") + C("not") + C("div") + C("mod") + C("true") + C("false")
local lp_lua_function = C(R("az","AZ","__")^1 * (P(".") * R("az","AZ","__")^1)^1) * ("(") / function(t) -- todo: better . handling
@@ -449,11 +451,11 @@ local content =
lp_child +
lp_any
-local converter = lpeg.Cs (
- lp_fastpos + (lpeg.P { lparent * (lpeg.V(1))^0 * rparent + content } )^0
+local converter = Cs (
+ lp_fastpos + (P { lparent * (V(1))^0 * rparent + content } )^0
)
-cleaner = lpeg.Cs ( (
+cleaner = Cs ( (
--~ lp_fastpos +
lp_reserved +
lp_string +
diff --git a/tex/context/base/lxml-tex.lua b/tex/context/base/lxml-tex.lua
index 4809942a8..92783d499 100644
--- a/tex/context/base/lxml-tex.lua
+++ b/tex/context/base/lxml-tex.lua
@@ -979,7 +979,7 @@ local function number(collected)
end
end
-local function concatrange(collected,start,stop,separator,lastseparator) -- test this on mml
+local function concatrange(collected,start,stop,separator,lastseparator,textonly) -- test this on mml
if collected then
local nofcollected = #collected
local separator = separator or ""
@@ -987,7 +987,11 @@ local function concatrange(collected,start,stop,separator,lastseparator) -- test
start, stop = (start == "" and 1) or tonumber(start) or 1, (stop == "" and nofcollected) or tonumber(stop) or nofcollected
if stop < 0 then stop = nofcollected + stop end -- -1 == last-1
for i=start,stop do
- xmlsprint(collected[i])
+ if textonly then
+ xmlcprint(collected[i])
+ else
+ xmlsprint(collected[i])
+ end
if i == nofcollected then
-- nothing
elseif i == nofcollected-1 and lastseparator ~= "" then
@@ -999,8 +1003,8 @@ local function concatrange(collected,start,stop,separator,lastseparator) -- test
end
end
-local function concat(collected,separator,lastseparator) -- test this on mml
- concatrange(collected,false,false,separator,lastseparator)
+local function concat(collected,separator,lastseparator,textonly) -- test this on mml
+ concatrange(collected,false,false,separator,lastseparator,textonly)
end
finalizers.first = first
@@ -1154,12 +1158,12 @@ function lxml.chainattribute(id,pattern,a,default)
end
end
-function lxml.concatrange(id,pattern,start,stop,separator,lastseparator) -- test this on mml
- concatrange(lxmlparseapply(id,pattern),start,stop,separator,lastseparator)
+function lxml.concatrange(id,pattern,start,stop,separator,lastseparator,textonly) -- test this on mml
+ concatrange(lxmlparseapply(id,pattern),start,stop,separator,lastseparator,textonly)
end
-function lxml.concat(id,pattern,separator,lastseparator)
- concatrange(lxmlparseapply(id,pattern),false,false,separator,lastseparator)
+function lxml.concat(id,pattern,separator,lastseparator,textonly)
+ concatrange(lxmlparseapply(id,pattern),false,false,separator,lastseparator,textonly)
end
function lxml.element(id,n)
diff --git a/tex/context/base/lxml-xml.lua b/tex/context/base/lxml-xml.lua
index bbde4bd42..5d6db9475 100644
--- a/tex/context/base/lxml-xml.lua
+++ b/tex/context/base/lxml-xml.lua
@@ -94,17 +94,19 @@ local function chainattribute(collected,arguments) -- todo: optional levels
return ""
end
-local function raw(collected)
+local function raw(collected) -- hybrid
if collected then
- return xmlserialize(collected[1]) -- only first as we cannot concat function
+ local e = collected[1] or collected
+ return (e and xmlserialize(e)) or "" -- only first as we cannot concat function
else
return ""
end
end
-local function text(collected)
+local function text(collected) -- hybrid
if collected then
- return xmltostring(collected[1].dt) -- only first as we cannot concat function
+ local e = collected[1] or collected
+ return (e and xmltostring(e.dt)) or ""
else
return ""
end
@@ -247,9 +249,14 @@ end
function xml.text(id,pattern)
if pattern then
- return text(xmlfilter(id,pattern))
+ -- return text(xmlfilter(id,pattern))
+ local collected = xmlfilter(id,pattern)
+ return (collected and xmltostring(collected[1].dt)) or ""
+ elseif id then
+ -- return text(id)
+ return xmltostring(id.dt) or ""
else
- return text(id)
+ return ""
end
end
diff --git a/tex/context/base/math-ali.mkiv b/tex/context/base/math-ali.mkiv
index 2ef77c6a8..c9741e8cc 100644
--- a/tex/context/base/math-ali.mkiv
+++ b/tex/context/base/math-ali.mkiv
@@ -1044,6 +1044,241 @@
{\preparebinrel{#2}%
\currentbinrel{\mathop{\kern\zeropoint#2}\limits_{#1}}}
+%D The following code comes from \type {math-str.mkiv}.
+
+%D Here we implement a basic math alignment mechanism. Numbers
+%D are also handled. The macros \type {\startinnermath} and
+%D \type {\stopinnermath} can be overloaded in specialized
+%D modules.
+
+\def\startinnermath
+ {\getvalue{\e!start\??fm\formulaparameter\c!align}}
+
+\def\stopinnermath
+ {\getvalue{\e!stop \??fm\formulaparameter\c!align}}
+
+\def\mathinnerstrut
+ {\doif{\formulaparameter\c!strut}\v!yes\strut}
+
+\long\def\defineinnermathhandler#1#2#3%
+ {\setvalue{\e!start\??fm#1}{#2}%
+ \setvalue{\e!stop \??fm#1}{#3}}
+
+\newif\iftracemath
+
+\def\mathhbox
+ {\iftracemath\ruledhbox\else\hbox\fi}
+
+\chardef\mathraggedstatus=0 % normal left center right
+\chardef\mathnumberstatus=0 % nothing normal shift_right
+\let\mathnumbercorrection\!!zeropoint
+
+\def\startmathbox#1%
+ {\hsize\displaywidth
+ \global\chardef\mathnumberstatus\plusone
+ \chardef\mathraggedstatus#1\relax
+ \let\mathnumbercorrection\!!zeropoint
+ \global\let\@eqno \empty \def\eqno {\gdef\@eqno }%
+ \global\let\@leqno\empty \def\leqno{\gdef\@leqno}%
+ % added
+ \let\normalreqno\eqno
+ \let\normalleqno\leqno
+ % added
+ \doplaceformulanumber
+ \setbox\scratchbox\mathhbox to \displaywidth\bgroup
+ \mathinnerstrut
+ $%
+ \displaystyle
+ \ifcase\mathraggedstatus\or\hfill\or\hfill\fi}
+
+\def\llappedmathno
+ {\ifcase\mathraggedstatus\or
+ \@eqno
+ \or
+ \llap{\@eqno}%
+ \or
+ \llap{\@eqno}%
+ \fi}
+
+\def\rlappedmathno
+ {\ifcase\mathraggedstatus\or
+ \rlap{\@leqno}%
+ \or
+ \rlap{\@leqno}%
+ \or
+ \@leqno
+ \fi}
+
+\def\stopmathbox
+ {$%
+ \ifcase\mathraggedstatus\or\or\hfill\or\hfill\fi
+ \egroup
+ \setbox0\hbox{\unhcopy\scratchbox}%
+ \scratchdimen\wd0
+ \ifdim\scratchdimen>\displaywidth
+ \donetrue
+ \else
+ \donefalse
+ \fi
+ \hbox to \displaywidth\bgroup
+ \ifcase\mathnumberstatus
+ \box\scratchbox
+ \or
+ \ifx\@leqno\empty
+ \ifx\@eqno\empty
+ \box\scratchbox
+ \else
+ \ifdone
+ \vbox{\box\scratchbox\hbox to \displaywidth{\hss\llappedmathno}}%
+ \else
+ \hss\box\scratchbox\llappedmathno % hss makes room for number
+ \fi
+ \fi
+ \else
+ \ifdone
+ \vbox{\hbox to \displaywidth{\rlappedmathno\hss}\box\scratchbox}%
+ \else
+ \rlappedmathno\box\scratchbox\hss % hss makes room for number
+ \fi
+ \fi
+ \or
+ \hskip\mathnumbercorrection
+ \box\scratchbox
+ \hss
+ \else
+ \box\scratchbox
+ \fi
+ \egroup}
+
+\defineinnermathhandler\v!left {\startmathbox\plusone }{\stopmathbox}
+\defineinnermathhandler\v!middle {\startmathbox\plustwo }{\stopmathbox}
+\defineinnermathhandler\v!right {\startmathbox\plusthree}{\stopmathbox}
+\defineinnermathhandler\v!flushleft {\startmathbox\plusthree}{\stopmathbox}
+\defineinnermathhandler\v!center {\startmathbox\plustwo }{\stopmathbox}
+\defineinnermathhandler\v!flushright{\startmathbox\plusone }{\stopmathbox}
+
+%D [The examples below are in english and don't process in the
+%D documentation style, which will be english some day.]
+%D
+%D Normally a formula is centered, but in case you want to
+%D align it left or right, you can set up formulas to behave
+%D that way. Normally a formula will adapt is left indentation
+%D to the environment:
+%D
+%D \startbuffer
+%D \fakewords{20}{40}\epar
+%D \startitemize
+%D \item \fakewords{20}{40}\epar
+%D \placeformula \startformula \fakeformula \stopformula
+%D \item \fakewords{20}{40}\epar
+%D \stopitemize
+%D \fakewords{20}{40}\epar
+%D \stopbuffer
+%D
+%D % \getbuffer
+%D
+%D In the next examples we explicitly align formulas to the
+%D left (\type {\raggedleft}), center and right (\type
+%D {\raggedright}):
+%D
+%D \startbuffer
+%D \setupformulas[align=left]
+%D \startformula\fakeformula\stopformula
+%D \setupformulas[align=middle]
+%D \startformula\fakeformula\stopformula
+%D \setupformulas[align=right]
+%D \startformula\fakeformula\stopformula
+%D \stopbuffer
+%D
+%D \typebuffer
+%D
+%D Or in print:
+%D
+%D % {\getbuffer}
+%D
+%D With formula numbers these formulas look as follows:
+%D
+%D \startbuffer
+%D \setupformulas[align=left]
+%D \placeformula \startformula\fakeformula\stopformula
+%D \setupformulas[align=middle]
+%D \placeformula \startformula\fakeformula\stopformula
+%D \setupformulas[align=right]
+%D \placeformula \startformula\fakeformula\stopformula
+%D \stopbuffer
+%D
+%D % {\getbuffer}
+%D
+%D This was keyed in as:
+%D
+%D \typebuffer
+%D
+%D When tracing is turned on (\type {\tracemathtrue}) you can
+%D visualize the bounding box of the formula,
+%D
+%D % {\tracemathtrue\getbuffer}
+%D
+%D As you can see, the dimensions are the natural ones, but if
+%D needed you can force a normalized line:
+%D
+%D \startbuffer
+%D \setupformulas[strut=yes]
+%D \placeformula \startformula \fakeformula \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer
+%D
+%D This time we get a more spacy result.
+%D
+%D % {\tracemathtrue\getbuffer}
+%D
+%D We will now show a couple of more settings and combinations
+%D of settings. In centered formulas, the number takes no space
+%D
+%D \startbuffer
+%D \setupformulas[align=middle]
+%D \startformula \fakeformula \stopformula
+%D \placeformula \startformula \fakeformula \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer % {\tracemathtrue\getbuffer}
+%D
+%D You can influence the placement of the whole box with the
+%D parameters \type {leftmargin} and \type {rightmargin}.
+%D
+%D \startbuffer
+%D \setupformulas[align=right,leftmargin=3em]
+%D \startformula \fakeformula \stopformula
+%D \placeformula \startformula \fakeformula \stopformula
+%D
+%D \setupformulas[align=left,rightmargin=1em]
+%D \startformula \fakeformula \stopformula
+%D \placeformula \startformula \fakeformula \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer % {\tracemathtrue\getbuffer}
+%D
+%D You can also inherit the margin from the environment.
+%D
+%D \startbuffer
+%D \setupformulas[align=right,margin=standard]
+%D \startformula \fakeformula \stopformula
+%D \placeformula \startformula \fakeformula \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer % {\tracemathtrue\getbuffer}
+%D
+%D The distance between the formula and the number is only
+%D applied when the formula is left or right aligned.
+%D
+%D \startbuffer
+%D \setupformulas[align=left,distance=2em]
+%D \startformula \fakeformula \stopformula
+%D \placeformula \startformula \fakeformula \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer % {\tracemathtrue\getbuffer}
+
\protect \endinput
% \placeformula \startformula[-] \startmatrix
diff --git a/tex/context/base/math-for.mkiv b/tex/context/base/math-for.mkiv
index c8f73a8a3..ae398fcab 100644
--- a/tex/context/base/math-for.mkiv
+++ b/tex/context/base/math-for.mkiv
@@ -49,12 +49,15 @@
\def\dosetupformulas[#1][#2]%
{\ifsecondargument
+ \edef\currentformula{#1}%
\getparameters[\??fm#1][#2]%
\else
+% \let\currentformula\v!formula % hm
+ \let\currentformula\empty
\getparameters[\??fm][#1]%
\fi
- \edef\currentformula{#1}%
- \the\everysetupformulas}
+ \the\everysetupformulas
+ \let\currentformula\empty}
%D Not yet cleanup up:
diff --git a/tex/context/base/mult-de.tex b/tex/context/base/mult-de.tex
index 8715a65ba..cdd3db858 100644
--- a/tex/context/base/mult-de.tex
+++ b/tex/context/base/mult-de.tex
@@ -325,8 +325,12 @@
\setinterfacevariable{outer}{aussen}
\setinterfacevariable{outeredge}{outeredge}
\setinterfacevariable{outermargin}{outermargin}
+\setinterfacevariable{overbar}{ueberstrichen}
+\setinterfacevariable{overbars}{ueberstreichen}
\setinterfacevariable{overlay}{overlay}
\setinterfacevariable{overprint}{overprint}
+\setinterfacevariable{overstrike}{durchgestrichen}
+\setinterfacevariable{overstrikes}{durchstreichen}
\setinterfacevariable{packed}{gepackt}
\setinterfacevariable{page}{seite}
\setinterfacevariable{pagecomment}{pagecomment}
@@ -480,6 +484,8 @@
\setinterfacevariable{type}{tippen}
\setinterfacevariable{typing}{tippen}
\setinterfacevariable{unavailable}{nichtverfuegbar}
+\setinterfacevariable{underbar}{unterstrichen}
+\setinterfacevariable{underbars}{unterstreichen}
\setinterfacevariable{unit}{einheit}
\setinterfacevariable{units}{einheiten}
\setinterfacevariable{unknown}{unbekannt}
@@ -787,6 +793,7 @@
\setinterfaceconstant{openaction}{oeffenaktion}
\setinterfaceconstant{openpageaction}{openpageaction}
\setinterfaceconstant{option}{option}
+\setinterfaceconstant{order}{order}
\setinterfaceconstant{orientation}{orientation}
\setinterfaceconstant{otherstext}{otherstext}
\setinterfaceconstant{outermargin}{outermargin}
@@ -917,6 +924,7 @@
\setinterfaceconstant{stop}{stop}
\setinterfaceconstant{stopper}{abschnitttrenner}
\setinterfaceconstant{stretch}{strecken}
+\setinterfaceconstant{strip}{strip}
\setinterfaceconstant{strut}{strut}
\setinterfaceconstant{style}{stil}
\setinterfaceconstant{sub}{unter}
@@ -1302,10 +1310,6 @@
\setinterfacecommand{outeredgewidth}{outeredgewidth}
\setinterfacecommand{outermargindistance}{outermargindistance}
\setinterfacecommand{outermarginwidth}{outermarginwidth}
-\setinterfacecommand{overbar}{ueberstrichen}
-\setinterfacecommand{overbars}{ueberstreichen}
-\setinterfacecommand{overstrike}{durchgestrichen}
-\setinterfacecommand{overstrikes}{durchstreichen}
\setinterfacecommand{packed}{kleinerdurchschuss}
\setinterfacecommand{page}{seite}
\setinterfacecommand{pagedepth}{pagedepth}
@@ -1640,8 +1644,6 @@
\setinterfacecommand{type}{tippen}
\setinterfacecommand{typebuffer}{tippepuffer}
\setinterfacecommand{typefile}{tippedatei}
-\setinterfacecommand{underbar}{unterstrichen}
-\setinterfacecommand{underbars}{unterstreichen}
\setinterfacecommand{unitmeaning}{bedeutung}
\setinterfacecommand{unknown}{unbekant}
\setinterfacecommand{useJSscripts}{verwendeJSscript}
diff --git a/tex/context/base/mult-def.lua b/tex/context/base/mult-def.lua
index 618c28c3b..3514774d4 100644
--- a/tex/context/base/mult-def.lua
+++ b/tex/context/base/mult-def.lua
@@ -2829,46 +2829,6 @@ return {
["pe"]="عرضحاشیهخارجی",
["ro"]="outermarginwidth",
},
- ["overbar"]={
- ["cs"]="nadtrzeno",
- ["de"]="ueberstrichen",
- ["en"]="overbar",
- ["fr"]="overbar",
- ["it"]="sopralinea",
- ["nl"]="overstreep",
- ["pe"]="میلهرو",
- ["ro"]="barasus",
- },
- ["overbars"]={
- ["cs"]="nadtrzeni",
- ["de"]="ueberstreichen",
- ["en"]="overbars",
- ["fr"]="overbars",
- ["it"]="sopralinee",
- ["nl"]="overstrepen",
- ["pe"]="میلههارو",
- ["ro"]="supralinie",
- },
- ["overstrike"]={
- ["cs"]="preskrtnuto",
- ["de"]="durchgestrichen",
- ["en"]="overstrike",
- ["fr"]="surlignetout",
- ["it"]="sbarrato",
- ["nl"]="doorstreep",
- ["pe"]="خطزدن",
- ["ro"]="liniepeste",
- },
- ["overstrikes"]={
- ["cs"]="preskrtnuti",
- ["de"]="durchstreichen",
- ["en"]="overstrikes",
- ["fr"]="surligne",
- ["it"]="sbarrati",
- ["nl"]="doorstrepen",
- ["pe"]="خطزدنها",
- ["ro"]="liniipeste",
- },
["packed"]={
["cs"]="zhustene",
["de"]="kleinerdurchschuss",
@@ -6209,26 +6169,6 @@ return {
["pe"]="تایپپرونده",
["ro"]="typefile",
},
- ["underbar"]={
- ["cs"]="podtrzeno",
- ["de"]="unterstrichen",
- ["en"]="underbar",
- ["fr"]="souslignetout",
- ["it"]="sottolinea",
- ["nl"]="onderstreep",
- ["pe"]="میلهزیر",
- ["ro"]="sublinie",
- },
- ["underbars"]={
- ["cs"]="podtrzeni",
- ["de"]="unterstreichen",
- ["en"]="underbars",
- ["fr"]="sousligne",
- ["it"]="sottolinee",
- ["nl"]="onderstrepen",
- ["pe"]="میلههایزیر",
- ["ro"]="sublinii",
- },
["unitmeaning"]={
["cs"]="vyznam",
["de"]="bedeutung",
@@ -6540,6 +6480,12 @@ return {
},
},
["constants"]={
+ ["strip"]={
+ ["en"]="strip",
+ },
+ ["order"]={
+ ["en"]="order",
+ },
["headalign"]={
["en"]="headalign",
["nl"]="kopuitlijnen",
@@ -11151,6 +11097,66 @@ return {
},
},
["variables"]={
+ ["underbar"]={
+ ["cs"]="podtrzeno",
+ ["de"]="unterstrichen",
+ ["en"]="underbar",
+ ["fr"]="souslignetout",
+ ["it"]="sottolinea",
+ ["nl"]="onderstreep",
+ ["pe"]="میلهزیر",
+ ["ro"]="sublinie",
+ },
+ ["underbars"]={
+ ["cs"]="podtrzeni",
+ ["de"]="unterstreichen",
+ ["en"]="underbars",
+ ["fr"]="sousligne",
+ ["it"]="sottolinee",
+ ["nl"]="onderstrepen",
+ ["pe"]="میلههایزیر",
+ ["ro"]="sublinii",
+ },
+ ["overbar"]={
+ ["cs"]="nadtrzeno",
+ ["de"]="ueberstrichen",
+ ["en"]="overbar",
+ ["fr"]="overbar",
+ ["it"]="sopralinea",
+ ["nl"]="overstreep",
+ ["pe"]="میلهرو",
+ ["ro"]="barasus",
+ },
+ ["overbars"]={
+ ["cs"]="nadtrzeni",
+ ["de"]="ueberstreichen",
+ ["en"]="overbars",
+ ["fr"]="overbars",
+ ["it"]="sopralinee",
+ ["nl"]="overstrepen",
+ ["pe"]="میلههارو",
+ ["ro"]="supralinie",
+ },
+ ["overstrike"]={
+ ["cs"]="preskrtnuto",
+ ["de"]="durchgestrichen",
+ ["en"]="overstrike",
+ ["fr"]="surlignetout",
+ ["it"]="sbarrato",
+ ["nl"]="doorstreep",
+ ["pe"]="خطزدن",
+ ["ro"]="liniepeste",
+ },
+ ["overstrikes"]={
+ ["cs"]="preskrtnuti",
+ ["de"]="durchstreichen",
+ ["en"]="overstrikes",
+ ["fr"]="surligne",
+ ["it"]="sbarrati",
+ ["nl"]="doorstrepen",
+ ["pe"]="خطزدنها",
+ ["ro"]="liniipeste",
+ },
["maxheight"]={
["en"]="maxheight",
},
diff --git a/tex/context/base/mult-en.tex b/tex/context/base/mult-en.tex
index 148d43f35..3d4362a79 100644
--- a/tex/context/base/mult-en.tex
+++ b/tex/context/base/mult-en.tex
@@ -325,8 +325,12 @@
\setinterfacevariable{outer}{outer}
\setinterfacevariable{outeredge}{outeredge}
\setinterfacevariable{outermargin}{outermargin}
+\setinterfacevariable{overbar}{overbar}
+\setinterfacevariable{overbars}{overbars}
\setinterfacevariable{overlay}{overlay}
\setinterfacevariable{overprint}{overprint}
+\setinterfacevariable{overstrike}{overstrike}
+\setinterfacevariable{overstrikes}{overstrikes}
\setinterfacevariable{packed}{packed}
\setinterfacevariable{page}{page}
\setinterfacevariable{pagecomment}{pagecomment}
@@ -480,6 +484,8 @@
\setinterfacevariable{type}{type}
\setinterfacevariable{typing}{typing}
\setinterfacevariable{unavailable}{unavailable}
+\setinterfacevariable{underbar}{underbar}
+\setinterfacevariable{underbars}{underbars}
\setinterfacevariable{unit}{unit}
\setinterfacevariable{units}{units}
\setinterfacevariable{unknown}{unknown}
@@ -787,6 +793,7 @@
\setinterfaceconstant{openaction}{openaction}
\setinterfaceconstant{openpageaction}{openpageaction}
\setinterfaceconstant{option}{option}
+\setinterfaceconstant{order}{order}
\setinterfaceconstant{orientation}{orientation}
\setinterfaceconstant{otherstext}{otherstext}
\setinterfaceconstant{outermargin}{outermargin}
@@ -917,6 +924,7 @@
\setinterfaceconstant{stop}{stop}
\setinterfaceconstant{stopper}{stopper}
\setinterfaceconstant{stretch}{stretch}
+\setinterfaceconstant{strip}{strip}
\setinterfaceconstant{strut}{strut}
\setinterfaceconstant{style}{style}
\setinterfaceconstant{sub}{sub}
@@ -1302,10 +1310,6 @@
\setinterfacecommand{outeredgewidth}{outeredgewidth}
\setinterfacecommand{outermargindistance}{outermargindistance}
\setinterfacecommand{outermarginwidth}{outermarginwidth}
-\setinterfacecommand{overbar}{overbar}
-\setinterfacecommand{overbars}{overbars}
-\setinterfacecommand{overstrike}{overstrike}
-\setinterfacecommand{overstrikes}{overstrikes}
\setinterfacecommand{packed}{packed}
\setinterfacecommand{page}{page}
\setinterfacecommand{pagedepth}{pagedepth}
@@ -1640,8 +1644,6 @@
\setinterfacecommand{type}{type}
\setinterfacecommand{typebuffer}{typebuffer}
\setinterfacecommand{typefile}{typefile}
-\setinterfacecommand{underbar}{underbar}
-\setinterfacecommand{underbars}{underbars}
\setinterfacecommand{unitmeaning}{unitmeaning}
\setinterfacecommand{unknown}{unknown}
\setinterfacecommand{useJSscripts}{useJSscripts}
diff --git a/tex/context/base/mult-fr.tex b/tex/context/base/mult-fr.tex
index 1942984f1..ff8104e45 100644
--- a/tex/context/base/mult-fr.tex
+++ b/tex/context/base/mult-fr.tex
@@ -325,8 +325,12 @@
\setinterfacevariable{outer}{exterieur}
\setinterfacevariable{outeredge}{bordexterieur}
\setinterfacevariable{outermargin}{margeexterieure}
+\setinterfacevariable{overbar}{overbar}
+\setinterfacevariable{overbars}{overbars}
\setinterfacevariable{overlay}{revetement}
\setinterfacevariable{overprint}{overprint}
+\setinterfacevariable{overstrike}{surlignetout}
+\setinterfacevariable{overstrikes}{surligne}
\setinterfacevariable{packed}{groupe}
\setinterfacevariable{page}{page}
\setinterfacevariable{pagecomment}{commentairepage}
@@ -480,6 +484,8 @@
\setinterfacevariable{type}{type}
\setinterfacevariable{typing}{typing}
\setinterfacevariable{unavailable}{indisponible}
+\setinterfacevariable{underbar}{souslignetout}
+\setinterfacevariable{underbars}{sousligne}
\setinterfacevariable{unit}{unite}
\setinterfacevariable{units}{unites}
\setinterfacevariable{unknown}{inconnu}
@@ -787,6 +793,7 @@
\setinterfaceconstant{openaction}{actionouverture}
\setinterfaceconstant{openpageaction}{actionouverturepage}
\setinterfaceconstant{option}{option}
+\setinterfaceconstant{order}{order}
\setinterfaceconstant{orientation}{orientation}
\setinterfaceconstant{otherstext}{otherstext}
\setinterfaceconstant{outermargin}{margeexterieure}
@@ -917,6 +924,7 @@
\setinterfaceconstant{stop}{stoppe}
\setinterfaceconstant{stopper}{taquet}
\setinterfaceconstant{stretch}{etire}
+\setinterfaceconstant{strip}{strip}
\setinterfaceconstant{strut}{strut}
\setinterfaceconstant{style}{style}
\setinterfaceconstant{sub}{sous}
@@ -1302,10 +1310,6 @@
\setinterfacecommand{outeredgewidth}{outeredgewidth}
\setinterfacecommand{outermargindistance}{outermargindistance}
\setinterfacecommand{outermarginwidth}{outermarginwidth}
-\setinterfacecommand{overbar}{overbar}
-\setinterfacecommand{overbars}{overbars}
-\setinterfacecommand{overstrike}{surlignetout}
-\setinterfacecommand{overstrikes}{surligne}
\setinterfacecommand{packed}{groupe}
\setinterfacecommand{page}{page}
\setinterfacecommand{pagedepth}{pagedepth}
@@ -1640,8 +1644,6 @@
\setinterfacecommand{type}{dactylographier}
\setinterfacecommand{typebuffer}{tapebuffer}
\setinterfacecommand{typefile}{fichierdactylo}
-\setinterfacecommand{underbar}{souslignetout}
-\setinterfacecommand{underbars}{sousligne}
\setinterfacecommand{unitmeaning}{sensunite}
\setinterfacecommand{unknown}{inconnu}
\setinterfacecommand{useJSscripts}{utiliseJSscripts}
diff --git a/tex/context/base/mult-it.tex b/tex/context/base/mult-it.tex
index 339d51579..67ec0d1f8 100644
--- a/tex/context/base/mult-it.tex
+++ b/tex/context/base/mult-it.tex
@@ -325,8 +325,12 @@
\setinterfacevariable{outer}{esterno}
\setinterfacevariable{outeredge}{bordoesterno}
\setinterfacevariable{outermargin}{margineesterno}
+\setinterfacevariable{overbar}{sopralinea}
+\setinterfacevariable{overbars}{sopralinee}
\setinterfacevariable{overlay}{sovrapponi}
\setinterfacevariable{overprint}{overprint}
+\setinterfacevariable{overstrike}{sbarrato}
+\setinterfacevariable{overstrikes}{sbarrati}
\setinterfacevariable{packed}{impaccato}
\setinterfacevariable{page}{pagina}
\setinterfacevariable{pagecomment}{commentopagina}
@@ -480,6 +484,8 @@
\setinterfacevariable{type}{type}
\setinterfacevariable{typing}{typing}
\setinterfacevariable{unavailable}{nondisponibile}
+\setinterfacevariable{underbar}{sottolinea}
+\setinterfacevariable{underbars}{sottolinee}
\setinterfacevariable{unit}{unita}
\setinterfacevariable{units}{unita}
\setinterfacevariable{unknown}{ignoto}
@@ -787,6 +793,7 @@
\setinterfaceconstant{openaction}{azioneapri}
\setinterfaceconstant{openpageaction}{azioneapripagina}
\setinterfaceconstant{option}{opzione}
+\setinterfaceconstant{order}{order}
\setinterfaceconstant{orientation}{orientation}
\setinterfaceconstant{otherstext}{otherstext}
\setinterfaceconstant{outermargin}{margineesterno}
@@ -917,6 +924,7 @@
\setinterfaceconstant{stop}{termina}
\setinterfaceconstant{stopper}{stopper}
\setinterfaceconstant{stretch}{dilata}
+\setinterfaceconstant{strip}{strip}
\setinterfaceconstant{strut}{strut}
\setinterfaceconstant{style}{stile}
\setinterfaceconstant{sub}{sotto}
@@ -1302,10 +1310,6 @@
\setinterfacecommand{outeredgewidth}{outeredgewidth}
\setinterfacecommand{outermargindistance}{outermargindistance}
\setinterfacecommand{outermarginwidth}{outermarginwidth}
-\setinterfacecommand{overbar}{sopralinea}
-\setinterfacecommand{overbars}{sopralinee}
-\setinterfacecommand{overstrike}{sbarrato}
-\setinterfacecommand{overstrikes}{sbarrati}
\setinterfacecommand{packed}{impaccato}
\setinterfacecommand{page}{pagina}
\setinterfacecommand{pagedepth}{pagedepth}
@@ -1640,8 +1644,6 @@
\setinterfacecommand{type}{type}
\setinterfacecommand{typebuffer}{typebuffer}
\setinterfacecommand{typefile}{typefile}
-\setinterfacecommand{underbar}{sottolinea}
-\setinterfacecommand{underbars}{sottolinee}
\setinterfacecommand{unitmeaning}{nomeunita}
\setinterfacecommand{unknown}{ignoto}
\setinterfacecommand{useJSscripts}{usaJSscripts}
diff --git a/tex/context/base/mult-nl.tex b/tex/context/base/mult-nl.tex
index 75dff8bb1..50cbf9055 100644
--- a/tex/context/base/mult-nl.tex
+++ b/tex/context/base/mult-nl.tex
@@ -325,8 +325,12 @@
\setinterfacevariable{outer}{buiten}
\setinterfacevariable{outeredge}{buitenrand}
\setinterfacevariable{outermargin}{buitenmarge}
+\setinterfacevariable{overbar}{overstreep}
+\setinterfacevariable{overbars}{overstrepen}
\setinterfacevariable{overlay}{overlay}
\setinterfacevariable{overprint}{overprint}
+\setinterfacevariable{overstrike}{doorstreep}
+\setinterfacevariable{overstrikes}{doorstrepen}
\setinterfacevariable{packed}{opelkaar}
\setinterfacevariable{page}{pagina}
\setinterfacevariable{pagecomment}{paginacommentaar}
@@ -480,6 +484,8 @@
\setinterfacevariable{type}{type}
\setinterfacevariable{typing}{typen}
\setinterfacevariable{unavailable}{nietbeschikbaar}
+\setinterfacevariable{underbar}{onderstreep}
+\setinterfacevariable{underbars}{onderstrepen}
\setinterfacevariable{unit}{eenheid}
\setinterfacevariable{units}{eenheden}
\setinterfacevariable{unknown}{onbekend}
@@ -787,6 +793,7 @@
\setinterfaceconstant{openaction}{openactie}
\setinterfaceconstant{openpageaction}{openpaginaactie}
\setinterfaceconstant{option}{optie}
+\setinterfaceconstant{order}{order}
\setinterfaceconstant{orientation}{orientatie}
\setinterfaceconstant{otherstext}{otherstext}
\setinterfaceconstant{outermargin}{buitenmarge}
@@ -917,6 +924,7 @@
\setinterfaceconstant{stop}{stop}
\setinterfaceconstant{stopper}{afsluiter}
\setinterfaceconstant{stretch}{rek}
+\setinterfaceconstant{strip}{strip}
\setinterfaceconstant{strut}{strut}
\setinterfaceconstant{style}{letter}
\setinterfaceconstant{sub}{sub}
@@ -1302,10 +1310,6 @@
\setinterfacecommand{outeredgewidth}{buitenrandbreedte}
\setinterfacecommand{outermargindistance}{buitenmargeafstand}
\setinterfacecommand{outermarginwidth}{buitenmargebreedte}
-\setinterfacecommand{overbar}{overstreep}
-\setinterfacecommand{overbars}{overstrepen}
-\setinterfacecommand{overstrike}{doorstreep}
-\setinterfacecommand{overstrikes}{doorstrepen}
\setinterfacecommand{packed}{opelkaar}
\setinterfacecommand{page}{pagina}
\setinterfacecommand{pagedepth}{paginadiepte}
@@ -1640,8 +1644,6 @@
\setinterfacecommand{type}{type}
\setinterfacecommand{typebuffer}{typebuffer}
\setinterfacecommand{typefile}{typefile}
-\setinterfacecommand{underbar}{onderstreep}
-\setinterfacecommand{underbars}{onderstrepen}
\setinterfacecommand{unitmeaning}{betekenis}
\setinterfacecommand{unknown}{onbekend}
\setinterfacecommand{useJSscripts}{gebruikJSscripts}
diff --git a/tex/context/base/mult-ro.tex b/tex/context/base/mult-ro.tex
index babe464f3..0ab78bc6c 100644
--- a/tex/context/base/mult-ro.tex
+++ b/tex/context/base/mult-ro.tex
@@ -325,8 +325,12 @@
\setinterfacevariable{outer}{extern}
\setinterfacevariable{outeredge}{outeredge}
\setinterfacevariable{outermargin}{outermargin}
+\setinterfacevariable{overbar}{barasus}
+\setinterfacevariable{overbars}{supralinie}
\setinterfacevariable{overlay}{overlay}
\setinterfacevariable{overprint}{overprint}
+\setinterfacevariable{overstrike}{liniepeste}
+\setinterfacevariable{overstrikes}{liniipeste}
\setinterfacevariable{packed}{impachetat}
\setinterfacevariable{page}{pagina}
\setinterfacevariable{pagecomment}{comentariupagina}
@@ -480,6 +484,8 @@
\setinterfacevariable{type}{type}
\setinterfacevariable{typing}{typing}
\setinterfacevariable{unavailable}{nedisponibil}
+\setinterfacevariable{underbar}{sublinie}
+\setinterfacevariable{underbars}{sublinii}
\setinterfacevariable{unit}{unitate}
\setinterfacevariable{units}{unitati}
\setinterfacevariable{unknown}{necunoscut}
@@ -787,6 +793,7 @@
\setinterfaceconstant{openaction}{actiunedeschidere}
\setinterfaceconstant{openpageaction}{actiunedeschiderepagina}
\setinterfaceconstant{option}{optiune}
+\setinterfaceconstant{order}{order}
\setinterfaceconstant{orientation}{orientation}
\setinterfaceconstant{otherstext}{otherstext}
\setinterfaceconstant{outermargin}{outermargin}
@@ -917,6 +924,7 @@
\setinterfaceconstant{stop}{stop}
\setinterfaceconstant{stopper}{stopper}
\setinterfaceconstant{stretch}{dilatat}
+\setinterfaceconstant{strip}{strip}
\setinterfaceconstant{strut}{strut}
\setinterfaceconstant{style}{stil}
\setinterfaceconstant{sub}{sub}
@@ -1302,10 +1310,6 @@
\setinterfacecommand{outeredgewidth}{outeredgewidth}
\setinterfacecommand{outermargindistance}{outermargindistance}
\setinterfacecommand{outermarginwidth}{outermarginwidth}
-\setinterfacecommand{overbar}{barasus}
-\setinterfacecommand{overbars}{supralinie}
-\setinterfacecommand{overstrike}{liniepeste}
-\setinterfacecommand{overstrikes}{liniipeste}
\setinterfacecommand{packed}{impachetat}
\setinterfacecommand{page}{pagina}
\setinterfacecommand{pagedepth}{pagedepth}
@@ -1640,8 +1644,6 @@
\setinterfacecommand{type}{type}
\setinterfacecommand{typebuffer}{scriebuffer}
\setinterfacecommand{typefile}{typefile}
-\setinterfacecommand{underbar}{sublinie}
-\setinterfacecommand{underbars}{sublinii}
\setinterfacecommand{unitmeaning}{numeunitate}
\setinterfacecommand{unknown}{necunoscut}
\setinterfacecommand{useJSscripts}{folosestescriptJS}
diff --git a/tex/context/base/node-bck.lua b/tex/context/base/node-bck.lua
index 477ca3f21..94fbac85f 100644
--- a/tex/context/base/node-bck.lua
+++ b/tex/context/base/node-bck.lua
@@ -67,7 +67,6 @@ local function add_backgrounds(head) -- boxes, inline will be done too
if mode then
local glue = new_glue(-current.width)
local rule = new_rule(current.width,current.height,current.depth)
---~ local rule = new_rule(current.width,-current.depth/2,current.depth) -- test
local color = has_attribute(found,a_color)
local transparency = has_attribute(found,a_transparency)
set_attribute(rule,a_colorspace, mode)
diff --git a/tex/context/base/node-rul.lua b/tex/context/base/node-rul.lua
new file mode 100644
index 000000000..ea964327a
--- /dev/null
+++ b/tex/context/base/node-rul.lua
@@ -0,0 +1,157 @@
+if not modules then modules = { } end modules ['node-rul'] = {
+ version = 1.001,
+ comment = "companion to node-rul.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- todo: order and maybe other dimensions
+
+local floor = math.floor
+
+local a_ruled = attributes.private('ruled')
+local a_color = attributes.private('color')
+local a_transparency = attributes.private('transparency')
+local a_colorspace = attributes.private('colormodel')
+
+local glyph = node.id("glyph")
+local disc = node.id("disc")
+local glue = node.id("glue")
+local kern = node.id("kern")
+local hlist = node.id("hlist")
+local vlist = node.id("vlist")
+
+local new_rule = nodes.rule
+local new_kern = nodes.kern
+local new_glue = nodes.glue
+
+local insert_before, insert_after = node.insert_before, node.insert_after
+local list_dimensions, has_attribute, set_attribute = node.dimensions, node.has_attribute, node.set_attribute
+local dimenfactor = fonts.dimenfactor
+local texwrite = tex.write
+
+local fontdata = fonts.ids
+local variables = interfaces.variables
+
+nodes.rules = nodes.rules or { }
+nodes.rules.data = nodes.rules.data or { }
+
+storage.register("nodes/rules/data", nodes.rules.data, "nodes.rules.data")
+
+local data = nodes.rules.data
+
+-- method, offset, continue, dy, rulethickness, unit, order, max, colorspace, color, transparency
+
+function nodes.rules.define(...)
+ data[#data+1] = { ... }
+ texwrite(#data)
+end
+
+local function flush(head,f,l,d,level,parent) -- not that fast but acceptable for this purpose
+ local r, m
+ local w = list_dimensions(parent.glue_set,parent.glue_sign,parent.glue_order,f,l.next)
+ local method, offset, continue, dy, rulethickness, unit, order, max = d[1], d[2], d[3], d[4], d[5]/2, d[6], d[7], d[8]
+ local cs, co, tr = d[9], d[10], d[11]
+ local e = dimenfactor(unit,fontdata[f.font])
+ local colorspace = (cs > 0 and cs) or has_attribute(f,a_colorspace) or 1
+ local color = (co > 0 and co) or has_attribute(f,a_color)
+ local transparency = (tr > 0 and tr) or has_attribute(f,a_transparency)
+ local foreground = order == variables.foreground
+ if method == 0 then -- center
+ offset = 2*offset
+ m = (offset+(level-1)*dy+rulethickness)*e/2
+ else
+ m = 0
+ end
+ if level > max then
+ level = max
+ end
+ for i=1,level do
+ local ht = (offset+(i-1)*dy+rulethickness)*e - m
+ local dp = -(offset+(i-1)*dy-rulethickness)*e + m
+ local r = new_rule(w,ht,dp)
+ if color then
+ set_attribute(r,a_colorspace,colorspace)
+ set_attribute(r,a_color,color)
+ end
+ if transparency then
+ set_attribute(r,a_transparency,transparency)
+ end
+ local k = new_kern(-w)
+ if foreground then
+ insert_after(head,l,k)
+ insert_after(head,k,r)
+ l = r
+ else
+ head, _ = insert_before(head,f,r)
+ insert_after(head,r,k)
+ end
+ -- print(level,w,nodes.ids_to_string(f,l),nodes.tosequence(f,l,true))
+ end
+ return head
+end
+
+-- todo: functions: word, sentence
+
+local function process(head,parent)
+ local n = head
+ local f, l, a, d, i, level
+ local continue = false
+ while n do
+ local id = n.id
+ if id == glyph then
+ local aa = has_attribute(n,a_ruled)
+ if aa then
+ if aa == a then
+ if not f then
+ f = n
+ end
+ l = n
+ else
+ -- possible extensions: when in same class then keep spanning
+ if f then
+ head = flush(head,f,l,d,level,parent)
+ end
+ f, l, a = n, n, aa
+ level, i = floor(a/1000), a%1000
+ d = data[i]
+ continue = d[3] == variables.yes
+ end
+ else
+ if f then
+ head = flush(head,f,l,d,level,parent)
+ end
+ f, l, a = nil, nil, nil
+ end
+ elseif f and id == disc then
+ l = n
+ elseif f and id == kern and n.subtype == 0 then
+ l = n
+ elseif id == hlist or id == vlist then
+ if f then
+ head = flush(head,f,l,d,level,parent)
+ f, l, a = nil, nil, nil
+ end
+ n.list = process(n.list,n)
+ elseif f and not continue then
+ head = flush(head,f,l,d,level,parent)
+ f, l, a = nil, nil, nil
+ end
+ n = n.next
+ end
+ if f then
+ head = flush(head,f,l,d,level,parent)
+ end
+ return head, true -- todo: done
+end
+
+nodes.rules.process = function(head) return process(head) end
+
+function nodes.rules.enable()
+ tasks.enableaction("shipouts","nodes.rules.process")
+end
+
+--~ tasks.appendaction ("shipouts", "normalizers", "nodes.rules.process")
+--~ tasks.disableaction("shipouts", "nodes.rules.process") -- only kick in when used
+
diff --git a/tex/context/base/node-rul.mkiv b/tex/context/base/node-rul.mkiv
new file mode 100644
index 000000000..246e8d222
--- /dev/null
+++ b/tex/context/base/node-rul.mkiv
@@ -0,0 +1,202 @@
+%D \module
+%D [ file=node-bar,
+%D version=2009.11.03, % 1995.10.10,
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=Bars,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Core Macros / Bars}
+
+%D The name of this file might change.
+
+%D \macros
+%D {underbar,underbars,
+%D overbar,overbars,
+%D overstrike,overstrikes,
+%D setupbar}
+%D
+%D In the rare case that we need undelined words, for instance
+%D because all font alternatives are already in use, one can
+%D use \type{\underbar} and \type{\overstrike} and their plural
+%D forms.
+%D
+%D \startbuffer
+%D \underbars{drawing \underbar{bars} under words is a typewriter leftover}
+%D \overstrikes{striking words makes them \overstrike{unreadable} but
+%D sometimes even \overbar{top lines} come into view.}
+%D \stopbuffer
+%D
+%D \typebuffer
+%D
+%D \startvoorbeeld
+%D \startlines
+%D \getbuffer
+%D \stoplines
+%D \stopvoorbeeld
+%D
+%D The next macros are derived from the \PLAIN\ \TEX\ one, but
+%D also supports nesting. The \type{$} keeps us in horizontal
+%D mode and at the same time applies grouping.
+%D
+%D \showsetup{underbar}
+%D \showsetup{underbars}
+%D \showsetup{overbar}
+%D \showsetup{overbars}
+%D \showsetup{overstrike}
+%D \showsetup{overstrikes}
+%D
+%D \showsetup{setupunderbar}
+
+\unprotect
+
+\definesystemattribute[ruled]
+
+\registerctxluafile{node-rul}{1.001}
+
+\newtoks\checkalldefinedbars
+
+\def\barparameter #1{\csname\dobarparameter\currentbar#1\endcsname}
+\def\dobarparameter #1#2{\ifcsname\??on#1#2\endcsname\??on#1#2\else\expandafter\dobarparentparameter\csname\??on#1\s!parent\endcsname#2\fi}
+\def\dobarparentparameter#1#2{\ifx#1\relax\s!empty\else\dobarparameter#1#2\fi}
+
+\def\definebar
+ {\dotripleempty\dodefinebar}
+
+\def\dodefinebar[#1][#2][#3]%
+ {\ifthirdargument
+ \getparameters[\??on#1][\s!parent=#2,#3]%
+ \else
+ \getparameters[\??on#1][\s!parent=,#2]%
+ \fi
+ %
+ %\setvalue{\??on:#1}{0}%
+ %
+ \ifcsname\??on:#1:c\endcsname
+ \csname\??on:#1:c\endcsname\zerocount
+ \else
+ \expandafter\newcount\csname\??on:#1:c\endcsname
+ \fi
+ \normalexpanded{\checkalldefinedbars{\noexpand\doredefinebar{#1}\the\checkalldefinedbars}}%
+ \dodefinebarindeed{#1}%
+ \unexpanded\setvalue{#1}{\doruled{#1}}}
+
+\def\dodefinebarindeed#1%
+ {\bgroup
+ \def\currentbar{#1}%
+ \doifsomethingelse{\barparameter\c!color}
+ {\donetrue\colored[\barparameter\c!color]}
+ {\donefalse}%
+ \normalexpanded
+ {\egroup
+ \scratchcounter\ctxlua{nodes.rules.define(
+ \barparameter\c!method,
+ \barparameter\c!offset,
+ "\barparameter\c!continue",
+ \barparameter\c!dy,
+ \barparameter\c!rulethickness,
+ "\barparameter\c!unit",
+ "\barparameter\c!order",
+ \barparameter\c!max,
+ \ifdone\the\attribute\colormodelattribute\else0\fi,
+ \ifdone\the\attribute\colorattribute\else0\fi,
+ \ifdone\the\attribute\transparencyattribute\else0\fi)}}%
+ \setevalue{\??on#1:a}{\the\scratchcounter}}
+
+\let\doredefinebar\dodefinebarindeed
+
+\def\doruled
+ {\ctxlua{nodes.rules.enable()}%
+ \glet\doruled\doruledindeed
+ \doruledindeed}
+
+\def\doruledindeed#1%
+ {\groupedcommand{\dodoruled{#1}}\relax}
+
+\def\dodoruled#1%
+ {\advance\csname\??on:#1:c\endcsname\plusone
+ \scratchcounter\csname\??on:#1:c\endcsname
+ \dosetattribute{ruled}{\numexpr1000*\scratchcounter
+ +\csname\??on#1\ifcsname\??on#1:\number\scratchcounter\s!parent\endcsname:\number\scratchcounter\fi:a\endcsname}}
+
+% ungrouped
+
+\unexpanded\def\startbar[#1]%
+ {\begingroup
+ \dodoruled{#1}}
+
+\unexpanded\def\stopbar
+ {\endgroup}
+
+\newcount\currentbarnesting
+
+\unexpanded\def\pushbar[#1]%
+ {\global\advance\currentbarnesting\plusone
+ \setevalue{\??on:s:\number\currentbarnesting}{\dogetattribute{ruled}}% stack
+ \dodoruled{#1}}
+
+\unexpanded\def\popbar
+ {\dosetattribute{ruled}{\getvalue{\??on:s:\number\currentbarnesting}}%
+ \global\advance\currentbarnesting\minusone}
+
+\def\setupbars
+ {\dodoubleempty\dosetupbars}
+
+\def\dosetupbars[#1][#2]% not that efficient
+ {\ifsecondargument
+ \getparameters[\??on#1][#2]%
+ \dodefinebarindeed{#1}%
+ \else
+ \getparameters[\??on][#1]%
+ \the\checkalldefinedbars
+ \fi}
+
+\setupbars
+ [\c!method=0, % new: 0=center nested, 1=stack nested
+ \c!continue=\v!no,
+ \c!offset=0, % upwards, replaces: topoffset bottomoffset
+ \c!dy=0,
+ \c!max=3,
+ \c!rulethickness=.1,
+ \c!order=\v!foreground,
+ \c!unit=ex, % so now we are relative
+ \c!color=] % replaces: rulecolor
+
+% \definebar[touchbar] [\c!method=0,\c!dy=-0.4,\c!offset=-0.0]
+% \definebar[touchbars] [touchbar] [\c!continue=\v!yes]
+
+\definebar[\v!overstrike] [\c!method=0,\c!dy= 0.4,\c!offset= 0.5]
+\definebar[\v!underbar] [\c!method=1,\c!dy=-0.4,\c!offset=-0.3]
+\definebar[\v!overbar] [\c!method=1,\c!dy= 0.4,\c!offset= 1.8]
+
+\definebar[\v!overstrikes] [\v!overstrike] [\c!continue=\v!yes]
+\definebar[\v!underbars] [\v!underbar] [\c!continue=\v!yes]
+\definebar[\v!overbars] [\v!overbar] [\c!continue=\v!yes]
+
+% we want these always so ...
+
+\expandafter\let\expandafter\overstrike \csname\v!overstrike \endcsname
+\expandafter\let\expandafter\underbar \csname\v!underbar \endcsname
+\expandafter\let\expandafter\overbar \csname\v!overbar \endcsname
+\expandafter\let\expandafter\overstrikes\csname\v!overstrikes\endcsname
+\expandafter\let\expandafter\underbars \csname\v!underbars \endcsname
+\expandafter\let\expandafter\overbars \csname\v!overbars \endcsname
+
+\def\setupunderbar[#1]% too incompatible for the moment
+ {}
+
+\protect \endinput
+
+% obsolete:
+
+\setupunderbar
+ [\c!alternative=a,
+ \c!rulethickness=\linewidth,
+ \c!bottomoffset=1.5pt,
+ \c!topoffset=2.5pt,
+ \c!rulecolor=]
diff --git a/tex/context/base/node-seq.lua b/tex/context/base/node-seq.lua
index 6b705eeda..d3a999030 100644
--- a/tex/context/base/node-seq.lua
+++ b/tex/context/base/node-seq.lua
@@ -13,6 +13,8 @@ assume that namespaces for the functions are used, but for speed we
use locals to refer to them when compiling the chain.
--ldx]]--
+-- todo: delayed: i.e. we register them in the right order already but delay usage
+
local format, gsub, concat, gmatch = string.format, string.gsub, table.concat, string.gmatch
sequencer = sequencer or { }
@@ -30,9 +32,11 @@ end
function sequencer.reset()
return {
- list = { },
+ list = { },
order = { },
- kind = { },
+ kind = { },
+ askip = { },
+ gskip = { },
}
end
@@ -68,6 +72,11 @@ function sequencer.appendaction(t,group,action,where,kind,force)
end
end
+function sequencer.enableaction (t,action) t.askip[action] = false end
+function sequencer.disableaction(t,action) t.askip[action] = true end
+function sequencer.enablegroup (t,group) t.gskip[group] = false end
+function sequencer.disablegroup (t,group) t.gskip[group] = true end
+
function sequencer.setkind(t,action,kind)
t.kind[action] = kind
end
@@ -101,15 +110,20 @@ return function(...)
end]]
function sequencer.tostring(t,n) -- n not done
- local list, order, kind, vars, calls = t.list, t.order, t.kind, { }, { }
+ local list, order, kind, gskip, askip = t.list, t.order, t.kind, t.gskip, t.askip
+ local vars, calls, args = { }, { }, nil
for i=1,#order do
local group = order[i]
- local actions = list[group]
- for i=1,#actions do
- local action = actions[i]
- local localized = localize(action)
- vars [#vars +1] = format("local %s = %s", localized, action)
- calls[#calls+1] = format(" %s(...) -- %s %i", localized, group, i)
+ if not gskip[group] then
+ local actions = list[group]
+ for i=1,#actions do
+ local action = actions[i]
+ if not askip[action] then
+ local localized = localize(action)
+ vars [#vars +1] = format("local %s = %s", localized, action)
+ calls[#calls+1] = format(" %s(...) -- %s %i", localized, group, i)
+ end
+ end
end
end
return format(template,concat(vars,"\n"),concat(calls,"\n"))
@@ -130,7 +144,8 @@ return function(head%s)
end]]
function sequencer.nodeprocessor(t,n)
- local list, order, kind, vars, calls, args = t.list, t.order, t.kind, { }, { }, nil
+ local list, order, kind, gskip, askip = t.list, t.order, t.kind, t.gskip, t.askip
+ local vars, calls, args = { }, { }, nil
if n == 0 then
args = ""
elseif n == 1 then
@@ -142,20 +157,24 @@ function sequencer.nodeprocessor(t,n)
end
for i=1,#order do
local group = order[i]
- local actions = list[group]
- for i=1,#actions do
- local action = actions[i]
- local localized = localize(action)
- vars[#vars+1] = format("local %s = %s",localized,action)
- if kind[action] == "nohead" then
- calls[#calls+1] = format(" ok = %s(head%s) done = done or ok -- %s %i",localized,args,group,i)
- else
- calls[#calls+1] = format(" head, ok = %s(head%s) done = done or ok -- %s %i",localized,args,group,i)
+ if not gskip[group] then
+ local actions = list[group]
+ for i=1,#actions do
+ local action = actions[i]
+ if not askip[action] then
+ local localized = localize(action)
+ vars[#vars+1] = format("local %s = %s",localized,action)
+ if kind[action] == "nohead" then
+ calls[#calls+1] = format(" ok = %s(head%s) done = done or ok -- %s %i",localized,args,group,i)
+ else
+ calls[#calls+1] = format(" head, ok = %s(head%s) done = done or ok -- %s %i",localized,args,group,i)
+ end
+ end
end
end
end
local processor = format(template,concat(vars,"\n"),args,concat(calls,"\n"))
- -- print(processor)
+--~ print(processor)
return processor
end
diff --git a/tex/context/base/node-tra.lua b/tex/context/base/node-tra.lua
index 1e0feb5a1..2b758fa24 100644
--- a/tex/context/base/node-tra.lua
+++ b/tex/context/base/node-tra.lua
@@ -390,7 +390,7 @@ end
function nodes.ids_to_string(head,tail)
local t, last_id, last_n = { }, nil, 0
- for n in traverse_nodes(head,tail) do
+ for n in traverse_nodes(head,tail) do -- hm, does not stop at tail
local id = n.id
if not last_id then
last_id, last_n = id, 1
@@ -404,6 +404,9 @@ function nodes.ids_to_string(head,tail)
end
last_id, last_n = id, 1
end
+ if n == tail then
+ break
+ end
end
if not last_id then
t[#t+1] = "no nodes"
diff --git a/tex/context/base/node-tsk.lua b/tex/context/base/node-tsk.lua
index 63b07ecc5..4921fe4f6 100644
--- a/tex/context/base/node-tsk.lua
+++ b/tex/context/base/node-tsk.lua
@@ -8,8 +8,8 @@ if not modules then modules = { } end modules ['node-tsk'] = {
local trace_tasks = false trackers.register("tasks", function(v) trace_tasks = v end)
-tasks = tasks or { }
-tasks.data = tasks.data or { }
+tasks = tasks or { }
+tasks.data = tasks.data or { }
function tasks.new(name,list)
local tasklist = sequencer.reset()
@@ -19,13 +19,42 @@ function tasks.new(name,list)
end
end
-function tasks.restart(name,group)
+function tasks.restart(name)
local data = tasks.data[name]
if data then
data.runner = false
end
end
+function tasks.enableaction(name,action)
+ local data = tasks.data[name]
+ if data then
+ sequencer.enableaction(data.list,action)
+ data.runner = false
+ end
+end
+function tasks.disableaction(name,action)
+ local data = tasks.data[name]
+ if data then
+ sequencer.disableaction(data.list,action)
+ data.runner = false
+ end
+end
+function tasks.enablegroup(name,group)
+ local data = tasks.data[name]
+ if data then
+ sequencer.enablegroup(data.list,group)
+ data.runner = false
+ end
+end
+function tasks.disablegroup(name,group)
+ local data = tasks.data[name]
+ if data then
+ sequencer.disablegroup(data.list,group)
+ data.runner = false
+ end
+end
+
function tasks.appendaction(name,group,action,where,kind)
local data = tasks.data[name]
if data then
diff --git a/tex/context/base/page-lin.lua b/tex/context/base/page-lin.lua
index c8f5161d8..c5f901e05 100644
--- a/tex/context/base/page-lin.lua
+++ b/tex/context/base/page-lin.lua
@@ -9,7 +9,7 @@ if not modules then modules = { } end modules ['page-lin'] = {
-- experimental
local format = string.format
-local texsprint, texbox = tex.sprint, tex.box
+local texsprint, texwrite, texbox = tex.sprint, tex.write, tex.box
local ctxcatcodes = tex.ctxcatcodes
@@ -69,7 +69,10 @@ function nodes.lines.finalize(t)
for _,r in next, p do
if r.metadata.kind == "line" then
local e = r.entries
- e.linenumber = getnumber(e.text or 0)
+ local u = r.userdata
+ e.linenumber = getnumber(e.text or 0) -- we can nil e.text
+ e.conversion = u and u.conversion
+ r.userdata = nil -- hack
end
end
end
@@ -83,13 +86,19 @@ jobreferences.registerfinalizer(nodes.lines.finalize)
filters.line = filters.line or { }
function filters.line.default(data)
- helpers.title(data.entries.linenumber or "?",data.metadata)
+-- helpers.title(data.entries.linenumber or "?",data.metadata)
+ texsprint(ctxcatcodes,format("\\convertnumber{%s}{%s}",data.entries.conversion or "numbers",data.entries.linenumber or "0"))
end
function filters.line.page(data,prefixspec,pagespec) -- redundant
helpers.prefixpage(data,prefixspec,pagespec)
end
+function filters.line.linenumber(data) -- raw
+ texwrite(data.entries.linenumber or "0")
+end
+
+
-- boxed variant
nodes.lines.boxed = { }
diff --git a/tex/context/base/page-lin.mkiv b/tex/context/base/page-lin.mkiv
index 4b2731a7e..0a5c44554 100644
--- a/tex/context/base/page-lin.mkiv
+++ b/tex/context/base/page-lin.mkiv
@@ -97,7 +97,7 @@
{\doresetattribute{line-number}}
% we could make this a bit more efficient by putting the end reference
-% in the same table as the start one but why make thinsg complex ...
+% in the same table as the start one but why make things complex ...
\let\dofinishlinereference\dofinishfullreference
@@ -106,7 +106,8 @@
\global\advance\linerefcounter\plusone
\dosetattribute{line-reference}\linerefcounter
#3%
- \expanded{\dodosetreference{line}{#2}{}{\the\linerefcounter}}% kind labels userdata text
+ % for the moment we use a simple system i.e. no prefixes etc .. todo: store as number
+ \expanded{\dodosetreference{line}{#2}{conversion=\linenumberparameter\c!conversion}{\the\linerefcounter}}% kind labels userdata text
\endgroup}
\def\mkstartlinereference#1{\mksomelinereference{#1}{lr:b:#1}{}\ignorespaces}
@@ -320,6 +321,7 @@
\def\mkdoleftlinenumber #1#2#3#4#5%
{\hbox{\llap{\dosomelinenumber{#1}{2}{#2}{#5}\hskip#3\scaledpoint}}}
+
\def\mkdorightlinenumber#1#2#3#4#5%
{\hbox{\rlap{\hskip#4\scaledpoint\hskip#3\scaledpoint\dosomelinenumber{#1}{1}{#2}{#5}}}}
@@ -408,11 +410,14 @@
% eventually we will do this in lua
+\def\currentreferencelinenumber{\ctxlua{jobreferences.filter("linenumber")}}
+
\def\doifelsesamelinereference#1#2#3%
{\doifreferencefoundelse{lr:b:#1}
- {\edef\fline{\currentreferencetext}%
+ {\edef\fline{\currentreferencelinenumber}%
\doifreferencefoundelse{lr:e:#1}
- {\edef\tline{\currentreferencetext}%
+ {\edef\tline{\currentreferencelinenumber}%
+ %[\fline,\tline]
\ifx\fline\tline#2\else#3\fi}
{\unknownreference{#1}#2}}
{\unknownreference{#1}#2}}
@@ -426,6 +431,11 @@
{\in{#1}[lr:b:#2]}
{\in{#1}[lr:b:#2]--\in[lr:e:#2]}}}
+\def\inlinerange[#1]%
+ {\doifelsesamelinereference{#1}
+ {\in[lr:b:#1]}
+ {\in[lr:b:#1]--\in[lr:e:#1]}}
+
\protect \endinput
\iffalse % \iftrue eventually we will do it like ...
diff --git a/tex/context/base/spac-gen.mkii b/tex/context/base/spac-gen.mkii
index 5fab917f9..8274db1b9 100644
--- a/tex/context/base/spac-gen.mkii
+++ b/tex/context/base/spac-gen.mkii
@@ -1337,21 +1337,11 @@
\definecomplexorsimple\setupspacing
-% \dorecurse{100}{\recurselevel\spacefactor 800 \space} \par
-% \dorecurse{100}{\recurselevel\spacefactor1200 \space} \par
-% \dorecurse{100}{\recurselevel\spacefactor 800 \normalspaceprimitive} \par
-% \dorecurse{100}{\recurselevel\spacefactor1200 \normalspaceprimitive} \par
+\let\normalspaceprimitive=\ % space-comment is really needed else \
-% When we don't add the % here, we effectively get \ and
-% since we have by default \def\^^M{\ } we get into a loop.
+\unexpanded\def\nonbreakablespace{\penalty\plustenthousand\normalspaceprimitive}
-\let\normalspaceprimitive=\ % space-comment is really needed
-
-\unexpanded\def\ {\mathortext\normalspaceprimitive\space} % no \dontleavehmode\space (else no frenchspacing)
-
-\unexpanded\def\nonbreakablespace{\penalty\plustenthousand\space}
-
-\letcatcodecommand \ctxcatcodes `\~ \nonbreakablespace % overloaded later
+\letcatcodecommand \ctxcatcodes `\~ \nonbreakablespace
\def\space { }
\def\removelastspace{\ifhmode\unskip\fi}
@@ -1376,7 +1366,10 @@
\unskip\unskip\unskip\unskip\unskip
\fi}
-\appendtoks\let~\space\to\simplifiedcommands
+\appendtoks
+ \let~\space
+ \let\ \space
+\to\simplifiedcommands
% still not fixed in aleph / luatex
%
@@ -4514,10 +4507,10 @@
\def\obeyedspace{\mathortext\normalspace{\dontleavehmode \normalspace }}%
\let\ =\obeyedspace}
-\installspacehandler \v!off
+\installspacehandler \v!off % == default
{\normalspaces
\let\obeyedspace\normalspace
- \let\ =\normalspace}
+ \let\ =\normalspaceprimitive} % was \normalspace
\installspacehandler \v!fixed
{\obeyspaces
diff --git a/tex/context/base/spac-hor.mkiv b/tex/context/base/spac-hor.mkiv
index 719167734..ee88f9656 100644
--- a/tex/context/base/spac-hor.mkiv
+++ b/tex/context/base/spac-hor.mkiv
@@ -311,14 +311,31 @@
% hm ...
-\unexpanded\def\ {\mathortext\normalspaceprimitive\space} % no \dontleavehmode\space (else no frenchspacing)
+% \unexpanded\def\normalnotobeyedspace{\mathortext\normalspaceprimitive\space} % no \dontleavehmode\space (else no frenchspacing)
+% \let\ =\normalnotobeyedspace
% Because I strip spaces at the end of lines (in the editor) we need a bit of
-% a trick to define slash+newline, so \ and \ are the same
+% a trick to define slash+newline, so \space and \ are the same
-\ctxlua{tex.sprint(tex.ctxcatcodes,"\string\\unexpanded\string\\def\string\\\string\n{\string\\ }")}
+% We need to be careful with \ and \space and the definition of ~ which uses \ as
+% we need to associate unicode spacing with it. There is some messy thing that that
+% I forgot to note down so I will revision the \ once I ran into it again.
-\unexpanded\def\nonbreakablespace{\penalty\plustenthousand\mathortext\ \space} % no space in math
+% \ruledhbox spread 10pt {\frenchspacing xx xx\ X}
+% \ruledhbox spread 10pt {\nonfrenchspacing xx xx\ X}
+% \ruledhbox spread 10pt {\frenchspacing xx xx X}
+% \ruledhbox spread 10pt {\nonfrenchspacing xx xx X}
+% \ruledhbox spread 10pt {\frenchspacing xx xx~X}
+% \ruledhbox spread 10pt {\nonfrenchspacing xx xx~X}
+
+% \ruledhbox spread 10pt {\frenchspacing xx dr.\ X}
+% \ruledhbox spread 10pt {\nonfrenchspacing xx dr.\ X}
+% \ruledhbox spread 10pt {\frenchspacing xx dr. X}
+% \ruledhbox spread 10pt {\nonfrenchspacing xx dr. X}
+% \ruledhbox spread 10pt {\frenchspacing xx dr.~X}
+% \ruledhbox spread 10pt {\nonfrenchspacing xx dr.~X}
+
+\unexpanded\def\nonbreakablespace{\penalty\plustenthousand\normalspaceprimitive} % no space in math
\letcatcodecommand \ctxcatcodes `\~ \nonbreakablespace % overloaded later
@@ -326,6 +343,9 @@
\def\removelastspace{\ifhmode\unskip\fi}
\def\nospace {\removelastspace\ignorespaces}
+\ctxlua{tex.sprint(tex.ctxcatcodes,"\string\\unexpanded\string\\def\string\\\string\n{\string\\space}")}
+% \ctxlua{tex.sprint(tex.ctxcatcodes,"\string\\let\string\\\string\n=\string\\space")}
+
% in tables we need:
%
% \def\fixedspace {\hskip.5em\relax}
@@ -339,13 +359,10 @@
\def\fixedspaces
{\letcatcodecommand \ctxcatcodes `\~ \fixedspace}
-\appendtoks\let~\space\to\simplifiedcommands
-
-% \def\removeunwantedspaces
-% {\ifhmode % we also need to unskip 0pt skips
-% \unskip\unskip\unskip\unskip\unskip
-% \unskip\unskip\unskip\unskip\unskip
-% \fi}
+\appendtoks
+ \let~\space
+ \let\ \space
+\to\simplifiedcommands
\unexpanded\def\removeunwantedspaces
{\ifhmode
@@ -782,37 +799,11 @@
\def\fixedspaceamount#1%
{#1\interwordspace}
-%D This is a dangerous feature because it makes the \TEX\ source
-%D less portable, i.e. any parser now needs to apply exactly the
-%D same algorithm when it wants to interpret the source. We
-%D strongly recommend not to mention this feature in manuals! It's
-%D provided for users who are hooked to such a mechanism.
-%D
-%D \starttyping
-%D \setupsorting[logo][next=\autoinsertnextspace] \logo[TEX]{\TeX}
-%D
-%D bla bla \TEX bla bla \TEX (bla) bla (\TEX)
-%D \stoptyping
-
-%D This will become a proper mkiv method: (user node with attribute)
-
-\def\autoinsertnextspace{\futurelet\nexttoken\doautoinsertnextspace}
-
-\def\doautoinsertnextspace % slightly extended version of a user supplied macro
- {\ifx\nexttoken \bgroup\else \ifx\nexttoken\begingroup\else
- \ifx\nexttoken \egroup\else \ifx\nexttoken \endgroup\else
- \ifx\nexttoken \/\else \ifx\nexttoken /\else \ifx\nexttoken ~\else
- \ifx\nexttoken \ \else \ifx\nexttoken \blankspace\else \ifx\nexttoken \space\else
- \ifx\nexttoken .\else \ifx\nexttoken ,\else
- \ifx\nexttoken !\else \ifx\nexttoken ?\else
- \ifx\nexttoken :\else \ifx\nexttoken ;\else
- \ifx\nexttoken '\else \ifx\nexttoken "\else
- \ifx\nexttoken )\else \ifx\nexttoken -\else \ifx\nexttoken |\else
- \ifx\nexttoken \%\else \ifx\nexttoken \&\else
- \space
- \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
-
% moved from page-lin
+%
+% the following code is used in startlines\stoplines
+%
+% do we need \normalspaceprimitive here?
\def\installspacehandler#1#2% needs to set \obeyedspace
{\setvalue{\??sr#1}{#2}}
@@ -824,13 +815,13 @@
\installspacehandler \v!yes
{\obeyspaces
- \def\obeyedspace{\mathortext\normalspace{\dontleavehmode \normalspace }}%
+ \def\obeyedspace{\mathortext\normalspace{\dontleavehmode\normalspace}}%
\let\ =\obeyedspace}
-\installspacehandler \v!off
+\installspacehandler \v!off % == default
{\normalspaces
\let\obeyedspace\normalspace
- \let\ =\normalspace}
+ \let\ =\normalspaceprimitive} % was \normalspace
\installspacehandler \v!fixed
{\obeyspaces
diff --git a/tex/context/base/spac-ver.lua b/tex/context/base/spac-ver.lua
index dbb5b0f39..b1eac73ba 100644
--- a/tex/context/base/spac-ver.lua
+++ b/tex/context/base/spac-ver.lua
@@ -273,9 +273,9 @@ storage.register("vspacing/data/skip", vspacing.data.skip, "vspacing.data.skip")
do -- todo: interface.variables
- local function logger(c,s)
- logs.report("vspacing",s)
- texsprint(c,s)
+ local function logger(c,...)
+ logs.report("vspacing",concat {...})
+ texsprint(c,...)
end
vspacing.fixed = false
@@ -436,7 +436,7 @@ end
local function trace_node(what)
local nt = node.type(what.id)
local tl = trace_list[#trace_list]
- if tl[1] == "node" then
+ if tl and tl[1] == "node" then
trace_list[#trace_list] = { "node", tl[2] .. " + " .. nt }
else
trace_list[#trace_list+1] = { "node", nt }
@@ -577,7 +577,8 @@ local function collapser(head,where,what,trace,snap) -- maybe also pass tail
if glue_data then
if force_glue then
if trace then trace_done("flushed due to " .. why,glue_data) end
- head, _ = forced_skip(head,current,glue_data.spec.width,"before",trace)
+ local spec = glue_data.spec
+ head, _ = forced_skip(head,current,(spec and spec.width) or 0,"before",trace)
free_glue_node(glue_data)
elseif glue_data.spec then
if trace then trace_done("flushed due to " .. why,glue_data) end
@@ -737,7 +738,8 @@ local function collapser(head,where,what,trace,snap) -- maybe also pass tail
free_glue_node(glue_data) -- also free spec
head, current, glue_data = remove_node(head, current)
elseif sc == force then
- -- todo: inject kern
+ -- last one counts, some day we can provide an accumulator and largest etc
+ -- but not now
if trace then trace_skip('force',sc,so,sp,current) end
free_glue_node(glue_data) -- also free spec
head, current, glue_data = remove_node(head, current)
@@ -847,27 +849,27 @@ local function collapser(head,where,what,trace,snap) -- maybe also pass tail
current = current.next
elseif subtype == above_display_skip then
--
-if trace then trace_skip("above display skip (normal)",sc,so,sp,current) end
-flush("above display skip (normal)")
-current = current.next
+ if trace then trace_skip("above display skip (normal)",sc,so,sp,current) end
+ flush("above display skip (normal)")
+ current = current.next
--
elseif subtype == below_display_skip then
--
-if trace then trace_skip("below display skip (normal)",sc,so,sp,current) end
-flush("below display skip (normal)")
-current = current.next
+ if trace then trace_skip("below display skip (normal)",sc,so,sp,current) end
+ flush("below display skip (normal)")
+ current = current.next
--
elseif subtype == above_display_short_skip then
--
-if trace then trace_skip("above display skip (short)",sc,so,sp,current) end
-flush("above display skip (short)")
-current = current.next
+ if trace then trace_skip("above display skip (short)",sc,so,sp,current) end
+ flush("above display skip (short)")
+ current = current.next
--
elseif subtype == below_display_short_skip then
--
-if trace then trace_skip("below display skip (short)",sc,so,sp,current) end
-flush("below display skip (short)")
-current = current.next
+ if trace then trace_skip("below display skip (short)",sc,so,sp,current) end
+ flush("below display skip (short)")
+ current = current.next
--
else -- other glue
if snap and trace_vsnapping and current.spec and current.spec.width ~= 0 then
diff --git a/tex/context/base/strc-doc.lua b/tex/context/base/strc-doc.lua
index 7239cffc2..465d10e97 100644
--- a/tex/context/base/strc-doc.lua
+++ b/tex/context/base/strc-doc.lua
@@ -332,8 +332,8 @@ function sections.numbers()
return data.numbers
end
-function sections.matching_till_depth(depth,numbers)
- local dn = data.numbers
+function sections.matching_till_depth(depth,numbers,parentnumbers)
+ local dn = parentnumbers or data.numbers
local ok = false
for i=1,depth do
if dn[i] == numbers[i] then
diff --git a/tex/context/base/strc-lnt.mkiv b/tex/context/base/strc-lnt.mkiv
index d0816cfc7..d80d38900 100644
--- a/tex/context/base/strc-lnt.mkiv
+++ b/tex/context/base/strc-lnt.mkiv
@@ -17,26 +17,13 @@
\unprotect
-\newcounter\linenotecounter
-\newtoks \collectedlinenotes
-\newif \iftracelinenotes
-
-\appendtoks
- \the\collectedlinenotes
-\to \everylinenumber
-
-\appendtoks
- \global\collectedlinenotes\emptytoks
-\to \beforeeverylinenumbering
+\newcounter\linenotecounter \newif\iftracelinenotes % will be tracker
\def\dohandlelinenote#1#2#3%
{\bgroup
- \expanded{\beforesplitstring#2}\at--\to\linenotelinenumber
- \ifnum\linenotelinenumber=\linenumber\relax
- \def\linenotelinenumber##1{#2}%
- \setupnote[#1][\c!numbercommand=\linenotelinenumber,\c!textcommand=\gobbleoneargument]%
- \setnote[#1]{#3}%
- \fi
+ \def\linenotelinenumber##1{\inlinerange[#2]}% ##1 == order
+ \setupnote[ln:#1][\c!numbercommand=\linenotelinenumber,\c!textcommand=\gobbleoneargument]% todo: deep hook
+ \setnote[ln:#1]{#3}%
\egroup}
\def\dotracedlinenote#1%
@@ -54,37 +41,30 @@
\def\dolinenote#1#2%
{\doglobal\increment\linenotecounter
- \doifreferencefoundelse{\??rr:\linenotecounter}%
- {\expanded{\doglobal\noexpand\appendtoks\noexpand\dohandlelinenote
- {#1}{\currenttextreference}}{#2}\to\collectedlinenotes}
- \donothing
+ \dohandlelinenote{#1}{\linenotecounter}{#2}%
\dotracedlinenote\empty
- \expanded{\someline[\??rr:\linenotecounter]}}
+ \expanded{\someline[\linenotecounter]}}
\def\dostartlinenote#1[#2]#3%
- {\doifreferencefoundelse{\??rr:#2}%
- {\expanded{\doglobal\noexpand\appendtoks\noexpand\dohandlelinenote
- {#1}{\currenttextreference}}{#3}\to\collectedlinenotes}%
- {\unknownreference{#2}}%
+ {\doglobal\increment\linenotecounter
+ \dohandlelinenote{#1}{#2}{#3}%
\dotracedlinenote{#2}%
- \startline[\??rr:#2]}
+ \startline[#2]}
\def\dostoplinenote#1[#2]%
- {\stopline[\??rr:#2]}
-
-% defining them
+ {\stopline[#2]}
\def\definelinenote
{\dodoubleempty\dodefinelinenote}
\def\dodefinelinenote[#1][#2]%
- {\definenote[#1][#2]%
- \setvalue {#1}{\dolinenote {#1}}%
- \setvalue{\e!start#1}{\dostartlinenote{#1}}%
- \setvalue{\e!stop #1}{\dostoplinenote {#1}}}
+ {\definenote[ln:#1][#2]%
+ \unexpanded\setvalue {#1}{\dolinenote {#1}}%
+ \unexpanded\setvalue{\e!start#1}{\dostartlinenote{#1}}%
+ \unexpanded\setvalue{\e!stop #1}{\dostoplinenote {#1}}}
-\def\setuplinenote % convenient
- {\setupnote}
+\def\setuplinenote[#1]% convenient
+ {\setupnote[ln:#1]}
% We predefine one, namely \type {\linenote} cum suis.
diff --git a/tex/context/base/strc-lst.lua b/tex/context/base/strc-lst.lua
index fbb502d1a..12c0b8c45 100644
--- a/tex/context/base/strc-lst.lua
+++ b/tex/context/base/strc-lst.lua
@@ -38,6 +38,7 @@ lists.internals = lists.internals or { }
lists.ordered = lists.ordered or { }
local variables = interfaces.variables
+local matching_till_depth, number_at_depth = sections.matching_till_depth, sections.number_at_depth
local function initializer()
-- create a cross reference between internal references
@@ -78,8 +79,7 @@ if job then
job.register('structure.lists.collected', structure.lists.tobesaved, initializer)
end
-local cached = { }
-local pushed = { }
+local cached, pushed = { }, { }
function lists.push(t)
local r = t.references
@@ -127,7 +127,7 @@ function lists.pushnesting(i)
local name = r.metadata.name
local numberdata = r and r.numberdata
local n = (numberdata and numberdata.numbers[sections.getlevel(name)]) or 0
- insert(nesting, { number = n, name = name, result = lists.result })
+ insert(nesting, { number = n, name = name, result = lists.result, parent = r })
end
function lists.popnesting()
@@ -135,7 +135,7 @@ function lists.popnesting()
lists.result = old.result
end
-local function filter_collected(names, criterium, number, collected)
+local function filter_collected(names, criterium, number, collected, nested)
local numbers, depth = documents.data.numbers, documents.data.depth
local hash, result, all, detail = { }, { }, not names or names == "" or names == variables.all, nil
if not all then
@@ -269,21 +269,22 @@ local function filter_collected(names, criterium, number, collected)
elseif criterium == variables["local"] then -- not yet ok
local nested = nesting[#nesting]
if nested then
- return filter_collected(names,nested.name,nested.number,collected)
+ return filter_collected(names,nested.name,nested.number,collected,nested)
elseif sections.autodepth(documents.data.numbers) == 0 then
return filter_collected(names,variables.all,number,collected)
else
return filter_collected(names,variables.current,number,collected)
end
else -- sectionname, number
- -- now same as register
+ -- not the same as register
local depth = sections.getlevel(criterium)
- local number = tonumber(number) or sections.number_at_depth(depth) or 0
+ local number = tonumber(number) or number_at_depth(depth) or 0
if trace_lists then
local t = sections.numbers()
- detail = format("depth: %s, number: %s, numbers: %s",depth,number,(#t>0 and concat(t,".",1,depth)) or "?")
+ detail = format("depth: %s, number: %s, numbers: %s, startset: %s",depth,number,(#t>0 and concat(t,".",1,depth)) or "?",#collected)
end
if number > 0 then
+ local parent = nested and nested.parent and nested.parent.numberdata.numbers -- so local as well as nested
for i=1,#collected do
local v = collected[i]
local r = v.references
@@ -293,7 +294,7 @@ local function filter_collected(names, criterium, number, collected)
local metadata = v.metadata
local cnumbers = sectionnumber.numbers
if cnumbers then
- if (all or hash[metadata.name or false]) and #cnumbers >= depth and sections.matching_till_depth(depth,cnumbers) then
+ if (all or hash[metadata.name or false]) and #cnumbers >= depth and matching_till_depth(depth,cnumbers,parent) then
result[#result+1] = v
end
end
@@ -404,6 +405,7 @@ function lists.savedprefixednumber(name,n)
helpers.prefix(data,data.prefixdata)
local numberdata = data.numberdata
if numberdata then
+--~ print(name,n,table.serialize(numberdata))
sections.typesetnumber(numberdata,"number",numberdata or false)
end
end
diff --git a/tex/context/base/strc-mat.mkiv b/tex/context/base/strc-mat.mkiv
index 38c75c840..0b8642814 100644
--- a/tex/context/base/strc-mat.mkiv
+++ b/tex/context/base/strc-mat.mkiv
@@ -15,9 +15,11 @@
\registerctxluafile{strc-mat}{1.001}
+% we have potential for captions
+
\unprotect
-\definestructureconversionset[\v!formula][number,characters]
+\definestructureconversionset[\v!formula][numbers,characters]
\setupformulas
[%\c!way=\@@nrway,
@@ -46,127 +48,206 @@
\definestructurecounter
[\v!formula]
-\setupstructurecounter
- [\v!formula]
- [\c!numberconversionset=\v!formula]
+% \setupstructurecounter
+% [\v!formula]
+% [\c!numberconversionset=\v!formula]
\presetstructurecountersetup\setupformulas\sharedstructurecounterparameter
\appendtoks
- \dostructurecountersetup\currentformula\formulaparameter
- \docheckstructurecountersetup\currentformula
+% \dostructurecountersetup\currentformula\formulaparameter
+% \docheckstructurecountersetup\currentformula
+ \dostructurecountersetup\v!formula\formulaparameter
+% \docheckstructurecountersetup\v!formula
\to \everysetupformulas
+\setupformulas
+ [\c!numberconversionset=\v!formula] % why forgotten
+
\def\storecurrentformulanumber#1#2#3#4#5% ref, todo:str, \sync % todo: title etc (like float)
{\dostructurecountercomponent
{formula}%
- \getformulaparameters
- \formulaparameter
- \detokenizedformulaparameter
- \relax
- \relax
- \relax
- [\c!name=\currentformula,\s!counter=\currentformula,%
- \s!hascaption=\v!yes,\s!hasnumber=\v!yes,\s!hastitle=\v!yes,\s!haslevel=#5,%
+ \getformulaparameters \formulaparameter \detokenizedformulaparameter
+ \relax \relax \relax
+% [\c!name=\currentformula,\s!counter=\currentformula,%
+ [\c!name=\v!formula,\s!counter=\v!formula,%
+ \s!hascaption=\v!yes,\s!hastitle=\v!yes,\s!hasnumber=\v!yes,%\s!haslevel=#6,%
+ \s!hasnumber=\v!no,%
\c!reference=#1,\c!title=,\c!bookmark=]%
[#2]%
- \globallet\currentformulanumber\laststructurecounternumber
- \globallet#3\laststructurecountersynchronize
- \globallet#4\laststructurecounterattribute}
+ \globallet#3\laststructurecounternumber
+ \globallet#4\laststructurecountersynchronize
+ \globallet#5\laststructurecounterattribute}
\newif\ifnoformulanumber
-% \def\thecurrentformulanumber
-% {%\ifnoformulacaption \else \ifnoformulanumber \else
-% \labeltexts\currentformula{\convertedstructurecounter[formula]}% ! ! todo: use a lua call instead
-% }%\fi \fi}
+\newconditional\handleformulanumber
+\newconditional\incrementformulanumber
-\def\thecurrentformulanumber
- {\ifx\currentformulanumber\relax\else \ifnoformulanumber \else
- \labeltexts\currentformula{\ctxlua{structure.lists.savedprefixednumber("\currentformula",\currentformulanumber)}}%
- \fi \fi}
+\newtoks\everyresetformulas
-\def\placecurrentformulanumber
- {\currentformulassynchronize \currentformulasattribute % todo
- \currentformulasynchronize \currentformulasattribute % todo
- \currentsubformulasynchronize \currentsubformulaattribute % todo
- \thecurrentformulanumber}
+\newconditional\insideplaceformula
+\newconditional\insideplacesubformula
+\newconditional\insideformulas
+\newconditional\insidesubformulas
-\def\doformulanumber
- {\dotripleempty\dodoformulanumber}
+% 0=unset, 1=forced, 2=none, 3=reference
-\def\dodoformulanumber[#1][#2][#3]%
- {\doquadruplegroupempty\dododoformulanumber{#1}{#2}{#3}}
+\def\handleplaceformulanumbering % place formula
+ {\settrue\handleformulanumber
+ \docheckformulareference\placeformulanumbermode\currentplaceformulareference
+ \glet\doplaceformulanumber \doplaceformulanumberindeed
+ \glet\donestedformulanumber\donestedformulanumberindeed}
-\let\subformulasreference\empty % temp hack
+\def\handleformulasnumbering % formulas
+ {\docheckformulareference\formulasnumbermode\currentformularesference}
-\let\currentformulasynchronize \relax \let\currentformulaattribute \relax
-\let\currentsubformulasynchronize\relax \let\currentsubformulaattribute\relax
-\let\currentformulassynchronize \relax \let\currentformulasattribute \relax
+\def\handlesubformulasnumbering % sub formulas
+ {\docheckformulareference\subformulasnumbermode\currentsubformulasreference
+ \doincrementsubstructurecounter[\v!formula][1]% always
+ \storecurrentformulanumber
+ \currentsubformulasreference
+ \empty
+ \currentsubformulasnumber
+ \currentsubformulassynchronize
+ \currentsubformulasattribute
+ }
-\def\inhibitformulanumberflag{-}
+\def\tracedformulamode
+ {\hbox{\quad\tt\txx[\number\placeformulanumbermode,\number\formulasnumbermode,\number\subformulasnumbermode,\number\nestedformulanumbermode]}}
-\def\dododoformulanumber#1#2#3#4% (#1,#2)=outer(ref,sub) (#3,#4)=inner(ref,sub)
- {\hbox\bgroup
- \ifconditional\handleformulanumber
- % main counter
- \setbox0\hbox{\ignorespaces#2\unskip}%
- \ifdim\wd0>\zeropoint
- \setsubstructurecounterown[\v!formula][2]{#2}% \detokenize?
- \fi
- \edef\currentformulareference{#1}%
- \ifx\currentformulareference\inhibitformulanumberflag
- \glet\currentformulasynchronize\relax
- \glet\currentformulaattribute \relax
- \noformulanumbertrue
- \else
- \storecurrentformulanumber\currentformulareference\empty\currentformulasynchronize\currentformulaattribute1%
- \noformulanumberfalse
- \fi
- % subcounter
- \setbox0\hbox{\ignorespaces#4\unskip}%
- \ifdim\wd0>\zeropoint
- \setsubstructurecounterown[\v!formula][2]{#4}% \detokenize?
- \fi
- \edef\currentsubformulareference{#3}%
- \ifx\currentsubformulareference\empty
- \glet\currentsubformulasynchronize\relax
- \glet\currentsubformulaattribute \relax
- \else
- \storecurrentformulanumber\currentsubformulareference\empty\currentsubformulasynchronize\currentsubformulaattribute2%
- \fi
- %
- \rm % nodig ?
- \doif{\formulaparameter\c!location}\v!right{\hskip\formulaparameter\c!distance}%
- \formulaparameter\c!numbercommand
- {\dosetformulaattributes\c!numberstyle\c!numbercolor
- \strut
- \formulaparameter\c!left
- \labeltexts\v!formula{\ignorespaces\placecurrentformulanumber\unskip}%
- \formulaparameter\c!right}%
- \doif{\formulaparameter\c!location}\v!left{\hskip\formulaparameter\c!distance}%
+\def\placecurrentformulanumber
+ {\rm % nodig ?
+ \doif{\formulaparameter\c!location}\v!right{\hskip\formulaparameter\c!distance}%
+ \formulaparameter\c!numbercommand
+ {\dosetformulaattributes\c!numberstyle\c!numbercolor
+ \strut
+ \formulaparameter\c!left
+ \labeltexts\v!formula{\ignorespaces\doplacecurrentformulanumber\unskip}%
+ \formulaparameter\c!right}%
+ \doif{\formulaparameter\c!location}\v!left{\hskip\formulaparameter\c!distance}}
+
+\def\doplacecurrentformulanumber
+ {\dohandlecurrentformulareferences
+ %\currentformulasattribute % todo
+ %\currentformulasattribute % todo
+ %\currentsubformulaattribute % todo
+ \labeltexts\currentformula{\doconvertedstructurecounter[\v!formula][]}}
+
+\appendtoks
+ \glet\currentplaceformulasynchronize \relax
+ \glet\currentformulassynchronize \relax
+ \glet\currentsubformulassynchronize \relax
+ \glet\currentnestedformulasynchronize\relax
+ \let\currentformula\empty
+\to \everyresetformulas
+
+\def\dohandlecurrentformulareferences
+ {\ifnum\placeformulanumbermode=\plusthree
+ \storecurrentformulanumber
+ \currentplaceformulareference
+ \empty
+ \currentplaceformulanumber
+ \currentplaceformulasynchronize
+ \currentplaceformulaattribute
+ \currentplaceformulasynchronize
+ \glet\currentplaceformulasynchronize\relax
\fi
- \egroup}
+ \ifnum\formulasnumbermode=\plusthree
+ \storecurrentformulanumber
+ \currentformulasreference
+ \empty
+ \currentformulasnumber
+ \currentformulassynchronize
+ \currentformulasattribute
+ \currentformulassynchronize
+ \glet\currentformulassynchronize\relax
+ \fi
+ \ifnum\subformulasnumbermode=\plusthree
+ \currentsubformulassynchronize
+ \glet\currentsubformulassynchronize\relax
+ \fi
+ \ifnum\nestedformulanumbermode=\plusthree
+ \storecurrentformulanumber
+ \currentnestedformulareference
+ \empty
+ \currentnestedformulanumber
+ \currentnestedformulasynchronize
+ \currentnestedformulaattribute
+ \currentnestedformulasynchronize
+ \glet\currentnestedformulasynchronize\relax
+ \fi}
-\let\donestedformulanumber\gobbletwoarguments
+\let\currentformulasreference \empty \let\currentformulassuffix \empty
+\let\currentformulareference \empty \let\currentformulasuffix \empty
+\let\currentsubformulareference \empty \let\currentsubformulasuffix \empty
+\let\currentnestedformulareference\empty \let\currentnestedformulasuffix\empty
-\definelist[\v!formula]
+\let\currentformulasynchronize \relax \let\currentformulaattribute \relax
+\let\currentsubformulasynchronize\relax \let\currentsubformulaattribute\relax
+\let\currentformulassynchronize \relax \let\currentformulasattribute \relax
-\global\let\doflushformulalistentry\gobbleoneargument
+\def\dododoformulanumber
+ {\ifconditional\handleformulanumber
+ \hbox\bgroup
+ % main counter
+ \doiftext \currentplaceformulasuffix {\setsubstructurecounterown[\v!formula][2]{\currentplaceformulasuffix}}%
+ \ifconditional\insidesubformulas
+ % nothing
+ \else
+ \ifcase\formulasnumbermode
+ \ifcase\placeformulanumbermode
+ \doincrementsubstructurecounter[\v!formula][1]%
+ \placecurrentformulanumber
+ \or
+ \doincrementsubstructurecounter[\v!formula][1]%
+ \placecurrentformulanumber
+ \or
+ % nothing
+ \or
+ \doincrementsubstructurecounter[\v!formula][1]%
+ \placecurrentformulanumber
+ \fi
+ \or
+ \doincrementsubstructurecounter[\v!formula][1]%
+ \placecurrentformulanumber
+ \or
+ % nothing
+ \or
+ \doincrementsubstructurecounter[\v!formula][1]%
+ \placecurrentformulanumber
+ \fi
+ \fi
+ % subcounter
+ \doiftext \currentsubformulasuffix {\setsubstructurecounterown[\v!formula][2]{\currentsubformulasuffix}}%
+ \ifconditional\insidesubformulas
+ \ifcase\subformulasnumbermode
+ % nothing
+ \or
+ \doincrementsubstructurecounter[\v!formula][2]%
+ \placecurrentformulanumber
+ \or
+ % nothing
+ \or
+ \doincrementsubstructurecounter[\v!formula][2]%
+ \placecurrentformulanumber
+ \fi
+ \fi
+ %\rlap{\tracedformulamode}%
+ \egroup
+ \fi}
-\def\setformulalistentry#1%
- {\gdef\doflushformulalistentry##1%
- {\normalexpanded{\noexpand\writetolist[\v!formula]{##1}}{#1}%
- \global\let\doflushformulalistentry\gobbleoneargument}}
+\definelist[\v!formula]
-\newconditional\handleformulanumber
-\newconditional\incrementformulanumber
-\newconditional\insidesubformulas
+\appendtoks
+ \global\setfalse\insideplaceformula
+ \global\setfalse\insideplacesubformula
+ \global\setfalse\insideformulas
+ \global\setfalse\insidesubformulas
+\to \everyresetformulas
\newif\ifinformula
-\let\doplaceformulanumber\empty
-
%D We need a hook into the plain math alignment macros
%D
%D \starttyping
@@ -178,8 +259,8 @@
%D Otherwise we get a missing \type {$$} error reported.
\def\resetdisplaymatheq
- {\let\normalleqno\relax \let\leqno\relax
- \let\normalreqno\relax \let\eqno \relax
+ {\let\normalleqno\gobbleoneargument \let\leqno\gobbleoneargument
+ \let\normalreqno\gobbleoneargument \let\eqno \gobbleoneargument
\let\doplaceformulanumber\empty}
%D
@@ -265,27 +346,6 @@
\newdimen\lastlinewidth
-% test \par \dorecurse{10}{test } \moveformula \startformula test \stopformula test \endgraf
-% test \par \dorecurse{10}{test } \startformula test \stopformula test \endgraf
-% \dorecurse{30}{\bpar \dorecurse\recurselevel{test } \epar \startformula formula \stopformula}
-
-\def\setlastlinewidth
- {\resetlastlinewidth
- \ifoptimizedisplayspacing\ifmmode\else\ifhmode
- \bgroup
- \forgetdisplayskips
- \displaywidowpenalty\widowpenalty % brrr, else widowpenalty does not work
- \everymath \emptytoks
- \everydisplay\emptytoks
- $$\strut\global\lastlinewidth\predisplaysize$$
- \vskip-\lineheight
- \vskip\zeropoint
- \egroup
- \fi\fi\fi}
-
-\def\resetlastlinewidth
- {\global\lastlinewidth\zeropoint\relax}
-
\abovedisplayskip \zeropoint
\abovedisplayshortskip \zeropoint % evt. 0pt minus 3pt
\belowdisplayskip \zeropoint
@@ -296,13 +356,6 @@
% we don't use the skip's
-\def\displayskipsize#1#2% obsolete
- {\ifdim\ctxparskip>\zeropoint
- #1\ctxparskip\!!plus#2\ctxparskip\!!minus#2\ctxparskip\relax
- \else
- #1\lineheight\!!plus#2\lineheight\!!minus#2\lineheight\relax
- \fi}
-
\def\forgetdisplayskips % to do
{\abovedisplayskip \zeropoint
\belowdisplayskip \zeropoint
@@ -325,26 +378,26 @@
\def\afterdisplayspace
{\doifnot{\formulaparameter\c!spaceafter }\v!none{\blank[\formulaparameter\c!spaceafter ]}}
-\def\setpredisplaysize#1%
- {\predisplaysize#1\relax
- \ifdim\predisplaysize<\maxdimen
- \ifdim\predisplaysize>\zeropoint
- \advance\predisplaysize \predisplaysizethreshhold
- \fi
- \advance\predisplaysize \displayindent % needed ?
- \ifdim\predisplaysize>\hsize
- \predisplaysize\hsize
- \fi
- \else
- \predisplaysize\zeropoint
- \fi}
+% \def\setpredisplaysize
+% {\predisplaysize\lastlinewidth\relax
+% \ifdim\predisplaysize<\maxdimen
+% \ifdim\predisplaysize>\zeropoint
+% \advance\predisplaysize \predisplaysizethreshhold
+% \fi
+% \advance\predisplaysize \displayindent % needed ?
+% \ifdim\predisplaysize>\hsize
+% \predisplaysize\hsize
+% \fi
+% \else
+% \predisplaysize\zeropoint
+% \fi}
\def\setdisplaydimensions
{\displayindent\leftdisplayskip
\advance\displayindent\leftdisplaymargin
\displaywidth\hsize
-% \setlocalhsize
-% \displaywidth\localhsize
+ %\setlocalhsize
+ %\displaywidth\localhsize
\ifdim\hangindent>\zeropoint
\advance\displayindent\hangindent
\else
@@ -353,8 +406,6 @@
\advance\displaywidth\dimexpr-\displayindent-\rightdisplayskip-\rightdisplaymargin\relax
\hsize\displaywidth} % new, else overfull in itemize
-\newif\ifoptimizedisplayspacing
-
\def\dostartformula#1%
{\dodoubleempty\dodostartformula[#1]}
@@ -362,8 +413,6 @@
\newskip\formulastrutht
\newskip\formulastrutdp
-% hm, invoke otr in hmode in order to move skips to mvl, could be an option
-
%D \startbuffer
%D \startformula[9pt] x = 1 \stopformula
%D \startformula[7pt] x = 1 \stopformula
@@ -372,12 +421,7 @@
%D \typebuffer \getbuffer
\def\dodostartformula[#1][#2]% setting leftskip adaption is slow !
- {% todo: test first
- %
- % \ifdim\lastskip>\zeropoint
- % \resetlastlinewidth % else problems with in between stuff without \epar
- % \fi
- \bgroup % HERE
+ {\bgroup % HERE
\def\currentformula{#1}%
\the\everybeforedisplayformula
\formulaparskip\parskip
@@ -400,13 +444,6 @@
\freezedimenmacro\rightdisplaymargin
\freezedimenmacro\predisplaysizethreshhold
\forgetdisplayskips
- \ifoptimizedisplayspacing
- \ifdim\lastlinewidth>\zeropoint
- \abovedisplayshortskip-\strutht\relax
- \fi
- \else
- \resetlastlinewidth
- \fi
\getvalue{\e!start\formulaparameter\c!alternative\v!formula}}
\def\switchtoformulabodyfont{\switchtobodyfont}
@@ -423,46 +460,15 @@
\def\dostopformula
{\doplaceformulanumber
\getvalue{\e!stop\formulaparameter\c!alternative\v!formula}%
- \resetlastlinewidth
\nonoindentation
\checknextindentation[\formulaparameter\c!indentnext]%
\egroup
\hangafter\minusone % added for side floats
\hangindent\zeropoint % added for side floats
\setfalse\handleformulanumber
+ \the\everyresetformulas
\dorechecknextindentation} % here ?
-% \def\startdisplaymath
-% {\bgroup
-% \parskip\formulaparskip % ! !
-% \informulatrue
-% %\forgetall % otherwise backgrounds fail
-% \ifdim\lastskip<\zeropoint\else
-% \par
-% \ifvmode \ifdim\parskip>\zeropoint\relax
-% \whitespace \vskip-\parskip % kind of forces and cancels again
-% \fi \fi
-% \fi
-% \beforedisplayspace
-% \par
-% \ifvmode
-% \prevdepth-\maxdimen % texbook pagina 79-80
-% % otherwise problems at the top of a page
-% \verticalstrut
-% \vskip-\struttotal
-% \vskip-\baselineskip
-% \fi
-% $$\setdisplaydimensions
-% \setpredisplaysize\lastlinewidth
-% \startinnermath}
-
-% \def\stopdisplaymath
-% {\stopinnermath
-% $$%
-% \par\ifvmode\ifdim\parskip>\zeropoint\whitespace\vskip-\parskip\fi\fi
-% \afterdisplayspace
-% \egroup}
-
\def\startdisplaymath
{\bgroup
\par
@@ -474,7 +480,7 @@
\fi
$$
\setdisplaydimensions
- \setpredisplaysize\lastlinewidth
+ %\setpredisplaysize
\startinnermath}
\def\stopdisplaymath
@@ -512,35 +518,18 @@
% \placeformula {f} \startspformule \fakespacingformula \stopspformule
% \fakewords{20}{40}
-\def\placeformula
- {\settrue\incrementformulanumber
- \dodoubleempty\doplaceformula}
-
-\def\placesubformula
- {\setfalse\incrementformulanumber
- \dodoubleempty\doplaceformula}
-
\def\startsubformulas
{\dosingleempty\dostartsubformulas}
\def\dostartsubformulas[#1]%
- {\ifconditional\incrementformulanumber
- \incrementstructurecounter[\v!formula]% ?????
- \edef\subformulasreference{#1}% messy
- \ifx\subformulasreference\empty
- \glet\currentformulassynchronize\relax
- \glet\currentformulasattribute \relax
- \else
- \storecurrentformulanumber\subformulasreference\empty\currentformulassynchronize\currentformulasattribute2%
- \fi
- \fi
- \settrue\insidesubformulas}
+ {\edef\currentsubformulasreference{#1}%
+ \global\settrue\insidesubformulas
+ \handlesubformulasnumbering}
\def\stopsubformulas
- {\setfalse\insidesubformulas
- \resetlastlinewidth
- \nonoindentation
+ {\nonoindentation
\checknextindentation[\formulaparameter\c!indentnext]%
+ \the\everyresetformulas
\dorechecknextindentation} % here ?
%D Named subformulas (to be redone)
@@ -566,52 +555,14 @@
%D
%D \typebuffer \getbuffer
-\def\placenamedformula
- {\dosingleempty\doplacenamedformula}
-
-\def\doplacenamedformula[#1]#2%
- {\iffirstargument
- \def\next{\placeformula[#1]}%
- \else
- \let\next\placeformula
- \fi
- \setformulalistentry{#2}%
- \next}
-
-%D The implementation of placement is a bit ugly:
-
-\def\doplaceformula[#1][#2]% #2 = dummy, gobbles spaces
- {\def\redoplaceformula
- {\bgroup
- \ifx\next\bgroup
- \egroup \@EA\moreplaceformula % [ref]{}
- \else
- \let\nextnext$% no def
- \ifx\next\nextnext
- \egroup \@EAEAEA\dispplaceformula % [ref]$$
- \else
- \egroup \@EAEAEA\dodoplaceformula % [ref]\start
- \fi
- \fi[#1]{}}%
- \futurelet\next\redoplaceformula}
-
-\long\def\moreplaceformula[#1]#2#3#4% #2 dummy #4 gobbles spaces
- {\def\redoplaceformula
- {\bgroup
- \let\nextnext$% no def
- \ifx\next\nextnext
- \egroup \@EA\dispplaceformula % [ref]$$
- \else
- \egroup \@EA\dodoplaceformula % [ref]\start
- \fi
- [#1]{#3}}%
- \futurelet\next\redoplaceformula#4}
-
-\let\startplaceformula\placeformula
-\let\stopplaceformula \relax
+\def\startformulas
+ {\dosingleempty\dostartformulas}
-\def\startformulas#1\stopformulas % new / to be internationalized
+\def\dostartformulas[#1]#2\stopformulas % new / to be internationalized
{\bgroup
+ \global\settrue\insideformulas
+ \edef\currentformulasreference{#1}%
+ \handleformulasnumbering
\let\currentformula\empty
\forgetdisplayskips
\startdisplaymath
@@ -619,7 +570,7 @@
\long\def\startformula##1\stopformula
{\advance\scratchcounter\plusone}%
\scratchcounter\zerocount
- #1% preroll
+ #2% preroll
\ifcase\scratchcounter\else
\divide \hsize \scratchcounter
\fi
@@ -629,276 +580,161 @@
\def\normalstopformula {$$}%
\def\startformula {$\vcenter\bgroup\normalstartformula}%
\def\stopformula {\normalstopformula\egroup$\hss}%
- #1%
+ #2%
\egroup
\stopdisplaymath
\egroup
+ \the\everyresetformulas
\hangafter\minusone % added for side floats
\hangindent\zeropoint} % added for side floats
-\def\dispplaceformula[#1]#2$$#3$$%
- {\dodoplaceformula[#1]{#2}\dostartformula{}#3\dostopformula}
-
-\def\dodoplaceformula[#1]#2% messy, needs a clean up
- {\doifelse{#1}{-}
- {\setfalse\handleformulanumber}
- {\doifelse{#2}{-}
- {\setfalse\handleformulanumber}
- {\settrue\handleformulanumber}}%
- \ifconditional\handleformulanumber
- \def\formulanumber
- {%\global\let\subformulanumber\doformulanumber % no, bug
- \doformulanumber[#1][#2]}%
- \def\donestedformulanumber##1##2%
- {\doifsomething{##1}
- {\doifelse{##1}{+}{\doformulanumber[#1]}{\doformulanumber[##1]}[##2][]{}}}%
- \def\subformulanumber
- {\setfalse\incrementformulanumber
- \formulanumber}%
- \gdef\doplaceformulanumber
- {\global\let\doplaceformulanumber\empty
- \doifelse{\formulaparameter\c!location}\v!left
- {\normalleqno{\doformulanumber[#1][#2][]{}}}
- {\normalreqno{\doformulanumber[#1][#2][]{}}}}%
+% place
+
+% 0=unset, 1=forced, 2=none, 3=reference
+
+\chardef\placeformulanumbermode \zerocount
+\chardef\formulanumbermode \zerocount
+\chardef\formulasnumbermode \zerocount
+\chardef\subformulasnumbermode \zerocount
+\chardef\nestedformulanumbermode\zerocount
+
+\def\inhibitformulanumberflag{-}
+\def\forceformulanumberflag {+}
+
+\def\docheckformulareference#1#2%
+ {\chardef#1\ifx#2\empty
+ \zerocount
+ \else\ifx#2\forceformulanumberflag
+ \plusone
+ \else\ifx#2\inhibitformulanumberflag
+ \plustwo
\else
- \def\formulanumber{\doformulanumber[#1][#2]}%
- \let\donestedformulanumber\gobbletwoarguments
- \let\subformulanumber\doformulanumber % was \global
- \global\let\doplaceformulanumber\empty
- \fi}
-
-%D Here we implement a basic math alignment mechanism. Numbers
-%D are also handled. The macros \type {\startinnermath} and
-%D \type {\stopinnermath} can be overloaded in specialized
-%D modules.
-
-\def\startinnermath
- {\getvalue{\e!start\??fm\formulaparameter\c!align}}
-
-\def\stopinnermath
- {\getvalue{\e!stop \??fm\formulaparameter\c!align}}
-
-\def\mathinnerstrut
- {\doif{\formulaparameter\c!strut}\v!yes\strut}
-
-\long\def\defineinnermathhandler#1#2#3%
- {\setvalue{\e!start\??fm#1}{#2}%
- \setvalue{\e!stop \??fm#1}{#3}}
-
-\newif\iftracemath
-
-\def\mathhbox
- {\iftracemath\ruledhbox\else\hbox\fi}
-
-\chardef\mathraggedstatus=0 % normal left center right
-\chardef\mathnumberstatus=0 % nothing normal shift_right
-\let\mathnumbercorrection\!!zeropoint
-
-\def\startmathbox#1%
- {\hsize\displaywidth
- \global\chardef\mathnumberstatus\plusone
- \chardef\mathraggedstatus#1\relax
- \let\mathnumbercorrection\!!zeropoint
- \global\let\@eqno \empty \def\eqno {\gdef\@eqno }%
- \global\let\@leqno\empty \def\leqno{\gdef\@leqno}%
- % added
- \let\normalreqno\eqno
- \let\normalleqno\leqno
- % added
- \doplaceformulanumber
- \setbox\scratchbox\mathhbox to \displaywidth\bgroup
- \mathinnerstrut
- $%
- \displaystyle
- \ifcase\mathraggedstatus\or\hfill\or\hfill\fi}
-
-\def\llappedmathno
- {\ifcase\mathraggedstatus\or
- \@eqno
- \or
- \llap{\@eqno}%
- \or
- \llap{\@eqno}%
+ \plusthree
+ \fi\fi\fi}
+
+\def\doformulanumber
+ {\dosingleempty\dodoformulanumber}
+
+\def\dodoformulanumber[#1]%
+ {\def\currentformulareference{#1}%
+ \dosinglegroupempty\dododoformulanumber}
+
+\def\redoformulanumber#1%
+ {\def\currentformulasuffix{#1}%
+ \dododoformulanumber}
+
+\def\placeformula
+ {\doglobal\settrue\insideplaceformula
+ \settrue\incrementformulanumber
+ \dodoubleempty\doplaceformula}
+
+\def\placesubformula
+ {\doglobal\settrue\insideplacesubformula
+ \setfalse\incrementformulanumber
+ \dodoubleempty\doplaceformula}
+
+\def\placeformula
+ {\doglobal\settrue\insideplaceformula
+ \settrue\incrementformulanumber
+ \dodoubleempty\doplaceformula}
+
+\def\placesubformula
+ {\doglobal\settrue\insideplacesubformula
+ \setfalse\incrementformulanumber
+ \dodoubleempty\doplaceformula}
+
+\def\doplaceformula[#1][#2]% #2 = dummy, gobbles spaces
+ {\def\currentplaceformulareference{#1}%
+ \let\currentplaceformulasuffix\empty
+ \futurelet\next\redoplaceformulaone}
+
+\let\mathdollarsign$ % no def
+
+\def\redoplaceformulaone % use doifnextcharelse
+ {\ifx\next\bgroup
+ \@EA\moreplaceformula % [ref]{}
+ \else
+ \@EA\redoplaceformulatwo
\fi}
-\def\rlappedmathno
- {\ifcase\mathraggedstatus\or
- \rlap{\@leqno}%
+\long\def\moreplaceformula#1#2#3% #1 dummy #3 gobbles spaces
+ {\def\currentplaceformulasuffix{#2}%
+ \futurelet\next\redoplaceformulatwo#3}
+
+\def\redoplaceformulatwo
+ {\ifx\next\mathdollarsign
+ \@EA\dispplaceformula % [ref]$$
+ \else
+ \@EA\dodoplaceformula % [ref]\start
+ \fi}%
+
+\def\dodoplaceformula
+ {\handleplaceformulanumbering}
+
+\def\dispplaceformula$$#1$$%
+ {\handleplaceformulanumbering
+ \dostartformula{}#1\dostopformula}
+
+\let\startplaceformula\placeformula
+\let\stopplaceformula \relax
+
+% to be checked
+
+\def\doformulanumber
+ {\dosingleempty\dodoformulanumber}
+
+\def\dodoformulanumber[#1]%
+ {\def\currentformulareference{#1}%
+ \dosinglegroupempty\dododoformulanumber}
+
+\def\redoformulanumber#1%
+ {\def\currentformulasuffix{#1}%
+ \dododoformulanumber}
+
+\glet\doplaceformulanumber \relax
+\glet\donestedformulanumber\gobbletwoarguments
+
+\def\donestedformulanumberindeed#1#2%
+ {\def\currentnestedformulareference{#1}%
+ \def\currentnestedformulasuffix{#2}%
+ \glet\doplaceformulanumber\relax
+ \docheckformulareference\nestedformulanumbermode\currentnestedformulareference
+ \ifcase\nestedformulanumbermode
+ % nothing
+ \or
+ \doformulanumber
\or
- \rlap{\@leqno}%
+ % nothing
\or
- \@leqno
+ \doformulanumber
\fi}
-\def\stopmathbox
- {$%
- \ifcase\mathraggedstatus\or\or\hfill\or\hfill\fi
- \egroup
- \setbox0\hbox{\unhcopy\scratchbox}%
- \scratchdimen\wd0
- \ifdim\scratchdimen>\displaywidth
- \donetrue
+\def\doplaceformulanumberindeed
+ {\glet\doplaceformulanumber\relax
+ \doifelse{\formulaparameter\c!location}\v!left
+ {\normalleqno{\dododoformulanumber}}
+ {\normalreqno{\dododoformulanumber}}}
+
+% todo
+
+\def\placenamedformula
+ {\dosingleempty\doplacenamedformula}
+
+\def\doplacenamedformula[#1]#2%
+ {\iffirstargument
+ \def\next{\placeformula[#1]}%
\else
- \donefalse
+ \let\next\placeformula
\fi
- \hbox to \displaywidth\bgroup
- \ifcase\mathnumberstatus
- \box\scratchbox
- \or
- \ifx\@leqno\empty
- \ifx\@eqno\empty
- \box\scratchbox
- \else
- \ifdone
- \vbox{\box\scratchbox\hbox to \displaywidth{\hss\llappedmathno}}%
- \else
- \hss\box\scratchbox\llappedmathno % hss makes room for number
- \fi
- \fi
- \else
- \ifdone
- \vbox{\hbox to \displaywidth{\rlappedmathno\hss}\box\scratchbox}%
- \else
- \rlappedmathno\box\scratchbox\hss % hss makes room for number
- \fi
- \fi
- \or
- \hskip\mathnumbercorrection
- \box\scratchbox
- \hss
- \else
- \box\scratchbox
- \fi
- \egroup}
+ \setformulalistentry{#2}%
+ \next}
-\defineinnermathhandler\v!left {\startmathbox\plusone }{\stopmathbox}
-\defineinnermathhandler\v!middle {\startmathbox\plustwo }{\stopmathbox}
-\defineinnermathhandler\v!right {\startmathbox\plusthree}{\stopmathbox}
-\defineinnermathhandler\v!flushleft {\startmathbox\plusthree}{\stopmathbox}
-\defineinnermathhandler\v!center {\startmathbox\plustwo }{\stopmathbox}
-\defineinnermathhandler\v!flushright{\startmathbox\plusone }{\stopmathbox}
+\global\let\doflushformulalistentry\gobbleoneargument
-%D [The examples below are in english and don't process in the
-%D documentation style, which will be english some day.]
-%D
-%D Normally a formula is centered, but in case you want to
-%D align it left or right, you can set up formulas to behave
-%D that way. Normally a formula will adapt is left indentation
-%D to the environment:
-%D
-%D \startbuffer
-%D \fakewords{20}{40}\epar
-%D \startitemize
-%D \item \fakewords{20}{40}\epar
-%D \placeformula \startformula \fakeformula \stopformula
-%D \item \fakewords{20}{40}\epar
-%D \stopitemize
-%D \fakewords{20}{40}\epar
-%D \stopbuffer
-%D
-%D % \getbuffer
-%D
-%D In the next examples we explicitly align formulas to the
-%D left (\type {\raggedleft}), center and right (\type
-%D {\raggedright}):
-%D
-%D \startbuffer
-%D \setupformulas[align=left]
-%D \startformula\fakeformula\stopformula
-%D \setupformulas[align=middle]
-%D \startformula\fakeformula\stopformula
-%D \setupformulas[align=right]
-%D \startformula\fakeformula\stopformula
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D Or in print:
-%D
-%D % {\getbuffer}
-%D
-%D With formula numbers these formulas look as follows:
-%D
-%D \startbuffer
-%D \setupformulas[align=left]
-%D \placeformula \startformula\fakeformula\stopformula
-%D \setupformulas[align=middle]
-%D \placeformula \startformula\fakeformula\stopformula
-%D \setupformulas[align=right]
-%D \placeformula \startformula\fakeformula\stopformula
-%D \stopbuffer
-%D
-%D % {\getbuffer}
-%D
-%D This was keyed in as:
-%D
-%D \typebuffer
-%D
-%D When tracing is turned on (\type {\tracemathtrue}) you can
-%D visualize the bounding box of the formula,
-%D
-%D % {\tracemathtrue\getbuffer}
-%D
-%D As you can see, the dimensions are the natural ones, but if
-%D needed you can force a normalized line:
-%D
-%D \startbuffer
-%D \setupformulas[strut=yes]
-%D \placeformula \startformula \fakeformula \stopformula
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D This time we get a more spacy result.
-%D
-%D % {\tracemathtrue\getbuffer}
-%D
-%D We will now show a couple of more settings and combinations
-%D of settings. In centered formulas, the number takes no space
-%D
-%D \startbuffer
-%D \setupformulas[align=middle]
-%D \startformula \fakeformula \stopformula
-%D \placeformula \startformula \fakeformula \stopformula
-%D \stopbuffer
-%D
-%D \typebuffer % {\tracemathtrue\getbuffer}
-%D
-%D You can influence the placement of the whole box with the
-%D parameters \type {leftmargin} and \type {rightmargin}.
-%D
-%D \startbuffer
-%D \setupformulas[align=right,leftmargin=3em]
-%D \startformula \fakeformula \stopformula
-%D \placeformula \startformula \fakeformula \stopformula
-%D
-%D \setupformulas[align=left,rightmargin=1em]
-%D \startformula \fakeformula \stopformula
-%D \placeformula \startformula \fakeformula \stopformula
-%D \stopbuffer
-%D
-%D \typebuffer % {\tracemathtrue\getbuffer}
-%D
-%D You can also inherit the margin from the environment.
-%D
-%D \startbuffer
-%D \setupformulas[align=right,margin=standard]
-%D \startformula \fakeformula \stopformula
-%D \placeformula \startformula \fakeformula \stopformula
-%D \stopbuffer
-%D
-%D \typebuffer % {\tracemathtrue\getbuffer}
-%D
-%D The distance between the formula and the number is only
-%D applied when the formula is left or right aligned.
-%D
-%D \startbuffer
-%D \setupformulas[align=left,distance=2em]
-%D \startformula \fakeformula \stopformula
-%D \placeformula \startformula \fakeformula \stopformula
-%D \stopbuffer
-%D
-%D \typebuffer % {\tracemathtrue\getbuffer}
+\def\setformulalistentry#1%
+ {\gdef\doflushformulalistentry##1%
+ {\normalexpanded{\noexpand\writetolist[\v!formula]{##1}}{#1}%
+ \global\let\doflushformulalistentry\gobbleoneargument}}
\protect \endinput
diff --git a/tex/context/base/strc-not.mkiv b/tex/context/base/strc-not.mkiv
index c314fda9c..0d45ee59e 100644
--- a/tex/context/base/strc-not.mkiv
+++ b/tex/context/base/strc-not.mkiv
@@ -521,7 +521,7 @@
\begingroup
\doenumerationcheckconditions
\let\currentnote\currentdescriptionmain
- \dodescriptioncomponent[\c!reference=#1,\c!label={\descriptionparameter\c!text},\c!title={#3},\c!bookmark=,][]%
+ \dodescriptioncomponent[\c!reference=#1,\c!label={\descriptionparameter\c!text},\c!title={#3},\c!list=,\c!bookmark=,][]%
\xdef\currentnotenumber{\ctxlua{structure.notes.store("\currentnote",\currentdescriptionnumberentry)}}%
\settrue\processingnote
\ifconditional\skipnoteplacement
diff --git a/tex/context/base/strc-num.lua b/tex/context/base/strc-num.lua
index e07b59fc7..8165d0786 100644
--- a/tex/context/base/strc-num.lua
+++ b/tex/context/base/strc-num.lua
@@ -206,10 +206,12 @@ function counters.compact(name,level,onlynumbers)
local compact = { }
for i=1,level or #data do
local d = data[i]
+--~ print(name,i,d.number)
if d.number ~= 0 then
compact[i] = (onlynumbers and d.number) or d
end
end
+--~ print(table.serialize(compact))
return compact
end
end
@@ -294,7 +296,6 @@ function counters.reset(name,n)
savevalue(name,i)
d.number = d.start or 0
d.own = nil
---~ print("\n",name,d.number)
synchronize(name,d)
end
cd.numbers = nil
diff --git a/tex/context/base/strc-num.mkiv b/tex/context/base/strc-num.mkiv
index ac0c54e05..88b03a699 100644
--- a/tex/context/base/strc-num.mkiv
+++ b/tex/context/base/strc-num.mkiv
@@ -95,8 +95,6 @@
% \def\dostructurecounterparameter #1#2{\ifcsname#1#2\endcsname#1#2\else\expandafter\dostructurecounterparentparameter\csname#1\s!number\endcsname#2\fi}
% \def\dostructurecounterparentparameter#1#2{\ifx#1\relax\s!empty\else\dostructurecounterparameter#1#2\fi}
-%
-
\def\definestructurecounter
{\dodoubleempty\dodefinestructurecounter}
@@ -373,7 +371,7 @@
%
\doif{#3\c!title}\v!none{\setfalse\hasstructurecountercaption\setfalse\hasstructurecounternumber}% will become obsolete
%
- \ifx\hasstructurecounternumber\v!yes
+ \ifx\hasstructurecounternumber\v!yes % here due to previous test but best in callers
\doincrementsubstructurecounter[\currentcounter][\hasstructurecounterlevel]%
\fi
%
diff --git a/tex/context/base/strc-ref.mkiv b/tex/context/base/strc-ref.mkiv
index 71a4e2cbe..d54d75207 100644
--- a/tex/context/base/strc-ref.mkiv
+++ b/tex/context/base/strc-ref.mkiv
@@ -1017,8 +1017,8 @@
\def\extrareferencearguments{\luaconditional\highlighthyperlinks,\luaconditional\gotonewwindow,"\currentviewerlayer"}
-\unexpanded\def\directgoto {\ifconditional\uselocationstrut\expandafter\dodirectgoto\else\expandafter\directgotohtdp\fi}
-\unexpanded\def\goto {\ifconditional\uselocationstrut\expandafter\dogoto \else\expandafter\gotohtdp \fi}
+\unexpanded\def\directgoto{\ifconditional\uselocationstrut\expandafter\dodirectgoto\else\expandafter\directgotohtdp\fi}
+\unexpanded\def\goto {\ifconditional\uselocationstrut\expandafter\dogoto \else\expandafter\gotohtdp \fi}
% The unbox trick is needed in order to permit \par inside a reference. Otherwise
% the reference attribute migrates to the outer boxes.
@@ -1614,7 +1614,7 @@
\setbox\scratchbox\hbox{#1}% to be solved some day
\ifdim\wd\scratchbox>\zeropoint
\unhbox\scratchbox
- \@@rfseparator
+ \doifsomething\@@rfseparator{\removeunwantedspaces\@@rfseparator}% remove is new
\else
\unhbox\scratchbox
\fi
diff --git a/tex/context/base/strc-reg.lua b/tex/context/base/strc-reg.lua
index ac0426504..721d4300b 100644
--- a/tex/context/base/strc-reg.lua
+++ b/tex/context/base/strc-reg.lua
@@ -22,6 +22,8 @@ local sections = structure.sections
local documents = structure.documents
local pages = structure.pages
+local matching_till_depth, number_at_depth = sections.matching_till_depth, sections.number_at_depth
+
-- some day we will share registers and lists (although there are some conceptual
-- differences in the application of keywords)
@@ -122,8 +124,10 @@ local function filter_collected(names,criterium,number,collected,prevmode)
else -- sectionname, number
-- beware, this works ok for registers
local depth = sections.getlevel(criterium)
- local number = tonumber(number) or sections.number_at_depth(depth) or 0
- detail = format("depth: %s, number: %s, numbers: %s",depth,number,concat(sections.numbers(),".",1,depth))
+ local number = tonumber(number) or number_at_depth(depth) or 0
+ if trace_registers then
+ detail = format("depth: %s, number: %s, numbers: %s, startset: %s",depth,number,concat(sections.numbers(),".",1,depth),#collected)
+ end
if number > 0 then
for i=1,#collected do
local v = collected[i]
@@ -134,7 +138,7 @@ local function filter_collected(names,criterium,number,collected,prevmode)
local metadata = v.metadata
local cnumbers = sectionnumber.numbers
if cnumbers then
- if (all or hash[metadata.name or false]) and #cnumbers >= depth and sections.matching_till_depth(depth,cnumbers) then
+ if (all or hash[metadata.name or false]) and #cnumbers >= depth and matching_till_depth(depth,cnumbers) then
result[#result+1] = v
end
end
diff --git a/tex/context/base/strc-syn.mkiv b/tex/context/base/strc-syn.mkiv
index 2a1ef8558..7b3271591 100644
--- a/tex/context/base/strc-syn.mkiv
+++ b/tex/context/base/strc-syn.mkiv
@@ -317,7 +317,7 @@
\fi
\endgroup}
-\def\doinsertsort#1#2% name tag
+\unexpanded\def\doinsertsort#1#2% name tag
{\begingroup
% no kap currently, of .. we need to map cap onto WORD
\dosetsynonymattributes\c!style\c!color
diff --git a/tex/context/base/supp-mis.mkii b/tex/context/base/supp-mis.mkii
index 5b45d8b9d..f3bde453b 100644
--- a/tex/context/base/supp-mis.mkii
+++ b/tex/context/base/supp-mis.mkii
@@ -91,8 +91,7 @@
\ifnocontextobject \writestatus \do
- \def\writestatus#1#2%
- {\immediate\write16{#1 : #2}}
+ \def\writestatus#1#2{\immediate\write16{#1 : #2}}
\fi
@@ -704,6 +703,30 @@
\let\newconditional = \setfalse
\let\ifconditional = \ifcase
+%D We could load \type {norm-tex} but this takes less hash space:
+
+\let \normalif = \if
+\let \normalifcase = \ifcase
+\let \normalifcat = \ifcat
+\let \normalifdim = \ifdim
+\let \normalifeof = \ifeof
+\let \normaliffalse = \iffalse
+\let \normalifhbox = \ifhbox
+\let \normalifhmode = \ifhmode
+\let \normalifinner = \ifinner
+\let \normalifmmode = \ifmmode
+\let \normalifnum = \ifnum
+\let \normalifodd = \ifodd
+\let \normaliftrue = \iftrue
+\let \normalifvbox = \ifvbox
+\let \normalifvmode = \ifvmode
+\let \normalifvoid = \ifvoid
+\let \normalifx = \ifx
+\let \normalfi = \fi
+\let \normalelse = \else
+
+\let \normalunexpanded = \unexpanded % beware the primitive, not the context one
+
%D That's it. Please forget this junk and take a look at how
%D it should be done.
diff --git a/tex/context/base/syst-gen.mkii b/tex/context/base/syst-gen.mkii
index 65a501360..0367ba4fd 100644
--- a/tex/context/base/syst-gen.mkii
+++ b/tex/context/base/syst-gen.mkii
@@ -4435,7 +4435,15 @@
% \ifx\writestatus\undefined \let\writestatus\normalwritestatus \fi
% \ifx\writebanner\undefined \def\writebanner{\writestring} \fi
-\let\writestatus\normalwritestatus
+\ifx\normalwritestatus\undefined
+ % for use within latex
+ \ifx\writestatus\undefined
+ \def\writestatus#1#2{\immediate\write16{#1 : #2}}
+ \fi
+\else
+ \let\writestatus\normalwritestatus
+\fi
+
\def\writebanner{\writestring}
\writestatus{loading}{ConTeXt System Macros / General}
diff --git a/tex/context/base/task-ini.lua b/tex/context/base/task-ini.lua
index d00b4535a..a0d5bc32a 100644
--- a/tex/context/base/task-ini.lua
+++ b/tex/context/base/task-ini.lua
@@ -8,13 +8,15 @@ if not modules then modules = { } end modules ['task-ini'] = {
-- this is a temporary solution, we need to isolate some modules and then
-- the load order can determine the trickery to be applied to node lists
+--
+-- we can disable more handlers and enable then when really used (*)
tasks.appendaction("processors", "normalizers", "fonts.collections.process")
-tasks.appendaction("processors", "normalizers", "fonts.checkers.missing")
+tasks.appendaction("processors", "normalizers", "fonts.checkers.missing") -- *
-tasks.appendaction("processors", "characters", "chars.handle_mirroring")
-tasks.appendaction("processors", "characters", "chars.handle_casing")
-tasks.appendaction("processors", "characters", "chars.handle_breakpoints")
+tasks.appendaction("processors", "characters", "chars.handle_mirroring") -- *
+tasks.appendaction("processors", "characters", "chars.handle_casing") -- *
+tasks.appendaction("processors", "characters", "chars.handle_breakpoints") -- *
tasks.appendaction("processors", "characters", "scripts.preprocess")
tasks.appendaction("processors", "words", "kernel.hyphenation")
@@ -26,26 +28,29 @@ tasks.appendaction("processors", "fonts", "nodes.protect_glyphs", nil, "no
tasks.appendaction("processors", "fonts", "kernel.ligaturing")
tasks.appendaction("processors", "fonts", "kernel.kerning")
-tasks.appendaction("processors", "lists", "lists.handle_spacing")
-tasks.appendaction("processors", "lists", "lists.handle_kerning")
+tasks.appendaction("processors", "lists", "lists.handle_spacing") -- *
+tasks.appendaction("processors", "lists", "lists.handle_kerning") -- *
tasks.appendaction("shipouts", "normalizers", "nodes.cleanup_page")
-tasks.appendaction("shipouts", "normalizers", "nodes.add_references")
-tasks.appendaction("shipouts", "normalizers", "nodes.add_destinations")
+tasks.appendaction("shipouts", "normalizers", "nodes.add_references") -- *
+tasks.appendaction("shipouts", "normalizers", "nodes.add_destinations") -- *
+tasks.appendaction("shipouts", "normalizers", "nodes.rules.process") -- *
+
+tasks.disableaction("shipouts", "nodes.rules.process") -- * only kick in when used
tasks.appendaction("shipouts", "finishers", "shipouts.handle_color")
tasks.appendaction("shipouts", "finishers", "shipouts.handle_transparency")
tasks.appendaction("shipouts", "finishers", "shipouts.handle_colorintent")
-tasks.appendaction("shipouts", "finishers", "shipouts.handle_negative")
-tasks.appendaction("shipouts", "finishers", "shipouts.handle_effect")
-tasks.appendaction("shipouts", "finishers", "shipouts.handle_viewerlayer")
+tasks.appendaction("shipouts", "finishers", "shipouts.handle_negative") -- *
+tasks.appendaction("shipouts", "finishers", "shipouts.handle_effect") -- *
+tasks.appendaction("shipouts", "finishers", "shipouts.handle_viewerlayer") -- *
tasks.appendaction("math", "normalizers", "noads.relocate_characters", nil, "nohead")
-tasks.appendaction("math", "normalizers", "noads.resize_characters", nil, "nohead")
-tasks.appendaction("math", "normalizers", "noads.respace_characters", nil, "nohead")
+tasks.appendaction("math", "normalizers", "noads.resize_characters", nil, "nohead")
+tasks.appendaction("math", "normalizers", "noads.respace_characters", nil, "nohead")
tasks.appendaction("math", "builders", "noads.mlist_to_hlist")
-- quite experimental
-tasks.appendaction("finalizers", "lists", "nodes.repackage_graphicvadjust")
+tasks.appendaction("finalizers", "lists", "nodes.repackage_graphicvadjust") -- *
diff --git a/tex/context/interface/cont-cs.xml b/tex/context/interface/cont-cs.xml
index f8dc85a84..c50d3c5d5 100644
--- a/tex/context/interface/cont-cs.xml
+++ b/tex/context/interface/cont-cs.xml
@@ -1034,6 +1034,11 @@
+
+
+
+
+
@@ -1244,7 +1249,7 @@
-
+
@@ -1253,7 +1258,7 @@
-
+
@@ -1262,7 +1267,7 @@
-
+
@@ -1271,7 +1276,7 @@
-
+
@@ -1280,7 +1285,7 @@
-
+
@@ -1289,7 +1294,7 @@
-
+
diff --git a/tex/context/interface/cont-de.xml b/tex/context/interface/cont-de.xml
index aeb0a4acd..2aa738ed1 100644
--- a/tex/context/interface/cont-de.xml
+++ b/tex/context/interface/cont-de.xml
@@ -1034,6 +1034,11 @@
+
+
+
+
+
@@ -1244,7 +1249,7 @@
-
+
@@ -1253,7 +1258,7 @@
-
+
@@ -1262,7 +1267,7 @@
-
+
@@ -1271,7 +1276,7 @@
-
+
@@ -1280,7 +1285,7 @@
-
+
@@ -1289,7 +1294,7 @@
-
+
diff --git a/tex/context/interface/cont-en.xml b/tex/context/interface/cont-en.xml
index 95e8a4ab9..f2cf7f7b8 100644
--- a/tex/context/interface/cont-en.xml
+++ b/tex/context/interface/cont-en.xml
@@ -1034,6 +1034,11 @@
+
+
+
+
+
diff --git a/tex/context/interface/cont-fr.xml b/tex/context/interface/cont-fr.xml
index 3e6df06ed..81baacff3 100644
--- a/tex/context/interface/cont-fr.xml
+++ b/tex/context/interface/cont-fr.xml
@@ -1034,6 +1034,11 @@
+
+
+
+
+
@@ -1244,7 +1249,7 @@
-
+
@@ -1253,7 +1258,7 @@
-
+
@@ -1280,7 +1285,7 @@
-
+
@@ -1289,7 +1294,7 @@
-
+
diff --git a/tex/context/interface/cont-it.xml b/tex/context/interface/cont-it.xml
index c670feb92..058e71735 100644
--- a/tex/context/interface/cont-it.xml
+++ b/tex/context/interface/cont-it.xml
@@ -1034,6 +1034,11 @@
+
+
+
+
+
@@ -1244,7 +1249,7 @@
-
+
@@ -1253,7 +1258,7 @@
-
+
@@ -1262,7 +1267,7 @@
-
+
@@ -1271,7 +1276,7 @@
-
+
@@ -1280,7 +1285,7 @@
-
+
@@ -1289,7 +1294,7 @@
-
+
diff --git a/tex/context/interface/cont-nl.xml b/tex/context/interface/cont-nl.xml
index 3c3fbca5f..ebb29402f 100644
--- a/tex/context/interface/cont-nl.xml
+++ b/tex/context/interface/cont-nl.xml
@@ -1034,6 +1034,11 @@
+
+
+
+
+
@@ -1244,7 +1249,7 @@
-
+
@@ -1253,7 +1258,7 @@
-
+
@@ -1262,7 +1267,7 @@
-
+
@@ -1271,7 +1276,7 @@
-
+
@@ -1280,7 +1285,7 @@
-
+
@@ -1289,7 +1294,7 @@
-
+
diff --git a/tex/context/interface/cont-pe.xml b/tex/context/interface/cont-pe.xml
index 3b1f8c6c0..5a86933a8 100644
--- a/tex/context/interface/cont-pe.xml
+++ b/tex/context/interface/cont-pe.xml
@@ -1034,6 +1034,11 @@
+
+
+
+
+
@@ -1244,7 +1249,7 @@
-
+
@@ -1253,7 +1258,7 @@
-
+
@@ -1262,7 +1267,7 @@
-
+
@@ -1271,7 +1276,7 @@
-
+
@@ -1280,7 +1285,7 @@
-
+
@@ -1289,7 +1294,7 @@
-
+
diff --git a/tex/context/interface/cont-ro.xml b/tex/context/interface/cont-ro.xml
index e63ca67d1..17e914725 100644
--- a/tex/context/interface/cont-ro.xml
+++ b/tex/context/interface/cont-ro.xml
@@ -1034,6 +1034,11 @@
+
+
+
+
+
@@ -1244,7 +1249,7 @@
-
+
@@ -1253,7 +1258,7 @@
-
+
@@ -1262,7 +1267,7 @@
-
+
@@ -1271,7 +1276,7 @@
-
+
@@ -1280,7 +1285,7 @@
-
+
@@ -1289,7 +1294,7 @@
-
+
diff --git a/tex/context/interface/keys-cs.xml b/tex/context/interface/keys-cs.xml
index 45c7a0889..983aff19f 100644
--- a/tex/context/interface/keys-cs.xml
+++ b/tex/context/interface/keys-cs.xml
@@ -328,8 +328,12 @@
+
+
+
+
@@ -483,6 +487,8 @@
+
+
@@ -793,6 +799,7 @@
+
@@ -923,6 +930,7 @@
+
@@ -1314,10 +1322,6 @@
-
-
-
-
@@ -1652,8 +1656,6 @@
-
-
diff --git a/tex/context/interface/keys-de.xml b/tex/context/interface/keys-de.xml
index a9c03ff60..b4047a7b9 100644
--- a/tex/context/interface/keys-de.xml
+++ b/tex/context/interface/keys-de.xml
@@ -328,8 +328,12 @@
+
+
+
+
@@ -483,6 +487,8 @@
+
+
@@ -793,6 +799,7 @@
+
@@ -923,6 +930,7 @@
+
@@ -1314,10 +1322,6 @@
-
-
-
-
@@ -1652,8 +1656,6 @@
-
-
diff --git a/tex/context/interface/keys-en.xml b/tex/context/interface/keys-en.xml
index 69a4ff610..e6495fef8 100644
--- a/tex/context/interface/keys-en.xml
+++ b/tex/context/interface/keys-en.xml
@@ -328,8 +328,12 @@
+
+
+
+
@@ -483,6 +487,8 @@
+
+
@@ -793,6 +799,7 @@
+
@@ -923,6 +930,7 @@
+
@@ -1314,10 +1322,6 @@
-
-
-
-
@@ -1652,8 +1656,6 @@
-
-
diff --git a/tex/context/interface/keys-fr.xml b/tex/context/interface/keys-fr.xml
index 8c986b2c3..351d674f4 100644
--- a/tex/context/interface/keys-fr.xml
+++ b/tex/context/interface/keys-fr.xml
@@ -328,8 +328,12 @@
+
+
+
+
@@ -483,6 +487,8 @@
+
+
@@ -793,6 +799,7 @@
+
@@ -923,6 +930,7 @@
+
@@ -1314,10 +1322,6 @@
-
-
-
-
@@ -1652,8 +1656,6 @@
-
-
diff --git a/tex/context/interface/keys-it.xml b/tex/context/interface/keys-it.xml
index 7693cce38..e7766a5d5 100644
--- a/tex/context/interface/keys-it.xml
+++ b/tex/context/interface/keys-it.xml
@@ -328,8 +328,12 @@
+
+
+
+
@@ -483,6 +487,8 @@
+
+
@@ -793,6 +799,7 @@
+
@@ -923,6 +930,7 @@
+
@@ -1314,10 +1322,6 @@
-
-
-
-
@@ -1652,8 +1656,6 @@
-
-
diff --git a/tex/context/interface/keys-nl.xml b/tex/context/interface/keys-nl.xml
index c2dd09597..57d02af27 100644
--- a/tex/context/interface/keys-nl.xml
+++ b/tex/context/interface/keys-nl.xml
@@ -328,8 +328,12 @@
+
+
+
+
@@ -483,6 +487,8 @@
+
+
@@ -793,6 +799,7 @@
+
@@ -923,6 +930,7 @@
+
@@ -1314,10 +1322,6 @@
-
-
-
-
@@ -1652,8 +1656,6 @@
-
-
diff --git a/tex/context/interface/keys-pe.xml b/tex/context/interface/keys-pe.xml
index 1e49026f2..308798af0 100644
--- a/tex/context/interface/keys-pe.xml
+++ b/tex/context/interface/keys-pe.xml
@@ -328,8 +328,12 @@
+
+
+
+
@@ -483,6 +487,8 @@
+
+
@@ -793,6 +799,7 @@
+
@@ -923,6 +930,7 @@
+
@@ -1314,10 +1322,6 @@
-
-
-
-
@@ -1652,8 +1656,6 @@
-
-
diff --git a/tex/context/interface/keys-ro.xml b/tex/context/interface/keys-ro.xml
index 5e1c87f8b..2f145b4ea 100644
--- a/tex/context/interface/keys-ro.xml
+++ b/tex/context/interface/keys-ro.xml
@@ -328,8 +328,12 @@
+
+
+
+
@@ -483,6 +487,8 @@
+
+
@@ -793,6 +799,7 @@
+
@@ -923,6 +930,7 @@
+
@@ -1314,10 +1322,6 @@
-
-
-
-
@@ -1652,8 +1656,6 @@
-
-
diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua
index 080f31744..875f03d8f 100644
--- a/tex/generic/context/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : c:/data/develop/context/texmf/tex/generic/context/luatex-fonts-merged.lua
-- parent file : c:/data/develop/context/texmf/tex/generic/context/luatex-fonts.lua
--- merge date : 11/02/09 21:36:28
+-- merge date : 11/07/09 18:04:39
do -- begin closure to overcome local limits and interference
@@ -539,7 +539,7 @@ table.join = table.concat
local concat, sort, insert, remove = table.concat, table.sort, table.insert, table.remove
local format, find, gsub, lower, dump = string.format, string.find, string.gsub, string.lower, string.dump
local getmetatable, setmetatable = getmetatable, setmetatable
-local type, next, tostring, ipairs = type, next, tostring, ipairs
+local type, next, tostring, tonumber, ipairs, pairs = type, next, tostring, tonumber, ipairs, pairs
function table.strip(tab)
local lst = { }
@@ -874,7 +874,7 @@ local function do_serialize(root,name,depth,level,indexed)
handle(format("%s %s,",depth,v))
end
elseif t == "string" then
- if reduce and (find(v,"^[%-%+]?[%d]-%.?[%d+]$") == 1) then
+ if reduce and tonumber(v) then
handle(format("%s %s,",depth,v))
else
handle(format("%s %q,",depth,v))
@@ -933,7 +933,7 @@ local function do_serialize(root,name,depth,level,indexed)
end
end
elseif t == "string" then
- if reduce and (find(v,"^[%-%+]?[%d]-%.?[%d+]$") == 1) then
+ if reduce and tonumber(v) then
--~ handle(format("%s %s=%s,",depth,key(k),v))
if type(k) == "number" then -- or find(k,"^%d+$") then
if hexify then
@@ -3248,6 +3248,18 @@ function fonts.show_font_parameters()
end
end
+local dimenfactors = number.dimenfactors
+
+function fonts.dimenfactor(unit,tfmdata)
+ if unit == "ex" then
+ return tfmdata.parameters.x_height
+ elseif unit == "em" then
+ return tfmdata.parameters.em_height
+ else
+ return dimenfactors[unit] or unit
+ end
+end
+
end -- closure
do -- begin closure to overcome local limits and interference
@@ -3814,6 +3826,9 @@ end
if not t.psname then
t.psname = t.fullname -- else bad luck
end
+ if trace_defining then
+ logs.report("define font","used for subsetting: %s ",t.fullname or "nofullname")
+ end
return t, delta
end
@@ -5215,6 +5230,7 @@ local trace_dynamics = false trackers.register("otf.dynamics", function(v
local trace_sequences = false trackers.register("otf.sequences", function(v) trace_sequences = v end)
local trace_math = false trackers.register("otf.math", function(v) trace_math = v end)
local trace_unimapping = false trackers.register("otf.unimapping", function(v) trace_unimapping = v end)
+local trace_defining = false trackers.register("fonts.defining", function(v) trace_defining = v end)
--~ trackers.enable("otf.loading")
@@ -5465,6 +5481,9 @@ function otf.load(filename,format,sub,featurefile)
end
end
if data then
+ if trace_defining then
+ logs.report("define font","loading from cache: %s",hash)
+ end
otf.enhance("unpack",data,filename,false) -- no message here
otf.add_dimensions(data)
if trace_sequences then
@@ -7662,16 +7681,29 @@ end
local function toligature(kind,lookupname,start,stop,char,markflag,discfound) -- brr head
if start ~= stop then
+--~ if discfound then
+--~ local lignode = copy_node(start)
+--~ lignode.font = start.font
+--~ lignode.char = char
+--~ lignode.subtype = 2
+--~ start = node.do_ligature_n(start, stop, lignode)
+--~ if start.id == disc then
+--~ local prev = start.prev
+--~ start = start.next
+--~ end
if discfound then
+ -- print("start->stop",nodes.tosequence(start,stop))
local lignode = copy_node(start)
- lignode.font = start.font
- lignode.char = char
- lignode.subtype = 2
- start = node.do_ligature_n(start, stop, lignode)
- if start.id == disc then
- local prev = start.prev
- start = start.next
- end
+ lignode.font, lignode.char, lignode.subtype = start.font, char, 2
+ local next, prev = stop.next, start.prev
+ stop.next = nil
+ lignode = node.do_ligature_n(start, stop, lignode)
+ prev.next = lignode
+ if next then
+ next.prev = lignode
+ end
+ lignode.next, lignode.prev = next, prev
+ -- print("start->end",nodes.tosequence(start))
else -- start is the ligature
local deletemarks = markflag ~= "mark"
local n = copy_node(start)
--
cgit v1.2.3