Helmut
★★★
avatar
Homepage
Vienna, Austria,
2019-06-02 03:07
(2576 d 11:28 ago)

Posting: # 20309
Views: 1,556
 

 MathJax [Tips / Tricks]

[image]Dear all,

for lovers of beautiful math in all browsers (Shuanghe?) I installed the MathJax Java­Script library developed by The MathJax Consortium – a joint venture of the American Mathematical Society and the Society for Industrial and Applied Mathematics to advance mathematical and scientific content on the web.

Examples:
  • Quadratic Formula
    \(x = {-b \pm \sqrt{b^2-4ac} \over 2a}\)

  • Cauchy’s Integral Formula
    \(f(a) = \frac{1}{2\pi i} \oint\frac{f(z)}{z-a}dz\)

  • Double angle formula for Cosines
    \( \cos(θ+φ)=\cos(θ)\cos(φ)−\sin(θ)\sin(φ) \)

  • Gauss’ Divergence Theorem
    \( \int_D ({\nabla\cdot} F)dV=\int_{\partial D} F\cdot ndS \)

  • Curl of a Vector Field
    \( \vec{\nabla} \times \vec{F} = \left( \frac{\partial F_z}{\partial y} - \frac{\partial F_y}{\partial z} \right) \mathbf{i} + \left( \frac{\partial F_x}{\partial z} - \frac{\partial F_z}{\partial x} \right) \mathbf{j} + \left( \frac{\partial
    F_y}{\partial x} - \frac{\partial F_x}{\partial y} \right) \mathbf{k} \)

  • Standard Deviation
    \(\sigma = \sqrt{ \frac{1}{N} \sum_{i=1}^N (x_i -\mu)^2} \)

  • Definition of Christoffel Symbols
    \((\nabla_X Y)^k = X^i (\nabla_i Y)^k = X^i \left( \frac{\partial Y^k}{\partial x^i} + \Gamma_{im}^k Y^m \right)\)

  • Welch–Satterthwaite’s approximation
    \(\nu \approx \frac{\left (\frac{s_{1}^{2}}{n_1}+\frac{s_{2}^{2}}{n_2}\right )^2}{\frac{s_{1}^{4}}{n_1(n_1-1)}+\frac{s_{2}^{4}}{n_2(n_2-1)}}\)

The default delimiters are $$...$$ and \[...\] for displayed formulas (in a centered paragraph) like this
\[x = {-b \pm \sqrt{b^2-4ac} \over 2a}\] and \(...\) for in-line formulas like this \(x = {-b \pm \sqrt{b^2-4ac} \over 2a}\).
Note in particular that the $...$ in-line delimiters are not used in order to avoid collisions with the $-symbol in posts. See also the details about MathJax TeX and LaTeX Support.
If you insist: \(\small{\mathfrak{Fraktur}\bullet\texttt{Typewriter}}\)

If you don’t like the size of rendered formulas you can enclose them in the usual BBcodes for small and big fonts. Might be usefull esp. for inline ones. Examples (original, small):
This one with the default \(x = {-b \pm \sqrt{b^2-4ac} \over 2a}\).
Enclosed in BBcodes \(x = {-b \pm \sqrt{b^2-4ac} \over 2a}\).

Another option is to use [image] font size modifier-commands directly: \Huge{}, \huge{}, \LARGE{}, \Large{}, \large{}, \normalsize{} (the default), \small{}, \scriptsize{}, \tiny{}.
Note that \footnotesize{} (between \small{} and \scriptsize{}) is not supported in MathJax.
$$\Huge{\text{The quick brown fox jumps over the fence.}}$$$$\huge{\text{The quick brown fox jumps over the fence.}}$$$$\LARGE{\text{The quick brown fox jumps over the fence.}}$$$$\Large{\text{The quick brown fox jumps over the fence.}}$$$$\large{\text{The quick brown fox jumps over the fence.}}$$$$\text{The quick brown fox jumps over the fence.}$$$$\small{\text{The quick brown fox jumps over the fence.}}$$$$\scriptsize{\text{The quick brown fox jumps over the fence.}}$$$$\tiny{\text{The quick brown fox jumps over the fence.}}$$

A simple table:$$\begin{array}{ccccc}
\textsf{S|P} & \textsf{I} & \textsf{II} & \textsf{III} & \textsf{IV}\\\hline
\textsf{1} & \textsf{T} & \textsf{R} & \textsf{T} & \textsf{R}\\
\textsf{2} & \textsf{R} & \textsf{T} & \textsf{R} & \textsf{T}
\end{array}$$
You can also number equations by adding \tag{foo} at the end (in the example 1…3). $$S_0=\int f(x)dx \tag{1}$$ $$S_1=\int x\cdot f(x)dx \tag{2}$$ $$S_2=\int x^2\cdot f(x)dx \tag{3}$$
If you are not familiar with [image] I suggest online editors (here, there) and the LaTeX wikibook. For improv­ed speed, install the STIX Fonts (available at GitHub).

Dif-tor heh smusma 🖖🏼 Довге життя Україна! [image]
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
UA Flag
Activity
 Admin contact
23,655 posts in 4,993 threads, 1,570 registered users;
232 visitors (0 registered, 232 guests [including 149 identified bots]).
Forum time: 14:36 CEST (Europe/Vienna)

Science is simply common sense at its best that is,
rigidly accurate in observation, and
merciless to fallacy in logic.    Thomas Henry Huxley

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5