\( \int_0^\pi \frac{1}{x^2+1} \, ds \)
You can use double dollar signs work for display math or use the
Latex command with backslash square brackets.
As of today you must use the LateX code: backslash left paren ..... backslash right paren in order to typeset inline math codes. The single dollar sign shortcut is not currently enabled.
You can use special HTML tags to turn off jsMath processing for part of a message (e.g. for a code block), and it is already turned off for <PRE>...</PRE> blocks automatically, so perhaps that is good enough, if people remember to use that. Otherwise, we will need to decide what should be used. Some sites have used $$...$$ and $$$...$$$ for in-line and display math. It is also possible to use something like <tex>...</tex>, but I'm not sure I like "fake" tags like that.
What do you think?
Davide
\(...\)
\( \int_0^\pi \frac{1}{x^2+1} \, ds \)\[...\]
\[ \int_0^\pi \frac{1}{x^2+1} \, ds \]$...$$ \int_0^\pi \frac{1}{x^2+1} \, ds $
$$...$$
$$ \int_0^\pi \frac{1}{x^2+1} \, ds $$Regarding the delimiters: pretty much every non-alphanumeric character that is easily typed is used in Perl code. :(
Using fake HTML tags wouldn't be very practical, since one has to switch out of WYSIWYG mode in order to type literal HTML. (I usually compose in raw mode, but I doubt others do.) Fortunately, the editor does allow you to enter "Preformatted" text, which gets wrapped in <pre> tags, but that's not really convenient for one-liners.
What do you think of something like [math]...[/math] for inline and [dmath]...[/dmath] for display? It's easy to type in the WYSIWYG editor, and that pattern is be very unlikely to show up in Perl code. Could jsMath do that?
Once I hear back from you, I'll ask Andrew Schretter to fix the config (as well as give us write access to the chameleon CSS files).
-sam
pretty much every non-alphanumeric character that is easily typed is used in Perl code
Could jsMath do that?
Sure. To make the change, someone needs to edit the moodle/filter/jsmath/javascript.php
file and change the settings at the top of the file. I recommend changing the following from their defaults:
processSlashParens: 0, // process \(...\) in text? processSlashBrackets: 0, // process \[...\] in text? processDoubleDollars: 0, // process $$...$$ in text? mimetexCompatible: 0, // make jsMath handle mimetex better?and then uncomment the custom delimiter settings below that and change them to
jsMath.Moodle.customDelimiters = [ '[math]','[/math]', // to begin and end in-line math '[dmath]','[/dmath]' // to begin and end display math ];Of course, that will make those tags in your message above be processed as math. :-) Note that you can prevent jsMath from processing a portion of a message by placing it within a tag that has
CLASS="tex2math_ignore"
, usually a DIV tag.
Davide
[math]\int_0^\pi \frac{1}{x^2+1} \, ds[/math]
[dmath]\int_0^\pi \frac{1}{x^2+1} \, ds[/dmath]
As of last week, the jsMath delimiters are [math]...[/math]
for inline math, and [dmath]...[/dmath]
for display math. For example:
Consider the expression [math]\int_0^\pi \frac{1}{x^2+1} \, ds[/math].
|
Consider the following expression: [dmath]\int_0^\pi \frac{1}{x^2+1} \, ds[/dmath]
|
Consider the expression [math]\int_0^\pi \frac{1}{x^2+1} \, ds[/math]. | [dmath]\int_0^\pi \frac{1}{x^2+1} \, ds[/dmath] |
To cause jsMath to ignore a [math]...[/math]
or [dmath]...[/dmath]
section, enclose the section in an HTML element with class tex2math_ignore
. This can be a <div> or a <span> or whatever you like. jsMath always ignores delimiters that occur within <pre> tags.