javascript - jqMath: How to colorize fractions inside jqMath tables -


in writing math using jqmath, have need highlight specific parts of math problems.

/* specific override border bottom important jqmath adds */ fmath td.redunderline {  border-bottom: #a20000 1px solid !important;  } fmath td.redunderline .math-sum.red{  border-bottom: 0 !important;  }  /* colorizes numerator , denominator */ .math .red-num .fm-num-frac, .math .red-den .fm-den-frac {     color: #a20000; }  /* colors fractions in browsers support mathml */ .math mfrac.red-num mn:nth-child(1), .math mfrac.red-num mrow:nth-child(1), .math mfrac.red-den mn:nth-child(2), .math mfrac.red-den mrow:nth-child(2) {     color:#a20000; } 

all of works great unless i'm in jqmath table.

$\table {5x+4},=,49; \html '<span class="red math-sum">−4</span>', ,\html '<span class="red math-sum">−4</span>'; {5x \html '<span class="red">+ 0</span>'},=,\html '<span class="red"> 45 </span>'; 5x,=,45; {\html '<span class="red-den">'{{5x}/5}\html '</span>'},=,{\html '<span class="red-den">' {45/5} \html '</span>'}; x,=,\html '<span class="red">9</span>';$ 

this line not formatting denominator:

{\html '<span class="red-den">'{{5x}/5}\html '</span>'},=,{\html '<span class="red-den">' {45/5} \html '</span>'}; 

if not group line, not handled jqmath, , still shows braces, etc. if group line, math problem, color span put row hidden rather wrapping numbers intend.

i considered using jquery add styles, there no way me mark html in location i'd add classes since jqmath not putting style in desired location, , needs generic enough can add tag or style bring desired effect page. adding jquery each math problem not option.

granted, can using regular html table (and have), i'd keep of math together, looking math problem future proofing. additionally, putting problems inside tables adds unnecessary markup page, adding page download time.

the ideal solution way tell individual rows how style themselves.

\html creates complete element, not opening or closing tag.

as say, best solution add css classes or ids specific mathematical subexpressions. answer jqmath highlight box bbox in mathjax/mathjs shows how this.

if style <fmath> instead, aware "fake math" tag isn't used in browsers firefox have native mathml - there jqmath uses standard <math> tag.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -