diff options
Diffstat (limited to 'tex')
-rw-r--r-- | tex/context/base/cont-new.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/context-version.pdf | bin | 4431 -> 4436 bytes | |||
-rw-r--r-- | tex/context/base/context.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/data-tre.lua | 24 | ||||
-rw-r--r-- | tex/context/base/page-lay.mkiv | 7 | ||||
-rw-r--r-- | tex/context/base/publ-ini.mkiv | 50 | ||||
-rw-r--r-- | tex/context/base/publ-jrn.lua | 138 | ||||
-rw-r--r-- | tex/context/base/status-files.pdf | bin | 24897 -> 24922 bytes | |||
-rw-r--r-- | tex/context/base/status-lua.pdf | bin | 249610 -> 249917 bytes | |||
-rw-r--r-- | tex/generic/context/luatex/luatex-fonts-merged.lua | 2 |
10 files changed, 194 insertions, 31 deletions
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index f0977ee79..c21e50c86 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2014.07.06 22:50} +\newcontextversion{2014.07.07 17:48} %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/context-version.pdf b/tex/context/base/context-version.pdf Binary files differindex 7e082ed9e..171f98b51 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 60e0f18c5..2e5cc632b 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -28,7 +28,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2014.07.06 22:50} +\edef\contextversion{2014.07.07 17:48} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/data-tre.lua b/tex/context/base/data-tre.lua index 940701c3f..044e205c5 100644 --- a/tex/context/base/data-tre.lua +++ b/tex/context/base/data-tre.lua @@ -6,18 +6,18 @@ if not modules then modules = { } end modules ['data-tre'] = { license = "see context related readme files" } --- tree://e:/temporary/mb-mp/**/drawing.jpg" --- tree://e:/temporary/mb-mp/**/Drawing.jpg" --- tree://t:./**/tufte.tex" --- tree://t:/./**/tufte.tex" --- tree://t:/**/tufte.tex" --- dirlist://e:/temporary/mb-mp/**/drawing.jpg" --- dirlist://e:/temporary/mb-mp/**/Drawing.jpg" --- dirlist://e:/temporary/mb-mp/**/just/some/place/drawing.jpg" --- dirlist://e:/temporary/mb-mp/**/images/drawing.jpg" --- dirlist://e:/temporary/mb-mp/**/images/drawing.jpg?option=fileonly" --- dirlist://///storage-2/resources/mb-mp/**/drawing.jpg" --- dirlist://e:/**/drawing.jpg" +-- tree://e:/temporary/mb-mp/**/drawing.jpg +-- tree://e:/temporary/mb-mp/**/Drawing.jpg +-- tree://t:./**/tufte.tex +-- tree://t:/./**/tufte.tex +-- tree://t:/**/tufte.tex +-- dirlist://e:/temporary/mb-mp/**/drawing.jpg +-- dirlist://e:/temporary/mb-mp/**/Drawing.jpg +-- dirlist://e:/temporary/mb-mp/**/just/some/place/drawing.jpg +-- dirlist://e:/temporary/mb-mp/**/images/drawing.jpg +-- dirlist://e:/temporary/mb-mp/**/images/drawing.jpg?option=fileonly +-- dirlist://///storage-2/resources/mb-mp/**/drawing.jpg +-- dirlist://e:/**/drawing.jpg local find, gsub, lower = string.find, string.gsub, string.lower local basename, dirname, joinname = file.basename, file.dirname, file .join diff --git a/tex/context/base/page-lay.mkiv b/tex/context/base/page-lay.mkiv index ccb60f1e8..f25316c63 100644 --- a/tex/context/base/page-lay.mkiv +++ b/tex/context/base/page-lay.mkiv @@ -1,4 +1,4 @@ -%D \module + %D \module %D [ file=page-lay, %D version=2000.10.20, % copied from main-001 %D title=\CONTEXT\ Page Macros, @@ -1491,6 +1491,11 @@ \definepapersize [A3plus] [\c!width=329mm,\c!height=483mm] +%D For Alan: + +\definepapersize [business] [\c!width=85mm,\c!height=55mm] +\definepapersize [businessUS] [\c!width=3.5in,\c!height=2in] + %D We can now default to a reasonable size. We match the print %D paper size with the typeset paper size. This setting should %D come after the first layout specification (already done). diff --git a/tex/context/base/publ-ini.mkiv b/tex/context/base/publ-ini.mkiv index bf8c29363..7f89e306e 100644 --- a/tex/context/base/publ-ini.mkiv +++ b/tex/context/base/publ-ini.mkiv @@ -43,6 +43,7 @@ \registerctxluafile{publ-ini}{1.001} \registerctxluafile{publ-oth}{1.001} % this could become an option \registerctxluafile{publ-fnd}{1.001} % new method (for the moment only local) +\registerctxluafile{publ-jrn}{1.001} \unprotect @@ -466,8 +467,8 @@ [\s!btx] \setuplist - [\s!btx]% - [\c!state=\v!start]% + [\s!btx] + [\c!state=\v!start] \appendtoks \ifx\currentbtxrenderingparent\empty @@ -515,21 +516,29 @@ \let\completelistofpublications\completebtxrendering \let\placelistofpublications \placebtxrendering -\def\publ_place_list_check_criterium - {\edef\currentbtxcriterium{\btxrenderingparameter\c!criterium}% \v!cite will become \s!cite - \ifx\currentbtxcriterium\empty - \let\currentbtxcriterium\v!previous - \else\ifx\currentbtxcriterium\v!cite - \let\currentbtxcriterium\v!here - \fi\fi} +\newtoks\everybtxlistrendering + +\appendtoks + \let\currentlist\s!btx + \let\currentbtxlist\currentbtxrendering + % + \edef\currentbtxcriterium{\btxrenderingparameter\c!criterium}% \v!cite will become \s!cite + \ifx\currentbtxcriterium\empty + \let\currentbtxcriterium\v!previous + \else\ifx\currentbtxcriterium\v!cite + \let\currentbtxcriterium\v!here + \fi\fi + % + \iflocation + \letinteractionparameter\c!style\empty + \fi +\to \everybtxlistrendering \def\publ_place_list_complete[#1][#2]% title might become obsolete, just headtext {\begingroup \edef\currentbtxrendering{#1}% \setupcurrentbtxrendering[#2]% - \let\currentlist\s!btx - \let\currentbtxlist\currentbtxrendering - \publ_place_list_check_criterium + \the\everybtxlistrendering \edef\currentbtxrenderingtitle{\btxrenderingparameter\c!title}% \ifx\currentbtxrenderingtitle\empty \normalexpanded{\startnamedsection[\v!chapter][\c!reference=\currentbtxrendering,\c!title={\headtext{\currentbtxrendering}}]}% @@ -544,9 +553,7 @@ {\begingroup \edef\currentbtxrendering{#1}% \setupcurrentbtxrendering[#2]% - \let\currentlist\s!btx - \let\currentbtxlist\currentbtxrendering - \publ_place_list_check_criterium + \the\everybtxlistrendering \publ_place_list_indeed \endgroup} @@ -1030,6 +1037,19 @@ \stopcontextdefinitioncode +%D Journals + +\unexpanded\def\btxloadjournallist [#1]{\ctxcommand{btxloadjournallist("#1")}} +\unexpanded\def\btxsavejournallist [#1]{\ctxcommand{btxsavejournallist("#1")}} +\unexpanded\def\btxaddjournal [#1][#2]{\ctxcommand{btxaddjournal("#1"."#2")}} + \def\btxexpandedjournal #1{\ctxcommand{btxexpandedjournal("#1")}} % \unexpanded ? + \def\btxabbreviatedjournal#1{\ctxcommand{btxabbreviatedjournal("#1")}} % \unexpanded ? + +% \btxloadjournallist[list.txt] % Foo Journal of Bars = FBJ \n .... +% +% \btxexpandedjournal[fbj] +% \btxabbreviatedjournal[foo journal of bars] + %D Defaults: \setupbtxrendering diff --git a/tex/context/base/publ-jrn.lua b/tex/context/base/publ-jrn.lua new file mode 100644 index 000000000..31d618dd6 --- /dev/null +++ b/tex/context/base/publ-jrn.lua @@ -0,0 +1,138 @@ +if not modules then modules = { } end modules ['publ-jrn'] = { + version = 1.001, + comment = "this module part of publication support", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- require("char-utf") + +-- Abhandlungen aus dem Westfälischen Museum für Naturkunde = Abh. Westfäl. Mus. Nat.kd. +-- Abhandlungen der Naturforschenden Gesellschaft in Zürich = Abh. Nat.forsch. Ges. Zür. +-- Abhandlungen des Naturwissenschaftlichen Vereins zu Bremen = Abh. Nat.wiss. Ver. Bremen + +local find = string.find +local P, C, S, Cs, lpegmatch, lpegpatterns = lpeg.P, lpeg.C, lpeg.S, lpeg.Cs, lpeg.match, lpeg.patterns + +local lower = characters.lower + +local report_journals = logs.reporter("publications","journals") + +local journals = { } +publications.journals = journals + +local expansions = { } +local abbreviations = { } +local nofexpansions = 0 +local nofabbreviations = 0 + +local valid = 1 - S([[ ."':;,-]]) +local pattern = Cs((valid^1 + P(1)/"")^1) + +local function simplify(name) + -- we have utf but it doesn't matter much if we lower the bytes + return name and lower(lpegmatch(pattern,name)) or name +end + +local function add(expansion,abbreviation) + if expansion and abbreviation then + local se = simplify(expansion) + local sa = simplify(abbreviation) + if not expansions[sa] then + expansions[sa] = expansion + nofexpansions = nofexpansions + 1 + end + if not abbreviations[se] then + abbreviations[se] = abbreviation + nofabbreviations = nofabbreviations + 1 + end + end +end + +local whitespace = lpegpatterns.whitespace^0 +local separator = whitespace * lpeg.P("=") * whitespace +local endofline = lpegpatterns.space^0 * (lpegpatterns.newline + P(-1)) +local splitter = whitespace * C((1-separator)^1) * separator * C((1-endofline)^1) +local pattern = (splitter / add)^0 + +function journals.load(filename) + if not filename then + return + end-- error + if file.suffix(filename,"txt") then + local data = io.loaddata(filename) + if type(data) ~= "string" then + return + elseif find(data,"=") then + -- expansion = abbreviation + lpegmatch(pattern,data) + end + elseif file.suffix(filename,"lua") then + local data = table.load(filename) + if type(data) ~= "table" then + return + else + local de = data.expansions + local da = data.abbreviations + if de and da then + -- { expansions = { a = e }, abbreviations = { e = a } } + if next(expansions) then + table.merge(expansions,de) + else + expansions = de + end + if next(abbreviations) then + table.merge(abbreviations,da) + else + abbreviations = da + end + elseif #data > 0 then + -- { expansion, abbreviation }, ... } + for i=1,#data do + local d = d[i] + add(d[1],d[2]) + end + else + -- { expansion = abbreviation, ... } + for expansion, abbreviation in data do + add(expansion,abbreviation) + end + end + end + end + report_journals("file %a loaded, %s expansions, %s abbreviations",filename,nofexpansions,nofabbreviations) +end + +function journals.save(filename) + table.save(filename,{ expansions = expansions, abbreviations = abbreviations }) +end + +function journals.add(expansion,abbreviation) + add(expansion,abbreviation) +end + +function journals.expanded(name) + local s = simplify(name) + return expansions[s] or expansions[simplify(abbreviations[s])] or name +end + +function journals.abbreviated(name) + local s = simplify(name) + return abbreviations[s] or abbreviations[simplify(expansions[s])] or name +end + +commands.btxloadjournallist = journals.load +commands.btxsavejournallist = journals.save +commands.btxaddjournal = function(...) context(journals.add(...)) end +commands.btxexpandedjournal = function(name) context(journals.expanded(name)) end +commands.btxabbreviatedjournal = function(name) context(journals.abbreviated(name)) end + +-- journals.load("e:/tmp/journals.txt") +-- journals.save("e:/tmp/journals.lua") + +-- inspect(journals.expanded ("Z. Ökol. Nat.schutz")) +-- inspect(journals.abbreviated("Z. Ökol. Nat. schutz")) + +typesetters.manipulators.methods.expandedjournal = journals.expanded +typesetters.manipulators.methods.abbreviatedjournal = journals.abbreviated diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf Binary files differindex 85d00dfa0..a37c74d32 100644 --- a/tex/context/base/status-files.pdf +++ b/tex/context/base/status-files.pdf diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf Binary files differindex b0160abbc..6f309ed57 100644 --- a/tex/context/base/status-lua.pdf +++ b/tex/context/base/status-lua.pdf diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 2f26be70e..ea3a8cc12 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 : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 07/06/14 22:50:12 +-- merge date : 07/07/14 17:48:35 do -- begin closure to overcome local limits and interference |