This repo contains the necessary files to use Cursor to edit LaTeX documents.
This repository contains a script named copy_files.sh
designed to facilitate the copying of specific configuration files from a source directory to the current working directory.
In the target directory (the directory containing the LaTeX files), run
bash /path/to/copy_files.sh /path/to/source/directory
Where /path/to/source/directory
is the directory of this repository.
This repo contains the following files:
.cursorrules
: Cursor rules for working with LaTeX documents. Feel free to modify it to fit your needs..gitignore
: Git ignore for LaTeX..vscode
: VSCode settings for LaTeX. It contains the specification for a task that automatically compile the project. It requires the Makefile to work.Makefile
: Makefile for the LaTeX project. You might need to adjust it to fit your pipeline.
Cursor is a powerful code editor that provides a lot of features out of the box. It can autocomplete your code and allows you to instruct LLMs to modify your code with natural language.
Since LaTeX documents can be regarded as code and LLMs recognize LaTeX syntax, naturally Cursor can provide a lot of help, such as refining the writing, fixing the formatting, modifying the tables, etc.
Required:
- Cursor: you might need to subscribe to the paid version to fully leverage the features.
.cursorrules
: the configuration file for Cursor. Feel free to modify it to fit your needs. But it's important to instruct Cursor that you are working on a LaTeX project so that it can follow the syntax.- A TeX distribution on your local computer: this allows you to compile the LaTeX documents. For Mac users, I recommend MacTeX. For other operating systems, please refer to TeX Live.
Highly recommended:
- LaTeX workshop: a VSCode extension that provides a lot of useful features for LaTeX editing and compiling. Please refer to the official documentation for detailed instructions.
Optional:
Makefile
: the Makefile for compiling the LaTeX documents. I included it when I need to customize my compiling pipeline..vscode/tasks.json
: the task specification for compiling the LaTeX documents. It requires the Makefile to work. You can trigger it in Cursor by pressingCtrl+Shift+B
.
Overleaf allows you to clone the repository to your local computer using Git. See the official documentation for detailed instructions.
After you make changes, you can commit and push to the remote repository. It's similar to working with GitHub, but the remote is Overleaf's server in this case.
Note that if others are working on the same project, you might face conflicts.
The only setup specific to Cursor is the .cursorrules
file, so the framework should also work for VSCode and GitHub Copilot with minor modifications.