* mathradical defaults to "normal", should it perhaps be "default"? @ 2017-06-05 8:24 Mikael P. Sundqvist 2017-06-07 14:50 ` Mikael P. Sundqvist 0 siblings, 1 reply; 10+ messages in thread From: Mikael P. Sundqvist @ 2017-06-05 8:24 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1: Type: text/plain, Size: 824 bytes --] Hi, this might be a matter of taste. look at the output of (attached). In my opinion the first square root is to "high", while it looks better on the second line. From setup-en.pdf it looks like the default of \setupmathradical is set to normal (and not default). I don't understand what normal should mean, but I think the alternative=default looks better. (The lucida fonts are loaded in this example, since the effect is more clear for them). /Mikael \setupbodyfont[lucidaot] \starttext \startTEXpage[offset=2pt] \startformula \sqrt{1+x^2}\neq \frac{1}{\sqrt{1+x^2}} \stopformula %the default setting for mathradical seems to be "normal". We change it to "normal" \setupmathradical[sqrt][alternative=default] \startformula \displaystyle\sqrt{1+x^2}\neq \frac{1}{\sqrt{1+x^2}} \stopformula \stopTEXpage \stoptext [-- Attachment #2: ctx-listexample34.pdf --] [-- Type: application/pdf, Size: 6157 bytes --] [-- Attachment #3: 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] 10+ messages in thread
* Re: mathradical defaults to "normal", should it perhaps be "default"? 2017-06-05 8:24 mathradical defaults to "normal", should it perhaps be "default"? Mikael P. Sundqvist @ 2017-06-07 14:50 ` Mikael P. Sundqvist 2017-06-07 15:12 ` Otared Kavian 2017-06-07 17:31 ` Hans Hagen 0 siblings, 2 replies; 10+ messages in thread From: Mikael P. Sundqvist @ 2017-06-07 14:50 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1: Type: text/plain, Size: 1366 bytes --] On Mon, Jun 5, 2017 at 10:24 AM, Mikael P. Sundqvist <mickep@gmail.com> wrote: > Hi, > > this might be a matter of taste. > > look at the output of (attached). In my opinion the first square root > is to "high", while it looks better on the second line. From > setup-en.pdf it looks like the default of \setupmathradical is set to > normal (and not default). I don't understand what normal should mean, > but I think the alternative=default looks better. (The lucida fonts > are loaded in this example, since the effect is more clear for them). > > /Mikael > > \setupbodyfont[lucidaot] > > \starttext > > \startTEXpage[offset=2pt] > \startformula > \sqrt{1+x^2}\neq \frac{1}{\sqrt{1+x^2}} > \stopformula > > %the default setting for mathradical seems to be "normal". We change > it to "normal" > \setupmathradical[sqrt][alternative=default] > > \startformula > \displaystyle\sqrt{1+x^2}\neq \frac{1}{\sqrt{1+x^2}} > \stopformula > \stopTEXpage > > \stoptext Hans, maybe the \setupmathradical[sqrt][alternative=default] was not so successful after all. Or maybe this is a bug: %%% start of test file \setupmathradical[sqrt][alternative=default] \starttext \startformula \sqrt{1+\Bigl(\frac{f(x_k)-f(x_{k-1})}{x_k-x_{k-1}}\Bigr)^2} \stopformula \stoptext %%% stop of test file The numerator looks too small in my opinion. Compiled with 2017.06.06 13:22. /Mikael [-- Attachment #2: ctx-example22.pdf --] [-- Type: application/pdf, Size: 10610 bytes --] [-- Attachment #3: 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] 10+ messages in thread
* Re: mathradical defaults to "normal", should it perhaps be "default"? 2017-06-07 14:50 ` Mikael P. Sundqvist @ 2017-06-07 15:12 ` Otared Kavian 2017-06-07 15:45 ` Alan BRASLAU 2017-06-07 16:09 ` Hans Hagen 2017-06-07 17:31 ` Hans Hagen 1 sibling, 2 replies; 10+ messages in thread From: Otared Kavian @ 2017-06-07 15:12 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 1927 bytes --] Hi, Indeed using \frac yields a weird result in the example sent by Mikael. Compare the output of the three formulas below, with or without \setupmathradical[sqrt][alternative=default]. The results are correct using \over in both cases, while the first one is weird when using \frac and \setupmathradical[sqrt][alternative=default]. Best regards: OK %%% start of test file \starttext \startbuffer[math] \startformula \sqrt{1+\Bigl(\frac{f(x_k)-f(x_{k-1})}{x_k-x_{k-1}}\Bigr)^2} \stopformula \startformula 1+\Bigl(\frac{f(x_k)-f(x_{k-1})}{x_k-x_{k-1}}\Bigr)^2 \stopformula \startformula \sqrt{1+\Bigl({f(x_k)-f(x_{k-1}) \over x_k - x_{k-1}}\Bigr)^2} \stopformula \stopbuffer \getbuffer[math] \hairline \setupmathradical[sqrt][alternative=default] \getbuffer[math] \stoptext %%% end of test file > On 7 Jun 2017, at 16:50, Mikael P. Sundqvist <mickep@gmail.com> wrote: >> […] > > Hans, > > maybe the \setupmathradical[sqrt][alternative=default] was not so > successful after all. Or maybe this is a bug: > > %%% start of test file > \setupmathradical[sqrt][alternative=default] > > \starttext > \startformula > \sqrt{1+\Bigl(\frac{f(x_k)-f(x_{k-1})}{x_k-x_{k-1}}\Bigr)^2} > \stopformula > \stoptext > %%% stop of test file > > The numerator looks too small in my opinion. Compiled with 2017.06.06 13:22. > > /Mikael > <ctx-example22.pdf>___________________________________________________________________________________ > 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 > ___________________________________________________________________________________ [-- Attachment #1.2: Type: text/html, Size: 3828 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] 10+ messages in thread
* Re: mathradical defaults to "normal", should it perhaps be "default"? 2017-06-07 15:12 ` Otared Kavian @ 2017-06-07 15:45 ` Alan BRASLAU 2017-06-07 15:53 ` Meer, Hans van der 2017-06-07 16:03 ` Hans Hagen 2017-06-07 16:09 ` Hans Hagen 1 sibling, 2 replies; 10+ messages in thread From: Alan BRASLAU @ 2017-06-07 15:45 UTC (permalink / raw) To: Otared Kavian; +Cc: mailing list for ConTeXt users On Wed, 7 Jun 2017 17:12:44 +0200 Otared Kavian <otared@gmail.com> wrote: > The results are correct using \over in both cases, while the first > one is weird when using \frac and I have been massacred on this list for ever preferring \over to \frac... ___________________________________________________________________________________ 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] 10+ messages in thread
* Re: mathradical defaults to "normal", should it perhaps be "default"? 2017-06-07 15:45 ` Alan BRASLAU @ 2017-06-07 15:53 ` Meer, Hans van der 2017-06-07 16:03 ` Hans Hagen 1 sibling, 0 replies; 10+ messages in thread From: Meer, Hans van der @ 2017-06-07 15:53 UTC (permalink / raw) To: NTG ConTeXt > On 7 Jun 2017, at 17:45, Alan BRASLAU <alan.braslau@cea.fr> wrote: > > On Wed, 7 Jun 2017 17:12:44 +0200 > Otared Kavian <otared@gmail.com> wrote: > >> The results are correct using \over in both cases, while the first >> one is weird when using \frac and > > I have been massacred on this list for ever preferring \over to \frac... Do not be sad, we will bring flowers to console you - some of us do not hate \over ;-) ;-) ;-) > __________________________________________________________________________________ ___________________________________________________________________________________ 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] 10+ messages in thread
* Re: mathradical defaults to "normal", should it perhaps be "default"? 2017-06-07 15:45 ` Alan BRASLAU 2017-06-07 15:53 ` Meer, Hans van der @ 2017-06-07 16:03 ` Hans Hagen 2017-06-08 4:37 ` Alan BRASLAU 1 sibling, 1 reply; 10+ messages in thread From: Hans Hagen @ 2017-06-07 16:03 UTC (permalink / raw) To: ntg-context On 6/7/2017 5:45 PM, Alan BRASLAU wrote: > On Wed, 7 Jun 2017 17:12:44 +0200 > Otared Kavian <otared@gmail.com> wrote: > >> The results are correct using \over in both cases, while the first >> one is weird when using \frac and > > I have been massacred on this list for ever preferring \over to \frac... and because of the many {} you then need you get these mismatch errors ... but, you can make \unexpanded\def\fakefrac#1#2{{{#1}\over{#2}}} ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ 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] 10+ messages in thread
* Re: mathradical defaults to "normal", should it perhaps be "default"? 2017-06-07 16:03 ` Hans Hagen @ 2017-06-08 4:37 ` Alan BRASLAU 0 siblings, 0 replies; 10+ messages in thread From: Alan BRASLAU @ 2017-06-08 4:37 UTC (permalink / raw) To: Hans Hagen; +Cc: mailing list for ConTeXt users On Wed, 7 Jun 2017 18:03:35 +0200 Hans Hagen <pragma@wxs.nl> wrote: > > I have been massacred on this list for ever preferring \over to > > \frac... > > and because of the many {} you then need you get these mismatch > errors ... but, you can make > > \unexpanded\def\fakefrac#1#2{{{#1}\over{#2}}} The syntax {a \over b} is much more readable (to a mathematician) than \frac{a}{b} which looks fine to a programmer. This has nothing to say about how one or the other performs, it is a purely syntactical preference. Alan ___________________________________________________________________________________ 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] 10+ messages in thread
* Re: mathradical defaults to "normal", should it perhaps be "default"? 2017-06-07 15:12 ` Otared Kavian 2017-06-07 15:45 ` Alan BRASLAU @ 2017-06-07 16:09 ` Hans Hagen 1 sibling, 0 replies; 10+ messages in thread From: Hans Hagen @ 2017-06-07 16:09 UTC (permalink / raw) To: ntg-context On 6/7/2017 5:12 PM, Otared Kavian wrote: > Hi, > > Indeed using \frac yields a weird result in the example sent by Mikael. > Compare the output of the three formulas below, with or without > \setupmathradical[sqrt][alternative=default]. > > The results are correct using \over in both cases, while the first one > is weird when using \frac and \setupmathradical[sqrt][alternative=default]. > > Best regards: OK > %%% start of test file > \starttext > \startbuffer[math] > \startformula > \sqrt{1+\Bigl(\frac{f(x_k)-f(x_{k-1})}{x_k-x_{k-1}}\Bigr)^2} > \stopformula > > \startformula > 1+\Bigl(\frac{f(x_k)-f(x_{k-1})}{x_k-x_{k-1}}\Bigr)^2 > \stopformula > > \startformula > \sqrt{1+\Bigl({f(x_k)-f(x_{k-1}) \over x_k - x_{k-1}}\Bigr)^2} > \stopformula > \stopbuffer > > \getbuffer[math] > \hairline > > \setupmathradical[sqrt][alternative=default] > > \getbuffer[math] > > \stoptext interesting side effect of Ustack (i'll look at it) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ 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] 10+ messages in thread
* Re: mathradical defaults to "normal", should it perhaps be "default"? 2017-06-07 14:50 ` Mikael P. Sundqvist 2017-06-07 15:12 ` Otared Kavian @ 2017-06-07 17:31 ` Hans Hagen 2017-06-07 18:27 ` Mikael P. Sundqvist 1 sibling, 1 reply; 10+ messages in thread From: Hans Hagen @ 2017-06-07 17:31 UTC (permalink / raw) To: ntg-context On 6/7/2017 4:50 PM, Mikael P. Sundqvist wrote: > On Mon, Jun 5, 2017 at 10:24 AM, Mikael P. Sundqvist <mickep@gmail.com> wrote: >> Hi, >> >> this might be a matter of taste. >> >> look at the output of (attached). In my opinion the first square root >> is to "high", while it looks better on the second line. From >> setup-en.pdf it looks like the default of \setupmathradical is set to >> normal (and not default). I don't understand what normal should mean, >> but I think the alternative=default looks better. (The lucida fonts >> are loaded in this example, since the effect is more clear for them). Ok, this is the story -- radicals (roots) are rather special and have some hard coded properties (like always scriptscript in the degree) -- \over (and friends) that are used in \frac (which by the way can be configured in many ways) has the danger of getting the wrong style as side effect of parsing (math list construction) and processing -- in context we want to support color etc for noth in a consistent way as well as style control (important in educational math) Normally it works out ok with the 'normal' setting but there is some catch here. The size of the radical symbols is determine by -- RadicalVerticalGap = 50 -- RadicalDisplayStyleVerticalGap = 175 (These are lucide values) and it happens that the second one if too large which can give a bad threshold in our case. In cambria it's RadicalVerticalGap = 166 RadicalDisplayStyleVerticalGap = 345 So a 1:2 ratio. If we use that for lucida it looks better, so lucida-opentype-math.lfg can become: local function FixRadicalDisplayStyleVerticalGap(value,target,original) local o = original.mathparameters.RadicalVerticalGap -- 50 return 2 * o * target.parameters.factor end return { name = "lucida-opentype-math", version = "1.00", comment = "Goodies that complement lucida opentype.", author = "Hans Hagen", copyright = "ConTeXt development team", mathematics = { parameters = { RadicalDisplayStyleVerticalGap = FixRadicalDisplayStyleVerticalGap, }, alternates = { italic = { feature = 'ss01', value = 1, comment = "Mathematical Alternative Lowercase Italic" }, arrow = { feature = 'ss02', value = 1, comment = "Mathematical Alternative Smaller Arrows" }, operator = { feature = 'ss03', value = 1, comment = "Mathematical Alternative Smaller Operators" }, calligraphic = { feature = 'ss04', value = 1, comment = "Mathematical Alternative Calligraphic Characters" }, zero = { feature = 'ss05', value = 1, comment = "Mathematical Alternative Zero" }, partial = { feature = 'ss20', value = 1, comment = "Mathematical Alternative Upright Partial Differential" }, }, }, } It's sort of a font property: the more sizes the better and sometimes you're simply hit by the threshold not suiting your case. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ 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] 10+ messages in thread
* Re: mathradical defaults to "normal", should it perhaps be "default"? 2017-06-07 17:31 ` Hans Hagen @ 2017-06-07 18:27 ` Mikael P. Sundqvist 0 siblings, 0 replies; 10+ messages in thread From: Mikael P. Sundqvist @ 2017-06-07 18:27 UTC (permalink / raw) To: mailing list for ConTeXt users On Wed, Jun 7, 2017 at 7:31 PM, Hans Hagen <pragma@wxs.nl> wrote: > On 6/7/2017 4:50 PM, Mikael P. Sundqvist wrote: >> >> On Mon, Jun 5, 2017 at 10:24 AM, Mikael P. Sundqvist <mickep@gmail.com> >> wrote: >>> >>> Hi, >>> >>> this might be a matter of taste. >>> >>> look at the output of (attached). In my opinion the first square root >>> is to "high", while it looks better on the second line. From >>> setup-en.pdf it looks like the default of \setupmathradical is set to >>> normal (and not default). I don't understand what normal should mean, >>> but I think the alternative=default looks better. (The lucida fonts >>> are loaded in this example, since the effect is more clear for them). > > Ok, this is the story > > -- radicals (roots) are rather special and have some hard coded properties > (like always scriptscript in the degree) > > -- \over (and friends) that are used in \frac (which by the way can be > configured in many ways) has the danger of getting the wrong style as side > effect of parsing (math list construction) and processing > > -- in context we want to support color etc for noth in a consistent way as > well as style control (important in educational math) > > Normally it works out ok with the 'normal' setting but there is some catch > here. The size of the radical symbols is determine by > > -- RadicalVerticalGap = 50 > -- RadicalDisplayStyleVerticalGap = 175 > > (These are lucide values) and it happens that the second one if too large > which can give a bad threshold in our case. In cambria it's > > RadicalVerticalGap = 166 > RadicalDisplayStyleVerticalGap = 345 > > So a 1:2 ratio. If we use that for lucida it looks better, so > > lucida-opentype-math.lfg > > can become: > > local function FixRadicalDisplayStyleVerticalGap(value,target,original) > local o = original.mathparameters.RadicalVerticalGap -- 50 > return 2 * o * target.parameters.factor > end > > return { > name = "lucida-opentype-math", > version = "1.00", > comment = "Goodies that complement lucida opentype.", > author = "Hans Hagen", > copyright = "ConTeXt development team", > mathematics = { > parameters = { > RadicalDisplayStyleVerticalGap = > FixRadicalDisplayStyleVerticalGap, > }, > alternates = { > italic = { feature = 'ss01', value = 1, comment = > "Mathematical Alternative Lowercase Italic" }, > arrow = { feature = 'ss02', value = 1, comment = > "Mathematical Alternative Smaller Arrows" }, > operator = { feature = 'ss03', value = 1, comment = > "Mathematical Alternative Smaller Operators" }, > calligraphic = { feature = 'ss04', value = 1, comment = > "Mathematical Alternative Calligraphic Characters" }, > zero = { feature = 'ss05', value = 1, comment = > "Mathematical Alternative Zero" }, > partial = { feature = 'ss20', value = 1, comment = > "Mathematical Alternative Upright Partial Differential" }, > }, > }, > } > > It's sort of a font property: the more sizes the better and sometimes you're > simply hit by the threshold not suiting your case. > > > Hans > > ----------------------------------------------------------------- > Hans Hagen | PRAGMA ADE > Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > ----------------------------------------------------------------- > ___________________________________________________________________________________ > 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 > ___________________________________________________________________________________ Hans, many thanks for your explanation, it is really appreciated when you take your time to do this! I updated my local lucida-opentype-math.lfg and indeed it works like charm. I think the uncramped version I get now looks better than what I forced with the temporary solution that I did not understand. /Mikael ___________________________________________________________________________________ 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] 10+ messages in thread
end of thread, other threads:[~2017-06-08 4:37 UTC | newest] Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2017-06-05 8:24 mathradical defaults to "normal", should it perhaps be "default"? Mikael P. Sundqvist 2017-06-07 14:50 ` Mikael P. Sundqvist 2017-06-07 15:12 ` Otared Kavian 2017-06-07 15:45 ` Alan BRASLAU 2017-06-07 15:53 ` Meer, Hans van der 2017-06-07 16:03 ` Hans Hagen 2017-06-08 4:37 ` Alan BRASLAU 2017-06-07 16:09 ` Hans Hagen 2017-06-07 17:31 ` Hans Hagen 2017-06-07 18:27 ` Mikael P. Sundqvist
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).