ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* new tricks in beta
@ 2013-02-20 13:47 Hans Hagen
  0 siblings, 0 replies; only message in thread
From: Hans Hagen @ 2013-02-20 13:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Aditya Mahajan

Hi Aditya,

I made a mathstyle mechanism ... used in fences first:

\starttext

\startTEXpage[offset=1ex]

\def\TestMe#1%
   {\NC \ttbf #1
    \NC \ruledhbox{$\setupmathstyle[#1]x + x_j^2 + x_i^{e^2} + \frac{1}{x}$}
    \NC \ruledhbox{$\setupmathstyle[#1,small]x + x_j^2 + x_i^{e^2} + 
\frac{1}{x}$}
    \NC \NR}

\starttabulate[|l|r|l|]
\HL
\NC \NC \NC \ttbf ...,small \NC \NR
\HL
\TestMe{text}
\TestMe{text,cramped}
\TestMe{script}
\TestMe{script,cramped}
\TestMe{scriptscript}
\TestMe{scriptscript,cramped}
\TestMe{display}
\TestMe{display,cramped}
\HL
\stoptabulate

\stopTEXpage

\startTEXpage

$x\begingroup\setupmathstyle[script]x\endgroup x$ \par
$x{\setupmathstyle[script]x}x$ \par
$x\startmathstyle[script]x\stopmathstyle x$

\stopTEXpage

\definemathfence [scriptbracket] [bracket] 
[command=yes,color=red,mathstyle=script]
\definemathfence [smallbracket]  [bracket] 
[command=yes,color=green,mathstyle=small]
\definemathfence [normalbracket] [bracket] [command=yes,color=blue]

\startTEXpage[offset=1ex]

\startbuffer
test 
$a\frac{1}{normal}\scriptbracket{\frac{1}{script}}\normalbracket{\frac{1}{normal}}\smallbracket{\frac{1}{small}}c$ 
test \par
\stopbuffer

\getbuffer \setupmathfences [color=red] \getbuffer

\stopTEXpage

\stoptext

\starttext

\definemathfence [fancybracket] [bracket] [command=yes,color=blue]

test $|x|$ test \par
test $||x||$ test (okay) \par
test $a\left|\frac{1}{b}\right|c$ test \par
test $a\left||\frac{1}{b}\right||c$ test (not okay) \par

\startbuffer
test $a\fenced[bar]{\frac{1}{b}}c$ test \par
test $a\fenced[doublebar]{\frac{1}{b}}c$ test \par
test $a\fenced[bracket]{\frac{1}{b}}c$ test \par
test $a\fancybracket{\frac{1}{b}}c$ test \par
\stopbuffer

\getbuffer \setupmathfences [color=red] \getbuffer

\stoptext

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-02-20 13:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-20 13:47 new tricks in beta Hans Hagen

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).