ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Size of fences, factor key
@ 2018-04-21 17:30 Mikael P. Sundqvist
  2018-04-25  5:29 ` Mikael P. Sundqvist
  0 siblings, 1 reply; 4+ messages in thread
From: Mikael P. Sundqvist @ 2018-04-21 17:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1641 bytes --]

Dear Hans and others,

I'm usually use the \big, \Big, \bigg etc to get the size of parentheses,
brackets and braces to be the size I want. I realize that the fences
machinery is probably a cleaner way of doing this.

I tried it a bit, and it usually gives the result I like. But sometimes
not, and it seems that the way to change the size of the
parentheses/brackets/braces is to use the factor key.

1) Are the different options none, auto NUMBER explained somehere?
2) Could one have, for exceptional cases where the default is not
satisfactory, a keyword like factor=big for example, to get the same size
as if one would have used \big?

I am a bit confused. See the example below, with output (from latest
standalone) attached.

/Mikael

PS: I would suggest to have
 italic       = { feature = 'ss01', value = 1, comment = "Mathematical
Alternative Lowercase Italic" },
set in lucida-opentype-math.lfg. In all books (on math) I have seen, I
think this is what is used.

%%% Example file:

\setupbodyfont[lucidaot]

\definemathfence[Set][left="007B,right="007D,command=yes]

\startbuffer
\startformula
\Set{x\in\mathbb R~:~x^2=1}
\stopformula
\stopbuffer


\startTEXpage[offset=3bp]

\startformula
\{x\in\mathbb R~:~ x^2=1\}%Too small
\stopformula

\startformula
\bigl\{x\in\mathbb R~:~ x^2=1\bigr\}%I like this one
\stopformula

\startformula
\Bigl\{x\in\mathbb R~:~ x^2=1\Bigr\}%Too big
\stopformula

\getbuffer

\setupmathfence[Set][factor=1]%I like this one
\getbuffer

\setupmathfence[Set][factor=auto]%Too big
\getbuffer

%\setupmathfence[Set][factor=big]%Perhaps this could work? Or size=big or
something
%\getbuffer
\stopTEXpage

[-- Attachment #1.2: Type: text/html, Size: 2362 bytes --]

[-- Attachment #2: ctx-listexample42.pdf --]
[-- Type: application/pdf, Size: 7547 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] 4+ messages in thread

* Re: Size of fences, factor key
  2018-04-21 17:30 Size of fences, factor key Mikael P. Sundqvist
@ 2018-04-25  5:29 ` Mikael P. Sundqvist
  2018-04-25 20:18   ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Mikael P. Sundqvist @ 2018-04-25  5:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1946 bytes --]

On Sat, Apr 21, 2018 at 7:30 PM, Mikael P. Sundqvist <mickep@gmail.com>
wrote:

