Aiuto:Formule matematiche

Da WikiAppunti.
Jump to navigation Jump to search

Sintassi[modifica sorgente]

I comandi di TeX vanno racchiusi nei markup <math> ... </math>. La barra degli strumenti per la modifica contiene un pulsante apposito per questa operazione, vedi Barra degli strumenti di editing.

TeX tratta gli spazi bianchi e i ritorni a capo in modo molto simile all'HTML, cioè vengono ignorati. Si possono invece richiedere interruzioni di linea e altri posizionamenti con richieste apposite (ad esempio, un'interruzione di linea dopo ogni termine o riga di una matrice).

I template, le variabili e i parametri non possono contenere i tag math, per maggiori dettagli vedi Demo per l'utilizzo di parametri che includono TeX.

Per problemi con gli stili che riguardino la composizione di contenuto matematico si guardi Convenzioni di stile/Matematica (su Wikipedia). In particolare, si prega di evitare l'uso di formule in una riga di testo normale dato che le formule non hanno un allineamento coerente con il resto e il loro font ha una misura superiore.

Funzioni, simboli, caratteri speciali[modifica sorgente]

Caratteristica Sintassi Come appare
Accenti \acute{a} \quad \grave{a} \quad \breve{a} \quad \check{a} \quad \tilde{a} \quad \hat{a} \quad \dot{a} <math>\acute{a} \quad \grave{a} \quad \breve{a} \quad \check{a} \quad \tilde{a} \quad \hat{a} \quad \dot{a}</math>
Funzioni elementari (metodo corretto) \sin x + \ln y + \operatorname{sgn} \, z
\sin a \ \cos b \ \tan c \ \cot d \ \sec e \ \csc f
\sinh g \ \cosh h \ \tanh i \ \coth j
\arcsin k \ \arccos l \ \arctan m
\lim n \ \limsup o \ \liminf p
\min q \ \max r \ \inf s \ \sup t
\exp u \ \lg v \ \log w
\ker x \ \deg x \gcd x \Pr x \ \det x \hom x \ \arg x \dim x
<math>\sin x + \ln y + \operatorname{sgn} \, z</math>

<math>\sin a \ \cos b \ \tan c \ \cot d \ \sec e \ \csc f</math>
<math>\sinh g \ \cosh h \ \tanh i \ \coth j</math>
<math>\arcsin k \ \arccos l \ \arctan m</math>
<math>\lim n \ \limsup o \ \liminf p</math>
<math>\min q \ \max r \ \inf s \ \sup t</math>
<math>\exp u \ \lg v \ \log w</math>
<math>\ker x \ \deg x \gcd x \Pr x \ \det x \hom x \ \arg x \dim x</math>

Funzioni elementari (metodo non corretto) sin x + ln y + sgn z <math>sin x + ln y + sgn z</math>
Aritmetica dell'orologio s_k \equiv 0 \pmod{m}
a \bmod b
<math>s_k \equiv 0 \pmod{m}</math>

<math>a \bmod b</math>

Derivate \nabla \partial x dx \dot x \ddot y <math>\nabla \; \partial x \; dx \; \dot x \; \ddot y</math>
Insiemi \forall \exists \empty \emptyset \varnothing \in \ni \not\in \notin
\subset \subseteq \not\subseteq \supset \supseteq \cap \bigcap \cup \bigcup \biguplus \times \setminus \smallsetminus
<math>\forall \; \exists \; \empty \; \emptyset \; \varnothing \in \ni \not\in \notin</math>

<math>\subset \subseteq \not\subseteq \supset \supseteq \cap \bigcap \cup \bigcup \biguplus \times \setminus \smallsetminus</math>

\sqsubset \sqsubseteq \sqsupset \sqsupseteq \sqcap \sqcup \bigsqcup <math>\sqsubset \sqsubseteq \sqsupset \sqsupseteq \sqcap \sqcup \bigsqcup</math>
Logica p \land \wedge \bigwedge \bar{q} \to p \lor \vee \bigvee \lnot \neg q <math>p \land \wedge \; \bigwedge \; \bar{q} \to p \lor \vee \; \bigvee \; \lnot \; \neg q</math>
Radicali \sqrt{2}\approx 1{,}4 <math>\sqrt{2}\approx 1{,}4</math>
\sqrt[n]{x} <math>\sqrt[n]{x}</math>
Simboli relazionali \sim \approx \simeq \cong \doteq \le < \ll \gg \ge > \equiv \not\equiv \ne \propto \div \pm \mp <math>\sim \; \approx \; \simeq \; \cong \; \doteq \; \le \; < \; \ll \; \gg \; \ge \; > \; \equiv \; \not\equiv \; \ne \; \propto \; \div \; \pm \; \mp</math>
Simboli geometrici \Diamond \Box \triangle \angle \perp \mid \nmid \| 45^\circ \; 45^\circ</math>
Frecce \leftarrow \gets \rightarrow \to \leftrightarrow
\longleftarrow \longrightarrow
\mapsto \longmapsto \hookrightarrow \hookleftarrow
\nearrow \searrow \swarrow \nwarrow
\uparrow \downarrow \updownarrow \leftrightarrows
<math>\leftarrow \; \gets \; \rightarrow \; \to \; \leftrightarrow</math>

<math>\longleftarrow \; \longrightarrow</math>
<math>\mapsto \; \longmapsto \; \hookrightarrow \; \hookleftarrow</math>
<math>\nearrow \; \searrow \; \swarrow \; \nwarrow</math>
<math>\uparrow \; \downarrow \; \updownarrow\ \; \leftrightarrows</math>

\rightharpoonup \rightharpoondown \leftharpoonup \leftharpoondown \upharpoonleft \upharpoonright \downharpoonleft \downharpoonright <math>\rightharpoonup \; \rightharpoondown \; \leftharpoonup \; \leftharpoondown \; \upharpoonleft \; \upharpoonright \; \downharpoonleft \; \downharpoonright</math>
\Leftarrow \Rightarrow \Leftrightarrow
\Longleftarrow \Longrightarrow \Longleftrightarrow (o \iff)
\Uparrow \Downarrow \Updownarrow
<math>\Leftarrow \; \Rightarrow \; \Leftrightarrow</math>

<math>\Longleftarrow \; \Longrightarrow \; \Longleftrightarrow (o \iff)</math>
<math>\Uparrow \; \Downarrow \; \Updownarrow</math>

Simboli speciali \eth \S \P \% \dagger \ddagger \star * \ldots
\smile \frown \wr \oplus \bigoplus \otimes \bigotimes
\cdot \circ \bullet \bigodot \triangleleft \triangleright \infty \bot \top \vdash \vDash \Vdash \models \lVert \rVert
\imath \hbar \ell \mho \Finv \Re \Im \wp \complement \quad \diamondsuit \heartsuit \clubsuit \spadesuit \Game \quad \flat \natural \sharp
<math>\eth \; \S \; \P \; \% \; \dagger \; \ddagger \; \star \; * \; \ldots</math>

<math>\smile \frown \wr \oplus \bigoplus \otimes \bigotimes</math>
<math>\cdot \circ \bullet \bigodot \triangleleft \triangleright \infty \bot \top \vdash \vDash \Vdash \models \lVert \rVert</math>
<math>\imath \; \hbar \; \ell \; \mho \; \Finv \; \Re \; \Im \; \wp \; \complement \quad \diamondsuit \; \heartsuit \; \clubsuit \; \spadesuit \; \Game \quad \flat \; \natural \; \sharp</math>

Le lettere maiuscole con \mathcal consentono caratteri extra \mathcal {0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ} <math>\mathcal {0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ}</math>

Apici, pedici, integrali[modifica sorgente]

