Difference between revisions of "User:Hirmuolio Pine/sandbox3"

From EVE University Wiki
Jump to: navigation, search
Line 1: Line 1:
  
UNI wiki allows adding equations in <math>\LaTeX</math> by using [https://www.mediawiki.org/wiki/Extension:SimpleMathJax SimpleMathJax]. Just place the expression in between <nowiki><math></math></nowiki> and it will be rendered.
+
UNI wiki allows adding equations using <math>\LaTeX</math> markup by using [https://www.mediawiki.org/wiki/Extension:SimpleMathJax SimpleMathJax]. Just place the expression in between <nowiki><math></math></nowiki> and it will be rendered.
  
 
You will be expected to learn to use Latex from other sources. This page contains only some useful information and formatting guidelines for use on this wiki.
 
You will be expected to learn to use Latex from other sources. This page contains only some useful information and formatting guidelines for use on this wiki.
 +
 +
For more in depth reading you can read the [[Wikipedia:Manual of Style/Mathematics|https://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Mathematics]]. But do note that Uni Wiki uses different math extension than Wikipedia.
  
 
== Useful <math>\LaTeX</math> knowledge ==
 
== Useful <math>\LaTeX</math> knowledge ==
  
* Spaces do not do anything. Use plenty of them to make the commands easy to read
+
By default the math will be in inline mode. This is good for mixing math into text. For equations that are not among text you will usually want to use display mode. This will allow the equations to gain more height.
** This here has 17 spaces in it (visible only in editor): <nowiki><math> a = b +            c </math></nowiki> <math> a = b +            c </math>
+
 
 +
To use display mode just add  <code>\displaystyle</code> at the beginning of the expression.
 +
 
 +
Example:
 +
 
 +
<math> \sum_{k=1}^n a_k  </math>
 +
<code> \sum_{k=1}^n a_k</code>
 +
 
 +
<math> \displaystyle\sum_{k=1}^n a_k </math>
 +
<code> \displaystyle\sum_{k=1}^n a_k</code>
 +
 
 +
 
 +
Some expressions apply to the whole equation. The affected area can be limited by surrounding it with curly bracets.
 +
 
 +
Examples:
 +
 
 +
<math> \color{red} a  = c  </math>
 +
<code> \color{red} a  = c</code>
 +
 
 +
<math> { \color{red} a } = c  </math>
 +
<code> { \color{red} a } = c</code>
 +
 
 +
 
 +
 
 +
To write roman text instead of italic text you can use either <code>\text{}</code> or <code>\rm</code> depending on your exact needs.<br>
 +
<code>\text{}</code> will only apply to the text within curly brackets. Additionally it will make spaces visible.<br>
 +
<code>\rm</code> will change the whole equation into roman text. This will not change how spaces are removed. The area of effect can be limited by placing the expression oin curly bracets.
 +
 
 +
Examples:
 +
 
 +
<math> \text{This is roman with spaces} </math>
 +
<code>\text{This is roman with spaces}</code>
 +
 
 +
<math> \rm vel = spd + d</math>
 +
<code>\rm vel = spd + dir</code>
 +
 
 +
 
 +
 
 +
Normally spaces will be removed from the equation when it is rendered. Use plenty of spaces to make the latex code easier to read. If you want to keep spaces you can use the <code>\text{}</code> as shown above. If you just want to insert spaces into the equation you can use <code>\ </code> for normal space and <code>\,</code> for thin space.
 +
 
 +
Examples:
 +
 
 +
<math> abb \ b\ b\ b </math> <code>abb \ b\ b\ b</code>
 +
 
 +
<math> abb \,b\,b\,b </math> <code>abb \,b\,b\,b</code>
 +
 
 +
 
 +
 
 +
If you want to change the size of text in equation you can use <code>\large</code>, <code>\Large</code> or <code>\LARGE</code> to make it bigger. This is most useful with nested exponents and fractions. The affected area can be limited by surrounding it with curly brackets.
 +
 
 +
Example:
 +
 
 +
<math> a^{\frac{b}{c} } </math> <code>a^{\frac{b}{c} }</code>
  
* \text{} makes spaces visible and text into roman.
+
<math> a^{\Large \frac{b}{c} } </math> <code>a^{\Large \frac{b}{c} }</code>
** <nowiki><math> \text{This is like normal text} = This is math text </math></nowiki> <math> \text{This is roman with spaces} = This is italic without spaces</math>
 
** \mathrm is similar but does not remove spaces. <nowiki><math> \mathrm{arc sinh} </math></nowiki> <math> \mathrm{arc sinh} </math>
 
  
* \rm will make the whole thing to be in roman instead of italic. Spaces will still be removed.
 
** <nowiki><math> \rm Velocity = S p e e d </math></nowiki> <math> \rm Velocity = S p e e d</math>
 
** {} can be used to limit its scope. <nowiki><math> { \rm Roman } = Italic</math></nowiki>  <math> { \rm Roman } = Italic</math>
 
  
* "\ " adds single space.
 
** <nowiki><math> abb \ b\ b\ b </math></nowiki> <math> abb \ b\ b\ b </math>
 
  
* "\," adds single thin space
+
Long equations can be written on multiple lines in multiple separate math tags and they will be rendered as one continuous equation. This is good for long equations that would be hard to edit otherwise.
** <nowiki><math> abb \,b\,b\,b </math></nowiki> <math> abb \,b\,b\,b </math>
 
  
* \displaystyle makes tall equations bigger and more beautiful. Will apply on things like sums and fractions.
+
Example:
** <nowiki><math> a= \frac{b}{c} + \sum_{k=1}^n a_k b_k </math></nowiki> <math> a= \frac{b}{c} + \sum_{k=1}^n a_k b_k </math>
 
** <nowiki><math> \displaystyle a= \frac{b}{c} + \sum_{k=1}^n a_k b_k </math></nowiki> <math> \displaystyle a= \frac{b}{c} + \sum_{k=1}^n a_k b_k </math>
 
  
* \large, \Large and \LARGE make text bigger. Like with \rm use {} to limit their scope. These help with things nested in exponents as exponent makes things smaller.
+
<math> a+a+a+a+a+a+a+a+a+a+a++a+a+a+a </math>
** <nowiki><math> a^{\Large \frac{b}{c} } </math></nowiki> <math> a^{\Large \frac{b}{c} } </math>. Compare to <math> a^{\frac{b}{c} } </math>
+
<math> +b+b+b+b+b+b++b+b+b+b+b++b+b+b+b+b </math>
  
* Long equations can be split to multiple separate <nowiki><math></nowiki> lines. It will look the same as if it was written in one go.
+
<nowiki><math> a+a+a+a+a+a+a+a+a+a+a++a+a+a+a </math></nowiki><br>
** <nowiki><math> a+a+a+a+a+a+a+a+a+a+a++a+a+a+a+b+b+b+b+b+b++b+b+b+b+b++b+b+b+b+b </math></nowiki> <math> a+a+a+a+a+a+a+a+a+a+a++a+a+a+a+b+b+b+b+b+b++b+b+b+b+b++b+b+b+b+b </math>
+
<nowiki><math> +b+b+b+b+b+b++b+b+b+b+b++b+b+b+b+b </math></nowiki>
** <nowiki><math> a+a+a+a+a+a+a+a+a+a+a++a+a+a+a </math></nowiki><br><nowiki><math> +b+b+b+b+b+b++b+b+b+b+b++b+b+b+b+b </math></nowiki>  <math> a+a+a+a+a+a+a+a+a+a+a++a+a+a+a </math><math> +b+b+b+b+b+b++b+b+b+b+b++b+b+b+b+b </math>
 
  
 
== Style ==
 
== Style ==

Revision as of 10:59, 18 January 2020

UNI wiki allows adding equations using [math]\LaTeX[/math] markup by using SimpleMathJax. Just place the expression in between <math></math> and it will be rendered.

You will be expected to learn to use Latex from other sources. This page contains only some useful information and formatting guidelines for use on this wiki.

For more in depth reading you can read the https://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Mathematics. But do note that Uni Wiki uses different math extension than Wikipedia.

Useful [math]\LaTeX[/math] knowledge

By default the math will be in inline mode. This is good for mixing math into text. For equations that are not among text you will usually want to use display mode. This will allow the equations to gain more height.

To use display mode just add \displaystyle at the beginning of the expression.

Example:

[math] \sum_{k=1}^n a_k [/math] \sum_{k=1}^n a_k

[math] \displaystyle\sum_{k=1}^n a_k [/math] \displaystyle\sum_{k=1}^n a_k


Some expressions apply to the whole equation. The affected area can be limited by surrounding it with curly bracets.

Examples:

[math] \color{red} a = c [/math] \color{red} a = c

[math] { \color{red} a } = c [/math] { \color{red} a } = c


To write roman text instead of italic text you can use either \text{} or \rm depending on your exact needs.
\text{} will only apply to the text within curly brackets. Additionally it will make spaces visible.
\rm will change the whole equation into roman text. This will not change how spaces are removed. The area of effect can be limited by placing the expression oin curly bracets.

Examples:

[math] \text{This is roman with spaces} [/math] \text{This is roman with spaces}

[math] \rm vel = spd + d[/math] \rm vel = spd + dir


Normally spaces will be removed from the equation when it is rendered. Use plenty of spaces to make the latex code easier to read. If you want to keep spaces you can use the \text{} as shown above. If you just want to insert spaces into the equation you can use \ for normal space and \, for thin space.

Examples:

[math] abb \ b\ b\ b [/math] abb \ b\ b\ b

[math] abb \,b\,b\,b [/math] abb \,b\,b\,b


If you want to change the size of text in equation you can use \large, \Large or \LARGE to make it bigger. This is most useful with nested exponents and fractions. The affected area can be limited by surrounding it with curly brackets.

Example:

[math] a^{\frac{b}{c} } [/math] a^{\frac{b}{c} }

[math] a^{\Large \frac{b}{c} } [/math] a^{\Large \frac{b}{c} }


Long equations can be written on multiple lines in multiple separate math tags and they will be rendered as one continuous equation. This is good for long equations that would be hard to edit otherwise.

Example:

[math] a+a+a+a+a+a+a+a+a+a+a++a+a+a+a [/math] [math] +b+b+b+b+b+b++b+b+b+b+b++b+b+b+b+b [/math]

<math> a+a+a+a+a+a+a+a+a+a+a++a+a+a+a </math>
<math> +b+b+b+b+b+b++b+b+b+b+b++b+b+b+b+b </math>

Style

Style guidelines for math vary by location and field. Don't worry about them too much. Being consistent, unambiguous and readable is more important than strictly following guidelines.

If you have time you can read these two:

Some of the main points are listed below:

  • Variables and letters that represent values should be in italic.
    • Multiletter and text variables are not exactly proper thing to do but they are fine in our wiki. Generally speaking use roman letters for them.
  • Text should be in roman.
  • Mathematical constants should be in roman. But this is often broken (for example [math]e[/math] and [math]\pi[/math]).
  • Physical constants should be italic.
  • Subscripts and superscripts that represent quantities should be italic. Otherwise they should be roman. For example [math] V_{\rm max}[/math] (max is roman) but [math] V_{n+1}[/math] (n is italic).
  • Mathematical operators and special functions are in roman. Usually this happens automatically. For example [math] \sin\alpha [/math] (<math> \sin\alpha </math>). If the special function isn't found then use \operatorname{} . Some operators will require manually setting. For example [math] \frac{ \mathrm{d} x }{ \mathrm{d} t} [/math] (<math> \frac{ \mathrm{d} x }{ \mathrm{d} t} </math>) and [math] \operatorname{arcsinh}\alpha [/math] (<math> \operatorname{arcsinh}\alpha </math>).
  • Single letter functions you define are italic. For example [math] f(x) [/math].
    • But multi letter named functions are in roman. For example [math] \mathrm{func}(x) [/math].
  • Units are in roman and separated from numbers by a unbreakable thin space "\,". [math] g = 9.81 \,{\rm m/s^2} [/math] (<math> g = 9.81 \,{\rm m/s^2} </math>)
  • Do not use "*" symbol for multiplication. Use "\times" insted. [math] 3 \times 2 = 6 [/math]


[math] \operatorname{arctanh} 3 [/math]