User:Mgkrupa/Code and Symbols
Math LaTeX code
- Detexify − Online tool: Find LaTeX code for a symbol by drawing it. (More tools here)
- Shapecatcher − Online tool: Find Unicode and HTML codes for a symbol by drawing it.
- Common misc code
{{abbreviation|TVS|Topological Vector Space}}
TVS
<ol type="a">
<ol style="list-style-type: lower-latin;">
WP:ACCESSIBILITY anTable of Binary Operatorsd MOS:MATH
|
---|
Indentation:
Do NOT use
"Do not use possibly unpronounceable symbols"
|
{{quote frame}} and {{quote box}} |
---|
|
{{math theorem}} |
---|
|
Proofs:
{{math proof}} |
---|
|
- Indentation
{{Block indent}}
{{in5}}
- Table of contents
{{TOC limit|3}}
Common math code
- Help:Displaying a formula (Commutative diagrams)
- List of mathematical symbols by subject
- WP:LaTeX symbols
- LaTeX + Unicode list: Long list 1, Long list 2.
- Involving indices/subscripts
Result | LaTeX code | Other info |
---|---|---|
<math>x_\bull = \left(x_i\right)_{i \in I}</math>
|
||
<math>x_\bull = \left(x_i\right)_{i=1}^\infty</math>
|
||
\sum_{\stackrel{i \in I,}{j \in J}} x_{i,j}
|
||
<math display=block>\begin{alignat}{4} f :\;&& X &&\;\to \;& Y \\[0.3ex] && x &&\;\mapsto\;& y \\ \end{alignat}</math> |
||
<math display=block>\begin{alignat}{4} \pi_i :\;&& \prod_{j \in I} X_j &&\;\to\; & X_i \\[0.3ex] && \left(x_j\right)_{j \in I} &&\;\mapsto\;& x_i \\ \end{alignat}</math> |
||
<math display=block>\begin{alignat}{9} f :\;&& X &&\;\to \;& Y && \quad \text{ and } \quad & g :\;&& X &&\;\to \;& Y \\[0.3ex] && x &&\;\mapsto\;& y && & && x &&\;\mapsto\;& y \\ \end{alignat}</math> |
||
|
<math display=block>f(x) = \begin{cases} x & \text{if } x \leq 0 \\ 0 & \text{otherwise } \\ \end{cases}</math> or (for more fine control over spacing/alignment) you can use <math display=block>f(x) =
\left\{
\begin{alignat}{9}
x&\,+\,&&x^2 \quad& \text{if } && &x \leq 0 \\
& &&x^2 & \text{if } && 0 \leq\,&x < 1 \\
x& && & \text{if } && 1 \leq\,&x \\
\end{alignat}
\right.
</math>
|
|
<math display=block>f(x) = \begin{cases} x & \text{if} & x \in (-\infty, 0] \\ x + x^2 & \text{if} & x \in (0, 1) \\ x + x^3 & \text{if} & x \geq 1 \\ \end{cases}</math> |
||
|
<math>\mathop\implies</math>
|
Misc
| ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Table/2-D sequence
|
---|
The following is used in the article Fréchet–Urysohn space.
<math>\begin{alignat}{11} &x_1^1, ~~ &x_1^2, ~~ &x_1^3, ~~ &x_1^4, ~~ &x_1^5, ~~ &\ldots ~~ &x_1^i, ~~ \ldots ~~ &\to ~~ &x_l \\ &x_2^1, ~~ &x_2^2, ~~ &x_2^3, ~~ &x_2^4, ~~ &x_2^5, ~~ &\ldots ~~ &x_2^i, ~~ \ldots ~~ &\to ~~ &x_2 \\ &x_3^1, ~~ &x_3^2, ~~ &x_3^3, ~~ &x_3^4, ~~ &x_3^5, ~~ &\ldots ~~ &x_3^i, ~~ \ldots ~~ &\to ~~ &x_3 \\ &x_4^1, ~~ &x_4^2, ~~ &x_4^3, ~~ &x_4^4, ~~ &x_4^5, ~~ &\ldots ~~ &x_4^i, ~~ \ldots ~~ &\to ~~ &x_4 \\ & & &\;\,\vdots & & & &\;\,\vdots & &\;\,\vdots \\ &x_l^1, ~~ &x_l^2, ~~ &x_l^3, ~~ &x_l^4, ~~ &x_l^5, ~~ &\ldots ~~ &x_l^i, ~~ \ldots ~~ &\to ~~ &x_l \\ & & &\;\,\vdots & & & &\;\,\vdots & &\;\,\vdots \\ & & & & & & & & &\,\downarrow \\ & & & & & & & & ~~ &\;x \\ \end{alignat} </math> |
Spaces and Sizes
Result | LaTeX code | Other info |
---|---|---|
Text text text text text
Text text text text text. Now without vertical spaces: Text text text text text. |
<math display=block> h_\bull \begin{aligned}&\\[1.0ex]\end{aligned} </math> |
Vertical space before and/or after a single line math statement. 2.0ex is 2.0 times the height of the 'x ' character.
|
<math>\displaystyle \sum_{i=1}^\infty</math>
|
||
<math>\bigl( \bigr) ~ ()</math>
|
||
<math>\dotsb</math> for binary operators/relations
|
- Spacing
- See also: em (typography) and Help:Displaying a formula#Spacing
- Zero-width space:
​
​
(The LaTeX\hspace{0pt}
and\hskip0pt
do not work on Wikipedia)
Result | LaTeX code |
---|---|
<math>\begin{alignat}{8} &M \! M&&\quad&&\backslash! &&\text{negative thin space (-3 mu)}\\ &MMM && && &&\text{no space}\\ &M \, M&& &&\backslash, &&\text{thin (3 mu)}\\ &M \; M&& &&\backslash; &&\text{thick (5 mu)}\\ &M \ M&& &&\backslash\text{ } &&\text{length of a text space character}\\ &M \text{ } M&& &&\backslash\text{text}\{\ \}&&\text{using } \backslash\text{text}\{\text{ }\}\\ &M \quad M&& &&\backslash\text{quad} &&\text{width of } M \text{ (18 mu)}\\ &MMM && && &&\text{no space }\\ &M \qquad M&& &&\backslash\text{qquad} &&\text{double width of } M \text{ (36 mu)}\\ &M \mathbin{M} M&& &&\backslash\text{mathbin}\{M\}\quad&&\text{spaces around binary relation } M\\ &M \mathrel{M} M&& &&\backslash\text{mathrel}\{M\}\quad&&\text{spaces around binary operator } M\\ \end{alignat}</math> |
Symbols (LaTeX)
- Links to Math symbol articles
|
- Symbols for Operations/Relations
- Unicode + corresponding LaTeX code
- Common Unicode/LaTeX symbols: Short list Long list
Result | LaTeX code | Other info |
---|---|---|
|
|
Weierstrass P |
|
|
|
|
|
QED end of proof box. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NOTE: |
|
|
|
|
|
Words/Terminology
Useful terminology or words with special symbols
- Fréchet
- Kuratowski closure axioms#Definition has useful terminology.
Lists of words at wiktionary:
|
---|
|
Non-Latex Code
Superscripts and subscripts
|
---|
Alignment:
{{center}} |
---|
Text goes here
|
Divide text into multiple columns: <div style="column-count: 3; column-rule-style: dotted; column-rule-color: lightblue; column-rule-style: outset; column-width: 80px;">The COVID‑19 pandemic, also known as the coronavirus pandemic, is an ongoing pandemic of coronavirus disease 2019 (COVID‑19) caused by severe acute respiratory syndrome coronavirus 2 (SARS‑CoV‑2). It was first identified in December 2019 in Wuhan, China. The World Health Organization declared the outbreak a Public Health Emergency of International Concern on 30 January 2020 and a pandemic on 11 March.</div> |
Spacing
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Equations and boxes
Boxes
| |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
For Box shadows - See also: CSS box-shadow Box shadows:
|
Referencing and Displaying equations
| ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Step (1): Wrap the equation in Step (2): Reference the equation by its Example: <div id=EquationID><math display=block>x \mapsto f x</math></div> where [[#EquationID|the equation above]] Output: where the equation above
Use
Complex number
(Eq. 90) Use
(3.5)
Step (2) Use
|
Aligning: \begin{alignat}{4}
and \begin{array}{4}
- For additional vertical space at the end of a line, use
\\[0.7ex]
instead of just\\
(2.0ex
is twice the height of thex
character).
LaTeX: Aligning equations
\begin{alignat}{4} \stackrel{a}{b} | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The Wikipedia equivalent of the LaTeX code
|
Result | LaTeX code | Other info |
---|---|---|
<math>f(x) = \begin{cases} x & \text{ if } x \leq 0 \\ 0 & \text{ otherwise } \\ \end{cases}</math> |
||
<math>\begin{alignat}{4} f : \,& X && \to \,&& Y \\ & x && \mapsto\,&& y \\ \end{alignat}</math> |
||
<math>\begin{array}{rccl} f : &X& \to \,&Y \\ &x& \mapsto\,&y \\ \end{array}</math> |
||
|
Definitions - {{dfn}}
{{dfn}}
Ex: Without alt text:
Say that {{em|{{dfn|1=new term|id=dfn-anchorname}}}} if ....<br/>this term ([[#dfn-anchorname|defined here]]), ...
- Say that new term if ....
this term (defined here), ...
Ex: With alt text:
Say that {{em|{{dfn|1=new term 2|2=Alt text giving definition of term|id=dfn-anchorname2}}}} if ....<br/>this term ([[#dfn-anchorname2|defined here]]), ...
- Say that new term if ....
this term (defined here), ...
Color
Result | LaTeX code | Other info |
---|---|---|
{\color{Red}{\bigcup}} B
|
||
A \color{Red}{\bigcup}\color{Black}{} B
|
See below for why \color{Black}{} is needed
| |
\color{Red}{\bigcup} B
|
Without the \color{Black}{} it renders as:
| |
<span style="color:red">red text</span>
|
For plain text. |
- Wikipedia:Manual of Style/Accessibility − MOS:COLORS has a table of acceptable colors. − More details at MOS:COLOR
- {{Color sample}}
- {{Font color}}
Colors
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
General Wiki code
Lists
<li value="7">Item</li>
- but
<li value="7a">Item</li>
does not produce "7a".
- but
<ol type="a"> or <ol style="list-style-type:lower-latin;"> or <ol style="list-style-type:square;"> or circle; {{Columns-list}} | ||||||
---|---|---|---|---|---|---|
|
Blank lists (no symbol)
{{plainlist}} {{unbulleted list}} | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Horizontal/Flat lists
{{hlist|class=inline|Entry1|Entry2}} | ||||||
---|---|---|---|---|---|---|
{{flatlist| * Entry 1 * Entry 2 * entry 3 }}produces:
Using {{flatlist}} improves WP:ACCESSIBILITY:
|
<ol style="list-style-position:inside;"> |
---|
where note that "words" appears directly underneath the "1." The default is "
where note that there is empty space directly underneath the "1." |
Spacing/Padding
<ol style="line-height:180%;"> |
---|
Produces:
The default is:
|
Tables and columns
Sorting Tables
|
---|
|
Wikipedia: Tables
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
For side by side info (e.g. code next to output): (The <div style="background: white; border: 2px solid rgb(0, 255, 0); padding: 2px;"> {| style="border-collapse: collapse; width: ; background: ; color: ; border: ; margin: ;" <!--- Example: {| style="width: 100%; background: yellow; color: red; border: 2px solid green;" ---> !style="text-align:center;"|Column 1 Title !style="text-align:center;"|Column 2 Title |-style="vertical-align:top;" |style="border-right:2px solid rgb(0, 255, 0); padding-top: ; padding-right:1em; padding-left:1em;"| Left side info - e.g. Code goes here |style="padding-top: ; padding-right:1em; padding-left:1em;"| Right side info here |} </div>
You can also use other languages for
|
Columns
| |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Column 1 start:
Column 2 start: If there is not enough space to display 2 columns then the second column will be displayed underneth the first column. Otherwise they will be side by side.
|
See also, Main, and other Hatnotes
- {{About}}
- {{About-distinguish2}}