How-To draw commutative diagram using MathJax ?

693 views
Skip to first unread message

Nilo de Roock

unread,
Feb 25, 2012, 4:47:31 AM2/25/12
to mathja...@googlegroups.com
Is there a possibility to create a commutative diagram using MathJax ? 

Victor Ivrii

unread,
Feb 25, 2012, 5:51:57 AM2/25/12
to mathja...@googlegroups.com
On Sat, Feb 25, 2012 at 4:47 AM, Nilo de Roock <ndro...@gmx.com> wrote:
> Is there a possibility to create a commutative diagram using MathJax ?


xyjax

http://homepage.mac.com/oasis/xyjax.html

which unfortunately so far is not extension but a fork of MJ

HTH

Davide P. Cervone

unread,
Feb 25, 2012, 9:11:46 AM2/25/12
to mathja...@googlegroups.com
Victor already mentioned xyjax.  But simple diagrams can be done using the array environment, for example

\require{AMSmath} \def\mapright#1{\xrightarrow{#1}} \def\mapdown#1{\Big\downarrow\rlap{\raise2pt{\scriptstyle{#1}}}} \begin{array}{ccc} A& \mapright{f} & B \\[3pt] \mapdown{g} & & \mapdown{g'} \\ A^*& \mapright{f^*} & B^* \end{array}\phantom{h}

(Note that the \\[3pt] requires MathJax v2.0 to be handled properly.  Just leave these off for MathJax v1.1.)

Davide

Victor Ivrii

unread,
Feb 25, 2012, 9:26:56 AM2/25/12
to mathja...@googlegroups.com
On Sat, Feb 25, 2012 at 9:11 AM, Davide P. Cervone <dp...@union.edu> wrote:
> Victor already mentioned xyjax.  But simple diagrams can be done using the
> array environment, for example
>
> \require{AMSmath} \def\mapright#1{\xrightarrow{#1}}
> \def\mapdown#1{\Big\downarrow\rlap{\raise2pt{\scriptstyle{#1}}}}
> \begin{array}{ccc} A& \mapright{f} & B \\[3pt] \mapdown{g} & & \mapdown{g'}
> \\ A^*& \mapright{f^*} & B^* \end{array}\phantom{h}
>
> (Note that the \\[3pt] requires MathJax v2.0 to be handled properly.  Just
> leave these off for MathJax v1.1.)
>
> Davide

Unfortunately stretched diagonal arrows seem to be unavailable.

xyjax seem to be frozen

Victor

Davide P. Cervone

unread,
Feb 25, 2012, 9:45:56 AM2/25/12
to mathja...@googlegroups.com
Well, here is a hack to get a diagonal arrow.  It only works OK in HTML-CSS output with the MathJax fonts (not STIX), so you would need to set the configuration to enforce that.  I don't really recommend it, though.

\require{AMSmath} \require{AMSsymbols} \def\mapright#1{\xrightarrow{{#1}}} \def\mapdown#1{\Big\downarrow\rlap{\raise2pt{\scriptstyle{#1}}}} \def\mapdiag#1{\vcenter{\diagdown\kern-.4em\lower.63em{\searrow}\llap{\raise2pt{\scriptstyle #1\kern2pt}}}} \begin{array}{ccc} A& \mapright{f} & B \\[3pt] &\mapdiag{g} & \mapdown{g'} \\ & & B^* \end{array}
Davide

PS, the "\phantom{h}" shouldn't have been at the end of my previous example.  It was left over from a previous attempt.
Reply all
Reply to author
Forward
0 new messages