used system for writing technical articles. I, for instance, wrote my Grasp’s thesis by Overleaf with a LaTeX file. Nevertheless, LaTeX is sophisticated to study, and when coping with it by Overleaf, you’ll encounter a variety of compiler errors and wrestle to prepare the file precisely the way you need.
Fortunately, there’s a a lot sooner and more practical approach of writing LaTeX code now: Write it in Cursor, or every other IDE powered by AI.
You possibly can nonetheless write the textual content such as you all the time 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 domestically in your pc, which is often sooner, after all, relying on the ability of your pc.
The purpose of this text is solely to indicate you the chances of an IDE by highlighting that you would be able to even create LaTeX information 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 need to naturally write your personal phrases. I’m merely saying you possibly can outsource all the 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 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 related, folks often resort to LaTeX. Folks use LaTeX as a result of:
- You get knowledgeable take a look at your article
- It’s very customizable. You primarily program the textual content, figures, and formatting right into a .tex file
- You might have a strong, scalable system for citations and references
Nevertheless, 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 resembling fixing compiler points, and the formatting of my thesis, fixing points like:
- How large 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’ve gotten a 100-page doc with a variety of photographs. I’ve now found there’s a significantly better approach of writing these articles, which is thru your IDE.
Under 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 strong 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 nicely 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]{photographs/document-to-ocr-to-IE.png}
caption{The OCR + LLM metadata extraction pipeline. A doc is first processed by 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 photographs immediately.}
label{fig:ocr-llm-flow}
finish{determine}
I might additionally argue that you must write non-technical content material by LaTeX. It’s an excellent organized method to create PDFs with correct formatting, figures, and references.
Moreover, you possibly can create displays by Overleaf, which is actually 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 format ought to 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 possibly can merely begin writing your content material. Should you want a particular construction or need to comply with a template, you may also immediate Cursor about this and have it design a top level view in 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 a top level view 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 may then simply begin filling out the content material of my article.
Picture formatting

At some factors, I need to add footage and figures to my article. I then present Cursor the native path to the picture on my pc, and the placement 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 photographs beside one another, …) I additionally immediate Cursor to try this.
Code formatting

Including code can be fairly easy with Cursor. I’ve a sure code formatting type laid out in my brokers.md file, and I then merely present Cursor the code to focus on, and it provides it to the file with the right formatting. In some unspecified time in the future, 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 just too lengthy, all the time wrap it). I’ll cowl extra about brokers.md within the subsequent part.
Field highlighting
Generally, I additionally need 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 under, which helps make my level clearer.

Sustaining brokers.md
While you begin writing and prompting the Cursor to repair formatting, you’ll discover that the AI agent typically 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 would like citations in a particular format
- If you would like a sure colour scheme
- How large ought to your figures be
At any time when Cursor deviates from the specified conduct, for instance, through the use of the inaccurate colour scheme, you must do two issues:
- Inform Cursor the right conduct (use a minimalistic black and white colour scheme as a substitute)
- 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 each time an AI agent doesn’t do precisely what you need it to do. It’s particularly necessary when writing longer LaTeX information, the place you’re depending on constant schemes and formatting, and also you don’t need to all the time specify the kind of colour scheme you need each 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, this can be a revolutionary workflow, saving me numerous hours each time I’m writing an article in LaTeX. I consider you must 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 Vision Language Models ebook
💻 My webinar on Vision Language Models
🧑💻 Get in touch
✍️ Medium
You too can learn my article under:

