Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wiki:formulas [2019/03/31 00:48] ttzhouwiki:formulas [2019/06/03 01:12] (current) – external edit 127.0.0.1
Line 8: Line 8:
 ===== Inline formulas ===== ===== Inline formulas =====
  
-Use ''%%\%%( ...... %%\%%)'' to render inline formulas.+Simply place LaTex codes in ''%%<m> ...... </m>%%'' or ''%%\%%( ...... %%\%%)'' to render inline formulas. 
 + 
 +<alert info>Use [[https://www.codecogs.com/latex/eqneditor.php|LaTeX Equation maker]] if you don't know how to write Latex codes.</alert>
  
 For example, For example,
Line 14: Line 16:
 <code> <code>
 \(E=MC^2\), equation in German-born physicist Albert Einstein’s theory of special relativity ...... \(E=MC^2\), equation in German-born physicist Albert Einstein’s theory of special relativity ......
 +</code>
 +or
 +<code>
 +<m>E=MC^2</m>, equation in German-born physicist Albert Einstein’s theory of special relativity ......
 </code> </code>
  
 The above will be rendered as: The above will be rendered as:
  
-\(E=MC^2\), equation in German-born physicist Albert Einstein’s theory of special relativity ......+<m>E=MC^2</m>, equation in German-born physicist Albert Einstein’s theory of special relativity ...... 
 + 
 +===== Display Math ===== 
 +Wrap LaTex codes in ''%%<math> ...... </math>%%'' or ''%%\%%[ ...... %%\%%]'' to display math formulas on its own line: 
 +<alert info>Use [[https://www.codecogs.com/latex/eqneditor.php|LaTeX Equation maker]] if you don't know how to write Latex codes.</alert> 
 + 
 +<code> 
 +\[ \sin A \cos B = \frac{1}{2}\left[ \sin(A-B)+\sin(A+B) \right] \] 
 +</code> 
 +or 
 +<code> 
 +<math> \sin A \cos B = \frac{1}{2}\left[ \sin(A-B)+\sin(A+B) \right] </math> 
 +</code> 
 + 
 +The above will be rendered as: 
 + 
 +<math> \sin A \cos B = \frac{1}{2}\left[ \sin(A-B)+\sin(A+B) \right] </math> 
 + 
 +A wide range of math environments will work as well: 
 + 
 +<code> 
 +\begin{align*} 
 +e^x & = 1 + x + \frac{x^2}{2} + \frac{x^3}{6} + \cdots \\ 
 +    & = \sum_{n\geq 0} \frac{x^n}{n!} 
 +\end{align*} 
 +</code>
  
 +\begin{align*}
 +e^x & = 1 + x + \frac{x^2}{2} + \frac{x^3}{6} + \cdots \\
 +    & = \sum_{n\geq 0} \frac{x^n}{n!}
 +\end{align*}