I have a scenario where I have a legacy user guide (Word/PDF format). I want to migrate it to a new Word template (.docx). I tried using cursor but the results were off. One reason is (could be that) the old and new styles are mismatching. Cursor is unable to map and re-create. Right now I am trying it with a smaller 30 page document as a PoC.
Any better trick/idea to achieve this doc to doc migration from old to new template with Cursor?
Hi @Tejas_Dandekar, what works here is having the agent script the conversion instead of re-creating the document itself. Cursor has no built-in understanding of Word styles, so “rewrite this in the new template” ends up guessing at the formatting, which is the mismatch you’re seeing.
- Work from the old .docx, not the PDF (a PDF no longer carries the style names), and keep both files in the project folder rather than attaching them to the chat.
- Ask the agent to list every paragraph style used in the old guide and every style in the new template (a few lines of python-docx).
- Have it write an old-to-new style mapping into a file, and correct that file yourself.
- Ask it to convert with pandoc: read the old file with
-f docx+styles, rename the styles with a small Lua filter built from your mapping, and write with--reference-doc=<new template>.docx.
Headers, footers and page setup then come from the template, and images and tables carry over. You’ll need Python and pandoc installed, and it’s worth asking the agent to list anything it couldn’t map so you can fix those by hand.
Sure, I’ll try and get back on how it goes. Thanks for explaining the approach.
Hi @colin. I tried. The approach works really well. It does migrate but I think much depends on how messy the original or old template is. The new one is clear. The old one has a lot of baggage and unwanted styles which makes it not very clean. I’ll also try one with a cleaner old document than what I have ![]()