<script type="text/x-mathjax-config">MathJax.Extension['TeX/xalign'] = {version : '1.0.0'};MathJax.Hub.Register.StartupHook('TeX Jax Ready', function () {var TEX = MathJax.InputJax.TeX;TEX.Definitions.Add({environment: {xalignat: ['ExtensionEnv', null, 'AMSmath'],'xalignat*': ['ExtensionEnv', null, 'AMSmath'],xxalignat: ['ExtensionEnv', null, 'AMSmath'],flalign: ['ExtensionEnv', null, 'AMSmath'],'flalign*': ['ExtensionEnv', null, 'AMSmath']}});});MathJax.Hub.Register.StartupHook('TeX AMSmath Ready', function () {var MML = MathJax.ElementJax.mml,TEX = MathJax.InputJax.TeX,TEXDEF = TEX.Definitions,STACKITEM = TEX.Stack.Item;TEXDEF.Add({environment: {xalignat: ['xAlignAt', null, true, true],'xalignat*': ['xAlignAt', null, false, true],xxalignat: ['xAlignAt', null, true, false],flalign: ['xAlignArray', null, true, false, true, 'rlcrlcrlcrlcrlcrlc',['',' ',' ',' ',' ',' ',''].join('auto auto fit')],'flalign*': ['xAlignArray', null, false, false, true, 'rlcrlcrlcrlcrlcrlc',['',' ',' ',' ',' ',' ',''].join('auto auto fit')]}});TEX.Parse.Augment({xAlignAt: function (begin, numbered, padded) {var n, align = [], width = [];n = this.GetArgument("\\begin{"+begin.name+"}");if (n.match(/[^0-9]/)) {TEX.Error(["PositiveIntegerArg","Argument to %1 must me a positive integer","\\begin{"+begin.name+"}"]);}if (padded) {align.push(""); width.push("")}while (n > 0) {align.push("rl");width.push("auto auto");n--;}if (padded) {align.push(""); width.push("")}return this.xAlignArray(begin, numbered, padded, false,align.join("c"), width.join(" fit "));},xAlignArray: function (begin, numbered, padded, center, align, width) {this.Push(begin);this.checkEqnEnv();align = align.split('').join(' ').replace(/r/g, 'right').replace(/l/g, 'left').replace(/c/g, 'center');return STACKITEM.xAlignArray(begin.name, numbered, padded, center, this.stack).With({arraydef: {width: "100%",displaystyle: true,columnalign: align,columnspacing: "0em",columnwidth: width,rowspacing: "3pt",side: TEX.config.TagSide,minlabelspacing: TEX.config.TagIndent}});}});STACKITEM.xAlignArray = STACKITEM.AMSarray.Subclass({type: "xAlignArray",Init: function (name, numbered, padded, center, stack) {this.SUPER(arguments).Init(name, numbered, padded || center, stack);this.padded = padded;this.center = center;this.maxrow = 0;},EndRow: function () {var cell, row = this.row;this.row = [];if (this.padded) this.row.push(MML.mtd());while ((cell = row.shift())) {this.row.push(cell);cell = row.shift();if (cell) this.row.push(cell);if (row.length || this.padded) this.row.push(MML.mtd());}if (this.row.length > this.maxrow) this.maxrow = this.row.length;this.SUPER(arguments).EndRow.call(this);},EndTable: function () {this.SUPER(arguments).EndTable.call(this);if (this.center) {var def = this.arraydef;if (this.maxrow <= 2) delete def.width;def.columnalign = def.columnalign.split(/ /).slice(0,this.maxrow).join(' ');def.columnwidth = def.columnwidth.split(/ /).slice(0,this.maxrow).join(' ');}}});MathJax.Hub.Startup.signal.Post("TeX xalign Ready");});</script>
<script type="text/x-mathjax-config">MathJax.Extension['TeX/subequations'] = {version: "1.0.0",subEq: false,subNo: 0};MathJax.Hub.Register.StartupHook('TeX Jax Ready', function () {var TEX = MathJax.InputJax.TeX,TEXDEF = TEX.Definitions;var SUBEQ = MathJax.Extension['TeX/subequations'];var CONFIG = MathJax.Hub.config.TeX.equationNumbers;SUBEQ.oldFormat = CONFIG.formatNumber;CONFIG.formatNumber = function (n) {n = SUBEQ.oldFormat(n);if (!SUBEQ.subEq) return n;MathJax.Extension['TeX/AMSmath'].number--;var m = ++SUBEQ.subNo;return n + (n.match(/\./) ? String.fromCharCode(0x60 + m) : '.' + m);};TEXDEF.Add({environment: {subequations: ['SubEquationsBegin', 'SubEquationsEnd']}});TEX.Parse.Augment({SubEquationsBegin: function (begin) {SUBEQ.subEq = true;SUBEQ.subNo = 0;return begin;},SubEquationsEnd: function (begin, row) {SUBEQ.subEq = false;MathJax.Extension['TeX/AMSmath'].number++;return row;}});MathJax.Hub.Startup.signal.Post("TeX subequations Ready");});</script>
\begin{subequations}\begin{align}x &= 123\\y &= x + 5\end{align}\end{subequations}
On Oct 9, 2018, at 6:21 AM, m.mos...@gmx.de wrote:Unfortunately MathJax does not support environments like xalignat, xxalignat, subequations and flalign environments. I am not looking for the accurate rendering of the formula. Thus I thought I could replace the name of the environment, e. g. replacing xalignat with alignat.\begin{xalignat}{3}
i_{11} & =0.25 & i_{12} & =i_{21} & i_{13} & =i_{23}\nonumber\\
i_{21} & =\frac{1}{3}i_{11} & i_{22} & =0.5i_{12}& i_{23} & =i_{31}\\
i_{31} & =0.33i_{22}\quad & i_{32} & =0.15i_{32}\quad & i_{33} & =i_{11}
\end{xalignat}
\begin{alignat}{3}
i_{11} & =0.25 & i_{12} & =i_{21} & i_{13} & =i_{23}\nonumber\\
i_{21} & =\frac{1}{3}i_{11} & i_{22} & =0.5i_{12}& i_{23} & =i_{31}\\
i_{31} & =0.33i_{22}\quad & i_{32} & =0.15i_{32}\quad & i_{33} & =i_{11}
\end{alignat}The result is satisfying. I replaced
.xalignat with alignat
xalignat* with alignat*
xxalignat with alignat*
flalign wih align
flalign* wih align*
I couldn't find any replacement for subequations.
My question is would the replacement work for every possible content? E. g. is there a structure for flalign environment that would cause an error in align environment?
--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to mathja...@googlegroups.com.
Does this work in Anki? If it does, how to use it?
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mathjax-users/8c641642-1daa-4669-9a34-b333f6b6fc41%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "MathJax Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mathjax-users/8YxzxF-m_hM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mathjax-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mathjax-users/F55137B2-55AD-43FE-BD30-2B6B81DC1B1E%40mathjax.org.
Thank you so much for taking your time answering my questions, I really appreciate it. You are right about Anki has built-in support of Mathjax, but I think Mathjax does not support flalign. I really wanted to use this feature on my Anki Desktop. Do you have any idea how to make this happen? I have tried copy-pasting your code on my cards and it still doesn't work. Does the link you gave me from github work for flalign in AnkiDesktop?
To view this discussion on the web visit https://groups.google.com/d/msgid/mathjax-users/CAMzM1erAhCsnr6U-XOC7aUp%3DTqZF7y3UoQZfYK2AHj7b6Ykxhg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mathjax-users/E4773517-FCA1-4D70-9078-04EE252D0BED%40gmail.com.