How to convert Markdown to LaTeX
Run pandoc notes.md -s -o notes.tex to get a complete LaTeX document; math written as $…$ and $$…$$ comes through by default, and math written as \(…\) and \[…\] needs -f markdown+tex_math_single_backslash. In Manulyx, New project → Markdown takes pasted text or a .md file and makes a LaTeX project that compiles as it is, with all four kinds of math and the top heading as the title.
Convert it yourself with pandoc
pandoc notes.md -s -o notes.tex --number-sections
# math written as \( \) and \[ \], as many AI answers write it:
pandoc -f markdown+tex_math_single_backslash notes.md -s -o notes.tex-swrites a complete document with a preamble; without it you get the body only.- Headings become
\section,\subsection, …;--number-sectionsnumbers them. - The title: put a YAML block at the top (
title:,author:,date:between---lines), or, if the file starts with one# Titleheading, add--shift-heading-level-by=-1: that heading becomes the title and##headings become sections. - Citations: write
[@smith2020]in the text.--citeproc --bibliography=refs.bibformats them and adds the reference list;--natbibor--biblatexinstead writes\citecommands for BibTeX or biber (not together with--citeproc). - Pictures:
alone in a paragraph becomes a figure with that caption. The picture file must be where the path says. - Raw LaTeX written in the Markdown, such as
\newpage, passes through to the LaTeX unchanged. - Compile with
latexmk -pdf notes.tex; text in a script other than Latin (Chinese, Arabic, Cyrillic) needslatexmk -xelatexor LuaLaTeX.
What pandoc loses
- HTML written inside the Markdown is dropped from LaTeX output.
- Syntax that only one Markdown flavor knows (callout boxes, diagrams in code blocks, wiki links) is not understood and comes out as plain text or code.
- Emoji: no standard TeX font has them, so they fail or vanish when you compile.
- Tables become
longtable, which does not work in a two-column layout.
What to check after converting
- Math: every formula typeset as math, not shown as text with dollar signs or backslashes.
- The title, and the heading levels (a single
#heading should not become a lone section). - Pictures: each file present and included.
- Citations: none left as
[@key]text. - Code blocks: long lines that run off the page.
- Characters the font does not have: compile with XeLaTeX if any are missing.
How Manulyx does it
Text written in Markdown, from a notes app, a README or an AI assistant's answer, becomes a LaTeX project: New project → Markdown, paste the text (or choose a .md file in New project → Import). Manulyx runs pandoc and makes a complete document that compiles as it is.
- Math written as
$…$,$$…$$,\(…\)or\[…\]comes through, with no option to choose. - The title is a YAML
title:if there is one; otherwise a single top heading becomes the title and the other headings move up a level; otherwise the title you type in the dialog. - Headings become numbered sections; lists, tables and links come through.
- Pictures cannot come with pasted text, so a framed note marks where each one goes and names the file: upload the picture and point to it there.
- Characters: symbols typed as characters become LaTeX commands, emoji are dropped, and text in another script (Chinese, Arabic, Cyrillic…) makes the project a XeLaTeX document, so it compiles.
Questions
Does pandoc convert math written as \( \) and \[ \]?
Not by default. Add -f markdown+tex_math_single_backslash; math written as $…$ and $$…$$ works without it.
How do I cite references in Markdown for LaTeX?
Write [@key] in the text and keep the entries in a .bib file. Convert with --natbib or --biblatex to get \cite commands, or with --citeproc --bibliography=refs.bib to get formatted citations.
Can I turn an AI assistant's answer into a LaTeX document?
Yes. Copy the answer as Markdown and convert it with the tex_math_single_backslash option, or paste it into New project → Markdown in Manulyx.
What happens to pictures when I paste Markdown into Manulyx?
Pasted text cannot carry pictures, so each one becomes a framed note naming the file. Upload the picture and point to it there.
Or read the guide first: Help: Markdown.