Aiuto:Formule matematiche TeX: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
m Font: residuo traduzione
m Annullata la modifica 142628281 di 151.36.127.170 (discussione)
Etichetta: Annulla
 
(179 versioni intermedie di 100 utenti non mostrate)
Riga 1:
{{TOCrightTOC Aiuto|right}}
{{abbreviazioni|WP:MATH|WP:TEX|WP:LATEX|Aiuto:TeX}}
'''Questa pagina è la traduzione della pagina inglese [[:meta:Help:Formula]]. Verrà aggiornata di tanto in tanto, ma la pagina inglese resta la guida di riferimento ufficiale.'''
'''Questa pagina è la traduzione della pagina inglese [[:meta:Help:Formula]]. Verrà aggiornata di tanto in tanto, ma la pagina inglese resta la guida di riferimento.'''
 
Dal [[gennaio]] [[2003]], è stata aggiunta la possibilità di usare su Wikipedia dei comandi [[TeX]] per formule matematiche.
Dal [[gennaio]] [[2003]], è stato aggiunta la possibilità di usare su Wikipedia dei comandi [[TeX]] per formule matematiche. Tali stringhe nel caso di espressioni semplici generano del semplice markup [[HTML]], nel caso di espressioni elaborate generano immagini [[PNG]] di maggiore evidenza che si differenziano dalle parti verbali. Se si vuole dare evidenza anche ad espressioni semplici, basta renderle elaborate aggiungendo richieste di spaziatura (v.o.). Nel futuro, col miglioramento dei browser, si apriranno possibilità di generare markup HTML (o [[XHTML]]) più sofisticato e di richiedere anche inserti [[MathML]] (e di controllare grafici con richieste in [[SVG]]).
 
'''Ogni markup matematico deve rientrare all'interno dei due tag <nowiki><{{tag|math> ... </math></nowiki>.'''}} Le interruzioni fisiche di linea all'interno di questi tag non vengono tradotte. 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).'''
 
