used system for writing technical articles. I, for instance, wrote my Master’s thesis through Overleaf with a LaTeX file. Nonetheless, LaTeX is complicated to learn, and when coping with it through Overleaf, you’ll encounter numerous compiler errors and struggle to prepare the file exactly how you wish.
Luckily, there may be a much faster and simpler way of writing LaTeX code now: Write it in Cursor, or some other IDE powered by AI.
You’ll be able to still write the text like you mostly used to, but as an alternative of spending time aligning figures, fixing citation issues, and solving compiler errors, you may now ask an LLM to repair these issues for you. Moreover, it is quicker than using a web-based editor like Overleaf, since you may compile the PDF locally in your computer, which is normally faster, in fact, depending on the ability of your computer.
The goal of this text is just to point out you the chances of an IDE by highlighting that you could 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 must naturally write your personal words. I’m simply saying you may outsource all the non-writing tasks to Cursor, so you may spend all of your time writing as an alternative. Also, I’m not sponsored by Cursor within the writing of this text.
You’ll be able to access the eBook created through this text here.
Why write LaTeX code in Cursor
LaTeX is the go-to system for writing technical articles, so each time you write a paper, a thesis, or similar, people often resort to LaTeX. People use LaTeX because:
- You get an expert have a look at your article
- It’s very customizable. You essentially program the text, figures, and formatting right into a .tex file
- You might have a solid, scalable system for citations and references
Nonetheless, it’s quite common to put in writing LaTeX in a web-based editor like Overleaf. I used Overleaf for my Master’s thesis in 2024, and it worked decently, though I did spend numerous time on mundane tasks reminiscent of fixing compiler issues, and the formatting of my thesis, fixing issues like:
- How wide should a picture be
- Compiler issues
- Proper citations

That is made especially frustrating because Overleaf spends quite a while compiling, especially when you may have a 100-page document with numerous images. I actually have now discovered there may be a significantly better way of writing these articles, which is thru your IDE.
Below you may see an example of LaTeX code, including bullet point lists and a figure with a caption and label used to reference the figure
A robust 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 robotically
item Handle each 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.9textwidth]{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 upper token costs of processing images directly.}
label{fig:ocr-llm-flow}
end{figure}
I might also argue that you must write non-technical content through LaTeX. It’s an excellent organized strategy to create PDFs with proper formatting, figures, and references.
Moreover, you may create presentations through Overleaf, which is basically an article, but in fact, using clearly separated slides.
Arrange LaTeX in Cursor
Organising LaTeX in Cursor is comparatively easy: You ask the agent to establish the environment for you. I used the next prompt:
arrange a file called ebook which is a latex file and help me parse it
as a pdf. The layout must be that of an information science ebook
Cursor then created an file, and the commands I needed to parse it. After that, you may simply start writing your content. If you happen to need a particular structure or need to follow a template, you may also prompt Cursor about this and have it design an overview on your article, where you may start working.
Writing your article and compiling
After establishing LaTeX in Cursor, I began writing my eBook. I asked Cursor to make an overview for me for an information science template, where it filled in 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 could then easily start filling out the content of my article.
Image formatting

At some points, I need so as to add pictures and figures to my article. I then provide Cursor the local path to the image on my computer, and the placement to place the image in, and supply a field to fill within the image description text. If I need any special formatting for the image (width, opacity, two images beside one another, …) I also prompt Cursor to do this.
Code formatting

Adding code can be quite easy with Cursor. I actually have a certain code formatting style laid out in my file, and I then simply provide Cursor the code to focus on, and it adds it to the file with the proper formatting. In some unspecified time in the future, I also noticed that a line of code was going outside the PDF, and I told Cursor to wrap the road, and added that to (. I’ll cover more about in the following section.
Box highlighting
Sometimes, I also need 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 so as to add it as context to the Cursor, and prompt the Cursor so as to add this as a key point box. Cursor then provides the box you see below, which helps make my point clearer.

Maintaining
While you start writing and prompting the Cursor to repair formatting, you’ll notice that the AI agent sometimes doesn’t do as you desire. In these cases, it’s very vital to take care of an where you condense your preferences right into a single file. For instance:
- If you happen to want citations in a particular format
- If you happen to desire a certain color scheme
- How wide should your figures be
Each time Cursor deviates from the specified behavior, for instance, by utilizing the inaccurate color scheme, you must do two things:
- Tell Cursor the proper behavior (
- Tell Cursor so as to add that behavior to agents.md (or .cursorrules). This can make sure the error doesn’t occur again
Doing these two steps should essentially be muscle memory each time an AI agent doesn’t do exactly what you wish it to do. It is very vital when writing longer LaTeX files, where you’re depending on consistent schemes and formatting, and also you don’t need to all the time specify the sort of color scheme you wish each time making an update.
Conclusion
In this text, I’ve taken you thru how you should use Cursor to put in writing your technical articles in LaTeX. For me, this can be a revolutionary workflow, saving me countless hours each time I’m writing an article in LaTeX. I imagine you must never be spending time manually solving compiler errors in Overleaf or copying and pasting code from ChatGPT to resolve formatting errors. Writing LaTeX in Cursor essentially solves all of your problems, apart from the writing itself, which you naturally need to perform yourself.
👉 Find me on socials:
📚 Get my free Vision Language Models ebook
💻 My webinar on Vision Language Models
🧑💻 Get in contact
✍️ Medium
You can too read my article below:
