used system for writing technical articles. I, for instance, wrote my Grasp’s thesis via Overleaf with a LaTeX file. Nonetheless, LaTeX is sophisticated to study, and when coping with it via Overleaf, you’ll encounter a variety of compiler errors and battle to arrange the file precisely the way you need.
Fortunately, there’s a a lot sooner and simpler manner of writing LaTeX code now: Write it in Cursor, or some other IDE powered by AI.
You may nonetheless write the textual content such as you at all times used to, however as a substitute 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 sooner than utilizing an internet editor like Overleaf, since you possibly can compile the PDF regionally in your pc, which is normally sooner, after all, relying on the ability of your pc.
The objective of this text is just to point out you the probabilities of an IDE by highlighting that you could even create LaTeX recordsdata with it. Discovering this as an possibility was an eye-opening expertise for me.
Notice that I’m not suggesting outsourcing your writing to Cursor. You must naturally write your individual phrases. I’m merely saying you possibly can outsource the entire non-writing duties to Cursor, so you possibly can spend all of your time writing as a substitute. Additionally, I’m not sponsored by Cursor within the writing of this text.
You may entry the eBook created via this text right 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 could have a strong, scalable system for citations and references
Nonetheless, it’s fairly frequent to jot down LaTeX in an internet editor like Overleaf. I used Overleaf for my Grasp’s thesis in 2024, and it labored decently, although I did spend a variety of time on mundane duties akin to fixing compiler points, and the formatting of my thesis, fixing points like:
- How huge 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 might have a 100-page doc with a variety of pictures. I’ve now found there’s a a lot better manner of writing these articles, which is thru your IDE.
Beneath you possibly can 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 method:
start{enumerate}
merchandise Apply OCR to extract doc textual content
merchandise Immediate an LLM to extract particular metadata
finish{enumerate}
This works extremely properly as a result of LLMs can:
start{itemize}
merchandise Perceive context (which dates are related vs irrelevant)
merchandise Parse totally 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 method:
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 via OCR to extract textual content, which is then mixed with a immediate and fed to an LLM to extract structured metadata. This method balances price and functionality, leveraging the LLM's contextual understanding whereas avoiding the upper token prices of processing pictures immediately.}
label{fig:ocr-llm-flow}
finish{determine}
I’d additionally argue that it’s best to write non-technical content material via LaTeX. It’s an excellent organized strategy to create PDFs with correct formatting, figures, and references.
Moreover, you possibly can create shows via 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 setting for you. I used the next immediate:
arrange a file referred to as e-book which is a latex file and assist me parse it
as a pdf. The structure ought to be that of an information science e-book
Cursor then created an e-book.tex file, and the instructions I wanted to parse it. After that, you possibly can merely begin writing your content material. If you happen to want a particular construction or wish to observe a template, you may as well immediate Cursor about this and have it design a top level view to your article, the place you can begin working.
Writing your article and compiling
After organising LaTeX in Cursor, I began writing my eBook. I requested Cursor to make a top level view for me for an information science template, the place it crammed 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 pc, and the situation to place the picture in, and supply a subject 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 do 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 right formatting. Sooner or later, I additionally observed {that a} line of code was going exterior the PDF, and I advised Cursor to wrap the road, and added that to brokers.md (if a code line is simply too lengthy, at all times wrap it). I’ll cowl extra about brokers.md within the subsequent part.
Field highlighting
Generally, I additionally wish to preface factors in my eBook. In these circumstances, 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 supplies the field you see beneath, which helps make my level clearer.

Sustaining brokers.md
If 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 circumstances, it’s essential to keep up an brokers.md the place you condense your preferences right into a single file. For instance:
- If you would like citations in a particular format
- If you would like a sure shade scheme
- How huge ought to your figures be
Each time Cursor deviates from the specified habits, for instance, by utilizing the wrong shade scheme, it’s best to do two issues:
- Inform Cursor the right habits (use a minimalistic black and white shade scheme as a substitute)
- Inform Cursor so as to add that habits 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 vital when writing longer LaTeX recordsdata, the place you’re depending on constant schemes and formatting, and also you don’t wish to at all times specify the kind of shade scheme you need every time making an replace.
Conclusion
On this article, I’ve taken you thru how you should use Cursor to jot down your technical articles in LaTeX. For me, it is 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 resolve formatting errors. Writing LaTeX in Cursor primarily solves all of your issues, apart from the writing itself, which you naturally must carry out your self.
👉 Discover me on socials:
📚 Get my free Imaginative and prescient Language Fashions e-book
💻 My webinar on Imaginative and prescient Language Fashions
📩 Subscribe to my e-newsletter
🧑💻 Get in contact
✍️ Medium
You can too learn my article beneath:
