Skip to content

tutorial_equations

Pedro edited this page Jun 2, 2020 · 2 revisions

How to render equations in a github flavoured markdown

Single line equations

Using raw html

  1. Go to codecogs
  2. Type your equation
  3. Set output format to .svg
  4. Copy <img src=[...] /> part of html (at the end of the page)
  5. Paste in markdown file

Bugs

  1. Replace parenthesis ( and ) for %28 and %29
  2. When writing transposed tensors/matrices ^\top is a pain. Use ^\text{T} or just ^T

Example

This input

<img 
    src="https://latex.codecogs.com/svg.latex?
        \mathbf{E}=\frac{1}{2}%28\nabla\mathbf{u}&plus;\nabla\mathbf{u}^\text{T}%29" 
    title="Green-Lagrange strain tensor" 
/>

Will generate this equation

Using markdown links

  1. Go to codecogs
  2. Type your equation
  3. Set output format to .svg
  4. At the end of the page, set output code to URL Encoded
  5. Paste in markdown file as ![](https://latex.codecogs[...])

Example

This input

![](https://latex.codecogs.com/svg.latex?%5Cmathbf%7BE%7D%3D%5Cfrac%7B1%7D%7B2%7D%5Cleft%28%5Cnabla%5Cmathbf%7Bu%7D&plus;%5Cnabla%5Cmathbf%7Bu%7D%5E%7B%5Ctext%7BT%7D%7D%5Cright%29 "Green-Lagrange strain tensor")

Will generate this equation

Multi-lined equations

If you need complicated stuff like cases or align environments, use Texify app for Github.

Other options you might want to checkout