The right way to Create Skilled Articles with LaTeX in Cursor

-

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.

This infographic highlights the major contents of this text. I’ll show you learn how to save countless hours by writing LaTeX code in Cursor as an alternative of Overleaf. This protects you each numerous time and frustration from solving bugs that AI agents can solve immediately. Image by Gemini.

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
Cursor IDE
This image shows how I work to create an eBook with LaTeX through Cursor. I actually have the code within the left pane, where I write my content. I sometimes turn off tab suggestions since they will be disruptive when writing. To the fitting of my code, I actually have my parsed PDF from the LaTeX code. This robotically updates each time I save the code file. All of the strategy to the fitting ,I actually have the Cursor agent, which I can prompt with CMD + L on Mac, to assist me with formatting, add a brand new image, and so forth. Image by the creator.

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

Latext ebook image
On this image, you may see an example of a figure I take advantage of in my eBook, in addition to text referring to the figure, and the figure description. So as to add this image, I simply provided Cursor the trail to my local image, and it copied that image into the relevant workspace and added the reference to the image in my ebook.tex file. Image by the creator,

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

Code block
This image shows an example of a code block in my eBook. You’ll be able to see the formatting within the code block with the colour palette, and the numbered lines on the left side, which is strictly how I need to display code in my eBook. Adding this formatting with Cursor was super easy and was way faster than adding such formatting through Overleaf. Image by the creator,

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.

This image highlights a key point in my article. I had the text after which asked Cursor to make this a key point in my article, with a box around it. I then got the result you see within the image. If I did this through Overleaf, it might take quite a bit longer, considering I might need to ask ChatGPT learn how to do it, copy and paste the code, after which adapt the code to my very own LaTeX code. Image by the creator.

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:

  1. Tell Cursor the proper behavior (
  2. 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

📩 Subscribe to my newsletter

🧑‍💻 Get in contact

🔗 LinkedIn

🐦 X / Twitter

✍️ Medium

You can too read my article below:

ASK ANA

What are your thoughts on this topic?
Let us know in the comments below.

0 0 votes
Article Rating
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Share this article

Recent posts

0
Would love your thoughts, please comment.x
()
x