Markdown, LaTeX Equations¶
Markdown Cells¶
Markdown is used for formatting text cells.
Double click on the markdown cells in this document (including this cell) for examples.
Make new paragraphs with empty lines.
Make new lines when the line above has at least two trailing spaces.
You can put raw html in markdown cells if you want.
You can insert images, pdf files, etc. into the document.
Make horizontal lines with three or more dashes, or underscores, or asterisks:
Heading¶
Subheading¶
Subsubheading¶
etc¶
Lists¶
Make a list like this:
- Item one (note the space after the -)
- Item two (note the symbol becomes a circle)
- Sub-bullet 1
- Sub-bullet 2
- Sub-bullet 3
- Sub-bullet 3 -Item 3
Here is a numbered list:
- Item 1
- Item 2
- Sub-item
- Sub-item
- Sub-Sub-item
Links¶
Make hyperlinks like this [Link text](http://somesite.com)
For example: Google it
You can link to locations inside the document. This is convenient for making, say, a linked table of contents. Here's how:
- Put an html anchor at the target location:
<a id='my_target_name'></a>
- Put the link to the target anywhere else in the notebook:
[Link text](#my_target_name)
- For example here is a link to the top of this page
- Double click the cell at the top to see the anchor
</a id="the_top"></a>
- Double click the cell at the top to see the anchor
Bold, Italic, Colored Text¶
Italicize text between *'s: *This will be italic*
- That is: This is italic
Bold text between **'s: **This will be bold**
- That is: This is bold
No markdown for underline, use html tags instead: <u>This will be underlined</u>
- That is This will be underlined
strikethrough between ~~'s: ~~this will be strikethrough~~
- That is:
this will be strikethrough
colored text, use html <font> tags:
- For example:
<font color="green">This is colored</font> - For example: This is colored
Format Code¶
To write code snipets, like those above, you can just tab indent them, or surround with back-quotes: `this is code`
If the first line is like this: ```python
then subsequent lines will get syntax coloring, which is nice:
if a<2.2 :
print("Hi there")
Blockquotes¶
Block style quotes are offset with >
This text will be a quote. If the quote is really long it will continue onto the next line automatically depending on how wide your browser is.
Tables¶
| Left-aligned | Center-aligned | Right-aligned |
|:-------------|:--------------:|--------------:|
| Pressure | P | (Pa) |
| Temperature | T | (K) |
| Velocity | v | (m^3) |
| Left-aligned | Center-aligned | Right-aligned |
|---|---|---|
| Pressure | P | (Pa) |
| Temperature | T | (K) |
| Velocity | v | (m^3) |
Images¶
Images can be inserted with this 
html is more flexible and allows sizing <img src=my_image.png width=300>
- You can include local pictures, or pictures on a website.
- This is convenient for sharing your notebooks.
IFrames¶
- Useful for including other files, like PDFs
- These go in code cells and you need to import a library as shown below.
from IPython.display import IFrame
IFrame("https://ignite.byu.edu/cbe263/lectures", width=600, height=300)
LaTeX Equations¶
Equations are entered using LaTeX format.
- Google "latex math tutorial" for details.
- Here are some examples. Double click this cell to see how the equations are formatted.
In-line equations are surrounded with $ like this: $a=b$. That code becomes $a=b$
Single-line equations are surrounded with $$ like this:
$$a = b$$
$$a = b$$
Greek symbols are entered as \alpha or \gamma, or \Gamma, etc.
So $\alpha = \Gamma$ becomes $\alpha = \Gamma$.
Superscripts: ^
- Example:
$a^b$gives $a^b$
Subscripts: _
- Example:
$a_b$gives $a_b$
For more than one character, surround with {}
- Example
$T_max$gives $T_max$, but$T_{max}$gives $T_{max}$.
Fractions
- Enter as
$\frac{numerator}{denominator}$ - Example
$P = \frac{nRT}{V}$gives $P = \frac{nRT}{V}$ $$P = \frac{nRT}{V}$$
Some key symbols
- Partial derivative
\partial$\partial$ - Infinity
\infty$\infty$ - Right arrow
\rightarrow$\rightarrow$ - A dot, as in multiplication
a\cdot b$a\cdot b$ (note the space before b). - Nabla
\nabla$\nabla$ - Delta
\Delta$\Delta$ - Comparison
\le$\le$,\ge$\ge$ - Many more
- Google search
Sums and integrals
$\int_a^bf(x)dx$$\int_a^bf(x)dx$$\sum_{i=1}^{n_{pts}} w_i$$\sum_{i=1}^{n_{pts}} w_i$ $$\sum_{i=1}^{n_{pts}} w_i$$
Big parenthesis with \left( and \right), etc.
$$\left(\frac{a}{b}\right) = \left[\frac{x+y}{2}\right]^\delta$$
$$\left(\frac{a}{b}\right) = \left[\frac{x+y}{2}\right]^\delta$$
Use \left. or \right. to skip one side, as in
$$\left.\frac{\partial y}{\partial x}\right|_{z}$$
Add space with \,
$f(x)=a,\,\,x>5$
$f(x)=a,\,\,\,x>5$
\phantom{xxx} is also useful (puts in the xxx without showing it, xxx is anything you want).
$f(x)=a,\phantom{xxx}x>5$
Add text with \text{some text}
$$f(x) = x^2\text{ if y holds}$$
Align equations: use & as the alignment character, and \\ for new line:
\begin{align*}
\frac{dv}{dt} &= a + b^c + \alpha^2, \\
\frac{dx}{dt} &= x.
\end{align*}
becomes \begin{align*} &\frac{dv}{dt} = \xi + b^c + \Gamma^2, \\ &\frac{dx}{dt} = x. \end{align*}
$$\frac{a - \frac{b}{T+c}}{\sin(x)}$$
$$\sum_{i=22}^{45} f(x)dx$$
$$\frac{\partial f(x,y)}{\partial y}$$
For math functions:
- use
\sin(x), notsin(x) - use
\ln(x), noln(x), etc. $$\sin(x)$$ $$sin(x)$$ $$\ln(x)$$ $$ln(x)$$
Enter greek letters in code cells¶
- Jupyter: type backslash then the letter name then hit the tab key.
- VScode: Install the Greek Alphabet Snippets plugin
- Then type the name of the greek letter (or part of it) and
π = 3.14159265358979