* mathsf / mathversions in context @ 2016-10-11 19:52 Csikos Bela 2016-10-11 21:02 ` Wolfgang Schuster 0 siblings, 1 reply; 7+ messages in thread From: Csikos Bela @ 2016-10-11 19:52 UTC (permalink / raw) To: ntg-context Dear list members: I would like to set up Tex Gyre Adventor sans serif font as my math font (even if it doesn't have math symbols). I have two questions related to this problem. 1. In latex I can specify math font versions, define a specific font as math serif / normal, another as math sans serif etc. (http://milde.users.sourceforge.net/LUCR/Math/math-font-selection.xhtml). Is this possible in context, and if yes, how? 2. If I specify Tex Gyre Adventor as default math font in context, I get compile error. Here is a MWE, file name is mathfont.tex: -------- \definefontfamily [mathfont] [sf] [Tex Gyre Bonum] \definefontfamily [mathfont] [mm] [Tex Gyre Adventor] \setupbodyfont[mathfont,10pt] \starttext Normal text. \math{Inline math expression.} Normal text. \stoptext -------- Running context mathfont.tex gives: This is LuaTeX, Version 0.98.3 (TeX Live 2017/dev) system commands enabled. .... tex error > tex error on line 9 in file ..../mathfont.tex: ! Math error: parameter \Umathquad\textstyle is not set \m_syst_action_nop ...artimath #1\normalstopimath \fi l.9 \math{Inline math expression.} 1 \definefontfamily [mathfont] [sf] [Tex Gyre Bonum] 2 \definefontfamily [mathfont] [mm] [Tex Gyre Adventor] 3 \setupbodyfont[mathfont,10pt] 4 5 \starttext 6 7 Normal text. 8 9 >> \math{Inline math expression.} 10 11 Normal text. 12 13 \stoptext ? I would appreciate any help or explanations on the topic, or naming a document that explains it. Thanks in advance, bcsikos ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: mathsf / mathversions in context 2016-10-11 19:52 mathsf / mathversions in context Csikos Bela @ 2016-10-11 21:02 ` Wolfgang Schuster 2016-10-14 14:56 ` Csikos Bela 0 siblings, 1 reply; 7+ messages in thread From: Wolfgang Schuster @ 2016-10-11 21:02 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 1727 bytes --] > Csikos Bela <mailto:bcsikos425@freemail.hu> > 11. Oktober 2016 um 21:52 > Dear list members: > > I would like to set up Tex Gyre Adventor sans serif font as my math > font (even if it doesn't have > math symbols). I have two questions related to this problem. > > 1. In latex I can specify math font versions, define a specific font > as math serif / normal, another as math > sans serif etc. > (http://milde.users.sourceforge.net/LUCR/Math/math-font-selection.xhtml). > Is this possible > in context, and if yes, how? ConTeXt doesn’t use the same style switches as LaTeX. > 2. If I specify Tex Gyre Adventor as default math font in context, I > get compile error. > Here is a MWE, file name is mathfont.tex: > > -------- > \definefontfamily [mathfont] [sf] [Tex Gyre Bonum] > \definefontfamily [mathfont] [mm] [Tex Gyre Adventor] > \setupbodyfont[mathfont,10pt] > > \starttext > > Normal text. > > \math{Inline math expression.} > > Normal text. > > \stoptext > -------- 1. sf is not a valid argument for the second argument of \definefontfamily 2. You need a real math font for mathematics, a text font doesn’t work because it lacks many parameter for math mode. 3. You can use the font fallback mechanism to replace certain character in the math font with characters from a text font. \definefontfamily [mathfont] [rm] [Tex Gyre Bonum] \definefallbackfamily [mathfont] [mm] [Tex Gyre Adventor] [preset=math:lowercaseitalic] \definefallbackfamily [mathfont] [mm] [Tex Gyre Adventor] [tf=style:italic,range=0x068,offset=0x0210E]% Planck constant \definefontfamily [mathfont] [mm] [Tex Gyre Pagella Math] \setupbodyfont[mathfont,10pt] \starttext Normal text. \math{a + b = c} \stoptext Wolfgang [-- Attachment #1.2: Type: text/html, Size: 3236 bytes --] [-- Attachment #2: Type: text/plain, Size: 489 bytes --] ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: mathsf / mathversions in context 2016-10-11 21:02 ` Wolfgang Schuster @ 2016-10-14 14:56 ` Csikos Bela 2016-10-16 18:23 ` Wolfgang Schuster 0 siblings, 1 reply; 7+ messages in thread From: Csikos Bela @ 2016-10-14 14:56 UTC (permalink / raw) To: mailing list for ConTeXt users Wolfgang Schuster írta: >>I would like to set up Tex Gyre Adventor sans serif >>font as my math font (even if it doesn't havemath symbols). I have >>two questions related to this problem. >> >>1. In latex I can specify >>math font versions, define a specific font as math serif / normal, >>another as mathsans serif etc. >>(http://milde.users.sourceforge.net/LUCR/Math/math-font-selection.xhtml). > >Is this possiblein context, and if yes, how? > >ConTeXt doesn’t use the same style switches as LaTeX. Thanks. Is there a way to change font family locally in math mode? For example how can I use serif if sans serif is the default math font? >3. You can use the font fallback mechanism to replace certain character >in the math font with characters from a text font. > >\definefontfamily [mathfont] [rm] [Tex Gyre Bonum] >\definefallbackfamily [mathfont] [mm] [Tex Gyre Adventor] >[preset=math:lowercaseitalic] >\definefallbackfamily [mathfont] [mm] [Tex Gyre Adventor] >[tf=style:italic,range=0x068,offset=0x0210E]% Planck constant >\definefontfamily [mathfont] [mm] [Tex Gyre Pagella Math] > >\setupbodyfont[mathfont,10pt] > I played a lot with these setups and have questions. I use this font setting: \definefontfamily [docuf] [rm] [TeX Gyre Bonum] \definefontfamily [docuf] [ss] [TeX Gyre Adventor] \definefontfamily [docuf] [tt] [Latin Modern Mono] [features=none] \definefallbackfamily [docuf] [mm] [Tex Gyre Adventor] [preset=math:uppercasenormal]%,scale=.6] \definefallbackfamily [docuf] [mm] [Tex Gyre Adventor] [preset=math:uppercasebold]%,scale=.6] \definefallbackfamily [docuf] [mm] [Tex Gyre Adventor] [preset=math:uppercaseitalic]%,scale=.6] \definefallbackfamily [docuf] [mm] [Tex Gyre Adventor] [preset=math:uppercasebolditalic]%,scale=.6] \definefallbackfamily [docuf] [mm] [Tex Gyre Adventor] [preset=math:lowercasenormal]%,scale=.6] \definefallbackfamily [docuf] [mm] [Tex Gyre Adventor] [preset=math:lowercasebold]%,scale=.6] \definefallbackfamily [docuf] [mm] [Tex Gyre Adventor] [preset=math:lowercaseitalic]%,scale=.6] \definefallbackfamily [docuf] [mm] [Tex Gyre Adventor] [preset=math:lowercasebolditalic]%,scale=.6] \definefallbackfamily [docuf] [mm] [Tex Gyre Adventor] [preset=math:digitsnormal]%,scale=.6] \definefallbackfamily [docuf] [mm] [Tex Gyre Adventor] [preset=math:digitsbold]%,scale=.6] \definefallbackfamily [docuf] [mm] [Tex Gyre Adventor] [preset=math:digitsitalic]%,scale=.6] \definefallbackfamily [docuf] [mm] [Tex Gyre Adventor] [preset=math:digitsbolditalic]%,scale=.6] \definefontfamily [docuf] [mm] [TeX Gyre Pagella Math] \setupbodyfont[docuf,24pt] 1. If I want to use a scale factor is it possible the give the scale factor by using the preset a,b,c,d,x,xx values? Or I must specify the scale factors as numbers? 2. Scaling occurs compared to which font in the definition list? 3. I found that if I write \definefontfamily [docuf] [mm] [TeX Gyre Pagella Math] before \definefallbackfamily lines, the latter have no effect. Is this normal? Shouldn't the order of definition lines be indifferent? 4. If I write a paragraph with different font size, how can I scale the embedded math too automatically? For example if I write \placefigure[here]{Figure title}{\ss\tfxx A B C D \math{E~F~G~}} A B C D is typeset with small fonts but E F G not; it will be huge compared to A B C D. I can't manually scale the math part because it is inserted here by chemfig module and I can't redefine how it typesets fonts. Thanks in advance, bcsikos ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: mathsf / mathversions in context 2016-10-14 14:56 ` Csikos Bela @ 2016-10-16 18:23 ` Wolfgang Schuster 2016-10-20 14:59 ` Csikos Bela 0 siblings, 1 reply; 7+ messages in thread From: Wolfgang Schuster @ 2016-10-16 18:23 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 4523 bytes --] > Csikos Bela <mailto:bcsikos425@freemail.hu> > 14. Oktober 2016 um 16:56 > Wolfgang Schuster írta: > >>> I would like to set up Tex Gyre Adventor sans serif >>> font as my math font (even if it doesn't havemath symbols). I have >>> two questions related to this problem. >>> >>> 1. In latex I can specify >>> math font versions, define a specific font as math serif / normal, >>> another as mathsans serif etc. >>> (http://milde.users.sourceforge.net/LUCR/Math/math-font-selection.xhtml). >>> Is this possiblein context, and if yes, how? >> ConTeXt doesn’t use the same style switches as LaTeX. > > Thanks. Is there a way to change font family locally in math mode? > For example how can I use serif if sans serif is the default math font? It depends what you want to achieve, for string you can use \text{...} which uses the text font. >> 3. You can use the font fallback mechanism to replace certain character >> in the math font with characters from a text font. >> >> \definefontfamily [mathfont] [rm] [Tex Gyre Bonum] >> \definefallbackfamily [mathfont] [mm] [Tex Gyre Adventor] >> [preset=math:lowercaseitalic] >> \definefallbackfamily [mathfont] [mm] [Tex Gyre Adventor] >> [tf=style:italic,range=0x068,offset=0x0210E]% Planck constant >> \definefontfamily [mathfont] [mm] [Tex Gyre Pagella Math] >> >> \setupbodyfont[mathfont,10pt] >> > > I played a lot with these setups and have questions. > I use this font setting: > > \definefontfamily [docuf] [rm] [TeX Gyre Bonum] > \definefontfamily [docuf] [ss] [TeX Gyre Adventor] > \definefontfamily [docuf] [tt] [Latin Modern Mono] [features=none] > > \definefallbackfamily [docuf] [mm] [Tex Gyre Adventor] [preset=math:uppercasenormal]%,scale=.6] > \definefallbackfamily [docuf] [mm] [Tex Gyre Adventor] [preset=math:uppercasebold]%,scale=.6] > \definefallbackfamily [docuf] [mm] [Tex Gyre Adventor] [preset=math:uppercaseitalic]%,scale=.6] > \definefallbackfamily [docuf] [mm] [Tex Gyre Adventor] [preset=math:uppercasebolditalic]%,scale=.6] > > \definefallbackfamily [docuf] [mm] [Tex Gyre Adventor] [preset=math:lowercasenormal]%,scale=.6] > \definefallbackfamily [docuf] [mm] [Tex Gyre Adventor] [preset=math:lowercasebold]%,scale=.6] > \definefallbackfamily [docuf] [mm] [Tex Gyre Adventor] [preset=math:lowercaseitalic]%,scale=.6] > \definefallbackfamily [docuf] [mm] [Tex Gyre Adventor] [preset=math:lowercasebolditalic]%,scale=.6] > > \definefallbackfamily [docuf] [mm] [Tex Gyre Adventor] [preset=math:digitsnormal]%,scale=.6] > \definefallbackfamily [docuf] [mm] [Tex Gyre Adventor] [preset=math:digitsbold]%,scale=.6] > \definefallbackfamily [docuf] [mm] [Tex Gyre Adventor] [preset=math:digitsitalic]%,scale=.6] > \definefallbackfamily [docuf] [mm] [Tex Gyre Adventor] [preset=math:digitsbolditalic]%,scale=.6] > > \definefontfamily [docuf] [mm] [TeX Gyre Pagella Math] > > \setupbodyfont[docuf,24pt] > > 1. If I want to use a scale factor is it possible the give the scale factor by using > the preset a,b,c,d,x,xx values? Or I must specify the scale factors as numbers? Only numbers are possible. > 2. Scaling occurs compared to which font in the definition list? > > 3. I found that if I write \definefontfamily [docuf] [mm] [TeX Gyre Pagella Math] > before \definefallbackfamily lines, the latter have no effect. Is this normal? > Shouldn't the order of definition lines be indifferent? The fallbackfamily settings are applied to a typeface and the \definefontfamily commands creates the typeface, without \definefontfamily the fallbacks are never used because there is no font which can use the settings. > 4. If I write a paragraph with different font size, how can I scale the embedded math > too automatically? For example if I write > > \placefigure[here]{Figure title}{\ss\tfxx > A B C D \math{E~F~G~}} > > A B C D is typeset with small fonts but E F G not; it will be huge compared to > A B C D. I can't manually scale the math part because it is inserted here > by chemfig module and I can't redefine how it typesets fonts. The x and xx perform not the same scaling as a, b etc. but you can define your own sizes which behave the same way as a etc. \definefontsize[m] \definefontsize[n] \definebodyfontenvironment[default][m=0.8,n=0.9] \starttext {\tfm This paragraph contains text and $math$.} {\tfn This paragraph contains text and $math$.} This paragraph contains text and $math$. {\tfa This paragraph contains text and $math$.} {\tfb This paragraph contains text and $math$.} \stoptext Wolfgang [-- Attachment #1.2: Type: text/html, Size: 6661 bytes --] [-- Attachment #2: Type: text/plain, Size: 489 bytes --] ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: mathsf / mathversions in context 2016-10-16 18:23 ` Wolfgang Schuster @ 2016-10-20 14:59 ` Csikos Bela 2016-10-26 18:22 ` Wolfgang Schuster 0 siblings, 1 reply; 7+ messages in thread From: Csikos Bela @ 2016-10-20 14:59 UTC (permalink / raw) To: mailing list for ConTeXt users Wolfgang Schuster <schuster.wolfgang@gmail.com> írta: Thank you again. Now I am even more confused. >> 3. I found that if I write \definefontfamily [docuf] [mm] [TeX Gyre Pagella Math] >> before \definefallbackfamily lines, the latter have no effect. Is this normal? >> Shouldn't the order of definition lines be indifferent? >The fallbackfamily settings are applied to a typeface and the >\definefontfamily commands creates the typeface, without \definefontfamily the >fallbacks are never used because there is no font which can use the settings. Sorry, but I don't understand the answer. If I have the code: \definefallbackfamily [documentfont] [mm] [Tex Gyre Adventor] [preset=math:lowercaseitalic] \definefontfamily [documentfont] [mm] [TeX Gyre Pagella Math] then Tex Gyre Adventor font is used for math (\definefallbackfamily has effect). If I have this code: \definefontfamily [documentfont] [mm] [TeX Gyre Pagella Math] \definefallbackfamily [documentfont] [mm] [Tex Gyre Adventor] [preset=math:lowercaseitalic] then Tex Gyre Pagella is used for math (\definefallbackfamily has no effect). According to your answer the opposite should happen, shouldn't? I am confused. >The x and xx perform not the same scaling as a, b etc. but you can >define your own sizes which behave the same way as a etc. > >\definefontsize[m] >\definefontsize[n] > >\definebodyfontenvironment[default][m=0.8,n=0.9] OK. How can I use this setting together with \definefontfamily and \definefallbackfamily? I have this code: \definefallbackfamily [documentfont] [mm] [Tex Gyre Adventor] [preset=math:lowercaseitalic] \definefallbackfamily [documentfont] [mm] [Tex Gyre Adventor] [preset=math:uppercaseitalic] \definefallbackfamily [documentfont] [mm] [Tex Gyre Adventor] [preset=math:uppercasenormal] \definefallbackfamily [documentfont] [mm] [Tex Gyre Adventor] [preset=math:lowercasenormal] \definefallbackfamily [documentfont] [mm] [Tex Gyre Adventor] [preset=math:digitsnormal] \definefallbackfamily [documentfont] [mm] [Tex Gyre Adventor] [preset=math:digitsitalic] \definefontfamily [documentfont] [mm] [TeX Gyre Pagella Math] \setupbodyfont[documentfont,10pt] \definefontsize[m] \definefontsize[n] \definebodyfontenvironment[default][m=0.8,n=0.6] \starttext This paragraph contains text and $\tf math$. {\tfa This paragraph contains text and $\tf math$.} {\tfb This paragraph contains text and $\tf math$.} \stoptext The result in this case is italic math font. How can I have it upright? (If I comment out \definefontsize and \definebodyfontenvironment lines, the math font are upright.) Thank you in advance, bcsikos ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: mathsf / mathversions in context 2016-10-20 14:59 ` Csikos Bela @ 2016-10-26 18:22 ` Wolfgang Schuster 2016-10-27 16:42 ` Csikos Bela 0 siblings, 1 reply; 7+ messages in thread From: Wolfgang Schuster @ 2016-10-26 18:22 UTC (permalink / raw) To: Csikos Bela; +Cc: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 1673 bytes --] > Csikos Bela <mailto:bcsikos425@freemail.hu> > 20. Oktober 2016 um 16:59 > Wolfgang Schuster<schuster.wolfgang@gmail.com> írta: > > Thank you again. Now I am even more confused. > >>> 3. I found that if I write \definefontfamily [docuf] [mm] [TeX Gyre Pagella Math] >>> before \definefallbackfamily lines, the latter have no effect. Is this normal? >>> Shouldn't the order of definition lines be indifferent? >> The fallbackfamily settings are applied to a typeface and the >> \definefontfamily commands creates the typeface, without \definefontfamily the >> fallbacks are never used because there is no font which can use the settings. > > Sorry, but I don't understand the answer. If I have the code: > > \definefallbackfamily [documentfont] [mm] [Tex Gyre Adventor] [preset=math:lowercaseitalic] > \definefontfamily [documentfont] [mm] [TeX Gyre Pagella Math] > > then Tex Gyre Adventor font is used for math (\definefallbackfamily has effect). > > If I have this code: > > \definefontfamily [documentfont] [mm] [TeX Gyre Pagella Math] > \definefallbackfamily [documentfont] [mm] [Tex Gyre Adventor] [preset=math:lowercaseitalic] > > then Tex Gyre Pagella is used for math (\definefallbackfamily has no effect). > > According to your answer the opposite should happen, shouldn't? > I am confused. > The \definefontfamily command creates a typeface which is used to load a font but after this point you can’t make changes to it. The \definefallbackfamily command let you assign additional characters for a font but this has to happen before the font is loaded, therefore \definefallbackfamily needs before \definefontfamily in the document. Wolfgang [-- Attachment #1.2: Type: text/html, Size: 2849 bytes --] [-- Attachment #2: Type: text/plain, Size: 492 bytes --] ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: mathsf / mathversions in context 2016-10-26 18:22 ` Wolfgang Schuster @ 2016-10-27 16:42 ` Csikos Bela 0 siblings, 0 replies; 7+ messages in thread From: Csikos Bela @ 2016-10-27 16:42 UTC (permalink / raw) To: ntg-context Wolfgang Schuster írta: [...] >\definefallbackfamily [documentfont] [mm] [Tex Gyre Adventor] [preset=math:lowercaseitalic] >\definefontfamily [documentfont] [mm] [TeX Gyre Pagella Math] > >then Tex Gyre Adventor font is used for math (\definefallbackfamily has effect). > >If I have this code: > >\definefontfamily [documentfont] [mm] [TeX Gyre Pagella Math] >\definefallbackfamily [documentfont] [mm] [Tex Gyre Adventor] [preset=math:lowercaseitalic] > >then Tex Gyre Pagella is used for math (\definefallbackfamily has no effect). > >According to your answer the opposite should happen, shouldn't? >I am confused. > > > >The \definefontfamily command creates a typeface which is used to load a > font but after this point you can’t make changes to it. I see, I didn't know this. >The \definefallbackfamily command let you assign additional >characters for a font but this has to happen before the font is loaded, >therefore \definefallbackfamily needs before \definefontfamily in the document. It is clear now. Thank you a lot. bcsikos ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-10-27 16:42 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-10-11 19:52 mathsf / mathversions in context Csikos Bela 2016-10-11 21:02 ` Wolfgang Schuster 2016-10-14 14:56 ` Csikos Bela 2016-10-16 18:23 ` Wolfgang Schuster 2016-10-20 14:59 ` Csikos Bela 2016-10-26 18:22 ` Wolfgang Schuster 2016-10-27 16:42 ` Csikos Bela
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).