Difference between revisions of "MathJax"

From TORI
Jump to navigation Jump to search
m (Text replacement - "\$([^\$]+)\$" to "\\(\1\\)")
 
(8 intermediate revisions by the same user not shown)
Line 9: Line 9:
   
 
==Dollar==
 
==Dollar==
  +
 
In MathJax, as in [[Latex]], many things are controlled by [[dollar]]s.
 
In MathJax, as in [[Latex]], many things are controlled by [[dollar]]s.
Typing the sign of dollar, id est, \( \\) \(, switches on the mathematics mode;
+
Typing the sign of dollar, id est, $, switches on the mathematics mode;
then, the characters are interpreted as mathematical symbols or as the [[Latex]] commands. If the dollar appears again, it switches the control back to the normal typesetting. In such a way, to type some math and then some plain text, one needs at least two dollars. The results may look like this: \)\int_a^b f(x)\mathrm d x\(.
+
then, the characters are interpreted as mathematical symbols or as the [[Latex]] commands. If the dollar appears again, it switches the control back to the normal typesetting. In such a way, to type some math and then some plain text, one needs at least two dollars. The results may look like this: \(\int_a^b f(x)\mathrm d x\).
   
Typing two dollars at once, id est, \) \\( \\) \(, reserves the special line for the equation.
+
Typing two dollars at once, id est, \$\$ , reserves the special line for the equation.
 
After to finish this equation, the double-dollar should be repeated again. The result may look as this:
 
After to finish this equation, the double-dollar should be repeated again. The result may look as this:
<math>\int_a^b f(x)\mathrm d x\</math>
 
   
 
<math>\int_a^b f(x)\mathrm d x</math>
==nomathjax==
 
In [[Wo]], [[MathJax]] is supported by default.
 
It can be desactivated with command [[nomathjax]], just type \)<\! \rm nomathjax \!>\(.
 
   
  +
In TORI, the use of dollar caused confusions at the automatic treatment of texts by robots.
After such a command, the dollars loss their usual value
 
  +
For this reason, here, the beginning of the math mode is marked as
  +
<pre>\(
  +
</pre>
  +
and the end of the math (and return to the normal text formatting) is denoted with
  +
<pre>\)
  +
</pre>
  +
In such a way, the math mode can be switched on and switched out with
  +
standard wikimedia notations
  +
<!--
  +
<pre>
  +
<math> ... </math>
  +
</pre>
  +
!-->
  +
  +
<nomathjax>
  +
<nowiki>
  +
<math> ... </math>
  +
</nowiki>
  +
</nomathjax>
  +
 
==nomathjax==
 
In [[TORI]], [[MathJax]] is supported by default.
 
It can be desactivated with command [[nomathjax]], just type
  +
<pre>
  +
<nomathjax> ...
  +
</nomathjax>
  +
</pre>
  +
After command "nomathjax", the
  +
<pre>
  +
\(
  +
</pre>
  +
is supposed to appear as it is typed.
  +
<!--
 
<ref>With command \)<\! \rm nomathjax \!>\(, one can easy refute the widely spread concept "<b><i>Dollar is always Dollar, even in Africa!</i></b>"</ref>
 
<ref>With command \)<\! \rm nomathjax \!>\(, one can easy refute the widely spread concept "<b><i>Dollar is always Dollar, even in Africa!</i></b>"</ref>
 
and are interpreted as ordinary characters; they can be typed in any amount without any special effect. In such a way, you may print so many dollars as you need.
 
and are interpreted as ordinary characters; they can be typed in any amount without any special effect. In such a way, you may print so many dollars as you need.
Line 29: Line 60:
   
 
Temporal suppressing of MathJax is essential at the including of some code in [[Latex]] and/or in [[PHP]], where dollars are important.
 
Temporal suppressing of MathJax is essential at the including of some code in [[Latex]] and/or in [[PHP]], where dollars are important.
  +
!-->
  +
  +
With these commands, the line below is typed:<br>
  +
<nomathjax>
  +
\( abcd^2 \)
  +
</nomathjax>
   
 
==Numbering of formulas==
 
==Numbering of formulas==
  +
<b>Sorry, after recovery in 2019-2020, this section is not yet updated.</b>
  +
 
The similarity with [[Latex]] appears in the numbering of formulas.
 
The similarity with [[Latex]] appears in the numbering of formulas.
 
The test of equation references is suggested at http://cdn.mathjax.org/mathjax/latest/test/sample-eqrefs.html
 
The test of equation references is suggested at http://cdn.mathjax.org/mathjax/latest/test/sample-eqrefs.html
Line 45: Line 84:
 
<math>f_2(x)={x+2\over\sqrt{1-x^2}}\label{ref2}\</math>
 
<math>f_2(x)={x+2\over\sqrt{1-x^2}}\label{ref2}\</math>
 
it is labeled as "ref2", and here is reference to ref2: \ref{ref2}.
 
it is labeled as "ref2", and here is reference to ref2: \ref{ref2}.
  +
The equations should be referred one by one, for example, \ref{ref1},
  +
\ref{ref2}. Attempts to cite them both at once is interpreted as an error
  +
\ref{ref1,ref2}, and marked with red.
  +
  +
<b>Sorry, there is some problem with it</b>
  +
  +
The similarity with [[Latex]] appears in the numbering of formulas.
  +
The test of equation references is suggested at http://cdn.mathjax.org/mathjax/latest/test/sample-eqrefs.html
  +
<ref>
  +
http://cdn.mathjax.org/mathjax/latest/test/sample-eqrefs.html
  +
A test of Equation References.
  +
</ref>. Similar examples are shown below.
  +
  +
Here is a labeled equation:
  +
  +
<math>f_1(x)=\frac{x+1}{\sqrt{1-x^2}}\label{eq:ref1} </math>
  +
  +
or
  +
  +
\[ f_1(x)=\frac{x+1}{\sqrt{1-x^2}}\label{eq:ref2} \]
  +
  +
or
  +
  +
\( f_1(x)=\frac{x+1}{\sqrt{1-x^2}}\label{eq:ref3} \)
  +
  +
or
  +
  +
$$ f_1(x)=\frac{x+1}{\sqrt{1-x^2}}\label{eq:ref5} $$
  +
  +
it is labeled as "ref1", and here is reference to ref1: \eqref{eq:ref1}.
  +
  +
\refeq{eq:ref1}.
  +
  +
In the similar way, one may label another equation,
  +
<math>f_2(x)={x+2\over\sqrt{1-x^2}}\label{eq:ref4}</math>
  +
it is labeled as "ref2", and here is reference to ref2: \eqref{eq:ref4}.
 
The equations should be referred one by one, for example, \ref{ref1},
 
The equations should be referred one by one, for example, \ref{ref1},
 
\ref{ref2}. Attempts to cite them both at once is interpreted as an error
 
\ref{ref2}. Attempts to cite them both at once is interpreted as an error

Latest revision as of 10:28, 26 March 2021

MathJax is software for typing formulas [1]. It uses the Latex style, making the source of the web-article compatible with style of a scientific journal.

MathJax logo by [1]

Dollar

In MathJax, as in Latex, many things are controlled by dollars. Typing the sign of dollar, id est, $, switches on the mathematics mode; then, the characters are interpreted as mathematical symbols or as the Latex commands. If the dollar appears again, it switches the control back to the normal typesetting. In such a way, to type some math and then some plain text, one needs at least two dollars. The results may look like this: \(\int_a^b f(x)\mathrm d x\).

Typing two dollars at once, id est, \$\$ , reserves the special line for the equation. After to finish this equation, the double-dollar should be repeated again. The result may look as this\[\int_a^b f(x)\mathrm d x\]

In TORI, the use of dollar caused confusions at the automatic treatment of texts by robots. For this reason, here, the beginning of the math mode is marked as

\(

and the end of the math (and return to the normal text formatting) is denoted with

\)

In such a way, the math mode can be switched on and switched out with standard wikimedia notations

\( ... \)

nomathjax

In TORI, MathJax is supported by default. It can be desactivated with command nomathjax, just type

<nomathjax> ...
</nomathjax>

After command "nomathjax", the

\(

is supposed to appear as it is typed.

With these commands, the line below is typed:
\( abcd^2 \)

Numbering of formulas

Sorry, after recovery in 2019-2020, this section is not yet updated.

The similarity with Latex appears in the numbering of formulas. The test of equation references is suggested at http://cdn.mathjax.org/mathjax/latest/test/sample-eqrefs.html [2]. Similar examples are shown below.

Here is a labeled equation\[f_1(x)=\frac{x+1}{\sqrt{1-x^2}}\label{ref1}\\] it is labeled as "ref1", and here is reference to ref1: \ref{ref1}.

In the similar way, one may label another equation, \(f_2(x)={x+2\over\sqrt{1-x^2}}\label{ref2}\\) it is labeled as "ref2", and here is reference to ref2: \ref{ref2}. The equations should be referred one by one, for example, \ref{ref1}, \ref{ref2}. Attempts to cite them both at once is interpreted as an error \ref{ref1,ref2}, and marked with red.

Sorry, there is some problem with it

The similarity with Latex appears in the numbering of formulas. The test of equation references is suggested at http://cdn.mathjax.org/mathjax/latest/test/sample-eqrefs.html [3]. Similar examples are shown below.

Here is a labeled equation\[f_1(x)=\frac{x+1}{\sqrt{1-x^2}}\label{eq:ref1} \]

or

\[ f_1(x)=\frac{x+1}{\sqrt{1-x^2}}\label{eq:ref2} \]

or

\( f_1(x)=\frac{x+1}{\sqrt{1-x^2}}\label{eq:ref3} \)

or

$$ f_1(x)=\frac{x+1}{\sqrt{1-x^2}}\label{eq:ref5} $$

it is labeled as "ref1", and here is reference to ref1: \eqref{eq:ref1}.

\refeq{eq:ref1}.

In the similar way, one may label another equation, \(f_2(x)={x+2\over\sqrt{1-x^2}}\label{eq:ref4}\) it is labeled as "ref2", and here is reference to ref2: \eqref{eq:ref4}. The equations should be referred one by one, for example, \ref{ref1}, \ref{ref2}. Attempts to cite them both at once is interpreted as an error \ref{ref1,ref2}, and marked with red.

References

  1. 1.0 1.1 http://www.mathjax.org/ MathJax is an open source JavaScript display engine for mathematics that works in all modern browsers.
  2. http://cdn.mathjax.org/mathjax/latest/test/sample-eqrefs.html A test of Equation References.
  3. http://cdn.mathjax.org/mathjax/latest/test/sample-eqrefs.html A test of Equation References.

Keywords

Latex, Mathematics, Science