Different jsMath images

Different jsMath images

by James Ballard -
Number of replies: 4
Hi

Using the following code:

\begin{eqnarray} \int x e^{x^2}\,dx &=& \int e^{x^2}\times x\,dx\\ &=& \int e^u\times \frac{1}{2}\frac{du}{dx}\,dx\\ &=& \frac{1}{2}\int e^u\,du. \end{eqnarray}

Moodle 1.8.2 using the jsMath filter (v.3.4b) renders the integral sign as /fonts/cmex10/alpha/100/char52.png.

Compared to WebCT 6 (v3.3g) using a <script>...</script> import on a web page the image is /fonts/cmex10/alpha/100/char5A.png.

Also the WebCT site is displaying &=& with line breaks which make the equation easier to follow (see screenshot).

Is there a reason for this, in the versions perhaps? I assume they should render the same.

Yours
James
Attachment jsmath.jpg
Average of ratings: -
In reply to James Ballard

Re: Different jsMath images

by Davide Cervone -
I think there are two things at issue, here. First, the small integral sign is used in text mode while the large one is used in display mode. If looks like you have used text-mode for your Moodle example. Make sure you use the display math delimiters (usually \[...\]).

Second, Moodle is known to have trouble editing text with backslashes in some cases. I suspect your double backslashes are being turned into single ones somewhere along the way. try changing the \\ to \cr and see if that helps. (If you double click on the jsMath typeset mathematics, you will see what it TeX code it actually processed.)

Davide
In reply to Davide Cervone

Re: Different jsMath images

by James Ballard -
Thanks,

Using \cr instead of double-slashes solved the line-break. Is there a better solution to this to use double-slashes?

I have tried enclosing the above using \[...\], $$...$$, and $...$ and they all give the same small integral sign. I have downloaded the latest jsMath version and have the following settings:

jsMath = {
Moodle: {
version: 1.8, // version of this file
processSlashParens: 1, // process \(...\) in text?
processSlashBrackets: 1, // process \[...\] in text?
processDoubleDollars: 1, // process $$...$$ in text?
processSingleDollars: 1, // process $...$ in text?
fixEscapedDollars: 1, // convert \$ to $ outside of math mode?
mimetexCompatible: 1, // make jsMath handle mimetex better?
doubleDollarsAreInLine: 0, // make $$...$$ be in-line math?
allowDoubleClicks: 1, // show TeX source for double-clicks?
allowDisableTag: 1, // allow ID="tex2math_off" to disable tex2math?
showFontWarnings: 0, // show jsMath font warning messages?
processPopups: 1, // process math in popup windows?
loadFiles: null, // a single file name or [file,file,...]
loadFonts: null, // a single font name or [font,font,...]
scale: 120, // the default scaling factor for jsMath
filter: 'filter/jsmath' // where the filter is found
}
};

Any ideas?

Yours
James
In reply to James Ballard

Re: Different jsMath images

by Davide Cervone -
Turn off mimeTeX compatibility, as mimeTeX defined a small integral and a large integral as separate macros.

Davide
In reply to Davide Cervone

Re: Different jsMath images

by James Ballard -
Thanks for the help, everything is working fine now.

Yours,
James