Difference between revisions of "HowToEnterMathSymbols"

From WeBWorK_wiki
Jump to navigation Jump to search
Line 91: Line 91:
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
 
//<![CDATA[
 
//<![CDATA[
 
 
MathJax.Hub.Config({
 
MathJax.Hub.Config({
 
 
tex2jax: {
 
tex2jax: {
 
 
inlineMath: [ ["\\(","\\)"] ],
 
inlineMath: [ ["\\(","\\)"] ],
 
 
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
 
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
 
 
processEscapes: false,
 
processEscapes: false,
 
 
element: "content",
 
element: "content",
 
 
ignoreClass: "(tex2jax_ignore|mw-search-results|searchresults)" /* note: this is part of a regex, check the docs! */
 
ignoreClass: "(tex2jax_ignore|mw-search-results|searchresults)" /* note: this is part of a regex, check the docs! */
 
 
},
 
},
 
 
TeX: {
 
TeX: {
 
 
Macros: {
 
Macros: {
 
 
/* Wikipedia compatibility: these macros are used on Wikipedia */
 
/* Wikipedia compatibility: these macros are used on Wikipedia */
 
 
empty: '\\emptyset',
 
empty: '\\emptyset',
 
 
P: '\\unicode{xb6}',
 
P: '\\unicode{xb6}',
 
 
Alpha: '\\unicode{x391}', /* FIXME: These capital Greeks don't show up in bold in \boldsymbol ... */
 
Alpha: '\\unicode{x391}', /* FIXME: These capital Greeks don't show up in bold in \boldsymbol ... */
 
 
Beta: '\\unicode{x392}',
 
Beta: '\\unicode{x392}',
 
 
Epsilon: '\\unicode{x395}',
 
Epsilon: '\\unicode{x395}',
 
 
Zeta: '\\unicode{x396}',
 
Zeta: '\\unicode{x396}',
 
 
Eta: '\\unicode{x397}',
 
Eta: '\\unicode{x397}',
 
 
Iota: '\\unicode{x399}',
 
Iota: '\\unicode{x399}',
 
 
Kappa: '\\unicode{x39a}',
 
Kappa: '\\unicode{x39a}',
 
 
Mu: '\\unicode{x39c}',
 
Mu: '\\unicode{x39c}',
 
 
Nu: '\\unicode{x39d}',
 
Nu: '\\unicode{x39d}',
 
 
Pi: '\\unicode{x3a0}',
 
Pi: '\\unicode{x3a0}',
 
 
Rho: '\\unicode{x3a1}',
 
Rho: '\\unicode{x3a1}',
 
 
Sigma: '\\unicode{x3a3}',
 
Sigma: '\\unicode{x3a3}',
 
 
Tau: '\\unicode{x3a4}',
 
Tau: '\\unicode{x3a4}',
 
 
Chi: '\\unicode{x3a7}',
 
Chi: '\\unicode{x3a7}',
 
 
C: '\\mathbb{C}', /* the complex numbers */
 
C: '\\mathbb{C}', /* the complex numbers */
 
 
N: '\\mathbb{N}', /* the natural numbers */
 
N: '\\mathbb{N}', /* the natural numbers */
 
 
Q: '\\mathbb{Q}', /* the rational numbers */
 
Q: '\\mathbb{Q}', /* the rational numbers */
 
 
R: '\\mathbb{R}', /* the real numbers */
 
R: '\\mathbb{R}', /* the real numbers */
 
 
Z: '\\mathbb{Z}', /* the integer numbers */
 
Z: '\\mathbb{Z}', /* the integer numbers */
 
 
RR: '\\mathbb{R}',
 
RR: '\\mathbb{R}',
 
 
ZZ: '\\mathbb{Z}',
 
ZZ: '\\mathbb{Z}',
 
 
NN: '\\mathbb{N}',
 
NN: '\\mathbb{N}',
 
 
QQ: '\\mathbb{Q}',
 
QQ: '\\mathbb{Q}',
 
 
CC: '\\mathbb{C}',
 
CC: '\\mathbb{C}',
 
 
FF: '\\mathbb{F}'
 
FF: '\\mathbb{F}'
 
 
}
 
}
 
 
}
 
}
 
 
});
 
});
 
 
//]]>
 
//]]>
 
</syntaxhighlight>
 
</syntaxhighlight>

Revision as of 12:30, 24 July 2012

