Help:TeX markup
Uit DGBC Wiki
De MediaWiki software gebruikt LaTeX opmaak om mathematische formules weer te geven en genereerd, afhankelijk van de gebruikers voorkeur en complexiteit van de formule, PNG afbeeldingen of simpele HTML opmaak. Mocht je gebruik maken van Mozilla Firefox dan kunt u MediaWiki instellen om uitgebreide HTML te genereren of zelfs MathML.
Mathematische, of kortweg Math, opmaak dient te worden geplaatst binnen de code <math> ... </math> . Het beginnen van een nieuwe regel binnen dit code-blok wordt niet weergeven en kan worden gebruikt om de formule leesbaar te houden (U zou bijvoorbeeld een nieuwe regel kunnen laten beginnen na elke term of rij in de matrix).
Houd u er rekening mee dat font groottes en typen binnen PNG afbeeldingen onafhankelijk zijn van de browser instellingen. De weergave van fonts in een PNG zal meestal afwijken als wanneer de formule via HTML wordt weergeven (bij dit laatste is wel de font grootte van de browser van toepassing). Gebruik geen TeX opmaak in een normale regel, juist vanwege de font grootte verschillen zullen er verschillen met de omliggende tekst optreden. De achtergrond kleur van een PNG afbeelding kan niet worden gewijzigd door de gebruiker.
Om dit goed te laten verlopen is een extra module vereist Deze module kan je downloaden op: http://wikitex.org/wikitex/, meer info kan je vinden op http://www.wikisophia.org/wiki/Main_Page.
Speciale karakters
| Toepassing | Syntaxis | Hoe het wordt weergeven |
|---|---|---|
| std. functies (goed) | \sin x + \ln y +\operatorname{sgn} z | <math>\sin x + \ln y +\operatorname{sgn} z</math> |
| std. functies (fout) | sin x + ln y + sgn z | <math>sin x + ln y + sgn z\,</math> |
| Modular arithm. | s_k \equiv 0 \pmod{m} | <math>s_k \equiv 0 \pmod{m}</math> |
| Afgeleiden | \nabla \partial x dx \dot x \ddot y | <math>\nabla \ \partial x \ dx \ \dot x\ \ddot y</math> |
| Sets | \forall x \not\in \varnothing \subseteq A \cap B \cup \exists \{x,y\}
\times C | <math>\forall x \not\in \varnothing \subseteq A \cap B \cup \exists
\{x,y\} \times C</math> |
| Logica | p \land \bar{q} \to p\lor \lnot q | <math>p \land \bar{q} \to p\lor \lnot q</math> |
| Worteltrekken | \sqrt{2}\approx 1.4 | <math>\sqrt{2}\approx 1.4</math> |
| \sqrt[n]{x} | <math>\sqrt[n]{x}</math> | |
| Relaties | \sim \simeq \cong \le \ge \equiv \not\equiv \approx \ne | <math> \sim \ \simeq \ \cong \ \le \ \ge \ \equiv \ \not\equiv \ \approx \ \ne</math> |
| Geometrie | 45^\circ | \ 45^\circ</math> |
| Pijlen |
\leftarrow \rightarrow \leftrightarrow |
<math>\leftarrow\ \rightarrow\ \leftrightarrow</math>
|
|
\Leftarrow \Rightarrow \Leftrightarrow |
<math>\Leftarrow\ \Rightarrow\ \Leftrightarrow</math>
| |
| Speciaal | \oplus \otimes \pm \mp \hbar \dagger \ddagger \star \circ \cdot \times
\bullet \infty | <math>\oplus \otimes \pm \mp \hbar \dagger \ddagger \star \circ
\cdot \times \bullet\ \infty</math> |
Subscript, superscript
| Toepassing | Syntaxis | Hoe het wordt weergeven |
|---|---|---|
| Superscript | a^2 | <math>a^2</math> |
| Subscript | a_2 | <math> a_2 </math> |
| Groepering | a^{2+2} | <math>a^{2+2}</math> |
| a_{i,j} | <math>a_{i,j}</math> | |
| Combineren van sub & super | x_2^3 | <math>x_2^3</math> |
| Afgeleide (goed) | x' | <math>x'</math> |
| Afgeleide (fout in HTML) | x^\prime | <math>x^\prime</math> |
| Afgeleide (fout in PNG) | x\prime | <math>x\prime</math> |
| Onderlijnen & bovenlijnen | \hat a \bar b \vec c \widehat {d e f} \overline {g h i} \underline {j k l} | <math>\hat a \ \bar b \ \vec c \ \widehat {d e f} \ \overline {g h i} \ \underline {j k l}</math> |
| Optellen | \sum_{k=1}^N k^2 | <math>\sum_{k=1}^N k^2</math> |
| Product | \prod_{i=1}^N x_i | <math>\prod_{i=1}^N x_i</math> |
| Limiet | \lim_{n \to \infty}x_n | <math>\lim_{n \to \infty}x_n</math> |
| Integraal | \int_{-N}^{N} e^x\, dx | <math>\int_{-N}^{N} e^x\, dx</math> |
| Lijn Integraal | \oint_{C} x^3\, dx + 4y^2\, dy | <math>\oint_{C} x^3\, dx + 4y^2\, dy</math> |
Fracties, matrices, multilijnen
| Toepassing | Syntaxis | Hoe het wordt weergeven |
|---|---|---|
| Fracties | \frac{2}{4} or {2 \over 4} | <math>\frac{2}{4}</math> |
| Binomial coefficienten | {n \choose k} | <math>{n \choose k}</math> |
| Matrices | \begin{pmatrix} x & y \\ z & v \end{pmatrix} | <math>\begin{pmatrix} x & y \\ z & v
\end{pmatrix}</math> |
| \begin{bmatrix} 0 & \cdots & 0 \\ \vdots &
\ddots & \vdots \\ 0 & \cdots & 0\end{bmatrix} | <math>\begin{bmatrix} 0 & \cdots & 0 \\ \vdots
& \ddots & \vdots \\ 0 & \cdots & 0\end{bmatrix} </math> | |
| \begin{Bmatrix} x & y \\ z & v \end{Bmatrix} | <math>\begin{Bmatrix} x & y \\ z & v
\end{Bmatrix}</math> | |
| \begin{vmatrix} x & y \\ z & v \end{vmatrix} | <math>\begin{vmatrix} x & y \\ z & v
\end{vmatrix}</math> | |
| \begin{Vmatrix} x & y \\ z & v \end{Vmatrix} | <math>\begin{Vmatrix} x & y \\ z & v
\end{Vmatrix}</math> | |
| \begin{matrix} x & y \\ z & v \end{matrix} | <math>\begin{matrix} x & y \\ z & v
\end{matrix}</math> | |
| Case distincties | f(n) = \left \{ \begin{matrix} n/2, & \mbox{if }n\mbox{ is
even} \\ 3n+1, & \mbox{if }n\mbox{ is odd} \end{matrix} \right. | <math>f(n) = \left \{ \begin{matrix} n/2, & \mbox{if }n\mbox{ is even} \\ 3n+1, & \mbox{if }n\mbox{ is odd} \end{matrix} \right. </math> |
| Meerlijnige vergelijkingen | \begin{matrix}f(n+1) & = & (n+1)^2 \\ \ &
= & n^2 + 2n + 1 \end{matrix} | <math>\begin{matrix}f(n+1) & = & (n+1)^2 \\ \ & = & n^2 + 2n + 1 \end{matrix}</math> |
Fonts
| Toepassing | Syntaxis | Hoe het wordt weergeven |
|---|---|---|
| Griekse letters | \alpha \beta \gamma \Gamma \phi \Phi \Psi\ \tau \Omega | <math>\alpha\ \beta\ \gamma\ \Gamma\ \phi\ \Phi\ \Psi\ \tau\ \Omega</math> |
| Schoolbord vetgedrukt | x\in\mathbb{R}\sub\mathbb{C} | <math>x\in\mathbb{R}\subset\mathbb{C}</math> |
| vetgedrukt (vectoren) | \mathbf{x}\cdot\mathbf{y} = 0 | <math>\mathbf{x}\cdot\mathbf{y} = 0</math> |
| vetgedrukt (grieks) | \boldsymbol{\alpha} + \boldsymbol{\beta} + \boldsymbol{\gamma} | <math>\boldsymbol{\alpha} + \boldsymbol{\beta} + \boldsymbol{\gamma}</math> |
| Fraktur typeface | \mathfrak{a} \mathfrak{B} | <math>\mathfrak{a} \mathfrak{B}</math> |
| Script | \mathcal{ABC} | <math>\mathcal{ABC}</math> |
| Hebreews | \aleph \beth \gimel \daleth | <math>\aleph\ \beth\ \gimel\ \daleth</math> |
| niet-italicised karakters | \mbox{abc} | <math>\mbox{abc}</math> |
| gemixte italics (fout) | \mbox{if} n \mbox{is even} | <math>\mbox{if} n \mbox{is even}</math> |
| gemixte italics (goed) | \mbox{if }n\mbox{ is even} | <math>\mbox{if }n\mbox{ is even}</math> |
Groeperen van grootte expressies
| Toepassing | Syntaxis | Hoe het wordt weergeven |
|---|---|---|
| Fout | ( \frac{1}{2} ) | <math>( \frac{1}{2} )</math> |
| Iets beter | \left ( \frac{1}{2} \right ) | <math>\left ( \frac{1}{2} \right )</math> |
U kunt verschillende delimiters gebruiken bij \left en \right:
| Toepassing | Syntaxis | Hoe het wordt weergeven |
|---|---|---|
| Parentheses | \left ( A \right ) | <math>\left ( A \right )</math> |
| Blokhaken | \left [ A \right ] | <math>\left [ A \right ]</math> |
| Braces | \left \{ A \right \} | <math>\left \{ A \right \}</math> |
| Angle brackets | \left \langle A \right \rangle | <math>\left \langle A \right \rangle</math> |
| Bars en dubbele bars | A \right | and \left \| B \right \| | A \right | and \left \| B \right \|</math> |
|
Delimiters kunnen worden gemixed, |
\left [ 0,1 \right ) |
<math>\left [ 0,1 \right )</math>
|
| Gebruik \left. en \right. als je niet wilt dat een delimiter zichtbaar wordt: | \left . \frac{A}{B} \right \} \to X | <math>\left . \frac{A}{B} \right \} \to X</math> |
Spatiëring
TeX handelt spaties automatisch af maar er zijn mogelijkheden om dit zelf te doen, indien nodig.
| Toepassing | Syntaxis | Hoe het wordt weergeven |
|---|---|---|
| dubbele quad spatie | a \qquad b | <math>a \qquad b</math> |
| quad spatie | a \quad b | <math> a \quad b</math> |
| tekst spatie | a\ b | <math>a\ b</math> |
| breede spatie | a\;b | <math>a\;b</math> |
| gemiddelde spatie | a\>b | [wordt niet ondersteund] |
| kleine spatie | a\,b | <math>a\,b</math> |
| geen spatie | ab | <math>ab\,</math> |
| negatieve spatie | a\!b | <math>a\!b</math> |
Geforceerde PNG weergave
Als u perse wilt is het mogelijk om formules altijd weer te laten geven als een PNG afbeelding, zodanig dat de weergave van de formule niet wordt beinvloed. Dit wordt gedaan door de code \,\! (kleine en negatieve spatie) binnen het math code-blok te zetten. (aan het einde is het handigst)
Dit kan zinvol zijn om bijvoorbeeld de weergave van formules consistent te houden, of voor formules die in HTML incorrect worden weergegeven (x prime of a^{2+2}) of om te demonstreren hoe zoiets wordt weergeven in HTML. Bijvoorbeeld:
| Syntaxis | Hoe het wordt weergeven |
|---|---|
| a^{2+2} | <math>a^{2+2}</math> |
| a^{2+2} \,\! | <math>a^{2+2} \,\!</math> |
| \int_{-N}^{N} e^x\, dx | <math> \int_{-N}^{N} e^x\, dx </math> |
| \int_{-N}^{N} e^x\, dx \,\! | <math> \int_{-N}^{N} e^x\, dx \,\! </math> |
Dit is getest met de meeste formules op deze pagina en lijkt perfect te werken.
U zou een HTML commentaar kunnen toevoegen zodat iemand de formule niet "verbetert" door de opmaak weg te halen:
You might want to include a comment in the HTML so people don't "correct" the formula by removing it:
- <!-- De \,\! is er voor bedoeld om de formule te laten weergeven als een PNG afbeelding in plaats van HTML code. Gelieve niet te verwijderen.-->
Externe Links
- Een LaTeX tutorial. http://www.maths.tcd.ie/~dwilkins/LaTeXPrimer/
- Een PDF document met een TeX introductie -- zie pagina 39 en verder voor een goede intro over the mathematisch kant: http://www.ctan.org/tex-archive/info/gentle/gentle.pdf
- Complete referentie lijst van symbolen: gezocht
- TeX referentie kaart: http://www.csit.fsu.edu/~mimi/tex/tex-refcard-letter.pdf
- Verschillende extensies voor LaTeX: http://www.ams.org/tex/amslatex.html
- Een set van public domain fixed-size math symbool bitmaps: http://us.metamath.org/symbols/symbols.html