> Dear Hans and others,
>
> I'm usually use the \big, \Big, \bigg etc to get the size of parentheses,
> brackets and braces to be the size I want. I realize that the fences
> machinery is probably a cleaner way of doing this.
>
> I tried it a bit, and it usually gives the result I like. But sometimes
> not, and it seems that the way to change the size of the
> parentheses/brackets/braces is to use the factor key.
>
> 1) Are the different options none, auto NUMBER explained somehere?
> 2) Could one have, for exceptional cases where the default is not
> satisfactory, a keyword like factor=big for example, to get the same size
> as if one would have used \big?
>
> I am a bit confused. See the example below, with output (from latest
> standalone) attached.
>
> /Mikael
>
> PS: I would suggest to have
>  italic       = { feature = 'ss01', value = 1, comment = "Mathematical
> Alternative Lowercase Italic" },
> set in lucida-opentype-math.lfg. In all books (on math) I have seen, I
> think this is what is used.
>
> %%% Example file:
>
> \setupbodyfont[lucidaot]
>
> \definemathfence[Set][left="007B,right="007D,command=yes]
>
> \startbuffer
> \startformula
> \Set{x\in\mathbb R~:~x^2=1}
> \stopformula
> \stopbuffer
>
>
> \startTEXpage[offset=3bp]
>
> \startformula
> \{x\in\mathbb R~:~ x^2=1\}%Too small
> \stopformula
>
> \startformula
> \bigl\{x\in\mathbb R~:~ x^2=1\bigr\}%I like this one
> \stopformula
>
> \startformula
> \Bigl\{x\in\mathbb R~:~ x^2=1\Bigr\}%Too big
> \stopformula
>
> \getbuffer
>
> \setupmathfence[Set][factor=1]%I like this one
> \getbuffer
>
> \setupmathfence[Set][factor=auto]%Too big
> \getbuffer
>
> %\setupmathfence[Set][factor=big]%Perhaps this could work? Or size=big or
> something
> %\getbuffer
> \stopTEXpage
>

I hate to do this, but a small *bump*

(If it is unclear what I'm asking for, I could try to clarify)

/Mikael

[-- Attachment #1.2: Type: text/html, Size: 3004 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] 4+ messages in thread

* Re: Size of fences, factor key
  2018-04-25  5:29 ` Mikael P. Sundqvist
@ 2018-04-25 20:18   ` Hans Hagen
  2018-04-26  5:39     ` Mikael P. Sundqvist
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2018-04-25 20:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Mikael P. Sundqvist

On 4/25/2018 7:29 AM, Mikael P. Sundqvist wrote:
> On Sat, Apr 21, 2018 at 7:30 PM, Mikael P. Sundqvist <mickep@gmail.com 
> <mailto:mickep@gmail.com>> wrote:
> 
>     Dear Hans and others,
> 
>     I'm usually use the \big, \Big, \bigg etc to get the size of
>     parentheses, brackets and braces to be the size I want. I realize
>     that the fences machinery is probably a cleaner way of doing this.
> 
>     I tried it a bit, and it usually gives the result I like. But
>     sometimes not, and it seems that the way to change the size of the
>     parentheses/brackets/braces is to use the factor key.
> 
>     1) Are the different options none, auto NUMBER explained somehere?
>     2) Could one have, for exceptional cases where the default is not
>     satisfactory, a keyword like factor=big for example, to get the same
>     size as if one would have used \big?
> 
>     I am a bit confused. See the example below, with output (from latest
>     standalone) attached.
> 
>     /Mikael
> 
>     PS: I would suggest to have
>       italic       = { feature = 'ss01', value = 1, comment =
>     "Mathematical Alternative Lowercase Italic" },
>     set in lucida-opentype-math.lfg. In all books (on math) I have seen,
>     I think this is what is used.
> 
>     %%% Example file:
> 
>     \setupbodyfont[lucidaot]
> 
>     \definemathfence[Set][left="007B,right="007D,command=yes]
> 
>     \startbuffer
>     \startformula
>     \Set{x\in\mathbb R~:~x^2=1}
>     \stopformula
>     \stopbuffer
> 
> 
>     \startTEXpage[offset=3bp]
> 
>     \startformula
>     \{x\in\mathbb R~:~ x^2=1\}%Too small
>     \stopformula
> 
>     \startformula
>     \bigl\{x\in\mathbb R~:~ x^2=1\bigr\}%I like this one
>     \stopformula
> 
>     \startformula
>     \Bigl\{x\in\mathbb R~:~ x^2=1\Bigr\}%Too big
>     \stopformula
> 
>     \getbuffer
> 
>     \setupmathfence[Set][factor=1]%I like this one
>     \getbuffer
> 
>     \setupmathfence[Set][factor=auto]%Too big
>     \getbuffer
> 
>     %\setupmathfence[Set][factor=big]%Perhaps this could work? Or
>     size=big or something
>     %\getbuffer
>     \stopTEXpage
> 
> 
> I hate to do this, but a small *bump*
> 
> (If it is unclear what I'm asking for, I could try to clarify)

sort of unclear indeed


these big things are tricky as in plain tex they depends on font 
dimensions and forced scaling but in context we have abit more control 
over these sizes

you can add this to cont-new.mkiv

\unprotect

\unexpanded\def\math_fenced_fenced_indeed[#1]#2%
   {\iffirstargument\setupcurrentmathfence[#1]\fi
    \math_fenced_fenced_common
    \edef\p_size{\mathfenceparameter\c!size}%
    \ifx\p_size\empty\else
 
\attribute\mathsizeattribute\numexpr\bigmathdelimitervariant*\plushundred+\p_size\relax
    \fi
    \math_fenced_left
    #2%
    \math_fenced_right
    \stopusemathstyleparameter
    \endgroup
    \advance\c_math_fenced_nesting\minusone}

\protect

and then do

\setupbodyfont[lucidaot]

\definemathfence[Set][left="007B,right="007D,command=yes]

\startTEXpage[offset=1ex]
     \startformula
         \Set{x\in\mathbb R~:~x^2=1}
     \stopformula
     \startformula
         \Set[size=2]{x\in\mathbb R~:~x^2=1}
     \stopformula
     \startformula
         \Set[size=3]{x\in\mathbb R~:~x^2=1}
     \stopformula
     \startformula
         \Set[size=4]{x\in\mathbb R~:~x^2=1}
     \stopformula
\stopTEXpage




-----------------------------------------------------------------
                                           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] 4+ messages in thread

* Re: Size of fences, factor key
  2018-04-25 20:18   ` Hans Hagen
@ 2018-04-26  5:39     ` Mikael P. Sundqvist
  0 siblings, 0 replies; 4+ messages in thread
From: Mikael P. Sundqvist @ 2018-04-26  5:39 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2814 bytes --]

>
>
>>
> sort of unclear indeed
>
>
> these big things are tricky as in plain tex they depends on font
> dimensions and forced scaling but in context we have abit more control over
> these sizes
>
> you can add this to cont-new.mkiv
>
> \unprotect
>
> \unexpanded\def\math_fenced_fenced_indeed[#1]#2%
>   {\iffirstargument\setupcurrentmathfence[#1]\fi
>    \math_fenced_fenced_common
>    \edef\p_size{\mathfenceparameter\c!size}%
>    \ifx\p_size\empty\else
>
> \attribute\mathsizeattribute\numexpr\bigmathdelimitervariant
> *\plushundred+\p_size\relax
>    \fi
>    \math_fenced_left
>    #2%
>    \math_fenced_right
>    \stopusemathstyleparameter
>    \endgroup
>    \advance\c_math_fenced_nesting\minusone}
>
> \protect
>
> and then do
>
> \setupbodyfont[lucidaot]
>
> \definemathfence[Set][left="007B,right="007D,command=yes]
>
> \startTEXpage[offset=1ex]
>     \startformula
>         \Set{x\in\mathbb R~:~x^2=1}
>     \stopformula
>     \startformula
>         \Set[size=2]{x\in\mathbb R~:~x^2=1}
>     \stopformula
>     \startformula
>         \Set[size=3]{x\in\mathbb R~:~x^2=1}
>     \stopformula
>     \startformula
>         \Set[size=4]{x\in\mathbb R~:~x^2=1}
>     \stopformula
> \stopTEXpage
>


Many thanks for your answer, I appreciate it!

If you look at the example below (output attached), you see that the
version with \bigl and \bigr has a different size than the other ones.

So my question boils down to: Is it possible, by using fences, to have the
same size as the \big, \Big, \bigg etc would give?

If not, is it possible to implement? I think it would make the already very
nice fencing system even more usable. The reason is to be able to use this
instead of not using fences at all in the few cases where the size from the
fencing is not optimal.

/Mikael


\unprotect

\unexpanded\def\math_fenced_fenced_indeed[#1]#2%
  {\iffirstargument\setupcurrentmathfence[#1]\fi
   \math_fenced_fenced_common
   \edef\p_size{\mathfenceparameter\c!size}%
   \ifx\p_size\empty\else

\attribute\mathsizeattribute\numexpr\bigmathdelimitervariant*\plushundred+\p_size\relax
   \fi
   \math_fenced_left
   #2%
   \math_fenced_right
   \stopusemathstyleparameter
   \endgroup
   \advance\c_math_fenced_nesting\minusone}

\protect

\setupbodyfont[lucidaot]

\definemathfence[Set][left="007B,right="007D,command=yes]

\startTEXpage[offset=1ex]
    \startformula
        \{x\in\mathbb R~:~x^2=1\}\quad\text{Here the braces are too small}
    \stopformula
    \startformula
        \bigl\{x\in\mathbb R~:~x^2=1\bigr\}\quad\text{I like this size}
    \stopformula
    \startformula
        \Set{x\in\mathbb R~:~x^2=1}\quad\text{Here the braces are too big}
    \stopformula
    \startformula
        \Set[size=2]{x\in\mathbb R~:~x^2=1}\quad\text{Here the braces are
too big}
    \stopformula
\stopTEXpage

[-- Attachment #1.2: Type: text/html, Size: 4167 bytes --]

[-- Attachment #2: ctx-example36.pdf --]
[-- Type: application/pdf, Size: 10392 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] 4+ messages in thread

end of thread, other threads:[~2018-04-26  5:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-21 17:30 Size of fences, factor key Mikael P. Sundqvist
2018-04-25  5:29 ` Mikael P. Sundqvist
2018-04-25 20:18   ` Hans Hagen
2018-04-26  5:39     ` 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).