1

jqMath を使用して数学を書く場合、数学の問題の特定の部分を強調する必要があります。

/* specific to 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 and denominator */
.math .red-num .fm-num-frac,
.math .red-den .fm-den-frac {
    color: #a20000;
}

/* Colors for fractions in browsers that 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;
}

私がjqMathテーブルにいない限り、これはすべてうまく機能します。

$\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>';$

これは、分母をフォーマットしていない行です。

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

行をグループ化しないと、jqMath で処理されず、中括弧などが表示されます。行をグループ化すると、数学の問題が発生しますが、スパンの色が別の行に配置されます。意図したとおりに数字をラップするのではなく、非表示にしました。

jQuery を使用してスタイルを追加することを検討しましたが、jqMath が目的の場所にスタイルを配置していないため、クラスを追加したい場所に HTML をマークする方法がありません。これは十分に汎用的である必要があります。タグやスタイルを追加して、ページに目的の効果をもたらすことができます。各数学の問題に jQuery を追加することはできません。

確かに、私は通常の html テーブルを使用してこれを行うことができます (そして持っています)。さらに、テーブル内に問題を配置すると、ページに不要なマークアップが追加されるだけで、ページのダウンロード時間が長くなります。

理想的な解決策は、個々の行にスタイルを設定する方法を伝える方法です。

4

1 に答える 1