Hi Hans, There are instances where the automatic scaling provided by \left and \right is not ideal and one has to use manual scaling. For example: \starttext \startTEXpage \startformula \left\langle \sum_{i=1}^n A_i x_i \right\rangle \hbox{ vs. } \bigg\langle \sum_{i=1}^n A_i x_i \bigg\rangle \stopformula \stopTEXpage \stoptext Currently, math fences always default to using \left and \right, which can lead to undesirable results. For example: \definemathfence [MEAN] [angle] [command=yes, color=blue] \starttext \startTEXpage \startformula \MEAN{ \sum_{i = 1}^n A_i x_i } \hbox{ vs. } \bigg\langle \sum_{i=1}^n A_i x_i \bigg\rangle \stopformula \stopTEXpage \stoptext Could we add an option to \definefence that allows the user to select the delimiter scaling using a key (say, `delimiter`) so that \MEAN[delimiter=auto] expands to \left\langle .. \right\langle \MEAN[delimiter=] expands to \langle .. \rangle \MEAN[delimiter=big] expands to \big\langle ... \big\rangle \MEAN[delimiter=Big] expands to \Big\langle ... \Big\rangle \MEAN[delimiter=bigg] expands to \bigg\langle ... \bigg\rangle \MEAN[delimiter=Bigg] expands to \Bigg\langle ... \Bigg\rangle I am not sure whether `delimiter` is the best key. I think that `scale` may be better, but using `scale` for specifying the scaling of math delimiters will be inconsistent with how `scale` is used everywhere else. Another option is to use `alternative` key. Thanks, Aditya
Hi Aditya, I agree totally with you and support your suggestion… Maybe instead of the « delimiter » keyword, one could introduce a keyword such as « size »: \MEAN[size=auto] expands to \left\langle .. \right\langle \MEAN[size=] expands to \langle .. \rangle \MEAN[size=big] expands to \big\langle ... \big\rangle \MEAN[size=Big] expands to \Big\langle ... \Big\rangle \MEAN[size=bigg] expands to \bigg\langle ... \bigg\rangle \MEAN[size=Bigg] expands to \Bigg\langle ... \Bigg\rangle Best regards: OK
On 6 Mar 2017, at 20:57, Aditya Mahajan
wrote: Hi Hans,
There are instances where the automatic scaling provided by \left and \right is not ideal and one has to use manual scaling. For example:
\starttext \startTEXpage \startformula \left\langle \sum_{i=1}^n A_i x_i \right\rangle \hbox{ vs. } \bigg\langle \sum_{i=1}^n A_i x_i \bigg\rangle \stopformula \stopTEXpage \stoptext
Currently, math fences always default to using \left and \right, which can lead to undesirable results. For example:
\definemathfence [MEAN] [angle] [command=yes, color=blue]
\starttext \startTEXpage \startformula \MEAN{ \sum_{i = 1}^n A_i x_i } \hbox{ vs. } \bigg\langle \sum_{i=1}^n A_i x_i \bigg\rangle \stopformula \stopTEXpage \stoptext
Could we add an option to \definefence that allows the user to select the delimiter scaling using a key (say, `delimiter`) so that
\MEAN[delimiter=auto] expands to \left\langle .. \right\langle \MEAN[delimiter=] expands to \langle .. \rangle \MEAN[delimiter=big] expands to \big\langle ... \big\rangle \MEAN[delimiter=Big] expands to \Big\langle ... \Big\rangle \MEAN[delimiter=bigg] expands to \bigg\langle ... \bigg\rangle \MEAN[delimiter=Bigg] expands to \Bigg\langle ... \Bigg\rangle
I am not sure whether `delimiter` is the best key. I think that `scale` may be better, but using `scale` for specifying the scaling of math delimiters will be inconsistent with how `scale` is used everywhere else. Another option is to use `alternative` key.
Thanks, Aditya ___________________________________________________________________________________ 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 ___________________________________________________________________________________
On 3/7/2017 7:35 AM, Otared Kavian wrote:
Hi Aditya,
I agree totally with you and support your suggestion… Maybe instead of the « delimiter » keyword, one could introduce a keyword such as « size »:
\MEAN[size=auto] expands to \left\langle .. \right\langle \MEAN[size=] expands to \langle .. \rangle \MEAN[size=big] expands to \big\langle ... \big\rangle \MEAN[size=Big] expands to \Big\langle ... \Big\rangle \MEAN[size=bigg] expands to \bigg\langle ... \bigg\rangle \MEAN[size=Bigg] expands to \Bigg\langle ... \Bigg\rangle
with integrals we have factor as key ... anyway, i'll look into it (not in the middle of something else) .. luatex actually has a bitmore control over these matters built in
Best regards: OK
On 6 Mar 2017, at 20:57, Aditya Mahajan
wrote: Hi Hans,
There are instances where the automatic scaling provided by \left and \right is not ideal and one has to use manual scaling. For example:
\starttext \startTEXpage \startformula \left\langle \sum_{i=1}^n A_i x_i \right\rangle \hbox{ vs. } \bigg\langle \sum_{i=1}^n A_i x_i \bigg\rangle \stopformula \stopTEXpage \stoptext
Currently, math fences always default to using \left and \right, which can lead to undesirable results. For example:
\definemathfence [MEAN] [angle] [command=yes, color=blue]
\starttext \startTEXpage \startformula \MEAN{ \sum_{i = 1}^n A_i x_i } \hbox{ vs. } \bigg\langle \sum_{i=1}^n A_i x_i \bigg\rangle \stopformula \stopTEXpage \stoptext
Could we add an option to \definefence that allows the user to select the delimiter scaling using a key (say, `delimiter`) so that
\MEAN[delimiter=auto] expands to \left\langle .. \right\langle \MEAN[delimiter=] expands to \langle .. \rangle \MEAN[delimiter=big] expands to \big\langle ... \big\rangle \MEAN[delimiter=Big] expands to \Big\langle ... \Big\rangle \MEAN[delimiter=bigg] expands to \bigg\langle ... \bigg\rangle \MEAN[delimiter=Bigg] expands to \Bigg\langle ... \Bigg\rangle
I am not sure whether `delimiter` is the best key. I think that `scale` may be better, but using `scale` for specifying the scaling of math delimiters will be inconsistent with how `scale` is used everywhere else. Another option is to use `alternative` key.
it would be something factor=2 or so, not the funny XxXxxxXX kind of flags
Thanks, Aditya ___________________________________________________________________________________ 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 ___________________________________________________________________________________
___________________________________________________________________________________ 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 Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On Tue, 7 Mar 2017, Hans Hagen wrote:
\MEAN[delimiter=auto] expands to \left\langle .. \right\langle \MEAN[delimiter=] expands to \langle .. \rangle \MEAN[delimiter=big] expands to \big\langle ... \big\rangle \MEAN[delimiter=Big] expands to \Big\langle ... \Big\rangle \MEAN[delimiter=bigg] expands to \bigg\langle ... \bigg\rangle \MEAN[delimiter=Bigg] expands to \Bigg\langle ... \Bigg\rangle
I am not sure whether `delimiter` is the best key. I think that `scale` may be better, but using `scale` for specifying the scaling of math delimiters will be inconsistent with how `scale` is used everywhere else. Another option is to use `alternative` key.
it would be something factor=2 or so, not the funny XxXxxxXX kind of flags
Sure. factor=(auto|none|1|2|3|4) is also ok (and would be directly mapped to choosemathbig). Aditya
On 3/8/2017 2:45 AM, Aditya Mahajan wrote:
On Tue, 7 Mar 2017, Hans Hagen wrote:
\MEAN[delimiter=auto] expands to \left\langle .. \right\langle \MEAN[delimiter=] expands to \langle .. \rangle \MEAN[delimiter=big] expands to \big\langle ... \big\rangle \MEAN[delimiter=Big] expands to \Big\langle ... \Big\rangle \MEAN[delimiter=bigg] expands to \bigg\langle ... \bigg\rangle \MEAN[delimiter=Bigg] expands to \Bigg\langle ... \Bigg\rangle
I am not sure whether `delimiter` is the best key. I think that `scale` may be better, but using `scale` for specifying the scaling of math delimiters will be inconsistent with how `scale` is used everywhere else. Another option is to use `alternative` key.
it would be something factor=2 or so, not the funny XxXxxxXX kind of flags
Sure. factor=(auto|none|1|2|3|4) is also ok (and would be directly mapped to choosemathbig).
actually we will hook into a new feature of luatex for specifying the size of delimiters (so no vbox hack) .. factors are multipliers of bodyfontsize \definemathfence [MEAN] [angle] [command=yes, color=blue, factor=2.5] \starttext \startTEXpage \startformula \MEAN[factor=1]{\sum_{i = 1}^n A_i x_i } \hbox{ vs. } \MEAN{ \sum_{i = 1}^n A_i x_i } \hbox{ vs. } \bigg\langle \sum_{i=1}^n A_i x_i \bigg\rangle \stopformula \stopTEXpage \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On Thu, 23 Mar 2017, Hans Hagen wrote:
On 3/8/2017 2:45 AM, Aditya Mahajan wrote:
On Tue, 7 Mar 2017, Hans Hagen wrote:
\MEAN[delimiter=auto] expands to \left\langle .. \right\langle \MEAN[delimiter=] expands to \langle .. \rangle \MEAN[delimiter=big] expands to \big\langle ... \big\rangle \MEAN[delimiter=Big] expands to \Big\langle ... \Big\rangle \MEAN[delimiter=bigg] expands to \bigg\langle ... \bigg\rangle \MEAN[delimiter=Bigg] expands to \Bigg\langle ... \Bigg\rangle
I am not sure whether `delimiter` is the best key. I think that `scale` may be better, but using `scale` for specifying the scaling of math delimiters will be inconsistent with how `scale` is used everywhere else. Another option is to use `alternative` key.
it would be something factor=2 or so, not the funny XxXxxxXX kind of flags
Sure. factor=(auto|none|1|2|3|4) is also ok (and would be directly mapped to choosemathbig).
actually we will hook into a new feature of luatex for specifying the size of delimiters (so no vbox hack) .. factors are multipliers of bodyfontsize
\definemathfence [MEAN] [angle] [command=yes, color=blue, factor=2.5]
\starttext \startTEXpage \startformula \MEAN[factor=1]{\sum_{i = 1}^n A_i x_i } \hbox{ vs. } \MEAN{ \sum_{i = 1}^n A_i x_i } \hbox{ vs. } \bigg\langle \sum_{i=1}^n A_i x_i \bigg\rangle \stopformula \stopTEXpage \stoptext
Thanks. If I understand the code correctly (sorry, haven't tested it yet), factor=, factor=none, and factor=auto all behave the same (all insert \normalleft ... \normalright) I think that it may be more consistent if factor= and factor=none do not scale the delimited at all. To maintain backward compatibility, the default value of factor can be set to auto. Also what values of factor give scaling equal to \big, \Big, \bigg, and \Bigg? Aditya
On 3/24/2017 8:24 AM, Aditya Mahajan wrote:
On Thu, 23 Mar 2017, Hans Hagen wrote:
On 3/8/2017 2:45 AM, Aditya Mahajan wrote:
On Tue, 7 Mar 2017, Hans Hagen wrote:
\MEAN[delimiter=auto] expands to \left\langle .. \right\langle \MEAN[delimiter=] expands to \langle .. \rangle \MEAN[delimiter=big] expands to \big\langle ... \big\rangle \MEAN[delimiter=Big] expands to \Big\langle ... \Big\rangle \MEAN[delimiter=bigg] expands to \bigg\langle ... \bigg\rangle \MEAN[delimiter=Bigg] expands to \Bigg\langle ... \Bigg\rangle
I am not sure whether `delimiter` is the best key. I think that `scale` may be better, but using `scale` for specifying the scaling of math delimiters will be inconsistent with how `scale` is used everywhere else. Another option is to use `alternative` key.
it would be something factor=2 or so, not the funny XxXxxxXX kind of flags
Sure. factor=(auto|none|1|2|3|4) is also ok (and would be directly mapped to choosemathbig).
actually we will hook into a new feature of luatex for specifying the size of delimiters (so no vbox hack) .. factors are multipliers of bodyfontsize
\definemathfence [MEAN] [angle] [command=yes, color=blue, factor=2.5]
\starttext \startTEXpage \startformula \MEAN[factor=1]{\sum_{i = 1}^n A_i x_i } \hbox{ vs. } \MEAN{ \sum_{i = 1}^n A_i x_i } \hbox{ vs. } \bigg\langle \sum_{i=1}^n A_i x_i \bigg\rangle \stopformula \stopTEXpage \stoptext
Thanks.
If I understand the code correctly (sorry, haven't tested it yet),
factor=, factor=none, and factor=auto all behave the same (all insert \normalleft ... \normalright)
i prefer empty to be as before we even had factor i.e. same as auto \ifx\p_factor\empty #2% \else\ifx\p_factor\v!auto #2% \else\ifx\p_factor\v!none #3\s!height\zeropoint\s!depth\zeropoint\s!axis #2% \else \scratchdimen\dimexpr\p_factor\bodyfontsize/2\relax #3\s!height\scratchdimen\s!depth\scratchdimen\s!axis \fi\fi\fi
I think that it may be more consistent if factor= and factor=none do not scale the delimited at all. To maintain backward compatibility, the default value of factor can be set to auto.
Also what values of factor give scaling equal to \big, \Big, \bigg, and \Bigg?
These values are actually somewhat weird and relate to the design size of a font .. derived from plain: 0.85 1.15 1.45 1.75 but ... as these are extensibles a font might have more values. The factor is n times the bodyfontsize (50% above and below the axis) what actually comes out depends on the chosen font 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 -----------------------------------------------------------------
On 24 Mar 2017, at 08:24, Aditya Mahajan
wrote: […]
Thanks.
If I understand the code correctly (sorry, haven't tested it yet),
Hi Aditya and Hans, Thank you Hans for the new feature. I did test the code sent by Hans, but it seems that the feature is not yet in the latest ConTeXt 2017.03.23 17:20 MKIV beta. Best regards: OK
Sorry for the noise… it does work fine indeed with ConTeXt 2017.03.23 17:20 MKIV beta (I tried last night with a previous version…). Thank you so much Hans!
On 24 Mar 2017, at 10:56, Otared Kavian
wrote: On 24 Mar 2017, at 08:24, Aditya Mahajan
wrote: […]
Thanks.
If I understand the code correctly (sorry, haven't tested it yet),
Hi Aditya and Hans,
Thank you Hans for the new feature. I did test the code sent by Hans, but it seems that the feature is not yet in the latest ConTeXt 2017.03.23 17:20 MKIV beta.
Best regards: OK
participants (3)
-
Aditya Mahajan
-
Hans Hagen
-
Otared Kavian