|
|
(153 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
| | | |
− | Extra reading: [http://www.tug.org/TUGboat/Articles/tb18-1/tb54becc.pdf www.tug.org/TUGboat/Articles/tb18-1/tb54becc.pdf]
| |
− |
| |
− | == Useful <math>\LaTeX</math> knowledge ==
| |
− |
| |
− | * Spaces do not do anything. Use plenty of them to make the commands easy to read
| |
− | ** This here has 17 spaces in it (visible only in editor): <nowiki><math> a = b + c </math></nowiki> <math> a = b + c </math>
| |
− |
| |
− | * \text{} makes spaces visible and text into roman.
| |
− | ** <nowiki><math> \text{This is like normal text} = This is math text </math></nowiki> <math> \text{This is like normal text} = This is math text </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
| |
− | ** <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.
| |
− | ** <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.
| |
− | ** <nowiki><math> a^{\Large \frac{b}{c} } </math></nowiki> <math> a^{\Large \frac{b}{c} } </math>. Compare to <math> a^{\frac{b}{c} } </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+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> 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 guidelines for math vary by location and field. Don't worry about them too much. Being consistent, unambiguous and readable is more important than to follow guidelines.
| |
− |
| |
− | * Variables and letters that represent values should be in italic.
| |
− | * Text should be in roman. Text variables are not exactly proper thing to do but they are fine in our wiki.
| |
− | * Constant should be in roman. But this is often broken on things like <math>e</math> and <math>\pi</math>.
| |
− | ** Constants that are not exactly constant are in italic. For example charge of electron is "constant" but the measured value can change and is therefore in italic <math>e</math>.
| |
− | * Multiletter variables are bad idea and should be avoided. If they are more like words (for example acronyms) use roman, otherwise use italic.
| |
− | * Sub 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> (<nowiki><math> \sin\alpha </math></nowiki>). But some operators will require manually setting. For example <math> \frac{ \mathrm{d} x }{ \mathrm{d} t} </math> (<nowiki><math> \frac{ \mathrm{d} x }{ \mathrm{d} t} </math></nowiki>) and <math> \mathrm{arcsinh}\,\alpha </math> (<nowiki><math> \mathrm{arcsinh}\,\alpha </math></nowiki>).
| |
− | * Single letter functions you define are italic. <math> f(x) </math>
| |
− | * But multi letter named functions are in roman. <math> \mathrm{func}(x) </math>
| |
− | * Units are in roman and separated from numbers by a space. <math> h = \frac{ E }{ m \times 9.81 \ {\rm m/s^2} } </math> (<nowiki><math> h = \frac{ E }{ m \times 9.81 \ {\rm m/s^2} } </math></nowiki>)
| |
− | * Do not use "*" symbol for multiplication. Use \times insted. <math> 3 \times 2 = 6 </math>
| |