GetWiki
GetWiki:Custom Formulas
ARTICLE SUBJECTS
being →
database →
ethics →
fiction →
history →
internet →
language →
linux →
logic →
method →
news →
policy →
purpose →
religion →
science →
software →
truth →
unix →
wiki →
ARTICLE TYPES
essay →
feed →
help →
system →
wiki →
ARTICLE ORIGINS
critical →
forked →
imported →
original →

Background
GetWiki allows TeX markup for mathematics and logic formulas. Instead of assuming complicated dependencies and server resources on all GetWiki-based wikis just to generate PNG images, GetWiki translates TeX into simple XHTML markup1, with LaTeX parsing and image rendering available as a deprecated option2. In the future, as browsers become even more XML capable, GetWiki could easily generate MathML instead, which is also a subset of XML.Mathematics and Logic formulas are rendered by placing your TeX code inside interchangeable
Using this approach has many advantages:
- Server resources beyond the wiki engine are not necessary
- Dependencies and mysterious subdependencies are avoided (LaTeX, Divips, Ghostsript, etc)
- Formula text matches the rest of the article, unlike defaulted Ghostcript images
- Formulas are indexable as text, with no TeX code used as image "alt text"
- Formulas align properly when displayed inline with text
- Text and background colours can be easily customized through CSS
Very complex formulas and matrices might very well fail to render correctly under this approach, so proofreading is necessary, and perhaps, further translation by the author(s) from TeX to plain text. Unfortunately, there is currently no perfect server-side solution to translating TeX for the web, so the approach in GetWiki is a compromise4, favouring standards and ease of setup: The advantages for a wiki outweigh the disadvantages5, and migration toward future developments in XML is trivial.
If you find a glaring omission of a symbol, function or argument which could be better represented using plain text entities, please post on the talk page for this article.
Formula Tags
feature | syntax | rendered |
---|---|---|
equivalent tags | ||
( |
( |
Simple Formulas
feature | syntax | rendered |
---|---|---|
standard functions | sin x + ln y + operatorname{sgn} z | s∈ x + ln y + |
sin {y} + ln x + cos z | s∈ |
|
Modular Algorithm | s_k equiv 0 pmod{m} | s |
Derivatives | nabla partial x dx dot x ddot y | ∇ &(art; x dx deriv(⋅) x dderiv(⋅) y |
Sets | forall x notin varnothing subseteq A cap B cup exists {x,y} times C | ∀ x not∈ varnoth∈g &su(;eq A &ca(; B &cu(; eξsts
|
Logic | p land bar{q} to plor lnot q therefore | ( ∧ |
Root | sqrt{2}approx 1.4 | √ |
sqrt[n]{x} | √[n] |
|
Relations | sim simeq cong le ge equiv notequiv approx ne | ∼ &≅; ≅ ≤ ≥ ≡ &≠; &asy&(lusmn;; ≠ |
Geometric | triangle angle perp | 45^circ | triang≤ ang≤ &(er(; || 45 |
Arrows |
leftarrow rightarrow leftrightarrow
longleftarrow longrightarrow mapsto longmapsto nearrow searrow swarrow nwarrow uparrow downarrow updownarrow |
← → ↔ long← long→ ma(s→ longma(s→ ≠arrow searrow swarrow nwarrow ↑ ⇓ u(⇓ |
Leftarrow Rightarrow Leftrightarrow
Longleftarrow Longrightarrow Longleftrightarrow Uparrow Downarrow Updownarrow |
⇐ ⇒ ⇔ Long← Long→ Long↔ ⇑ ↓ U(⇓
|
|
Special | oplus otimes pm mp hbar dagger ddagger star circ cdot times bullet infty | &o(lus; &o⋅; &(lusmn; &(lusmn; h |
Subscripts, Superscripts
feature | syntax | rendered |
---|---|---|
Superscript | a^2 | a |
Subscript | a_2 | a |
Grouping | a^{2+2} | a |
a_{i,j} | a |
|
Combining sub & super | x_2^3 | x |
Derivative | x' | x' |
x^prime | x |
|
xprime | x&(rime; |
|
Underlines & Overlines (use > to space) |
hat a bar b vec c widehat {d e f} overline {g h i} underline {j k l} | ^ a |
widehat {d>e>f} overline {g>h>i} underline {j>k>l} | wide^ |
Sum | sum_{k=1}^N k^2 | Σ |
Product | prod_{i=1}^N x_i | &(rod; |
Limit | lim_{n to infty}x_n | lim |
Integral | int_{-N}^{N} e^x, dx | ∈t |
Line Integral | oint_{C} x^3, dx + 4y^2, dy | o∈t |
Fractions, Matrices, Multilines
Fonts
feature | syntax | rendered |
---|---|---|
Greek Letters | alpha beta gamma Gamma phi Phi Psi tau Omega | &al(ha; &bη; γ Γ &(hi; Φ Ψ τ Ω |
Blackboard Bold | xinmathbb{R}submathbb{C} | ξn |
Boldface (Vectors) | mathbf{x}cdotmathbf{y} = 0 | |
Boldface (Greek) | boldsymbol{alpha} + boldsymbol{beta} + boldsymbol{gamma} | |
Fraktur Typeface | mathfrak{a} mathfrak{B} | Fraktur |
Script | mathcal{ABC} | Scri(t |
Hebrew Alphabet | aleph beth gimel daleth | a≤(h beth gimel da≤th |
Italics | mbox{abc} | |
mbox{if} n mbox{is even} | ||
mbox{if }nmbox{ is even} |
Parenthesizing Expressions
feature | syntax | rendered |
---|---|---|
Example | ( frac{1}{2} ) | ( 1/2 ) |
Example | ( {1}over{2} ) | ( |
Example | left ( frac{1}{2} right ) | (&nbs(;( 1/2 &nbs(;) ) |
You can use various delimiters with left and right:
feature | syntax | rendered |
---|---|---|
Parentheses | left ( A right ) | (&nbs(;( A &nbs(;) ) |
Brackets | left [ A right ] | (&nbs(;[ A &nbs(;) ] |
Braces | left { A right } | (&nbs(; |
Angle Brackets | left langle A right rangle | (&nbs(;lang≤ A &nbs(;) rang≤ |
Bars and Double Bars | left | A right | and left | B right | | (&nbs(;|| A &nbs(;) || and (&nbs(;|| B &nbs(;) || |
Delimiters can be mixed, as long as left and right match |
left [ 0,1 right ) left langle psi right | |
(&nbs(;[ 0 (&nbs(;lang≤ &(si; &nbs(;) ||
|
Use left. and right. if you don't want a delimiter to appear: |
left . frac{A}{B} right } to X | (&nbs(;. A/B &nbs(;) → X |
Spacing
feature | syntax | rendered |
---|---|---|
Doubled-Double Space | a qquad b | a &nbs(;&nbs(;&nbs(;&nbs(; b |
Double Space (quad) | a quad b | a &nbs(;&nbs(; b |
Large Space | a;b | a;b |
Medium Space | a>b | a>b |
Small Space (uses CSS) | a,b | a |
No Space | ab | ab |
Negative Space (uses CSS) | a!b | a |
Legacy Code
Forcing PNG rendering2 is ignored, such as placing ,! (small space and negative space, which cancel out) inside your tags. To turn on PNG rendering, the wiki administrator must toggle the setting in LocalSettings.php and ensure the dependency tree is installed and functioning (not recommended).syntax | rendered |
---|---|
a^{2+2} | a |
a^{2+2} ,! | a |
int_{-N}^{N} e^x, dx | ∈t |
int_{-N}^{N} e^x, dx ,! | ∈t |
Notes
- The PNG image generation is a great feature, but good only for a narrow use, and many developers are moving away from such solutions, toward standards-based XML, of which XHTML is a subset. The images certainly look nicer to the eye at first glance (on a white page, at least), but because their formulae cannot be indexed or searched, and because host systems sometimes cannot be configured correctly, the image-generation solution is neither standards-based nor accessible. In short, such solutions are behind the times.
- If you must, a toggle in LocalSettings.php will turn on the PNG rendering of formulae, assuming you have LaTeX, Divips, and Ghostscript installed, and only if their hidden and inconsistent dependencies are installed, which is different for each system. Also, download the texvc (+/- 400k) utility and place it in your installation directory. The related user options have been deprecated.
- This text approach has been tested with the formulas on this page, and seems to work perfectly for simple to intermediate formulas, but when your formulas become very complex, the text approach may not give the best results. This is, after all, a compromise. Consider typing our your fomulas using standard HTML/XHTML entities rather than using TeX, or adding an explanation for a complex formula.
- This was a problem on Wikinfo with this solution, where the host systems simply could not be configured correctly to support the assumptions built into MediaWiki. It was not only the image generation, but the very parsing of TeX with LaTeX, which was the problem. Weeks of testing resulted in having to lock out the settings from MediaWiki defaults (and eventually led to GetWiki).
- Unfortunately, along with problems with complex equations, some older browsers cannot display a few of the characters from the extended entity lists, and very old browsers cannot display the few CSS tweaks used, mentioned above. However, this has been kept to a minimum, and the character data is still indexable, searchable, and portable. CSS is used where actual characters are not available, such as negative spaces, or overlines.
External Links
- weblink - LaTeX tutorial
- weblink - (pp. 39-ff)
- weblink - (pp. 59, 72, with a complete reference list of symbols in LaTeX/AMS-LaTeX)
- weblink - TeX reference
- weblink - AMS-LaTeX reference
- weblink - symbol bitmaps (public domain)
Some content adapted from the MetaWikipedia article "MediaWiki User's Guide: Editing mathematical formulae" under the GNU Free Documentation License.
[ last updated: 6:17pm EDT - Sat, Aug 02 2008 ]
LATEST EDITS [ see all ]
GETWIKI 23 MAY 2022
The Illusion of Choice
Culture
Culture
GETWIKI 09 JUL 2019
Eastern Philosophy
History of Philosophy
History of Philosophy
GETWIKI 09 MAY 2016
GetMeta:About
GetWiki
GetWiki
GETWIKI 18 OCT 2015
M.R.M. Parrott
Biographies
Biographies
GETWIKI 20 AUG 2014
GetMeta:News
GetWiki
GetWiki
© 2007-2008, 2004-2023 M.R.M. PARROTT | ALL RIGHTS RESERVED