diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-08-24 20:15:46 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-08-24 20:15:46 +0200 |
commit | 9c25133c75ad4c533cd66a26243173de11ee461b (patch) | |
tree | e73042a06ef733736a25f1f297d10ffe6ff23d2f /tex | |
parent | 7fbe8caaed88379118eb18afea42c0d75297fdca (diff) | |
download | context-9c25133c75ad4c533cd66a26243173de11ee461b.tar.gz |
2017-08-24 19:52:00
Diffstat (limited to 'tex')
-rw-r--r-- | tex/context/base/mkii/cont-new.mkii | 2 | ||||
-rw-r--r-- | tex/context/base/mkii/context.mkii | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/cont-new.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/context.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/math-noa.lua | 147 | ||||
-rw-r--r-- | tex/context/base/mkiv/publ-dat.lua | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/publ-imp-apa.lua | 13 | ||||
-rw-r--r-- | tex/context/base/mkiv/publ-imp-apa.mkvi | 43 | ||||
-rw-r--r-- | tex/context/base/mkiv/publ-imp-default.lua | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/status-files.pdf | bin | 25767 -> 25754 bytes | |||
-rw-r--r-- | tex/context/base/mkiv/status-lua.pdf | bin | 426428 -> 426428 bytes | |||
-rw-r--r-- | tex/context/base/mkiv/trac-vis.lua | 90 | ||||
-rw-r--r-- | tex/context/interface/mkiv/i-context.pdf | bin | 818428 -> 818407 bytes | |||
-rw-r--r-- | tex/context/interface/mkiv/i-readme.pdf | bin | 60775 -> 60775 bytes | |||
-rw-r--r-- | tex/generic/context/luatex/luatex-fonts-merged.lua | 2 |
15 files changed, 150 insertions, 157 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index 492911707..8098667dc 100644 --- a/tex/context/base/mkii/cont-new.mkii +++ b/tex/context/base/mkii/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2017.08.15 12:35} +\newcontextversion{2017.08.24 19:46} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/mkii/context.mkii b/tex/context/base/mkii/context.mkii index 8028a2587..5fcab9b9c 100644 --- a/tex/context/base/mkii/context.mkii +++ b/tex/context/base/mkii/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2017.08.15 12:35} +\edef\contextversion{2017.08.24 19:46} %D For those who want to use this: diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index a2bb4bb2b..766365d84 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2017.08.15 12:35} +\newcontextversion{2017.08.24 19:46} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index 87dfa448f..9d3a6be89 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -41,7 +41,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2017.08.15 12:35} +\edef\contextversion{2017.08.24 19:46} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/mkiv/math-noa.lua b/tex/context/base/mkiv/math-noa.lua index 048d51d1e..532e293b9 100644 --- a/tex/context/base/mkiv/math-noa.lua +++ b/tex/context/base/mkiv/math-noa.lua @@ -1695,86 +1695,49 @@ do end end --- local function movesubscript(parent,current_nucleus,current_char,new_char) --- local prev = getprev(parent) --- if prev and getid(prev) == math_noad then --- local psup = getsup(prev) --- local psub = getsub(prev) --- if not psup and not psub then --- -- {f} {'}_n => f_n^' --- fixsupscript(prev,current_nucleus,current_char,new_char) --- local nucleus = getnucleus(parent) --- local sub = getsub(parent) --- setsup(prev,nucleus) --- setsub(prev,sub) --- local dummy = copy_node(nucleus) --- setchar(dummy,0) --- setnucleus(parent,dummy) --- setsub(parent) --- elseif not psup then --- -- {f} {'}_n => f_n^' --- fixsupscript(prev,current_nucleus,current_char,new_char) --- local nucleus = getnucleus(parent) --- setsup(prev,nucleus) --- local dummy = copy_node(nucleus) --- setchar(dummy,0) --- setnucleus(parent,dummy) --- end --- end --- end - --- fixscripts[math_char] = function(pointer,what,n,parent,nested) -- todo: switch to turn in on and off --- if parent then --- local nucleus = getnucleus(parent) --- if getid(nucleus) == math_char then --- local sub = getsub(parent) --- local sup = getsup(parent) --- if sup and getid(sup) == math_char then --- local oldchar = getchar(sup) --- local newchar = movesub[oldchar] --- if newchar then --- fixsupscript(parent,sup,oldchar,newchar) --- end --- end --- if sub then --- local oldchar = getchar(nucleus) --- local newchar = movesub[oldchar] --- if newchar then --- movesubscript(parent,nucleus,oldchar,newchar) --- end --- end --- end --- end --- end - - -- move this inline - - local function movesubscript(parent,current_nucleus,oldchar,newchar) - local prev = getprev(parent) - if prev and getid(prev) == math_noad then - local psup = getsup(prev) - local psub = getsub(prev) - if not psup and not psub then - -- {f} {'}_n => f_n^' - fixsupscript(prev,current_nucleus,oldchar,newchar) - local nucleus = getnucleus(parent) - local sub = getsub(parent) - setsup(prev,nucleus) - setsub(prev,sub) - local dummy = copy_node(nucleus) - setchar(dummy,0) - setnucleus(parent,dummy) - setsub(parent) - elseif not psup then - -- {f} {'}_n => f_n^' - fixsupscript(prev,current_nucleus,oldchar,newchar) - local nucleus = getnucleus(parent) - setsup(prev,nucleus) - local dummy = copy_node(nucleus) - setchar(dummy,0) - setnucleus(parent,dummy) - end - end + -- local function movesubscript(parent,current_nucleus,oldchar,newchar) + -- local prev = getprev(parent) + -- if prev and getid(prev) == math_noad then + -- local psup = getsup(prev) + -- local psub = getsub(prev) + -- if not psup and not psub then + -- fixsupscript(prev,current_nucleus,oldchar,newchar) + -- local nucleus = getnucleus(parent) + -- local sub = getsub(parent) + -- setsup(prev,nucleus) + -- setsub(prev,sub) + -- local dummy = copy_node(nucleus) + -- setchar(dummy,0) + -- setnucleus(parent,dummy) + -- setsub(parent) + -- elseif not psup then + -- fixsupscript(prev,current_nucleus,oldchar,newchar) + -- local nucleus = getnucleus(parent) + -- setsup(prev,nucleus) + -- local dummy = copy_node(nucleus) + -- setchar(dummy,0) + -- setnucleus(parent,dummy) + -- end + -- end + -- end + + local function move_none_none(parent,prev,nuc,oldchar,newchar) + fixsupscript(prev,nuc,oldchar,newchar) + local sub = getsub(parent) + setsup(prev,nuc) + setsub(prev,sub) + local dummy = copy_node(nuc) + setchar(dummy,0) + setnucleus(parent,dummy) + setsub(parent) + end + + local function move_none_psub(parent,prev,nuc,oldchar,newchar) + fixsupscript(prev,nuc,oldchar,newchar) + setsup(prev,nuc) + local dummy = copy_node(nuc) + setchar(dummy,0) + setnucleus(parent,dummy) end fixscripts[math_char] = function(pointer,what,n,parent,nested) -- todo: switch to turn in on and off @@ -1788,12 +1751,12 @@ do local sup = getsup(pointer) if sub then if sup then --- print("[char] sub sup") + -- print("[char] sub sup") else --- print("[char] sub ---") + -- print("[char] sub ---") end elseif sup then --- print("[char] --- sup") + -- print("[char] --- sup") else local prev = getprev(parent) if prev and getid(prev) == math_noad then @@ -1801,25 +1764,23 @@ do local psup = getsup(prev) if psub then if psup then --- print("sub sup [char] --- ---") + -- print("sub sup [char] --- ---") else - -- {f} {'}_n => f_n^' --- print("sub --- [char] --- ---") - movesubscript(parent,nuc,oldchar,newchar) + -- print("sub --- [char] --- ---") + move_none_psub(parent,prev,nuc,oldchar,newchar) end elseif psup then --- print("--- sup [char] --- ---") + -- print("--- sup [char] --- ---") else - -- {f} {'}_n => f_n^' --- print("[char] --- ---") - movesubscript(parent,nuc,oldchar,newchar) + -- print("[char] --- ---") + move_none_none(parent,prev,nuc,oldchar,newchar) end else --- print("no prev [char]") + -- print("no prev [char]") end end else --- print("[char]") + -- print("[char]") end end end diff --git a/tex/context/base/mkiv/publ-dat.lua b/tex/context/base/mkiv/publ-dat.lua index e2a31354f..0bddad216 100644 --- a/tex/context/base/mkiv/publ-dat.lua +++ b/tex/context/base/mkiv/publ-dat.lua @@ -140,7 +140,7 @@ local virtuals = allocate { local defaulttypes = allocate { author = "author", editor = "author", - publisher = "author", + -- publisher = "author", page = "pagenumber", pages = "pagenumber", keywords = "keyword", diff --git a/tex/context/base/mkiv/publ-imp-apa.lua b/tex/context/base/mkiv/publ-imp-apa.lua index 79686447d..65dee0717 100644 --- a/tex/context/base/mkiv/publ-imp-apa.lua +++ b/tex/context/base/mkiv/publ-imp-apa.lua @@ -84,11 +84,11 @@ local categories = specification.categories categories.article = { sets = { - author = { "author", "editor", "title" }, + author = { "author", "organization", "editor", "title" }, doi = generic.doi, }, required = { - "author" + "author", -- a set }, optional = { "withauthor", "translator", @@ -96,6 +96,13 @@ categories.article = { "subtitle", "type", "file", "journal", "volume", "number", "pages", "doi", "note", + -- APA ignores this: + -- + -- "month", + -- + -- fields defined in jabref but presently ignored: + -- + -- "issn", }, } @@ -183,7 +190,7 @@ categories.book = { categories.inbook = { sets = { - author = { "author", "editor", "publisher", "title", }, + author = { "author", "organization", "editor", "publisher", "title", }, ineditor = { "editor" }, editionset = generic.editionset, doi = generic.doi, diff --git a/tex/context/base/mkiv/publ-imp-apa.mkvi b/tex/context/base/mkiv/publ-imp-apa.mkvi index 5576b47f8..0a166576d 100644 --- a/tex/context/base/mkiv/publ-imp-apa.mkvi +++ b/tex/context/base/mkiv/publ-imp-apa.mkvi @@ -310,7 +310,7 @@ \c!etallimit=5, \c!etaldisplay=1, % TODO: when 2-4, show all first time, etaldisplay subsequently... \c!authorconversion=\v!name, - \c!sorttype=\v!normal, + \c!sorttype=normal, % \v!normal ? \c!style=, \c!compress=\v!yes, % note that cite sorts only work with compress=yes. \c!separator:names:3={\btxcomma\btxlabeltext{and}\space}, % not \textampersand @@ -833,6 +833,14 @@ \btxdoifelse {year} { \btxflush{year} \btxflushsuffix + \btxdoif {month} { % month and day optional in publ-imp-apa.lua + \btxcomma + \btxflush{month} + \btxdoif {day} { + \btxspace + \btxflush{day} + } + } } { \fastsetup{btx:apa:nd} % Hans: the following won't work but should. @@ -1180,21 +1188,25 @@ \removeunwantedspaces \stoptexdefinition +\starttexdefinition unexpanded btx:apa:type + \btxdoif {type} { + \btxleftbracket + \btxflush{type} + \btxrightbracketperiod + } +\stoptexdefinition + % Then setups, by category % An article from a journal -% Required fields: author or editor or title, journal, (year). +% Required fields: author or organization or editor or title, journal, (year). % Optional fields: volume, number, pages, type, doi, url, note. % Note that bibtex (and tools) do not include editor (e.g. special issue or section) \startsetups btx:apa:list:article \texdefinition{btx:apa:authoryear} \texdefinition{btx:apa:title-if-not-placed} - \btxdoif {type} { - \btxleftbracket - \btxflush{type} - \btxrightbracketperiod - } + \texdefinition{btx:apa:type} \texdefinition{btx:apa:journal-volume-number-pages} \texdefinition{btx:apa:url-doi-note} \stopsetups @@ -1245,6 +1257,7 @@ \startsetups btx:apa:list:book \texdefinition{btx:apa:authoryear} \texdefinition{btx:apa:title-if-not-placed} + \texdefinition{btx:apa:type} \texdefinition{btx:apa:editionset} \texdefinition{btx:apa:wherefrom-publisher} \texdefinition{btx:apa:url-doi-note} @@ -1262,6 +1275,7 @@ \startsetups btx:apa:list:inbook \texdefinition{btx:apa:authoryear} \texdefinition{btx:apa:title-if-not-placed} + \texdefinition{btx:apa:type} \texdefinition{btx:apa:editor-in} \texdefinition{btx:apa:editionset} \texdefinition{btx:apa:wherefrom-publisher} @@ -1397,7 +1411,11 @@ \btxflush{nationality} } \btxspace - \btxlabeltext{patent} + \btxdoifelse{type}{ + \btxflush{type} + }{ + \btxlabeltext{patent} + } \btxdoif {number} { \btxspace \btxlabeltext{apa:number} @@ -1422,6 +1440,7 @@ \startsetups btx:apa:list:electronic \texdefinition{btx:apa:authoryear} \texdefinition{btx:apa:title-if-not-placed} + \texdefinition{btx:apa:type} \texdefinition{btx:apa:organization-if-not-author} \btxdoif {howpublished} { \btxspace @@ -1473,11 +1492,7 @@ \btxperiod } } - \btxdoif {type} { - \btxleftbracket - \btxflush{type} - \btxrightbracketperiod - } + \texdefinition{btx:apa:type} \texdefinition{btx:apa:wherefrom-publisher} \texdefinition{btx:apa:url-doi-note} \stopsetups @@ -1490,7 +1505,7 @@ \fastsetup{btx:apa:list:book} \stopsetups -% Use this type when nothing else fits. +% Use this category when nothing else fits. % Required fields: none. % Optional fields: author, title, howpublished, month, year, note. diff --git a/tex/context/base/mkiv/publ-imp-default.lua b/tex/context/base/mkiv/publ-imp-default.lua index 61b08f30c..28f5bb316 100644 --- a/tex/context/base/mkiv/publ-imp-default.lua +++ b/tex/context/base/mkiv/publ-imp-default.lua @@ -109,11 +109,11 @@ return { editionset = { "edition", "volume", "number" }, }, required = { - "author", -- a set "title", "year", }, optional = { + "author", -- a set "subtitle", "keywords", "publisher", "address", diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex 4a5cf0260..4d352df22 100644 --- a/tex/context/base/mkiv/status-files.pdf +++ b/tex/context/base/mkiv/status-files.pdf diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf Binary files differindex f3bc68b12..f9f65510e 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkiv/trac-vis.lua b/tex/context/base/mkiv/trac-vis.lua index c4a9d90bb..e60eb1443 100644 --- a/tex/context/base/mkiv/trac-vis.lua +++ b/tex/context/base/mkiv/trac-vis.lua @@ -137,35 +137,37 @@ local trace_math local trace_italic local trace_discretionary local trace_expansion +local trace_line local report_visualize = logs.reporter("visualize") local modes = { - hbox = 1, - vbox = 2, - vtop = 4, - kern = 8, - glue = 16, - -- skip = 16, - penalty = 32, - fontkern = 64, - strut = 128, - whatsit = 256, - glyph = 512, - simple = 1024, - simplehbox = 1024 + 1, - simplevbox = 1024 + 2, - simplevtop = 1024 + 4, - user = 2048, - math = 4096, - italic = 8192, - origin = 16384, - discretionary = 32768, - expansion = 65536, + hbox = 1, + vbox = 2, + vtop = 4, + kern = 8, + glue = 16, + -- skip = 16, + penalty = 32, + fontkern = 64, + strut = 128, + whatsit = 256, + glyph = 512, + simple = 1024, + simplehbox = 1024 + 1, + simplevbox = 1024 + 2, + simplevtop = 1024 + 4, + user = 2048, + math = 4096, + italic = 8192, + origin = 16384, + discretionary = 32768, + expansion = 65536, + line = 131072, } local usedfont, exheight, emwidth -local l_penalty, l_glue, l_kern, l_fontkern, l_hbox, l_vbox, l_vtop, l_strut, l_whatsit, l_glyph, l_user, l_math, l_italic, l_origin, l_discretionary, l_expansion +local l_penalty, l_glue, l_kern, l_fontkern, l_hbox, l_vbox, l_vtop, l_strut, l_whatsit, l_glyph, l_user, l_math, l_italic, l_origin, l_discretionary, l_expansion, l_line local enabled = false local layers = { } @@ -218,6 +220,7 @@ local function enable() l_origin = layers.origin l_discretionary = layers.discretionary l_expansion = layers.expansion + l_line = layers.line enableaction("shipouts","nodes.visualizers.handler") report_visualize("enabled") enabled = true @@ -1098,6 +1101,9 @@ do local italic_kern_code = kerncodes.italiccorrection ----- user_kern_code = kerncodes.userkern + local listcodes = nodes.listcodes + local line_code = listcodes.line + local function visualize(head,vertical,forced,parent) local trace_hbox = false local trace_vbox = false @@ -1145,24 +1151,26 @@ do trace_origin = false trace_discretionary = false trace_expansion = false + trace_line = false else -- dead slow: - trace_hbox = hasbit(a, 1) - trace_vbox = hasbit(a, 2) - trace_vtop = hasbit(a, 4) - trace_kern = hasbit(a, 8) - trace_glue = hasbit(a, 16) - trace_penalty = hasbit(a, 32) - trace_fontkern = hasbit(a, 64) - trace_strut = hasbit(a, 128) - trace_whatsit = hasbit(a, 256) - trace_glyph = hasbit(a, 512) - trace_simple = hasbit(a, 1024) - trace_user = hasbit(a, 2048) - trace_math = hasbit(a, 4096) - trace_italic = hasbit(a, 8192) - trace_origin = hasbit(a,16384) - trace_discretionary = hasbit(a,32768) - trace_expansion = hasbit(a,65536) + trace_hbox = hasbit(a, 1) + trace_vbox = hasbit(a, 2) + trace_vtop = hasbit(a, 4) + trace_kern = hasbit(a, 8) + trace_glue = hasbit(a, 16) + trace_penalty = hasbit(a, 32) + trace_fontkern = hasbit(a, 64) + trace_strut = hasbit(a, 128) + trace_whatsit = hasbit(a, 256) + trace_glyph = hasbit(a, 512) + trace_simple = hasbit(a, 1024) + trace_user = hasbit(a, 2048) + trace_math = hasbit(a, 4096) + trace_italic = hasbit(a, 8192) + trace_origin = hasbit(a, 16384) + trace_discretionary = hasbit(a, 32768) + trace_expansion = hasbit(a, 65536) + trace_line = hasbit(a,131072) end attr = a end @@ -1226,7 +1234,9 @@ do if content then setlist(current,visualize(content,false,nil,current)) end - if trace_hbox then + if trace_line and getsubtype(current) == line_code then + head, current = ruledbox(head,current,false,l_line,"L__",trace_simple,previous,trace_origin,parent) + elseif trace_hbox then head, current = ruledbox(head,current,false,l_hbox,"H__",trace_simple,previous,trace_origin,parent) end elseif id == vlist_code then diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf Binary files differindex e41fad23a..88893e247 100644 --- a/tex/context/interface/mkiv/i-context.pdf +++ b/tex/context/interface/mkiv/i-context.pdf diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf Binary files differindex 941475404..4e8e40644 100644 --- a/tex/context/interface/mkiv/i-readme.pdf +++ b/tex/context/interface/mkiv/i-readme.pdf diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index ad9371829..3ff8349b6 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua --- merge date : 08/15/17 12:35:38 +-- merge date : 08/24/17 19:46:30 do -- begin closure to overcome local limits and interference |