Caratteristica Sintassi Come appare
Apice a^2 <math>a^2</math>
Pedice a_2 <math> a_2 </math>
Raggruppamento a^{2+2} <math>a^{2+2}</math>
a_{i,j} <math>a_{i,j}</math>
Combinazione di apici e pedici x_2^3 <math>x_2^3</math>
Derivate x', y'', f', f'' <math>x', y, f', f </math>
Sottolineato, sopralineato, vettori \hat a \ \bar b \ \vec c \ \overrightarrow{a b} \ \overleftarrow{c d} \ \widehat{d e f} \ \overline{g h i} \ \underline{j k l} \ \tilde{x} <math>\hat a \ \bar b \ \vec c \ \overrightarrow{a b} \ \overleftarrow{c d} \ \widehat{d e f} \ \overline{g h i} \ \underline{j k l}\ \tilde{x}</math>
Parentesi sopra \overbrace{ 1+2+\cdots+100 }^{5050} <math>\overbrace{ 1+2+\cdots+100 }^{5050}</math>
Parentesi sotto \underbrace{ a+b+\cdots+z }_{26} <math>\underbrace{ a+b+\cdots+z }_{26}</math>
Sommatoria \sum_{k=1}^N k^2 <math>\displaystyle\sum_{k=1}^N k^2</math>
Sommatoria (forzando il \textstyle) \begin{matrix} \sum_{k=1}^N k^2 \end{matrix} <math>\begin{matrix} \sum_{k=1}^N k^2 \end{matrix}</math>
Produttoria \prod_{i=1}^N x_i <math>\prod_{i=1}^N x_i</math>
Produttoria (forzando il \textstyle) \begin{matrix} \prod_{i=1}^N x_i \end{matrix} <math>\begin{matrix} \prod_{i=1}^N x_i \end{matrix}</math>
Coproduttoria \coprod_{i=1}^N x_i <math>\coprod_{i=1}^N x_i</math>
Coproduttoria (forzando il \textstyle) \begin{matrix} \coprod_{i=1}^N x_i \end{matrix} <math>\begin{matrix} \coprod_{i=1}^N x_i \end{matrix}</math>
Limite \lim_{n \to \infty}x_n <math>\lim_{n \to \infty}x_n</math>
Limite (forzando il \textstyle) \begin{matrix} \lim_{n \to \infty}x_n \end{matrix} <math>\begin{matrix} \lim_{n \to \infty}x_n \end{matrix}</math>
Integrale \int_{-N}^{N} e^x\, dx <math>\int_{-N}^{N} e^x\, dx</math>
Integrale (forzando il \textstyle) \begin{matrix} \int_{-N}^{N} e^x\, dx \end{matrix} <math>\begin{matrix} \int_{-N}^{N} e^x\, dx \end{matrix}</math>
Integrale doppio \iint_{D}^{W} \, dx\,dy <math>\iint_{D}^{W} \, dx\,dy</math>
Integrale triplo \iiint_{E}^{V} \, dx\,dy\,dz <math>\iiint_{E}^{V} \, dx\,dy\,dz</math>
Integrale quadruplo \iiiint_{F}^{U} \, dx\,dy\,dz\,dt <math>\iiiint_{F}^{U} \, dx\,dy\,dz\,dt</math>
Integrale su frontiera \oint_{C} x^3\, dx + 4y^2\, dy <math>\oint_{C} x^3\, dx + 4y^2\, dy</math>
Intersezioni \bigcap_1^{n} p <math>\bigcap_1^{n} p</math>
Unioni \bigcup_1^{k} p <math>\bigcup_1^{k} p</math>

Frazioni, matrici, multi-linea[modifica sorgente]

