+++ date = "2016-04-20T10:00:00" draft = false tags = [] title = "Writing content with Markdown, LaTeX, and Shortcodes" math = true +++ Content can be written using [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet), [LaTeX math](https://en.wikibooks.org/wiki/LaTeX/Mathematics), and [Hugo Shortcodes](http://gohugo.io/extras/shortcodes/). Additionally, HTML may be used for advanced formatting. This article gives an overview of the most common formatting options. ## Sub-headings ## H2 ### H3 #### H4 ##### H5 ###### H6 ## Emphasis Italics with *asterisks* or _underscores_. Bold with **asterisks** or __underscores__. Combined emphasis with **asterisks and _underscores_**. Strikethrough with ~~two tildes~~. ## Ordered lists 1. First item 2. Another item ## Unordered lists * First item * Another item ## Images Images may be added to a page by placing them in your `static/img/` folder and referencing them using one of the following two notations: A general image: ![alternative text for search engines](/img/screenshot.png) A numbered figure with caption: {{}} ## Links [I'm a link](https://www.google.com) [A post]({{}}) [A publication]({{}}) [A project]({{}}) [Another section]({{}}) ## Blockquote > This is a blockquote. > This is a blockquote. ## Code highlighting Pass the *language* of the code, such as `python`, as a parameter after three backticks: ```python # Example of code highlighting input_string_var = input("Enter some data: ") print("You entered: {}".format(input_string_var)) ``` Result: ```python # Example of code highlighting input_string_var = input("Enter some data: ") print("You entered: {}".format(input_string_var)) ``` ## Twitter tweet To include a single tweet, pass the tweet’s ID from the tweet's URL as parameter to the shortcode: {{}} ## Youtube {{}} ## Vimeo {{}} ## GitHub gist {{}} ## Speaker Deck {{}} ## $\rm \LaTeX$ math ```TeX $$\left [ – \frac{\hbar^2}{2 m} \frac{\partial^2}{\partial x^2} + V \right ] \Psi = i \hbar \frac{\partial}{\partial t} \Psi$$ ``` $$\left [ – \frac{\hbar^2}{2 m} \frac{\partial^2}{\partial x^2} + V \right ] \Psi = i \hbar \frac{\partial}{\partial t} \Psi$$ Alternatively, inline math can be written by wrapping the formula with only a single `$`: This is inline: $\mathbf{y} = \mathbf{X}\boldsymbol\beta + \boldsymbol\varepsilon$ This is inline: $\mathbf{y} = \mathbf{X}\boldsymbol\beta + \boldsymbol\varepsilon$ ## Table Code: ```Markdown | Command | Description | | ------------------| ------------------------------ | | `hugo` | Build your website. | | `hugo serve -w` | View your website. | ``` Result: | Command | Description | | ------------------| ------------------------------ | | `hugo` | Build your website. | | `hugo serve -w` | View your website. | ## Alerts Alerts are a useful feature that add side content such as tips, notes, or warnings to your articles. They are especially handy when writing educational tutorial-style articles. Use the corresponding shortcodes to enable alerts inside your content: {{%/* alert note */%}} Here's a tip or note... {{%/* /alert */%}} This will display the following *note* block: {{% alert note %}} Here's a tip or note... {{% /alert %}} {{%/* alert warning */%}} Here's some important information... {{%/* /alert */%}} This will display the following *warning* block: {{% alert warning %}} Here's some important information... {{% /alert %}}