write_file
Write or overwrite a file in an Overleaf project with live updates and cursor preservation. Replaces the entire file, so read first if content may have changed.
Instructions
Create or overwrite a file. Writes are merged into the live document as an operational transform, so a human with the project open sees the change immediately and their cursor is preserved. NOTE: this replaces the whole file — read_file first if the content may have changed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | e.g. main.tex, sections/intro.tex, refs.bib | |
| content | Yes | ||
| projectId | Yes |