{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "###### The cell below loads the style of this notebook." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "" ], "text/plain": [ "" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from IPython.core.display import HTML\n", "css_file = '../styles.css'\n", "HTML(open(css_file, \"r\").read())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Using markdown in the Jupyter Notebook\n", "-------------------------------------------------------------" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "
\n", "

Learning Objectives

\n", "
\n", "
\n", "\n", "> - learn how to format text in markdown cells\n", "> - learn how to include images and video in markdown cells\n", "> - learn how to format equations in markdown cells\n", "\n", "---" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# What is markdown?\n", "----\n", "\n", "Markdown is a *markup language* that can be used to format text. The full [specification](http://daringfireball.net/projects/markdown/syntax) lists all the possible ways that text can be styled. Here we'll look at a few useful examples. The best way to do that is to get our hands dirty!" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "
\n", "

Exercise: getting to know markdown

\n", "
\n", "
\n", "\n", "> Download this [notebook](http://nbviewer.ipython.org/github/ipython/ipython/blob/3.x/examples/Notebook/Working%20With%20Markdown%20Cells.ipynb), and open it. On the Astro Python Server, the notebook is in the bootcamp directory already.\n", "\n", "> When you edit each cell, you get to see the markdown syntax that produced the output you see. Explore the cells as far down as \"Latex Equations\" - note the markdown code in the cell, and the output it produces.\n", "\n", "> Create a new markdown cell at the top of the notebook that contains a title, a short paragraph, a bulleted list and a link to a webpage.\n", "\n", "---" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Embedding images\n", "---" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "If you have local files (images, video etc) in your notebook directory, you can display those files in the notebook using markdown. For example, suppose you have the Python logo in a folder called \"images\":\n", "\n", " \n", " \n", "will display the file, like so\n", "\n", "\n", "\n", "Too big? We can set the width and/or height\n", "\n", " \n", "\n", "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Writing Equations\n", "---\n", "\n", "One of the most useful properties of the notebook is the ability to write nicely formatted equations, using Latex notation. To do this, simply wrap the text you want to be rendered as an equation in \\$ \\$ symbols. For example, \\$y = 3x + c\\$ renders as $y = 3x + c$. If you want to display the equation on a new line, use \\$\\$ \\$\\$ instead.\n", "\n", "Latex equation format is very powerful, and renders beautiful equations. The syntax can take some getting used to, however. There is a really short reference guide [here](http://meta.math.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference), which is handy for learning the ropes. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "
\n", "

Exercise: equations in markdown

\n", "
\n", "
\n", "\n", "> Starting from the identity\n", "> $$e^{ix} = \\cos x + i \\sin x,$$\n", "> derive Euler's identity\n", "> $$e^{i\\pi} + 1= 0.$$\n", "\n", "> Write your derivation in a markdown cell. Make sure to include the mathematical steps and some text explaining each step.\n", "\n", "---" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "
\n", "

Conclusions

\n", "
\n", "
\n", "\n", "> We've learned how to format text, images and equations in the Jupyter notebook. \n", "\n", "> We've now been introduced to Python briefly, and we have seen how to install Python and run Python several different ways, including the IPython interpreter, .py files and the Jupyter notebook.\n", "\n", "> In the next session we'll introduce ourselves to the Python language itself, and start learning to write some code." ] } ], "metadata": { "kernelspec": { "display_name": "IPython (Python 3)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.4.3" } }, "nbformat": 4, "nbformat_minor": 0 }