Hi all, This is to announce that the latest beta supports creating virtual math fonts with fallback. The main test case is to use Euler font with missing characters taken from Pagella but the mechanism is general and can be used to replace a specific set of math glyphs from a font. This feature is not extensively tested. As such it will be useful if everyone interested in math fallback mechanism could test this out and report any bugs or inconsistencies. To use this feature you have to use `pagellaovereuler` as your math font. For example, to use Euler with DejaVu fonts, use: \usetypescriptfile[euler] \starttypescript[mainface] \definetypeface[mainface][rm][serif][dejavu] [default] \definetypeface[mainface][ss][sans] [dejavu] [default] \definetypeface[mainface][tt][mono] [dejavu] [default] \definetypeface[mainface][mm][math] [pagellaovereuler][default] \stoptypescript \setupbodyfont[mainface] \appendtoks \rm \to \everymathematics \setupmathematics [lcgreek=normal, ucgreek=normal] There is a built-in typescript `euler-with-pagella` to use `pagellaovereuler` as the math font and `pagella` as the text font. If you are interested in implementing similar fallback mechanisms for other fonts, see type-imp-euler.mkiv and euler-math.lfg for details. Aditya
Aditya Mahajan
This is to announce that the latest beta supports creating virtual math fonts with fallback. The main test case is to use Euler font with missing characters taken from Pagella but the mechanism is general and can be used to replace a specific set of math glyphs from a font.
This feature is not extensively tested. As such it will be useful if everyone interested in math fallback mechanism could test this out and report any bugs or inconsistencies.
I would like to test and hopefully use this setup for _Street-Fighting Science and Engineering_. It should also give the setup a thorough workout. But I can't quite get the preamble right. The test file below typesets text and math in palatino. \usetypescriptfile[euler-with-pagella] \definebodyfontenvironment[10.5pt] \setupbodyfont[palatino,10.5pt] \starttext \input knuth \placeformula\startformula a^2 + b^2 = c^2. \stopformula \stoptext If I add \appendtoks \rm \to \everymathematics \setupmathematics[lcgreek=normal, ucgreek=normal] just before \starttext, the math is typeset in roman pagella. What am I doing silly? Also, one of my reservations about using Euler for math, which readers complained about in _Street-Fighting Mathematics_, is that v and \nu (kinematic viscosity) look so similar. Do you know any way to make them more distinguishable, e.g. by substituting a different character? -Sanjoy
To use this feature you have to use `pagellaovereuler` as your math font. For example, to use Euler with DejaVu fonts, use:
\usetypescriptfile[euler] \starttypescript[mainface] \definetypeface[mainface][rm][serif][dejavu] [default] \definetypeface[mainface][ss][sans] [dejavu] [default] \definetypeface[mainface][tt][mono] [dejavu] [default] \definetypeface[mainface][mm][math] [pagellaovereuler][default] \stoptypescript
\setupbodyfont[mainface]
\appendtoks \rm \to \everymathematics \setupmathematics [lcgreek=normal, ucgreek=normal]
There is a built-in typescript `euler-with-pagella` to use `pagellaovereuler` as the math font and `pagella` as the text font.
Am 16.02.2014 um 17:51 schrieb Sanjoy Mahajan
Aditya Mahajan
writes: This is to announce that the latest beta supports creating virtual math fonts with fallback. The main test case is to use Euler font with missing characters taken from Pagella but the mechanism is general and can be used to replace a specific set of math glyphs from a font.
This feature is not extensively tested. As such it will be useful if everyone interested in math fallback mechanism could test this out and report any bugs or inconsistencies.
I would like to test and hopefully use this setup for _Street-Fighting Science and Engineering_. It should also give the setup a thorough workout. But I can't quite get the preamble right.
The test file below typesets text and math in palatino.
\usetypescriptfile[euler-with-pagella]
You have to load the typescript file for euler.
\definebodyfontenvironment[10.5pt] \setupbodyfont[palatino,10.5pt]
When you use the palatino typeface context uses only the pagella math fonts. To use palatino as text font and euler for math you have to create your own typeface collection: \usetypescriptfile[euler] \definetypeface [mainface] [rm] [serif] [pagella] [default] \definetypeface [mainface] [tt] [mono] [dejavu] [default] [rscale=0.9] \definetypeface [mainface] [mm] [math] [pagellaovereuler] [default] \setupbodyfont[mainface,10.5pt] \appendtoks \rm \to \everymathematics \setupmathematics[lcgreek=normal, ucgreek=normal] \starttext \input knuth \startplaceformula \startformula a^2 + b^2 = c^2. \stopformula \stopplaceformula \stoptext Wolfgang
Wolfgang, Thank you for the preamble. It works well standalone. For some reason it doesn't work with components. I think I've seen this problem before but can't remember the resolution. Here's a minimal example (with 2014.02.14 beta). The text comes out in Euler. The same happens putting the font setup in a project file and referring to it with \project. \startcomponent test \usetypescriptfile[euler] \definetypeface [mainface] [rm] [serif] [pagella] [default] \definetypeface [mainface] [tt] [mono] [dejavu] [default] [rscale=0.9] \definetypeface [mainface] [mm] [math] [pagellaovereuler] [default] \setupbodyfont[mainface,10.5pt] \appendtoks \rm \to \everymathematics \setupmathematics[lcgreek=normal, ucgreek=normal] \input knuth \stopcomponent
Am 17.02.2014 um 15:12 schrieb Sanjoy Mahajan
Wolfgang,
Thank you for the preamble. It works well standalone.
For some reason it doesn't work with components. I think I've seen this problem before but can't remember the resolution. Here's a minimal example (with 2014.02.14 beta). The text comes out in Euler. The same happens putting the font setup in a project file and referring to it with \project.
Put you font definitions before \startcomponent or better put them in a environment file and load this file before \startcomponent. Wolfgang
Put your font definitions before \startcomponent or better put them in a environment file and load this file before \startcomponent.
Sorry, I should have said that I had tried that, but it has the same problem (Euler font for everything). \usetypescriptfile[euler] \definetypeface [mainface] [rm] [serif] [pagella] [default] \definetypeface [mainface] [tt] [mono] [dejavu] [default] [rscale=0.9] \definetypeface [mainface] [mm] [math] [pagellaovereuler] [default] \setupbodyfont[mainface,10.5pt] \appendtoks \rm \to \everymathematics \setupmathematics[lcgreek=normal, ucgreek=normal] \startcomponent test \input knuth \stopcomponent
Am 17.02.2014 um 15:29 schrieb Sanjoy Mahajan
Put your font definitions before \startcomponent or better put them in a environment file and load this file before \startcomponent.
Sorry, I should have said that I had tried that, but it has the same problem (Euler font for everything).
I can’t reproduce this, when I process your example the text is typeset with the pagella font. Wolfgang
I can’t reproduce this, when I process your example the text is typeset with the pagella font.
You are right. I am not sure what I had done, but it works as you say. I also put the font setup in an environment file that is loaded by testproject.tex, and that also works. \project testproject \startcomponent test \input knuth \stopcomponent Because of font loading, is this recommended way to use components (rather than the old way of the \project line after \startcomponent)? If so, I'll make a note on the wiki. -Sanjoy
On Mon, 17 Feb 2014, Sanjoy Mahajan wrote:
\project testproject \startcomponent test
\input knuth
\stopcomponent
Because of font loading, is this recommended way to use components (rather than the old way of the \project line after \startcomponent)? If so, I'll make a note on the wiki.
Yes. This is one of the changes from MkII to MkIV. I think that Hans had a This Way document on this. Aditya
Am 17.02.2014 um 21:07 schrieb Sanjoy Mahajan
I can’t reproduce this, when I process your example the text is typeset with the pagella font.
You are right. I am not sure what I had done, but it works as you say.
I also put the font setup in an environment file that is loaded by testproject.tex, and that also works.
\project testproject \startcomponent test
\input knuth
\stopcomponent
Because of font loading, is this recommended way to use components (rather than the old way of the \project line after \startcomponent)? If so, I'll make a note on the wiki.
This does not only apply to component etc. but also to normal files because context sets and resets some values with \starttext etc. and to avoid some problems it’s better to put all setup commands before it. Wolfgang
Because of font loading, is this recommended way to use components (rather than the old way of the \project line after \startcomponent)? If so, I'll make a note on the wiki.
This does not only apply to component etc. but also to normal files because context sets and resets some values with \starttext etc. and to avoid some problems it’s better to put all setup commands before it.
Agreed. The wiki page for "Project Structure" has always shown setups (via \project ... ) going after the \startcomponent or \startproduct. I've edited the examples to have setups before the \start(product|component). If I did it wrong, let me know. -Sanjoy
Sanjoy Mahajan
The wiki page for "Project Structure" has always shown setups (via \project ... ) going after the \startcomponent or \startproduct. I've edited the examples to have setups before the \start(product|component). If I did it wrong, let me know.
My change doesn't work, because of how components handle project files (which also turns out to explain why I was seeing the Euler font when you didn't). The problem is that context doesn't generate a pdf file if the \project line comes before the \startcomponent. Thus, I was seeing a pdf file from a previous version of the test file (where the font setup came after the \startcomponent). Here are the two test files (testproject2.tex and test6.tex): ==== testproject2.tex ============ \startproject testproject \stopproject ================================== (If testproject2.tex is empty, then the problem does not occur.) ========== test6.tex ============= \project testproject2 \startcomponent test \input knuth \placeformula\startformula a^2 + b^2 = c^2 \stopformula \stopcomponent ================================== Here is the log file. It says 'result saved in test6.pdf' but no pdf file is actually saved. (/home/sanjoy/context/tex/texmf-context/tex/context/base/cont-yes.mkiv ConTeXt ver: 2014.02.14 17:07 MKIV beta fmt: 2014.2.15 int: english/english system > 'cont-new.mkiv' loaded (/home/sanjoy/context/tex/texmf-context/tex/context/base/cont-new.mkiv) system > files > jobname 'test6', input './test6', result 'test6' fonts > latin modern fonts are not preloaded languages > language 'en' is active (/home/sanjoy/sfse/test6.tex (testproject2.tex{/home/sanjoy/context/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map} fonts > preloading latin modern fonts (second stage) {/home/sanjoy/context/tex/texmf/fonts/map/dvips/lm/lm-math.map}{/home/sanjoy/context/tex/texmf/fonts/map/dvips/lm/lm-rm.map} fonts > 'fallback modern rm 12pt' is loaded ) ) ) system > structure > start used structure used structure > text: test6 used structure > project: testproject system > structure > stop used structure system > files > start used files used file > 1: filename=cont-yes.mkiv filetype=tex foundname=/home/sanjoy/context/tex/texmf-context/tex/context/base/cont-yes.mkiv usedmethod=otherwise used file > 2: filename=cont-new.mkiv filetype=tex foundname=/home/sanjoy/context/tex/texmf-context/tex/context/base/cont-new.mkiv usedmethod=otherwise used file > 3: filename=lang-us.lua filetype=scripts foundname=/home/sanjoy/context/tex/texmf-context/tex/context/patterns/lang-us.lua usedmethod=otherwise used file > 4: filename=/home/sanjoy/sfse/test6.tex foundname=/home/sanjoy/sfse/test6.tex usedmethod=direct used file > 5: filename=testproject2.tex foundname=testproject2.tex usedmethod=direct used file > 6: filename=mkiv-base.map filetype=map format=map foundname=/home/sanjoy/context/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map usedmethod=database used file > 7: filename=lm.lfg filetype=tex foundname=/home/sanjoy/context/tex/texmf-context/tex/context/fonts/lm.lfg usedmethod=otherwise used file > 8: filename=lm-math.lfg filetype=tex foundname=/home/sanjoy/context/tex/texmf-context/tex/context/fonts/lm-math.lfg usedmethod=otherwise used file > 9: filename=lm-math.map filetype=map format=map foundname=/home/sanjoy/context/tex/texmf/fonts/map/dvips/lm/lm-math.map usedmethod=database used file > 10: filename=lm-rm.map filetype=map format=map foundname=/home/sanjoy/context/tex/texmf/fonts/map/dvips/lm/lm-rm.map usedmethod=database used file > 11: filename=lmroman12-regular filetype=otf format=otf foundname=/home/sanjoy/context/tex/texmf/fonts/opentype/public/lm/lmroman12-regular.otf usedmethod=database used file > 12: filename=latinmodern-math.otf filetype=opentypefonts foundname=/home/sanjoy/context/tex/texmf/fonts/opentype/public/lm-math/latinmodern-math.otf usedmethod=database used file > 13: filename=latinmodern-math.otf filetype=otf format=otf foundname=/home/sanjoy/context/tex/texmf/fonts/opentype/public/lm-math/latinmodern-math.otf usedmethod=database system > files > stop used files system > options > start commandline options used option > currentrun="2" used option > fulljobname="./test6.tex" used option > input="./test6.tex" used option > kindofrun="2" used option > maxnofruns="8" used option > no-parse-first-line="true" used option > nonstopmode="true" used option > passon="-file-line-error -recorder -interaction nonstopmode" system > options > stop commandline options system > options > start commandline files used file > 1: ./test6.tex system > options > stop commandline files publications > start used btx commands publications > stop used btxcommands mkiv lua stats > used config file: selfautoparent:/texmf/web2c/texmfcnf.lua mkiv lua stats > used cache path: /home/sanjoy/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e mkiv lua stats > resource resolver: loadtime 0.012 seconds, 0 scans with scantime 0.000 seconds, 0 shared scans, 13 found files, scanned paths: <none> mkiv lua stats > stored bytecode data: 347 modules (0.240 sec), 69 tables (0.000 sec), 416 chunks (0.240 sec) mkiv lua stats > running in nuts mode: yes mkiv lua stats > cleaned up reserved nodes: 39 nodes, 443 lists of 442 mkiv lua stats > node memory usage: 2 glue, 2 penalty, 6 attribute, 19 glue_spec, 2 attribute_list, 2 temp mkiv lua stats > node list callback tasks: 6 unique task lists, 2 instances (re)created, 3 calls mkiv lua stats > used backend: pdf (backend for directly generating pdf output) mkiv lua stats > loaded patterns: en::2, load time: 0.000 mkiv lua stats > jobdata time: 0.001 seconds saving, 0.001 seconds loading mkiv lua stats > callbacks: 49 direct, 181 indirect, 230 total mkiv lua stats > randomizer: resumed with value 0.21033152621721 mkiv lua stats > result saved in file: test6.pdf, compresslevel 3, objectcompreslevel 3 mkiv lua stats > loaded fonts: 2 files: latinmodern-math.otf, lmroman12-regular.otf mkiv lua stats > fonts load time: 0.531 seconds for 4 fonts, 2 shared in backend, 2 common vectors, 0 common hashes mkiv lua stats > used platform: linux, type: unix, binary subtree: texmf-linux, symbol mask: utf (τεχ) mkiv lua stats > luatex banner: this is luatex, version beta-0.78.2 (tex live 2014/dev) (rev 4746) mkiv lua stats > control sequences: 38223 of 65536 + 100000 mkiv lua stats > current memory usage: 31 MB (ctx: 31 MB) mkiv lua stats > runtime: 0.853 seconds
Aditya Mahajan
This is to announce that the latest beta supports creating virtual math fonts with fallback. The main test case is to use Euler font with missing characters taken from Pagella but the mechanism is general and can be used to replace a specific set of math glyphs from a font.
This feature is not extensively tested. As such it will be useful if everyone interested in math fallback mechanism could test this out and report any bugs or inconsistencies.
One inconsistency or maybe bug is that text subscripts come out in Euler instead of Palatino. Here's an example (using 2014.02.14 beta). The "Sun" subscript using _{\tf Sun} or _{\rm Sun} was in Palatino in the corresponding MkII setup, but is in Euler now. The workaround of an hbox with \tfxx or \tfx doesn't get quite the right size. \usetypescriptfile[euler] \definetypeface [mainface] [rm] [serif] [pagella] [default] \definetypeface [mainface] [tt] [mono] [dejavu] [default] [rscale=0.9] \definetypeface [mainface] [mm] [math] [pagellaovereuler] [default] \setupbodyfont[mainface] \appendtoks \rm \to \everymathematics \setupmathematics[lcgreek=normal, ucgreek=normal] \starttext \placeformula\startformula M_{\rm Sun}\quad M_{\hbox{\tfx Sun}} \quad M_{\hbox{\tfxx Sun}} \quad M_{\tf Sun} \stopformula \stoptext
On Mon, 3 Mar 2014, Sanjoy Mahajan wrote:
Aditya Mahajan
writes: This is to announce that the latest beta supports creating virtual math fonts with fallback. The main test case is to use Euler font with missing characters taken from Pagella but the mechanism is general and can be used to replace a specific set of math glyphs from a font.
This feature is not extensively tested. As such it will be useful if everyone interested in math fallback mechanism could test this out and report any bugs or inconsistencies.
One inconsistency or maybe bug is that text subscripts come out in Euler instead of Palatino.
Here's an example (using 2014.02.14 beta). The "Sun" subscript using _{\tf Sun} or _{\rm Sun} was in Palatino in the corresponding MkII setup, but is in Euler now. The workaround of an hbox with \tfxx or \tfx doesn't get quite the right size.
That is because in math mode, \rm is symonym with \mathrm etc. The standard way to write this is _{\text{Sun}}. Aditya
Aditya,
Here's an example (using 2014.02.14 beta). The "Sun" subscript using _{\tf Sun} or _{\rm Sun} was in Palatino in the corresponding MkII setup, but is in Euler now. The workaround of an hbox with \tfxx or \tfx doesn't get quite the right size.
That is because in math mode, \rm is symonym with \mathrm etc. The standard way to write this is _{\text{Sun}}.
I agree about \rm. However, _{\tf blah} once (in MkII) selected the text font. e.g. \starttext \placeformula\startformula M_{\tf Sun} \stopformula \stoptext Is the II->IV change in \tf semantics intended? It's not hard to adjust for by using 'sed'. I raise the issue only in case the change is not intended. Actually, the example just as above (i.e. using modern fonts) works fine works in MkII and MkIV. It also works if "\setupbodyfont[palatino]" is inserted as the first line. It's fails only when using Palatino with Euler (at least, in the way that I did it). That data doesn't say what the right behavior is. But it may help you decide. -Sanjoy
participants (4)
-
Aditya Mahajan
-
Sanjoy Mahajan
-
Sanjoy Mahajan
-
Wolfgang Schuster