diff options
author | Hans Hagen <pragma@wxs.nl> | 2014-05-17 23:46:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2014-05-17 23:46:00 +0200 |
commit | 911a6faee70e0fce32c22bd40bcec9f9ed425615 (patch) | |
tree | 8ba97c2e66f121f9ff51355288abddf459dcb8d3 /tex/generic | |
parent | dcafc5c897cc956f197a54f516472954036af7f9 (diff) | |
download | context-911a6faee70e0fce32c22bd40bcec9f9ed425615.tar.gz |
beta 2014.05.17 23:46
Diffstat (limited to 'tex/generic')
-rw-r--r-- | tex/generic/context/luatex/luatex-basics-gen.lua | 13 | ||||
-rw-r--r-- | tex/generic/context/luatex/luatex-fonts-merged.lua | 11 | ||||
-rw-r--r-- | tex/generic/context/luatex/luatex-math.tex | 76 | ||||
-rw-r--r-- | tex/generic/context/luatex/luatex-test.tex | 26 |
4 files changed, 102 insertions, 24 deletions
diff --git a/tex/generic/context/luatex/luatex-basics-gen.lua b/tex/generic/context/luatex/luatex-basics-gen.lua index a304ab6aa..c19a49af3 100644 --- a/tex/generic/context/luatex/luatex-basics-gen.lua +++ b/tex/generic/context/luatex/luatex-basics-gen.lua @@ -353,3 +353,16 @@ end function table.setmetatableindex(t,f) setmetatable(t,{ __index = f }) end + +-- helper for plain: + +arguments = { } + +if arg then + for i=1,#arg do + local k, v = string.match(arg[i],"^%-%-([^=]+)=?(.-)$") + if k and v then + arguments[k] = v + end + end +end diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 70a395d7b..f7801ea05 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 : 05/16/14 20:08:26 +-- merge date : 05/17/14 23:46:22 do -- begin closure to overcome local limits and interference @@ -3460,6 +3460,15 @@ end function table.setmetatableindex(t,f) setmetatable(t,{ __index=f }) end +arguments={} +if arg then + for i=1,#arg do + local k,v=string.match(arg[i],"^%-%-([^=]+)=?(.-)$") + if k and v then + arguments[k]=v + end + end +end end -- closure diff --git a/tex/generic/context/luatex/luatex-math.tex b/tex/generic/context/luatex/luatex-math.tex index c8210c2b5..604b4a1f8 100644 --- a/tex/generic/context/luatex/luatex-math.tex +++ b/tex/generic/context/luatex/luatex-math.tex @@ -19,15 +19,6 @@ % a bunch of fonts: -\font\tenrm = file:lmroman10-regular.otf:+liga;+kern;+tlig;+trep at 10pt -\font\sevenrm = file:lmroman7-regular.otf:+liga;+kern;+tlig;+trep at 7pt -\font\fiverm = file:lmroman5-regular.otf:+liga;+kern;+tlig;+trep at 5pt - -\font\tentt = file:lmmono10-regular.otf at 10pt -\font\tensl = file:lmromanslant10-regular.otf:+liga;+kern;+tlig;+trep at 10pt -\font\tenit = file:lmroman10-italic.otf:+liga;+kern;+tlig;+trep at 10pt -\font\tenbi = file:lmroman10-bolditalic.otf:+liga;+kern;+tlig;+trep at 10pt - \let \teni = \relax \let \seveni = \relax \let \fivei = \relax @@ -35,19 +26,58 @@ \let \sevensy = \relax \let \fivesy = \relax \let \tenex = \relax -\let \tenbf = \relax \let \sevenbf = \relax \let \fivebf = \relax -\tenrm +\def\latinmodern + {\font\tenrm = file:lmroman10-regular.otf:+liga;+kern;+tlig;+trep at 10pt + \font\sevenrm = file:lmroman7-regular.otf:+liga;+kern;+tlig;+trep at 7pt + \font\fiverm = file:lmroman5-regular.otf:+liga;+kern;+tlig;+trep at 5pt + % + \font\tentt = file:lmmono10-regular.otf at 10pt + \font\tensl = file:lmromanslant10-regular.otf:+liga;+kern;+tlig;+trep at 10pt + \font\tenit = file:lmroman10-italic.otf:+liga;+kern;+tlig;+trep at 10pt + \font\tenbf = file:lmroman10-bold.otf:+liga;+kern;+tlig;+trep at 10pt + \font\tenbi = file:lmroman10-bolditalic.otf:+liga;+kern;+tlig;+trep at 10pt + % + \font\mathfonttextupright = file:latinmodern-math.otf:ssty=0;fixmath=yes at 10pt + \font\mathfontscriptupright = file:latinmodern-math.otf:ssty=1;fixmath=yes at 7pt + \font\mathfontscriptscriptupright = file:latinmodern-math.otf:ssty=2;fixmath=yes at 5pt + % + \textfont 0 = \mathfonttextupright + \scriptfont 0 = \mathfontscriptupright + \scriptscriptfont 0 = \mathfontscriptscriptupright + % + \tenrm} -\font\mathfonttextupright = file:latinmodern-math.otf:ssty=0;fixmath=yes at 10pt -\font\mathfontscriptupright = file:latinmodern-math.otf:ssty=1;fixmath=yes at 7pt -\font\mathfontscriptscriptupright = file:latinmodern-math.otf:ssty=2;fixmath=yes at 5pt +\def\lucidabright + {\font\tenrm = file:lucidabrightot.otf:+liga;+kern;+tlig;+trep at 10pt + \font\sevenrm = file:lucidabrightot.otf:+liga;+kern;+tlig;+trep at 7pt + \font\fiverm = file:lucidabrightot.otf:+liga;+kern;+tlig;+trep at 5pt + % + \font\tentt = file:lucidabrightot.otf at 10pt + \font\tenit = file:lucidabrightot.otf:+liga;+kern;+tlig;+trep at 10pt + \font\tenit = file:lucidabrightot-italic.otf:+liga;+kern;+tlig;+trep at 10pt + \font\tenbf = file:lucidabrightot-demi.otf:+liga;+kern;+tlig;+trep at 10pt + \font\tenbi = file:lucidabrightot-demiitalic.otf:+liga;+kern;+tlig;+trep at 10pt + % + \font\mathfonttextupright = file:lucidabrightmathot.otf:ssty=0;fixmath=yes at 10pt + \font\mathfontscriptupright = file:lucidabrightmathot.otf:ssty=1;fixmath=yes at 7pt + \font\mathfontscriptscriptupright = file:lucidabrightmathot.otf:ssty=2;fixmath=yes at 5pt + % + \textfont 0 = \mathfonttextupright + \scriptfont 0 = \mathfontscriptupright + \scriptscriptfont 0 = \mathfontscriptscriptupright + % + \tenrm} -\textfont 0 = \mathfonttextupright -\scriptfont 0 = \mathfontscriptupright -\scriptscriptfont 0 = \mathfontscriptscriptupright +\directlua { + if arguments["mtx:lucidabright"] then + tex.print("\string\\lucidabright") + else + tex.print("\string\\latinmodern") + end +} \newtoks\everymathrm \newtoks\everymathmit @@ -58,12 +88,12 @@ \newtoks\everymathbi \newtoks\everymathtt -\def\rm{\fam0\relax\the\everymathmrm\relax\tenrm\relax} -\def\it{\fam0\relax\the\everymathit \relax\tenit\relax} -\def\sl{\fam0\relax\the\everymathsl \relax\tensl\relax} -\def\bf{\fam0\relax\the\everymathbf \relax\tenbf\relax} -\def\bi{\fam0\relax\the\everymathbi \relax\tenbi\relax} -\def\tt{\fam0\relax\the\everymathtt \relax\tentt\relax} +\def\rm{\fam0\relax\the\everymathrm\relax\tenrm\relax} +\def\it{\fam0\relax\the\everymathit\relax\tenit\relax} +\def\sl{\fam0\relax\the\everymathsl\relax\tensl\relax} +\def\bf{\fam0\relax\the\everymathbf\relax\tenbf\relax} +\def\bi{\fam0\relax\the\everymathbi\relax\tenbi\relax} +\def\tt{\fam0\relax\the\everymathtt\relax\tentt\relax} \let\mit \relax % use names or \Uchar or define a vector \let\cal \relax % idem, i'm not in the mood for this now diff --git a/tex/generic/context/luatex/luatex-test.tex b/tex/generic/context/luatex/luatex-test.tex index fbf8ce3cf..b822af668 100644 --- a/tex/generic/context/luatex/luatex-test.tex +++ b/tex/generic/context/luatex/luatex-test.tex @@ -84,4 +84,30 @@ $$\sqrt {2} { { {1} \over { {1} \over {x} } } } $$ \cows Hello World! +% math test + +\latinmodern + +\def\sqrt{\Uroot "0 "221A{}} + +\def\root#1\of{\Uroot "0 "221A{#1}} + +Inline $\sqrt{x}{1.2}$ math. % same for $\root n of x$ + +$\root3\of x$ + +$\sin{x}$ + +\lucidabright + +\def\sqrt{\Uroot "0 "221A{}} + +\def\root#1\of{\Uroot "0 "221A{#1}} + +Inline $\sqrt{x}{1.2}$ math. % same for $\root n of x$ + +$\root3\of x$ + +$\sin{x}$ + \end |