Discussioni, errori riscontrati e richieste di caratteristiche aggiuntive andrebbero indirizzate alla [http://mail.wikipedia.org/mailman/listinfo/wikitech-l mailing list Wikitech-l] oppure a [[:en:Wikipedia:TeX_requests|Wikipedia:TeX requests]] (''in inglese'').
 
Per problemi con gli stili che riguardino la composizione di contenuto matematico si guardi: [[Progetto:en:Wikipedia:WikiProject_Mathematics|WikiProjectMatematica/Manuale Mathematicsdi stile]] (''in inglese''). 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.
 
Per quanto rigurdariguarda il colore, si tenga presente che talequesta pagina è considerata speciale (il suo nome comincia con "Aiuto:") ed ha perciò uno sfondo rosa. Le pagine normali di Wikipedia sono bianche, come lo sfondo delle formule, quindi non dovrebbero comportare alcun problema.
 
== MediaWiki e TeX ==
[[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 [[Portable Network Graphics|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. Per maggiori dettagli vedi di seguito.
[[MediaWiki]] usa un sottoinsieme dei markup di '''[[TeX]]''' (incluse qualche estensione di [[LaTeX]] e [[AMSLaTeX]]) per la formattazione di formule matematiche. Può essere generata un'immagine [[PNG]] oppure una semplice stringa di [[HTML]]. Quello che viene mostrato all'utente dipende dalle sue preferenze e dalla complessità dell'espressione. In futuro, come molti browser sono già in grado di fare, sarà possibile sfruttare, oltre all'HTML il linguaggio di markup [[MathML]].
 
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. Per maggiori dettagli vedi di seguito.
 
== Sintassi ==
I comandi di TeX vanno racchiusi nei markup {{tag|math}}. La barra degli strumenti per la modifica contiene un pulsante apposito per questa operazione, vedi [[m:Help:Edit_toolbar|Barra degli strumenti di editing]].
 
I comandi di TeX vanno racchiusi nei markup <code><nowiki><math> ... </math></nowiki></code>. La barra degli strumenti per la modifica contiene un pulsante apposito per questa operazione, vedi [[m:Help:Edit_toolbar|Modificare la barra degli strumenti]].
 
'''[[TeX]]''' tratta gli spazi bianchi e i ritorno-a-capo in modo molto simile all'[[HTML]], cioè vengono ignorati, ma vedremo in seguito come aggirare questo problema (anche se non si tratta di un vero e proprio problema).
Riga 27 ⟶ 26:
 
== Funzioni, simboli, caratteri speciali ==
{| class="wikitable" border="2" cellpadding="4" cellspacing="0" style="margin: 1em 1em 1em 0; background: #fff; border: 1px #aaa solid; border-collapse: collapse;" width="100%"
 
{| border="2" cellpadding="4" cellspacing="0" style="margin: 1em 1em 1em 0; background: #fff; border: 1px #aaa solid; border-collapse: collapse;" width="100%"
|-
! Caratteristica
Riga 35 ⟶ 33:
|-
| Accenti
| <code>\acute{a} \quad \grave{a} \quad \breve{a} \quad \check{a} \quad \tilde{a} \quad \hat{a} \quad \dot{a}</code>
| <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)
| <code>\sin x + \ln y + \operatorname{sgn} \, z<br />\sin a \ \cos b \ \tan c \ \cot d \ \sec e \ \csc f<br />\sinh g \ \cosh h \ \tanh i \ \coth j<br />\arcsin k \ \arccos l \ \arctan m<br />\lim n \ \limsup o \ \liminf p<br />\min q \ \max r \ \inf s \ \sup t<br />\exp u \ \lg v \ \log w<br />\ker x \ \deg x \gcd x \Pr x \ \det x \hom x \ \arg x \dim x</code>
| \sin x + \ln y +\operatorname{sgn} z<br/>
| <math>\sin x + \ln y + \operatorname{sgn} \, z</math><br /><math>\sin a \ \cos b \ \tan c \ \cot d \ \sec e \ \csc f</math><br /><math>\sinh g \ \cosh h \ \tanh i \ \coth j</math><br /><math>\arcsin k \ \arccos l \ \arctan m</math><br /><math>\lim n \ \limsup o \ \liminf p</math><br /><math>\min q \ \max r \ \inf s \ \sup t</math><br /><math>\exp u \ \lg v \ \log w</math><br /><math>\ker x \ \deg x \gcd x \Pr x \ \det x \hom x \ \arg x \dim x</math>
\sin a \ \cos b \ \tan c \ \cot d \ \sec e \ \csc f<br/>
\sinh g \ \cosh h \ \tanh i \ \coth j<br/>
\arcsin k \ \arccos l \ \arctan m<br/>
\lim n \ \limsup o \ \liminf p<br/>
\min q \ \max r \ \inf s \ \sup t<br/>
\exp u \ \lg v \ \log w<br/>
\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><br/>
<math>\sin a \ \cos b \ \tan c \ \cot d \ \sec e \ \csc f\!</math><br/>
<math>\sinh g \ \cosh h \ \tanh i \ \coth j\!</math><br/>
<math>\arcsin k \ \arccos l \ \arctan m\!</math><br/>
<math>\lim n \ \limsup o \ \liminf p\!</math><br/>
<math>\min q \ \max r \ \inf s \ \sup t\!</math><br/>
<math>\exp u \ \lg v \ \log w\!</math><br/>
<math>\ker x \ \deg x \gcd x \Pr x \ \det x \hom x \ \arg x \dim x\!</math>
|-
| Funzioni elementari (metodo non corretto)
| <code>sin x + ln y + sgn z</code>
| <math>sin x + ln y + sgn z\,\!</math>
|-
| Aritmetica dell'orologio
| <code>s_k \equiv 0 \pmod{m}<br />a \bmod b</code>
| <math>s_k \equiv 0 \pmod{m}</math><br /><math>a \bmod b</math>
a \bmod b
| <math>s_k \equiv 0 \pmod{m}\!</math><br/>
<math>a \bmod b\,\!</math>
|-
| Derivate
| <code>\nabla \; \partial x \; dx \; \dot x \; \ddot y</code>
| <math>\nabla \; \partial x \; dx \; \dot x \; \ddot y\!</math>
|-
| rowspan="2" | Insiemi
| <code>\forall \; \exists \; \empty \; \emptyset \; \varnothing \in \ni \not\in \notin<br />\subset \subseteq \not\subseteq \supset \supseteq \cap \bigcap \cup \bigcup \biguplus \times \setminus \smallsetminus</code>
| <math>\forall \; \exists \; \empty \; \emptyset \; \varnothing \in \ni \not\in \notin</math><br /><math>\subset \subseteq \not\subseteq \supset \supseteq \cap \bigcap \cup \bigcup \biguplus \times \setminus \smallsetminus</math>
| <math>\forall \; \exists \; \empty \; \emptyset \; \varnothing \in \ni \not\in \notin\!</math><br/>
<math>\subset \subseteq \supset \supseteq \cap \bigcap \cup \bigcup \biguplus\!</math>
|-
| <code>\sqsubset \sqsubseteq \sqsupset \sqsupseteq \sqcap \sqcup \bigsqcup</code>
| <math>\sqsubset \sqsubseteq \sqsupset \sqsupseteq \sqcap \sqcup \bigsqcup\!</math>
|-
| Logica
| <code>p \land \wedge \; \bigwedge \; \bar{q} \to p \; \lor \vee \; \bigvee \; \lnot \; \neg q \; \setminus \; \smallsetminus</code>
| <math>p \land \wedge \; \bigwedge \; \bar{q} \to p \lor \vee \; \bigvee \; \lnot \; \neg q \; \setminus \; \smallsetminus\!</math>
|-
| rowspan="2" | Radicali
| <code>\sqrt{2}\approx 1.{,}4</code>
| <math>\sqrt{2}\approx 1.{,}4\!</math>
|-
| <code>\sqrt[n]{x}</code>
| <math>\sqrt[n]{x}\!</math>
|-
| Simboli relazionali
| <code>\sim \; \approx \; \simeq \; \cong \;doteq \le \; < \; \ll \; \gg \; \ge \; > \; \equiv \; \not\equiv \; \ne \; \propto \;div \pm \; \mp</code>
| <math>\sim \; \approx \; \simeq \; \cong \; \doteq \; \le \; < \; \ll \; \gg \; \ge \; > \; \equiv \; \not\equiv \; \ne \; \propto \; \div \; \pm \; \mp\!</math>
|-
| Simboli geometrici
| <code>\Diamond \; \Box \; \triangle \; \angle \; \perp \; \mid \; \nmid \; <nowiki>\|</nowiki> \; 45^\circ</code>
| <math>\Diamond \; \Box \; \triangle \; \angle \; \perp \; \mid \; \nmid \; \| \; 45^\circ\!</math>
|-
| rowspan="3" | Frecce
| <code>\leftarrow \gets \rightarrow \to \leftrightarrow<br />\longleftarrow \longrightarrow<br />\mapsto \longmapsto \hookrightarrow \hookleftarrow<br />\nearrow \searrow \swarrow \nwarrow<br />\uparrow \downarrow \updownarrow \leftrightarrows</code>
| \leftarrow \; \gets \; \rightarrow \; \to \; \leftrightarrow<br/>
| <math>\leftarrow \; \gets \; \rightarrow \; \to \; \leftrightarrow</math><br /><math>\longleftarrow \; \longrightarrow</math><br /><math>\mapsto \; \longmapsto \; \hookrightarrow \; \hookleftarrow</math><br /><math>\nearrow \; \searrow \; \swarrow \; \nwarrow</math><br /><math>\uparrow \; \downarrow \; \updownarrow\ \; \leftrightarrows</math>
\longleftarrow \; \longrightarrow<br/>
\mapsto \; \longmapsto \; \hookrightarrow \; \hookleftarrow<br/>
\nearrow \; \searrow \; \swarrow \; \nwarrow<br/>
\uparrow \; \downarrow \; \updownarrow
| <math>\leftarrow \; \gets \; \rightarrow \; \to \; \leftrightarrow\!</math><br/>
<math>\longleftarrow \; \longrightarrow\!</math><br/>
<math>\mapsto \; \longmapsto \; \hookrightarrow \; \hookleftarrow\!</math><br/>
<math>\nearrow \; \searrow \; \swarrow \; \nwarrow\!</math><br/>
<math>\uparrow \; \downarrow \; \updownarrow\!</math>
|-
| <code>\rightharpoonup \; \rightharpoondown \; \leftharpoonup \; \leftharpoondown \; \upharpoonleft \; \upharpoonright \; \downharpoonleft \; \downharpoonright</code>
| <math>\rightharpoonup \; \rightharpoondown \; \leftharpoonup \; \leftharpoondown \; \upharpoonleft \; \upharpoonright \; \downharpoonleft \; \downharpoonright\!</math>
|-
| <code>\Leftarrow \Rightarrow \Leftrightarrow<br />\Longleftarrow \Longrightarrow \Longleftrightarrow (o \iff)<br />\Uparrow \Downarrow \Updownarrow</code>
| \Leftarrow \; \Rightarrow \; \Leftrightarrow<br/>
| <math>\Leftarrow \; \Rightarrow \; \Leftrightarrow</math><br /><math>\Longleftarrow \; \Longrightarrow \; \Longleftrightarrow (oro \iff)</math><br /><math>\Uparrow \; \Downarrow \; \Updownarrow</math>
\Uparrow \; \Downarrow \; \Updownarrow
| <math>\Leftarrow \; \Rightarrow \; \Leftrightarrow\!</math><br/>
<math>\Longleftarrow \; \Longrightarrow \; \Longleftrightarrow (or \iff)\!</math><br/>
<math>\Uparrow \; \Downarrow \; \Updownarrow\!</math>
|-
| Simboli speciali
| <code>\eth \S \P \% \dagger \ddagger \star * \ldots<br />\smile \frown \wr \oplus \bigoplus \otimes \bigotimes<br />\cdot \circ \bullet \bigodot \triangleleft \triangleright \infty \bot \top \vdash \vDash \Vdash \models \lVert \rVert<br />\imath \hbar \ell \mho \Finv \Re \Im \wp \complement \quad \diamondsuit \heartsuit \clubsuit \spadesuit \Game \quad \flat \natural \sharp</code>
| \eth \; \S \; \P \; \% \; \dagger \; \ddagger \; \star \; * \; \ldots<br/>
| <math>\eth \; \S \; \P \; \% \; \dagger \; \ddagger \; \star \; * \; \ldots</math><br /><math>\smile \frown \wr \oplus \bigoplus \otimes \bigotimes</math><br /><math>\cdot \circ \bullet \bigodot \triangleleft \triangleright \infty \bot \top \vdash \vDash \Vdash \models \lVert \rVert</math><br /><math>\imath \; \hbar \; \ell \; \mho \; \Finv \; \Re \; \Im \; \wp \; \complement \quad \diamondsuit \; \heartsuit \; \clubsuit \; \spadesuit \; \Game \quad \flat \; \natural \; \sharp</math>
\smile \frown \wr \oplus \bigoplus \otimes \bigotimes<br/>
\times \cdot \circ \bullet \bigodot \triangleleft \triangleright \infty \bot \top \vdash \vDash \Vdash \models \lVert \rVert<br/>
\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><br/>
<math>\smile \frown \wr \oplus \bigoplus \otimes \bigotimes\!</math><br/>
<math>\times \cdot \circ \bullet \bigodot \triangleleft \triangleright \infty \bot \top \vdash \vDash \Vdash \models \lVert \rVert\!</math><br/>
<math>\imath \; \hbar \; \ell \; \mho \; \Finv \; \Re \; \Im \; \wp \; \complement \quad \diamondsuit \; \heartsuit \; \clubsuit \; \spadesuit \; \Game \quad \flat \; \natural \; \sharp\!</math>
|-
| Le lettere minuscolemaiuscole con \mathcal consentono caratteri extra
| <code>\mathcal {45abcdenpqs0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ}</code>
| <math>\mathcal {45abcdenpqs0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ}\!</math>
|}
 
== Apici, pedici, integrali ==
{| class="wikitable" border="2" cellpadding="4" cellspacing="0" style="margin: 1em 1em 1em 0; background: #fff; border: 1px #aaa solid; border-collapse: collapse;" width="100%"
|-
! Caratteristica
! Sintassi
! colspan="2" | Come appare
|-
! &nbsp;
! &nbsp;
! HTML
! PNG
|-
| Apice
| <code>a^2</code>
| <math>a^2</math>
| <math>a^2 \!</math>
|-
| Pedice
| <code>a_2</code>
| <math> a_2 </math>
| <math> a_2 \!</math>
|-
| rowspan="2" | Raggruppamento
| <code>a^{2+2}</code>
| <math>a^{2+2}</math>
| <math>a^{2+2} \!</math>
|-
| <code>a_{i,j}</tdcode>
| <math>a_{i,j}</math>
| <math>a_{i,j} \!</math>
|-
| Combinazione di apici e pedici
| <code>x_2^3</code>
| <math>x_2^3</math>
| <math>x_2^3 \!</math>
|-
| Derivate (forzato in PNG)
| <code><nowiki> x', y'', f', f'' </nowiki></code>
| &nbsp;
| <math>x', y'', f', f'' \!</math>
|-
| Derivate (il corsivo sovrappone gli apici)
| x', y'', f', f''
| <math>x', y'', f', f''</math>
| <math>x', y'', f', f'' \!</math>
|-
| Derivate (errato in HTML)</td>
| x^\prime, y^{\prime\prime}
| <math>x^\prime, y^{\prime\prime}</math>
| <math>x^\prime, y^{\prime\prime} \!</math>
|-
| Derivate (errato in PNG)</td>
| x\prime, y{\prime\prime}
| <math>x\prime, y{\prime\prime}</math>
| <math>x\prime, y{\prime\prime} \!</math>
|-
| Sottolineato, sopralineato, vettori
| <code>\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}</code>
| colspan="2" | <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
| \begin{matrix} 5050 \\ <code>\overbrace{ 1+2+\cdots+100 } \end^{matrix5050}</code>
| colspan="2" | <math>\begin{matrix} 5050 \\ \overbrace{ 1+2+\cdots+100 } \end^{matrix5050} \!</math>
|-
| Parentesi sotto
| \begin{matrix} <code>\underbrace{ a+b+\cdots+z } \\ _{26 \end{matrix}</code>
| colspan="2" | <math>\begin{matrix} \underbrace{ a+b+\cdots+z } \\ _{26 \end{matrix} \!</math>
|-
| Sommatoria
| <code>\sum_{k=1}^N k^2</code>
| colspan="2" | <math>\displaystyle\sum_{k=1}^N k^2</math></td>
|-
| Sommatoria (forzando il <ttcode>\textstyle</ttcode>)
| <code>\begin{matrix} \sum_{k=1}^N k^2 \end{matrix}</code>
| colspan="2" | <math>\begin{matrix} \sum_{k=1}^N k^2 \end{matrix}</math></td>
|-
| Produttoria
| <code>\prod_{i=1}^N x_i</code>
| colspan="2" | <math>\prod_{i=1}^N x_i</math>
|-
| Produttoria (forzando il <ttcode>\textstyle</ttcode>)
| <code>\begin{matrix} \prod_{i=1}^N x_i \end{matrix}</code>
| colspan="2" | <math>\begin{matrix} \prod_{i=1}^N x_i \end{matrix}</math>
|-
| Coproduttoria
| <code>\coprod_{i=1}^N x_i</tdcode>
| colspan="2" | <math>\coprod_{i=1}^N x_i</math>
|-
| Coproduttoria (forzando il <ttcode>\textstyle</ttcode>)
| <code>\begin{matrix} \coprod_{i=1}^N x_i \end{matrix}</code>
| colspan="2" | <math>\begin{matrix} \coprod_{i=1}^N x_i \end{matrix}</math>
|-
| Limite
| <code>\lim_{n \to \infty}x_n</code>
| colspan="2" | <math>\lim_{n \to \infty}x_n</math>
|-
| Limite (forzando il <ttcode>\textstyle</ttcode>)
| <code>\begin{matrix} \lim_{n \to \infty}x_n \end{matrix}</code>
| colspan="2" | <math>\begin{matrix} \lim_{n \to \infty}x_n \end{matrix}</math>
|-
| Integrale
| <code>\int_{-N}^{N} e^x\, dx</code>
| colspan="2" | <math>\int_{-N}^{N} e^x\, dx</math>
|-
| Integrale (forzando il <ttcode>\textstyle</ttcode>)
| <code>\begin{matrix} \int_{-N}^{N} e^x\, dx \end{matrix}</code>
| td colspan="2" | <math>\begin{matrix} \int_{-N}^{N} e^x\, dx \end{matrix}</math>
|-
| Integrale doppio
| <code>\iint_{D}^{W} \, dx\,dy</code>
| colspan="2" | <math>\iint_{D}^{W} \, dx\,dy</math>
|-
| Integrale triplo
| <code>\iiint_{E}^{V} \, dx\,dy\,dz</code>
| colspan="2" | <math>\iiint_{E}^{V} \, dx\,dy\,dz</math>
|-
| Integrale quadruplo
| <code>\iiiint_{F}^{U} \, dx\,dy\,dz\,dt</code>
| colspan="2" | <math>\iiiint_{F}^{U} \, dx\,dy\,dz\,dt</math>
|-
| Integrale curvilineosu [[frontiera (topologia)|frontiera]]
| <code>\oint_{C} x^3\, dx + 4y^2\, dy</code>
| colspan="2" | <math>\oint_{C} x^3\, dx + 4y^2\, dy</math>
|-
| Intersezioni
| <code>\bigcap_1^{n} p</code>
| colspan="2" | <math>\bigcap_1^{n} p</math>
|-
| Unioni
| <code>\bigcup_1^{k} p</code>
| colspan="2" | <math>\bigcup_1^{k} p</math>
|}
 
== Frazioni, matrici, multi-linea ==
{| class="wikitable" border="2" cellpadding="4" cellspacing="0" style="margin: 1em 1em 1em 0; background: #fff; border: 1px #aaa solid; border-collapse: collapse;" width="100%"
|-
! Caratteristica
Riga 275 ⟶ 211:
! Come appare
|-
| rowspan="2" | Frazioni
| \frac{2}{4} oroppure {2 \over 4}
| <math>\frac{2}{4}\!</math>
|-
| \tfrac{2}{4}
| <math>\tfrac{2}{4}</math>
|-
| Coefficienti binomiali
| \binom{n}{k} oroppure {n \choose k}
| <math>{n \choose k}</math>
|-
| rowspan="65" | 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 &<br />\ddots & \vdots \\ 0 & \cdots &<br />0\end{bmatrix}
\ddots & \vdots \\ 0 & \cdots &<br/>
0\end{bmatrix}\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} x & y \\ z & v \end{Bmatrix}
| <math>\begin{Bmatrix} x & y \\ z & v \end{Bmatrix}\!</math>
|-
| \begin{Bmatrix} x & y \\ z & v \end{Bmatrix}
Riga 305 ⟶ 239:
|-
| Distinzione di casi
| f(n)=\left\{\begin{matrixcases} n/2, & \mbox{se }n\mbox{ pari} \\ 3n+1, & \mbox{se }n\mbox{ dispari}
\end{matrixcases}\right.
| <math>f(n)=\left\{\begin{matrixcases} n/2, & \mbox{se }n\mbox{ pari} \\ 3n+1, & \mbox{se }n\mbox{ dispari} \end{matrixcases}\right. </math>
|-
| Equazioni su più righe
| \begin{matrixalign} 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{matrixalign}</tdmath>
| <math>\begin{matrix}f(n+1)&=& (n+1)^2 &= \\ \ & =& n^2 + 2n + 1\end{matrix}</math>
|-
| Equazioni su più righe (alternativa usando le tabelle)
|
<pre>
<nowiki>
{|
|-
|<math>f(n+1)</math>
|<math>=(n+1)^2=</math>
|-
|
|<math>=n^2 + 2n + 1</math>
|}
</nowiki>
</pre>
|
{|
|-
|<math>f(n+1)\!</math>
|<math>=(n+1)^2=\!</math>
|-
|
|<math>=n^2 + 2n + 1\!</math>
|}
|}
 
== Font ==
{| class="wikitable" border="2" cellpadding="4" cellspacing="0" style="margin: 1em 1em 1em 0; background: #fff; border: 1px #aaa solid; border-collapse: collapse;" width="100%"
|-
! Caratteristica
! Sintassi
! colspan="2" | Come appare
|-
| [[alfabeto greco|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
| colspan="2" | <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>
|-
| [[alfabeto greco|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
| colspan="2" | <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>
|-
| [[alfabeto greco|Altre lettere greche]]
| \varepsilon \digamma \vartheta \varkappa \varpi \varrho \varsigma \varphi
| colspan="2" | <math>\varepsilon\ \digamma\ \vartheta\ \varkappa\ \varpi\ \varrho\ \varsigma\ \varphi \!</math>
|-
| [[Grassetto]] lavagna
| \mathbb{N}\ \mathbb{Z}\ \mathbb{Q}\ \mathbb{R}\ \mathbb{C} \mathbb{H} \mathbb{E}
| colspan="2" | <math>\mathbb{N}\ \mathbb{Z}\ \mathbb{Q}\ \mathbb{R}\ \mathbb{C} \! \mathbb{H} \ \mathbb{E} </math>
|-
| [[Grassetto]] (per [[vettoreVettore (matematica)|vettori]])
| \mathbf{x}\cdot\mathbf{y} = 0
| colspan="2" | <math>\mathbf{x}\cdot\mathbf{y} = 0 \!</math>
|-
| [[Grassetto]] per [[Alfabeto greco|lettere greche]]
| \boldsymbol{\alpha} + \boldsymbol{\beta} + \boldsymbol{\gamma}
| colspan="2" | <math>\boldsymbol{\alpha} + \boldsymbol{\beta} + \boldsymbol{\gamma} \!</math>
|-
| [[Corsivo]]
| \mathit{ABCDE abcde 1234}
| colspan="2" | <math>\mathit{ABCDE abcde 1234} \!</math>
|-
| Font [[Caratteri tipografici con grazie|Roman]]
| \mathrm{ABCDE abcde 1234}
| colspan="2" | <math>\mathrm{ABCDE abcde 1234} \!</math>
|-
| Font [[Fraktur]]
| \mathfrak{ABCDE abcde 1234}
| colspan="2" | <math>\mathfrak{ABCDE abcde 1234} \!</math>
|-
| Calligrafico
| \mathcal{ABCDE abcde 1234}
| colspan="2" | <math>\mathcal{ABCDE abcde 1234} \!</math>
|-
| [[Alfabeto ebraico|Lettere ebraiche]]
| \aleph \beth \gimel \daleth
| colspan="2" | <math>\aleph\ \beth\ \gimel\ \daleth \!</math>
|-
| Caratteri non [[corsivo|corsivi]]
| \mbox{abc} oppure \text{abc}
| <math>\mbox{abc}</math>
| <math>\mbox{abc}</math>
| <math>\mbox{abc}\!</math>
|-
| Misto [[corsivo]] (cattivo esempio)
| \mbox{se} n \mbox{pari}
| <math>\mbox{se} n \mbox{pari}</math>
| <math>\mbox{se} n \mbox{pari} \,\!</math>
|-
| Misto [[corsivo]] (buon esempio)
| \mbox{se } n \mbox{ pari}
| <math>\mbox{se }n\mbox{ pari}</math>
| <math>\mbox{se }n\mbox{ pari} \,\!</math>
|}
 
== Le parentesi nelle espressioni estese ==
{| class="wikitable" border="2" cellpadding="4" cellspacing="0" style="margin: 1em 1em 1em 0; background: #fff; border: 1px #aaa solid; border-collapse: collapse;"
 
{| border="2" cellpadding="4" cellspacing="0" style="margin: 1em 1em 1em 0; background: #fff; border: 1px #aaa solid; border-collapse: collapse;"
|-
! Caratteristica
! Sintassi
! Come appare
! Traduzione
|-
| Da evitare
Riga 423 ⟶ 331:
|}
 
Si possono usare vari delimitatori con \left e \right:
 
{| class="wikitable" border="2" cellpadding="4" cellspacing="0" style="margin: 1em 1em 1em 0; background: #fff; border: 1px #aaa solid; border-collapse: collapse;"
<table border="1">
|-
<tr>
<th>! Caratteristica</th> !! Sintassi !! Come appare
|-
<th>Sintassi</th>
| Parentesi tonde || \left ( A \right )
<th>Come appare</th>
| <math>\left ( A \right )</math>
</tr>
|-
<tr>
<td>| Parentesi tonde</td>quadre || \left [ A \right ]
| <tdmath>\left ([ A \right )]</tdmath>
|-
<td><math>\left ( A \right )</math></td>
| Parentesi graffe || \left \{ A \right \}
</tr>
| <math>\left \{ A \right \}</math>
<tr>
|-
<td>Parentesi quadre</td>
<td>| Parentesi angolari || \left [\langle A \right ]</td>\rangle
<td>| <math>\left [\langle A \right ]\rangle</math></td>
|-
</tr>
| Barre semplici e doppie
<tr>
| <nowiki>\left | A \right | and \left \| B \right \|</nowiki>
<td>Parentesi graffe</td>
| <tdmath>\left \{| A \right | and \left \| B \right \}|</tdmath>
|-
<td><math>\left \{ A \right \}</math></td>
|
</tr>
I delimitatori possono essere combinati,<br />facendoli corrispondere con \left e \right
<tr>
|
<td>Parentesi angolari</td>
\left [ 0,1 \right )<tdbr />\left \langle A\psi \right \rangle</td>|
|
<td><math>\left \langle A \right \rangle</math></td>
<math>\left [ 0,1 \right )</math><br /><math>\left \langle \psi \right |</math>
</tr>
|-
<tr>
| Usare \left. and \right. se si vuole<br />omettere un delimitatore:
<td>Barre semplici e doppie</td>
<td>| \left |. \frac{A}{B} \right | and \left} \|to B \right \|</td>X
<td>| <math>\left |. \frac{A}{B} \right | and \left} \|to B \right \|X</math></td>
|}
</tr>
<tr>
<td>
I delimitatori possono essere combinati,<br> facendoli corrispondere con \left e \right
</td>
<td>
\left [ 0,1 \right )<br>\left \langle \psi \right |
</td>
<td>
<math>\left [ 0,1 \right )</math><br><math>\left \langle \psi \right |</math>
</td>
</tr>
<tr>
<td>Usare \left. and \right. se si vuole<br>omettere un delimitatore:</td>
<td>\left . \frac{A}{B} \right \} \to X</td>
<td><math>\left . \frac{A}{B} \right \} \to X</math></td>
</tr>
</table>
 
== Spaziatura ==
Si rammenta che TeX tratta la spaziatura in modo per lo più automatico, ma a volte può essere necessario controllarla direttamente.
 
{| class="wikitable" border="2" cellpadding="4" cellspacing="0" style="margin: 1em 1em 1em 0; background: #fff; border: 1px #aaa solid; border-collapse: collapse;" align="center"
|-
! Caratteristica
! Sintassi
! Come appare
! Traduzione
|-
| Doppia spaziatura quad
Riga 509 ⟶ 400:
| Nessuna spaziatura
| ab
| <math>ab\,</math>
|-
| Spaziatura negativa
Riga 517 ⟶ 408:
 
== Allineamento col testo normale ==
Di default nello stile [[Foglio di stile|CSS]] abbiamo:
 
<pre>img.tex { vertical-align: middle; }</pre>
Riga 523 ⟶ 414:
per questo un'espressione come <math>\int_{-N}^{N} e^x\, dx</math> appare così.
 
Se dovete assolutamente allineare in altro modo usate <ttcode><nowiki><div style="vertical-align:-100%;display:inline;"><math>...</math></div></nowiki></ttcode> e giocate con il valore di <ttcode>vertical-align</ttcode> finchè non raggiungete il risultato desiderato. ComnunqueComunque molto spesso il rendering cambia da browser a browser, non preoccupatevi se a casa vostra vedete una cosa e dal vostro amico un'altra.
 
== Forzare il rendering PNG ==
Se necessario, è possibile forzare che una formula venga resa in PNG, senza influenzare l'aspetto della formula, aggiungendo \,\! (spazio ridotto e spazio negativo, che si elidono) ovunque all'interno del tag math (possibilmente al termine).
 
Ciò potrebbe essere utile per mantenere il rendering delle formule uniforme, per esempio, o per correggere una formula che viene resa in modo sbagliato con l'HTML (x derivato, oppure a^{2+2}), o per dimostrare come viene reso qualcosa normalmente visualizzato come HTML (come nell'esempio precedente). Per esempio:
 
{| border="2" cellpadding="4" cellspacing="0" style="margin: 1em 1em 1em 0; background: #fff; border: 1px #aaa solid; border-collapse: collapse;"
|-
! Sintassi
! Come appare
|-
| 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>
|}
 
È stato testato con la maggior parte delle formule di questa pagina, e sembra funzionare perfettamente.
 
Sarebbe opportuno inserire un commento nel codice HTML per evitare che qualcuno "corregga" la formula rimuovendolo:
 
:''<nowiki><!-- Il tag \,\! serve per rendere la formula come PNG invece che come HTML. Si prega di non rimuoverlo.--></nowiki>''
 
È possibile come ulteriore opzione aggiungere ''\emph'' prima di ogni formula all'interno del tag <nowiki><math></nowiki> per avere il rendering in PNG (ad esempio <math>Iz = Icm + MR^{2}</math> diventa <math>\emph Iz = Icm + MR^{2}</math>) .
 
== Esempi ==
<div align="center">
 
<center>
=== Polinomio di secondo grado ===
<math>ax^2 + bx + c = 0</math>
<nowiki><math>ax^2 + bx + c = 0</math></nowiki>
 
=== Polinomio di secondo grado (forzato in PNG)===
<math>ax^2 + bx + c = 0\,</math>
<nowiki><math>ax^2 + bx + c = 0\,</math></nowiki>
 
=== Soluzioni di un'equazione di secondo grado ===
Riga 573 ⟶ 427:
<nowiki><math>x_{1,2}=\frac{-b\pm\sqrt{b^2-4ac}}{2a}</math></nowiki>
 
=== Radici ===
<math>\sqrt{256}=16</math>
<nowiki><math>\sqrt{256}=16</math></nowiki>
 
<math>\sqrt[5]{32}=2</math>
<nowiki><math>\sqrt[5]{32}=2</math></nowiki>
 
=== Sistema di equazioni ===
<math>\begin{cases} 3x-y+8=0\\ 7-6x+12y=0\\ \end{cases}</math>
<nowiki><math>\begin{cases} 3x-y+8=0\\</nowiki>
<nowiki>7-6x+12y=0\\</nowiki>
<nowiki>\end{cases}</math></nowiki>
 
=== Logaritmi ===
<math>\log_{a}{b}=\frac{\log_{c}{b}}{\log_{c}{a}}</math>
<nowiki><math>\log_{a}{b}=\frac{\log_{c}{b}}{\log_{c}{a}}</math></nowiki>
 
=== Parentesi e frazioni ===
<math>2 = \left( [\frac{\left(3-x\right) \times 2}{3-x} \right)]</math>
<nowiki><math>2 = \left( [\frac{\left(3-x\right) \times 2}{3-x} \right)]</math></nowiki>
 
=== Integrali ===
Riga 596 ⟶ 471:
 
=== Numeri complessi ===
<math>|\bar{z}| = |z|, |(\bar{z})^n| = |z|^n, \arg(z^n) = n \arg(z)\,</math>
<nowiki><math>|\bar{z}| = |z|, |(\bar{z})^n| = |z|^n, \arg(z^n) = n \arg(z)\,</math></nowiki>
 
=== Limiti ===
<math>\lim_{z\rightarrow z_0} f(z)=f(z_0)\,</math>
<nowiki><math>\lim_{z\rightarrow z_0} f(z)=f(z_0)\,</math></nowiki>
 
Per limiti in due variabili:
 
<math>\lim_{(x,y) \to (x_0 , y_0)} f(x,y)=f(x_0,y_0)</math>
<nowiki><math>\lim_{(x,y) \to (x_0 , y_0)} f(x,y)=f(x_0,y_0)</math></nowiki>
 
oppure indicato con <math> \mathbf{x} = (x,y) </math> e <math> \mathbf{x}_0 = (x_0,y_0) </math>
 
<math>\lim_{\mathbf{x} \to \mathbf{x}_0} f(\mathbf{x})=f(\mathbf{x}_0)</math>
<nowiki><math>\lim_{\mathbf{x} \to \mathbf{x}_0} f(\mathbf{x})=f(\mathbf{x}_0)</math></nowiki>
 
=== Equazioni integrali ===
Riga 613 ⟶ 500:
 
=== Esempio generico ===
<math>\phi_n(\kappa) = 0.033C_n,\!033 \, C_n^2 \, \kappa^{-11/3},\quad \frac{1}{L_0}\ll\kappa\ll\frac{1}{l_0}\,</math>
<nowiki><math>\phi_n(\kappa) = <0,\!033 \, C_n^2 \, \kappa^{-11/nowiki>3},
<nowiki>0.033C_n^2\kappa^{-11/3}, \quad \frac{1}{L_0}\ll\kappa\ll\frac{1}{l_0}\,</math></nowiki>
 
=== Funzioni definite a ''pezzi''tratti ===
<math>f(x) = \begin{cases}1 & -1 \le x < 0\\
\frac{1}{2} & x = 0\\x&0<x\le 1\end{cases}</math>
<nowiki>f(x) = \begin{cases}1 & -1 \le x < 0\\</nowiki>
<nowiki>\frac{1}{2} & x = 0\\x & 0<x\le 1\end{cases}</nowiki>
 
=== Pedice prescritta ===
<math>{}_pF_q(a_1,...\dots,a_p;c_1,...\cdots,c_q;z) = \sum_{n=0}^\infty \frac{(a_1)_n\cdot\cdot\cdotcdots(a_p)_n}{(c_1)_n\cdot\cdot\cdotcdots(c_q)_n}\frac{z^n}{n!}\,</math>
<nowiki> <math>{}_pF_q(a_1,...\cdots ,a_p;c_1,...\cdots ,c_q;z) = \sum_{n=0}^\infty</nowiki>
<nowiki>\frac{(a_1)_n\cdot\cdot\cdotcdots (a_p)_n}{(c_1)_n\cdot\cdot\cdotcdots (c_q)_n}\frac{z^n}{n!}\,<nowiki></math></nowiki>
 
</centerdiv>
 
== VociPagine correlate ==
* [[Progetto:Matematica/Manuale di stile|Manuale di stile per le formule matematiche]]
* Proposta [http://en.wikipedia.org/wiki/Wikipedia:GNU_LilyPond_support en.wiki:GNU LilyPond support]
* [[Aiuto:Prontuario TeX|Prontuario TeX]]
* [[Notazioni matematiche]] (per chi non conoscesse i significati di tutti i formalismi)
* [[Aiuto:Caratteri speciali]]
* [[Aiuto:Formule chimiche]]
* [[Aiuto:Unità di misura]]
* [[Aiuto:Notazione musicale]]
 
== Collegamenti esterni ==
* Un tutorial di [[LaTeX]]: http://www.maths.tcd.ie/~dwilkins/LaTeXPrimer/
 
* Un tutorial di [[LaTeX]]: http://www.maths.tcd.ie/~dwilkins/LaTeXPrimer/
* Un documento [[Portable Document Format|PDF]] di introduzione a TeX -- cfr. pagina 39 e seguenti per una buona introduzione al lato matematico del contenuto: http://www.ctan.org/tex-archive/info/gentle/gentle.pdf
* Un articolo apparso su Ars TeXnica su come scrivere correttamente le formule matematiche: http://www.guit.sssup.it/arstexnica/download_ars/arstexnica05.pdf
* Un documento [[Portable Document Format|PDF]] di introduzione a TeX -- cfr. pagina 59 per la sezione di matematica. Cfr. pagina 72 per una lista completa di simboli inclusi in LaTeX e AMS-LaTeX. http://www.ctan.org/tex-archive/info/lshort/english/lshort.pdf
* Varie estensioni di LaTeX: http://www.ams.org/tex/amslatex.html
* Un insieme di simboli matematici in formato bitmap di pubblico dominio: http://us.metamath.org/symbols/symbols.html
* TeX Wizard: {{cita web|url=http://de.geocities.com/richyfourtythree/texwizard.html|titolo=TeX Wizard <!-- Bot generated title -->|deadurl=yes|urlarchivio=http://web.archive.org/web/20080101000000/http://de.geocities.com/richyfourtythree/texwizard.html}}
* [[MathML]] - Un prodotto del gruppo di lavoro di matematica della [[W3C]], sono specifiche a basso livello per descrivere enti matematici nella comunicazione tra elaboratori. http://www.w3.org/Math/
[[Categoria:Aiuto sulla scrittura delle voci]]
 
[[Categoria:Guide tecniche e glossari (aiuto)]]
 
 
[[Categoria:Aiuto|Formule matematiche TeX]]
[[Categoria:TeX|Formule matematiche TeX]]
 
[[be:Вікіпэдыя:TeX]]
[[de:Wikipedia:TeX]]
[[en:Wikipedia:TeX]]
[[es:Wikipedia:Usando TeX]]
[[fr:Wikipédia:Formules TeX]]
[[ia:Wikipedia:Formulas mathematic]]
[[ja:Wikipedia:TeX markup]]
[[nl:Wikipedia:TeX in Wikipedia]]
[[sv:Wikipedia:Användarhandledning för TeX]]
[[zh:Wikipedia:&#25968;&#23398;&#20844;&#24335;]]