used system for writing technical articles. I, for example, wrote my Master’s thesis through Overleaf with a LaTeX file. However, LaTeX is complicated to learn, and when dealing with it through Overleaf, you’ll encounter a lot of compiler errors and struggle to organize the file exactly how you want.
Luckily, there is a much faster and more effective way of writing LaTeX code now: Write it in Cursor, or any other IDE powered by AI.
You can still write the text like you always used to, but instead of spending time aligning figures, fixing citation issues, and solving compiler errors, you can now ask an LLM to fix these issues for you. Additionally, it is faster than using an online editor like Overleaf, since you can compile the PDF locally on your computer, which is usually faster, of course, depending on the power of your computer.

The goal of this article is simply to show you the possibilities of an IDE by highlighting that you can even create LaTeX files with it. Discovering this as an option was an eye-opening experience for me.
Note that I’m not suggesting outsourcing your writing to Cursor. You should naturally write your own words. I’m simply saying you can outsource all of the non-writing tasks to Cursor, so you can spend all your time writing instead. Also, I’m not sponsored by Cursor in the writing of this article.
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 whenever you write a paper, a thesis, or similar, people usually resort to LaTeX. People use LaTeX because:
- You get a professional look at your article
- It’s very customizable. You essentially program the text, figures, and formatting into a .tex file
- You have a solid, scalable system for citations and references
However, it’s quite common to write LaTeX in an online editor like Overleaf. I used Overleaf for my Master’s thesis in 2024, and it worked decently, though I did spend a lot of time on mundane tasks such as fixing compiler issues, and the formatting of my thesis, fixing issues like:
- How wide should an image be
- Compiler issues
- Proper citations

This is made especially frustrating because Overleaf spends quite some time compiling, especially when you have a 100-page document with a lot of images. I have now discovered there is a much better way of writing these articles, which is through your IDE.
Below you can see an example of LaTeX code, including bullet point lists and a figure with a caption and label used to reference the figure
A powerful middle-ground approach:
\begin{enumerate}
\item Apply OCR to extract document text
\item Prompt an LLM to extract specific metadata
\end{enumerate}
This works incredibly well because LLMs can:
\begin{itemize}
\item Understand context (which dates are relevant vs irrelevant)
\item Parse different date formats automatically
\item Handle both European (dd.mm.yyyy) and American (mm.dd.yyyy) standards
\end{itemize}
Figure~\ref{fig:ocr-llm-flow} illustrates this approach:
\begin{figure}[h]
\centering
\includegraphics[width=0.9\textwidth]{images/document-to-ocr-to-IE.png}
\caption{The OCR + LLM metadata extraction pipeline. A document is first processed through OCR to extract text, which is then combined with a prompt and fed to an LLM to extract structured metadata. This approach balances cost and capability, leveraging the LLM's contextual understanding while avoiding the higher token costs of processing images directly.}
\label{fig:ocr-llm-flow}
\end{figure}I would also argue that you should write non-technical content through LaTeX. It’s a super organized way to create PDFs with proper formatting, figures, and references.
Furthermore, you can create presentations through Overleaf, which is essentially an article, but of course, using clearly separated slides.
Set up LaTeX in Cursor
Setting up LaTeX in Cursor is relatively simple: You ask the agent to set up the environment for you. I used the following prompt:
set up a file called ebook which is a latex file and help me parse it
as a pdf. The layout should be that of a data science ebookCursor then created an ebook.tex file, and the commands I needed to parse it. After that, you can simply start writing your content. If you need a specific structure or want to follow a template, you can also prompt Cursor about this and have it design an outline for your article, where you can start working.
Writing your article and compiling
After setting up LaTeX in Cursor, I started writing my eBook. I asked Cursor to make an outline for me for a data science template, where it filled in the basics, leaving [TEXT PLACEHOLDER] around the file.
Cursor, for example, set up a title and subheader placeholder, the current date, a preface placeholder, and a chapter placeholder. I could then easily start filling out the content of my article.
Image formatting

At some points, I want to add pictures and figures to my article. I then provide Cursor the local path to the image on my computer, and the location to put the image in, and provide a field to fill in the image description text. If I want any special formatting for the image (width, opacity, two images beside each other, …) I also prompt Cursor to do that.
Code formatting

Adding code is also quite simple with Cursor. I have a certain code formatting style specified in my agents.md file, and I then simply provide Cursor the code to highlight, and it adds it to the file with the correct formatting. At some point, I also noticed that a line of code was going outside the PDF, and I told Cursor to wrap the line, and added that to agents.md (if a code line is too long, always wrap it). I’ll cover more about agents.md in the next section.
Box highlighting
Sometimes, I also want to preface points in my eBook. In these cases, I make use of box highlighting. I simply mark the relevant text in my code, press CMD + L to add it as context to the Cursor, and prompt the Cursor to add this as a key point box. Cursor then provides the box you see below, which helps make my point clearer.

Maintaining agents.md
When you start writing and prompting the Cursor to fix formatting, you’ll notice that the AI agent sometimes doesn’t do as you desire. In these cases, it’s very important to maintain an agents.md where you condense your preferences into a single file. For example:
- If you want citations in a specific format
- If you want a certain color scheme
- How wide should your figures be
Whenever Cursor deviates from the desired behavior, for example, by using the incorrect color scheme, you should do two things:
- Tell Cursor the correct behavior (use a minimalistic black and white color scheme instead)
- Tell Cursor to add that behavior to agents.md (or .cursorrules). This will ensure the error does not happen again
Doing these two steps should essentially be muscle memory whenever an AI agent doesn’t do exactly what you want it to do. It is especially important when writing longer LaTeX files, where you’re dependent on consistent schemes and formatting, and you don’t want to always specify the type of color scheme you want whenever making an update.
Conclusion
In this article, I’ve taken you through how you can use Cursor to write your technical articles in LaTeX. For me, this is a revolutionary workflow, saving me countless hours every time I’m writing an article in LaTeX. I believe you should never be spending time manually solving compiler errors in Overleaf or copying and pasting code from ChatGPT to solve formatting errors. Writing LaTeX in Cursor essentially solves all your problems, except for the writing itself, which you naturally have to perform yourself.
👉 Find me on socials:
📚 Get my free Vision Language Models ebook
💻 My webinar on Vision Language Models
🧑💻 Get in touch
✍️ Medium
You can also read my article below:


