Markdown to LaTeX cheat sheet
| Markdown | LaTeX |
|---|---|
# Title | \section{Title} |
## Sub | \subsection{Sub} |
**bold** | \textbf{bold} |
*italic* | \emph{italic} |
- item | \begin{itemize} \item … |
[text](url) | \href{url}{text} |
```py | \begin{lstlisting}[language=py] |
table | \begin{tabular}{l c r} |
Fragment or full document
The full document option wraps the output in an article preamble that loads hyperref, graphicx, listings, ulem (for strikethrough) and amsmath, so it compiles as-is in Overleaf or with pdflatex. Turn it off to paste into an existing paper.
Special characters
LaTeX reserves # $ % & _ { } ~ ^ \. They are escaped in text automatically (for example 50% becomes 50\%), so the output compiles without “Missing $ inserted” errors.
Math
Markdown math written as $…$ is kept as text here. For heavy math documents Pandoc (pandoc in.md -o out.tex) passes math through natively. To preview Markdown math, see the math guide.
Other formats
Markdown converts to: Confluence, Jira, Slack, BBCode, MediaWiki, AsciiDoc, reStructuredText, plus HTML, PDF, Word and Excel.