Caratteristica Sintassi Come appare
Frazioni \frac{2}{4} oppure {2 \over 4} <math>\frac{2}{4}</math>
\tfrac{2}{4} <math>\tfrac{2}{4}</math>
Coefficienti binomiali \binom{n}{k} oppure {n \choose k} <math>{n \choose k}</math>
Matrici \begin{matrix} x & y \\ z & v \end{matrix} <math>\begin{matrix} x & y \\ z & v \end{matrix}</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{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>
Distinzione di casi f(n)=\begin{cases} n/2, & \mbox{se }n\mbox{ pari} \\ 3n+1, & \mbox{se }n\mbox{ dispari}

\end{cases}

<math>f(n)=\begin{cases} n/2, & \mbox{se }n\mbox{ pari} \\ 3n+1, & \mbox{se }n\mbox{ dispari} \end{cases} </math>
Equazioni su più righe \begin{align} f(n+1) &= (n+1)^2 \\ &= n^2 + 2n + 1\end{align} <math>\begin{align} f(n+1) &= (n+1)^2 \\ &= n^2 + 2n + 1\end{align}</math>

Formattazione caratteri[modifica sorgente]

Caratteristica Sintassi Come appare
Lettere greche maiuscole \Alpha \Beta \Gamma \Delta \Epsilon \Zeta \Eta \Theta \Iota \Kappa \Lambda \Mu \Nu \Xi \Omicron \Pi \Rho \Sigma \Tau \Upsilon \Phi \Chi \Psi \Omega <math>\Alpha\ \Beta\ \Gamma\ \Delta\ \Epsilon\ \Zeta\ \Eta\ \Theta\ \Iota\ \Kappa\ \Lambda\ \Mu\ \Nu\ \Xi\ \Omicron\ \Pi\ \Rho\ \Sigma\ \Tau\ \Upsilon\ \Phi\ \Chi\ \Psi\ \Omega </math>
Lettere greche minuscole \alpha \beta \gamma \delta \epsilon \zeta \eta \theta \iota \kappa \lambda \mu \nu \xi \omicron \pi \rho \sigma \tau \upsilon \phi \chi \psi \omega <math>\alpha\ \beta\ \gamma\ \delta\ \epsilon\ \zeta\ \eta\ \theta\ \iota\ \kappa\ \lambda\ \mu\ \nu\ \xi\ \omicron\ \pi\ \rho\ \sigma\ \tau\ \upsilon\ \phi\ \chi\ \psi\ \omega </math>
Altre lettere greche \varepsilon \digamma \vartheta \varkappa \varpi \varrho \varsigma \varphi <math>\varepsilon\ \digamma\ \vartheta\ \varkappa\ \varpi\ \varrho\ \varsigma\ \varphi </math>
Grassetto lavagna \mathbb{N} \mathbb{Z} \mathbb{Q} \mathbb{R} \mathbb{C} \mathbb{H} <math>\mathbb{N}\ \mathbb{Z}\ \mathbb{Q}\ \mathbb{R}\ \mathbb{C} \ \mathbb{H} </math>
Grassetto (per vettori) \mathbf{x}\cdot\mathbf{y} = 0 <math>\mathbf{x}\cdot\mathbf{y} = 0 </math>
Grassetto per lettere greche \boldsymbol{\alpha} + \boldsymbol{\beta} + \boldsymbol{\gamma} <math>\boldsymbol{\alpha} + \boldsymbol{\beta} + \boldsymbol{\gamma} </math>
Corsivo \mathit{ABCDE abcde 1234} <math>\mathit{ABCDE abcde 1234} </math>
Tipo di carattere Roman \mathrm{ABCDE abcde 1234} <math>\mathrm{ABCDE abcde 1234} </math>
Tipo di carattere Fraktur \mathfrak{ABCDE abcde 1234} <math>\mathfrak{ABCDE abcde 1234} </math>
Calligrafico \mathcal{ABCDE abcde 1234} <math>\mathcal{ABCDE abcde 1234} </math>
Lettere ebraiche \aleph \beth \gimel \daleth <math>\aleph\ \beth\ \gimel\ \daleth </math>
Caratteri non corsivi \mbox{abc} <math>\mbox{abc}</math>
Misto corsivo (cattivo esempio) \mbox{se} n \mbox{pari} <math>\mbox{se} n \mbox{pari}</math>
Misto corsivo (buon esempio) \mbox{se } n \mbox{ pari} <math>\mbox{se }n\mbox{ pari}</math>

Le parentesi nelle espressioni estese[modifica sorgente]

Caratteristica Sintassi Come appare
Da evitare ( \frac{1}{2} ) <math>( \frac{1}{2} )</math>
Preferibile \left( \frac{1}{2} \right) <math>\left ( \frac{1}{2} \right )</math>

Si possono usare vari delimitatori con \left e \right:

Caratteristica Sintassi Come appare
Parentesi tonde \left ( A \right ) <math>\left ( A \right )</math>
Parentesi quadre \left [ A \right ] <math>\left [ A \right ]</math>
Parentesi graffe \left \{ A \right \} <math>\left \{ A \right \}</math>
Parentesi angolari \left \langle A \right \rangle <math>\left \langle A \right \rangle</math>
Barre semplici e doppie \left | A \right | and \left \| B \right \| A \right | and \left \| B \right \|</math>

I delimitatori possono essere combinati,
facendoli corrispondere con \left e \right

\left [ 0,1 \right )
\left \langle \psi \right |

<math>\left [ 0,1 \right )</math>
<math>\left \langle \psi \right |</math>

Usare \left. and \right. se si vuole
omettere un delimitatore:
\left . \frac{A}{B} \right \} \to X <math>\left . \frac{A}{B} \right \} \to X</math>

