used system for writing technical articles. I, for instance, wrote my Grasp’s thesis by way of Overleaf with a LaTeX file. Nevertheless, LaTeX is sophisticated to study, and when coping with it by way of Overleaf, you’ll encounter a number of compiler errors and wrestle to arrange the file precisely the way you need.
Fortunately, there’s a a lot quicker and more practical means of writing LaTeX code now: Write it in Cursor, or another IDE powered by AI.
You possibly can nonetheless write the textual content such as you all the time used to, however as an alternative of spending time aligning figures, fixing quotation points, and fixing compiler errors, now you can ask an LLM to repair these points for you. Moreover, it’s quicker than utilizing a web-based editor like Overleaf, since you’ll be able to compile the PDF regionally in your laptop, which is normally quicker, after all, relying on the ability of your laptop.
The objective of this text is solely to point out you the chances of an IDE by highlighting that you would be able to even create LaTeX recordsdata with it. Discovering this as an possibility was an eye-opening expertise for me.
Word that I’m not suggesting outsourcing your writing to Cursor. You must naturally write your personal phrases. I’m merely saying you’ll be able to outsource the entire non-writing duties to Cursor, so you’ll be able to spend all of your time writing as an alternative. Additionally, I’m not sponsored by Cursor within the writing of this text.
You can access the eBook created through this article here.
Why write LaTeX code in Cursor
LaTeX is the go-to system for writing technical articles, so everytime you write a paper, a thesis, or comparable, individuals normally resort to LaTeX. Individuals use LaTeX as a result of:
- You get knowledgeable have a look at your article
- It’s very customizable. You primarily program the textual content, figures, and formatting right into a .tex file
- You have got a stable, scalable system for citations and references
Nevertheless, it’s fairly frequent to put in writing LaTeX in a web-based editor like Overleaf. I used Overleaf for my Grasp’s thesis in 2024, and it labored decently, although I did spend a number of time on mundane duties comparable to fixing compiler points, and the formatting of my thesis, fixing points like:
- How broad ought to a picture be
- Compiler points
- Correct citations

That is made particularly irritating as a result of Overleaf spends fairly a while compiling, particularly when you could have a 100-page doc with a number of pictures. I’ve now found there’s a significantly better means of writing these articles, which is thru your IDE.
Beneath you’ll be able to see an instance of LaTeX code, together with bullet level lists and a determine with a caption and label used to reference the determine
A robust middle-ground strategy:
start{enumerate}
merchandise Apply OCR to extract doc textual content
merchandise Immediate an LLM to extract particular metadata
finish{enumerate}
This works extremely nicely as a result of LLMs can:
start{itemize}
merchandise Perceive context (which dates are related vs irrelevant)
merchandise Parse completely different date codecs mechanically
merchandise Deal with each European (dd.mm.yyyy) and American (mm.dd.yyyy) requirements
finish{itemize}
Determine~ref{fig:ocr-llm-flow} illustrates this strategy:
start{determine}[h]
centering
includegraphics[width=0.9textwidth]{pictures/document-to-ocr-to-IE.png}
caption{The OCR + LLM metadata extraction pipeline. A doc is first processed by way of OCR to extract textual content, which is then mixed with a immediate and fed to an LLM to extract structured metadata. This strategy balances price and functionality, leveraging the LLM's contextual understanding whereas avoiding the upper token prices of processing pictures instantly.}
label{fig:ocr-llm-flow}
finish{determine}
I’d additionally argue that it’s best to write non-technical content material by way of LaTeX. It’s an excellent organized strategy to create PDFs with correct formatting, figures, and references.
Moreover, you’ll be able to create displays by way of Overleaf, which is basically an article, however after all, utilizing clearly separated slides.
Arrange LaTeX in Cursor
Establishing LaTeX in Cursor is comparatively easy: You ask the agent to arrange the surroundings for you. I used the next immediate:
arrange a file known as e-book which is a latex file and assist me parse it
as a pdf. The structure must be that of a knowledge science e-book
Cursor then created an e-book.tex file, and the instructions I wanted to parse it. After that, you’ll be able to merely begin writing your content material. For those who want a particular construction or wish to comply with a template, you too can immediate Cursor about this and have it design an overview on your article, the place you can begin working.
Writing your article and compiling
After establishing LaTeX in Cursor, I began writing my eBook. I requested Cursor to make an overview for me for a knowledge science template, the place it stuffed within the fundamentals, leaving [TEXT PLACEHOLDER] across the file.
Cursor, for instance, arrange a title and subheader placeholder, the present date, a preface placeholder, and a chapter placeholder. I might then simply begin filling out the content material of my article.
Picture formatting

At some factors, I wish to add photos and figures to my article. I then present Cursor the native path to the picture on my laptop, and the situation to place the picture in, and supply a discipline to fill within the picture description textual content. If I need any particular formatting for the picture (width, opacity, two pictures beside one another, …) I additionally immediate Cursor to try this.
Code formatting

Including code can also be fairly easy with Cursor. I’ve a sure code formatting fashion laid out in my brokers.md file, and I then merely present Cursor the code to spotlight, and it provides it to the file with the proper formatting. Sooner or later, I additionally observed {that a} line of code was going outdoors the PDF, and I informed Cursor to wrap the road, and added that to brokers.md (if a code line is simply too lengthy, all the time wrap it). I’ll cowl extra about brokers.md within the subsequent part.
Field highlighting
Typically, I additionally wish to preface factors in my eBook. In these instances, I make use of field highlighting. I merely mark the related textual content in my code, press CMD + L so as to add it as context to the Cursor, and immediate the Cursor so as to add this as a key level field. Cursor then offers the field you see beneath, which helps make my level clearer.

Sustaining brokers.md
Once you begin writing and prompting the Cursor to repair formatting, you’ll discover that the AI agent generally doesn’t do as you need. In these instances, it’s essential to take care of an brokers.md the place you condense your preferences right into a single file. For instance:
- If you’d like citations in a particular format
- If you’d like a sure coloration scheme
- How broad ought to your figures be
Every time Cursor deviates from the specified conduct, for instance, by utilizing the wrong coloration scheme, it’s best to do two issues:
- Inform Cursor the proper conduct (use a minimalistic black and white coloration scheme as an alternative)
- Inform Cursor so as to add that conduct to brokers.md (or .cursorrules). This may make sure the error doesn’t occur once more
Doing these two steps ought to primarily be muscle reminiscence every time an AI agent doesn’t do precisely what you need it to do. It’s particularly necessary when writing longer LaTeX recordsdata, the place you’re depending on constant schemes and formatting, and also you don’t wish to all the time specify the kind of coloration scheme you need every time making an replace.
Conclusion
On this article, I’ve taken you thru how you should utilize Cursor to put in writing your technical articles in LaTeX. For me, this can be a revolutionary workflow, saving me numerous hours each time I’m writing an article in LaTeX. I consider it’s best to by no means be spending time manually fixing compiler errors in Overleaf or copying and pasting code from ChatGPT to unravel formatting errors. Writing LaTeX in Cursor primarily solves all of your issues, aside from the writing itself, which you naturally should carry out your self.
👉 Discover me on socials:
📚 Get my free Vision Language Models ebook
💻 My webinar on Vision Language Models
🧑💻 Get in touch
✍️ Medium
You can too learn my article beneath:
