Write Markdown to Overleaf
write_markdownConvert Markdown drafts into LaTeX and insert them into Overleaf projects by replacing sections, overwriting, or appending files.
Instructions
Write in Markdown, publish as LaTeX. Converts Markdown to LaTeX and writes it into the project: a new/overwritten .tex file, an existing section replaced by title, or appended to a file. Supports headings ({#sec:label}, {-} for unnumbered), $math$ and $$display$$ ({#eq:label}), citations [@key; @key2, p. 3], cross refs @fig:x/@sec:x/@eq:x/@tbl:x, figures
{#fig:x width=60%}, pipe tables with 'Table: caption {#tbl:x}', footnotes, lists, code, and raw LaTeX (\commands and \begin..\end blocks pass through). Set dry_run to preview the LaTeX first. Writing uses Git; falls back to the opt-in web mode if enabled.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | For a file target: overwrite (default) or append before \end{document}. | |
| path | No | Target .tex file in the project. Required unless `section` is given. | |
| dry_run | No | Only return the converted LaTeX and what would change; do not push. | |
| md_path | No | Absolute path of a local .md file to convert instead of `markdown`. | |
| project | No | Project ID or Overleaf project URL (or project name in web mode). Defaults to OVERLEAF_PROJECT_ID. | |
| section | No | Title of an existing section to replace. If the Markdown starts with a heading it replaces the heading too; otherwise only the body. | |
| markdown | No | Markdown text. Use this or md_path. | |
| top_level | No | LaTeX command for the shallowest Markdown heading. Defaults to section, or the replaced section's own level. | |
| commit_message | No |