Spaziatura[modifica sorgente]

Si rammenta che TeX tratta la spaziatura in modo per lo più automatico, ma a volte può essere necessario controllarla direttamente.

Caratteristica Sintassi Come appare
Doppia spaziatura quad a \qquad b <math>a \qquad b</math>
Spaziatura quad a \quad b <math> a \quad b</math>
Spaziatura del testo a\ b <math>a\ b</math>
Spaziatura grande a\;b <math>a\;b</math>
Spaziatura media a\>b [non supportata]
Spaziatura piccola a\,b <math>a\,b</math>
Nessuna spaziatura ab <math>ab</math>
Spaziatura negativa a\!b <math>a\!b</math>

Allineamento col testo normale[modifica sorgente]

Per impostazione predefinita un'espressione matematica appare allineata verticalmente al centro per esempio così: <math>\int_{-N}^{N} e^x\, dx</math>.

Se dovete assolutamente allineare in altro modo usate <div style="vertical-align: -100%; display: inline;"><math> ... </math></div> e giocate con il valore di vertical-align finchè non raggiungete il risultato desiderato. Comunque molto spesso il rendering cambia da browser a browser, non preoccupatevi se a casa vostra vedete una cosa e dal vostro amico un'altra.

Esempi[modifica sorgente]

Polinomio di secondo grado:

<math>ax^2 + bx + c = 0</math>

<math>ax^2 + bx + c = 0</math>