We use the MathJax Extension by Dirk Nuyens. This extension enables MathJax (http://www.mathjax.org/) which is a Javascript library written by Davide Cervone.

Usage

The following math environments are defined for inline style math:

  • \(...\) and
  • <math>...</math>.

And the following math environments are defined for display style math:

  • $$...$$ (can be turned off, even per page),
  • \[...\],
  • \begin{...}...\end{...} and
  • :<math>...</math>.

MathJax produces nice and scalable mathematics, see their website (http://www.mathjax.org/) for a demonstration. This extension also enables the usage of \label{} and \eqref{} tags with automatic formula numbering. If needed you can still hand label by using \tag{}.

Example

Latex Code

<syntaxhighlight lang="latex"> \(

 \newcommand{\Re}{\mathrm{Re}\,}
 \newcommand{\pFq}[5]{{}_{#1}\mathrm{F}_{#2} \left( \genfrac{}{}{0pt}{}{#3}{#4} \bigg| {#5} \right)}

\)

We consider, for various values of \(s\), the \(n\)-dimensional integral \begin{align}

 \label{def:Wns}
 W_n (s)
 &:=
 \int_{[0, 1]^n}
   \left| \sum_{k = 1}^n \mathrm{e}^{2 \pi \mathrm{i} \, x_k} \right|^s \mathrm{d}\boldsymbol{x}

\end{align} which occurs in the theory of uniform random walk integrals in the plane, where at each step a unit-step is taken in a random direction. As such, the integral \eqref{def:Wns} expresses the \(s\)-th moment of the distance to the origin after \(n\) steps.

By experimentation and some sketchy arguments we quickly conjectured and strongly believed that, for \(k\) a nonnegative integer \begin{align}

 \label{eq:W3k}
 W_3(k) &= \Re \, \pFq32{\frac12, -\frac k2, -\frac k2}{1, 1}{4}.

\end{align} Appropriately defined, \eqref{eq:W3k} also holds for negative odd integers. The reason for \eqref{eq:W3k} was long a mystery, but it will be explained at the end of the paper. </syntaxhighlight>

(Which comes from a preprint of Jon M. Borwein, et. al. Some arithmetic properties of short random walk integrals.)

Rendered text

\(

 \newcommand{\Re}{\mathrm{Re}\,}
 \newcommand{\pFq}[5]{{}_{#1}\mathrm{F}_{#2} \left( \genfrac{}{}{0pt}{}{#3}{#4} \bigg| {#5} \right)}

\)

We consider, for various values of \(s\), the \(n\)-dimensional integral \begin{align}

 \label{def:Wns}
 W_n (s)
 &:=
 \int_{[0, 1]^n}
   \left| \sum_{k = 1}^n \mathrm{e}^{2 \pi \mathrm{i} \, x_k} \right|^s \mathrm{d}\boldsymbol{x}

\end{align} which occurs in the theory of uniform random walk integrals in the plane, where at each step a unit-step is taken in a random direction. As such, the integral \eqref{def:Wns} expresses the \(s\)-th moment of the distance to the origin after \(n\) steps.

By experimentation and some sketchy arguments we quickly conjectured and strongly believed that, for \(k\) a nonnegative integer \begin{align}

 \label{eq:W3k}
 W_3(k) &= \Re \, \pFq32{\frac12, -\frac k2, -\frac k2}{1, 1}{4}.

\end{align} Appropriately defined, \eqref{eq:W3k} also holds for negative odd integers. The reason for \eqref{eq:W3k} was long a mystery, but it will be explained at the end of the paper.

Additional Information

  • This documentation comes from the MathJax Extension page. Additional documentation on using MathJax can be found at www.mathjax.org.
  • Our MathJax config file defines some potentially helpful macros:


<syntaxhighlight lang="javascript"> //<![CDATA[

   MathJax.Hub.Config({
       tex2jax: {
           inlineMath: [ ["\\(","\\)"] ],
           displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
           processEscapes: false,
           element: "content",
           ignoreClass: "(tex2jax_ignore|mw-search-results|searchresults)" /* note: this is part of a regex, check the docs! */
       },
       TeX: {
         Macros: {
           /* Wikipedia compatibility: these macros are used on Wikipedia */
           empty: '\\emptyset',
           P: '\\unicode{xb6}',
           Alpha: '\\unicode{x391}', /* FIXME: These capital Greeks don't show up in bold in \boldsymbol ... */
           Beta: '\\unicode{x392}',
           Epsilon: '\\unicode{x395}',
           Zeta: '\\unicode{x396}',
           Eta: '\\unicode{x397}',
           Iota: '\\unicode{x399}',
           Kappa: '\\unicode{x39a}',
           Mu: '\\unicode{x39c}',
           Nu: '\\unicode{x39d}',
           Pi: '\\unicode{x3a0}',
           Rho: '\\unicode{x3a1}',
           Sigma: '\\unicode{x3a3}',
           Tau: '\\unicode{x3a4}',
           Chi: '\\unicode{x3a7}',
           C: '\\mathbb{C}',        /* the complex numbers */
           N: '\\mathbb{N}',        /* the natural numbers */
           Q: '\\mathbb{Q}',        /* the rational numbers */
           R: '\\mathbb{R}',        /* the real numbers */
           Z: '\\mathbb{Z}',        /* the integer numbers */
           RR: '\\mathbb{R}',
           ZZ: '\\mathbb{Z}',
           NN: '\\mathbb{N}',
           QQ: '\\mathbb{Q}',
           CC: '\\mathbb{C}',
           FF: '\\mathbb{F}'
         }
       }
   });

//]]> </syntaxhighlight>