[NTG-context] Size of fences, factor key

Mikael P. Sundqvist mickep at gmail.com
Thu Apr 26 07:39:45 CEST 2018


>
>
>>
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20180426/e467dbf4/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ctx-example36.pdf
Type: application/pdf
Size: 10392 bytes
Desc: not available
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20180426/e467dbf4/attachment-0001.pdf>


More information about the ntg-context mailing list