TexToolsAI

Markdown Cheat Sheet: Syntax Reference with Examples

By VeloForge Labs · · 2 min read

A quick reference for the Markdown syntax you will use every day. Paste any example into the playground to see the HTML it produces.

Headings

# Heading 1
## Heading 2
### Heading 3

Put a space after the # characters. A page should have one H1 and use H2 and H3 for structure, which helps both readers and search engines.

Emphasis

*italic* or _italic_
**bold** or __bold__
***bold and italic***

Lists

- Unordered item
- Another item
  - Nested item (indent two spaces)

1. First
2. Second
3. Third

Numbered lists renumber themselves in the output, so the actual digits you type do not have to be sequential.

[Link text](https://example.com)
[Link with title](https://example.com "Hover text")
![Alt text for an image](https://example.com/pic.png)

Always write meaningful alt text. It is read aloud by screen readers and shown when the image fails to load.

Code

Wrap inline code in single backticks. For blocks, fence with three backticks or three tildes and name the language:

```python
print("Hello")
```

You can also indent a block by four spaces, though fenced blocks are easier to read in source form.

Blockquotes

> A quoted paragraph.
>
> Quotes can span multiple paragraphs.

Horizontal rule

Three or more hyphens, asterisks or underscores on a line by themselves: ---.

Line breaks and paragraphs

A blank line starts a new paragraph. To force a line break inside a paragraph, end the line with two spaces or a backslash. Some tools, including the TexToolsAI API, also turn a single newline into a line break.

GFM extras

These work in GitHub-Flavored Markdown, which is on by default in the TexToolsAI API:

| Column A | Column B |
|----------|----------|
| One      | Two      |

~~strikethrough~~

- [x] Done
- [ ] To do

More on these in the GFM guide.

Escaping

Put a backslash before a character that would otherwise be formatting: \*not italic\* shows literal asterisks.

Raw HTML

Most parsers let you use HTML tags inside Markdown. If you accept Markdown from other people, that is a security risk, and the output must be sanitized. See Why Markdown is not safe by default.

Convert it

Have Markdown that needs to become HTML? The API does it in one request, with sanitizing included.