<math>x_{1,2}=\frac{-b\pm\sqrt{b^2-4ac


{2a}</math>

|codice=<math>x_{1,2}=\frac{-b\pm\sqrt{b^2-4ac}}{2a}</math> |titolo=Soluzioni di un'equazione di secondo grado}}

Radici quadrate:

<math>\sqrt{256}=16</math>

<math>\sqrt{256}=16</math>


Radici di molteplicità qualsiasi:

<math>\sqrt[5]{32}=2</math>

<math>\sqrt[5]{32}=2</math>


Sistemi di equazioni:

<math>\begin{cases} 3x-y+8=0\\ 7-6x+12y=0\\ \end{cases}</math>

<math>\begin{cases} 3x-y+8=0\\

 7-6x+12y=0\\
 \end{cases}</math>

<math>\log_{a}{b}=\frac{\log_{c}{b


{\log_{c}{a}}</math>

|codice=<math>\log_{a}{b}=\frac{\log_{c}{b}}{\log_{c}{a}}</math> |titolo=Logaritmi}}

Parentesi e frazioni:

<math>2=\left[\frac{\left(3-x\right)\times 2}{3-x}\right]</math>

<math>2=\left[\frac{\left(3-x\right)\times 2}{3-x}\right]</math>


Integrali:

<math>\int_a^x \int_a^s f(y)\,dy\,ds = \int_a^x f(y)(x-y)\,dy</math>

<math>\int_a^x \int_a^s f(y)\,dy\,ds = \int_a^x f(y)(x-y)\,dy</math>


Sommatorie:

<math>\sum_{m=1}^\infty\sum_{n=1}^\infty\frac{m^2\,n} {3^m\left(m\,3^n+n\,3^m\right)}</math>

<math>\sum_{m=1}^\infty\sum_{n=1}^\infty\frac{m^2\,n}{3^m\left(m\,3^n+n\,3^m\right)}</math>


Equazioni differenziali:

<math>u'' + p(x)u' + q(x)u=f(x),\quad x>a</math>

<math>u + p(x)u' + q(x)u=f(x),\quad x>a</math>


Numeri complessi:

<math>|\bar{z}| = |z|, |(\bar{z})^n| = |z|^n, \arg(z^n) = n \arg(z)</math>

<math>


Limiti:

<math>\lim_{z\rightarrow z_0} f(z)=f(z_0)</math>

<math>\lim_{z\rightarrow z_0} f(z)=f(z_0)</math>


Equazioni integrali:

<math>\phi_n(\kappa) = \frac{1}{4\pi^2\kappa^2} \int_0^\infty \frac{\sin(\kappa R)}{\kappa R} \frac{\partial}{\partial R}\left[R^2\frac{\partial D_n(R)}{\partial R}\right]\,dR</math>

<math>\phi_n(\kappa) = \frac{1}{4\pi^2\kappa^2} \int_0^\infty \frac{\sin(\kappa R)}{\kappa R} \frac{\partial}{\partial R}\left[R^2\frac{\partial D_n(R)}{\partial R}\right]\,dR</math>


Esempio generico:

<math>\phi_n(\kappa) = 0,\!033 \, C_n^2 \, \kappa^{-11/3},\quad \frac{1}{L_0}\ll\kappa\ll\frac{1}{l_0}</math>

<math>\phi_n(\kappa) = 0,\!033 \, C_n^2 \, \kappa^{-11/3},\quad \frac{1}{L_0}\ll\kappa\ll\frac{1}{l_0}</math>


Funzioni definite a tratti:

<math>f(x) = \begin{cases}1 & -1 \le x < 0\\
\frac{1}{2} & x = 0\\x&0<x\le 1\end{cases}</math>

<math>f(x) = \begin{cases}1 & -1 \le x < 0\\ \frac{1}{2} & x = 0\\x&0<x\le 1\end{cases}</math>


Pedice prescritta:

<math>{}_pF_q(a_1,\cdots ,a_p;c_1,\cdots ,c_q;z) = \sum_{n=0}^\infty \frac{(a_1)_n\cdots (a_p)_n}{(c_1)_n\cdots (c_q)_n}\frac{z^n}{n!}</math>

<math>{}_pF_q(a_1,\dots,a_p;c_1,\cdots,c_q;z) = \sum_{n=0}^\infty \frac{(a_1)_n\cdots(a_p)_n}{(c_1)_n\cdots(c_q)_n}\frac{z^n}{n!}</math>

Note tecniche[modifica sorgente]

MediaWiki usa un sottoinsieme dei markup di TeX (incluse qualche estensione di LaTeX e AMSLaTeX) per la formattazione di formule matematiche, e le converte in immagini PNG.

Più precisamente MediaWiki filtra il markup attraverso Texvc, che converte i comandi in TeX per poi darli in pasto al motore di rendering, così che solo una piccola parte del linguaggio TeX è supportata.

Pagine correlate[modifica sorgente]

Collegamenti esterni[modifica sorgente]