cd /news/ai-tools/why-copying-ai-answers-into-word-sti… · home › topics › ai-tools › article
[ARTICLE · art-157064] src=dev.to ↗ pub= topic=ai-tools verified=true sentiment=↑ positive

Why copying AI answers into Word still breaks (and how I built a client-side converter for LaTeX & tables)

A developer built Aitoword, a free browser-based converter that turns AI-generated Markdown and LaTeX into editable .docx files entirely client-side. The tool isolates code blocks before normalizing math delimiters, parses supported expressions through KaTeX into MathML and maps them to OMML so equations open as native, editable Word math objects, and compiles the Markdown AST directly to Office Open XML for native headings and tables. Unsupported LaTeX macros are preserved as raw strings with a preview notice rather than silently dropped.

by read5 min views4 publishedOct 25, 2026

Live Tool: https://aitoword.online/en/

If you only work in Markdown, copying responses from ChatGPT, Claude, or DeepSeek is trivial. You click the copy button, paste it into Obsidian, VS Code, or Notion, and everything renders as expected.

The problem starts when you have to hand off a deliverable to someone who lives in Microsoft Word—a client report, a lab assignment, or internal documentation.

Depending on how you copy an AI response into Word, you usually hit one of three failure modes:

# headings, ** bold markers, and | table pipes as literal characters.\(...\) and \[...\] (or $...$ and $$...$$). Pasting these into Word leaves you with raw TeX strings. Worse, many online converters rasterize equations into static PNG images, meaning you cannot fix a single subscript in Word without re-generating the whole document. To solve this without installing a local Pandoc + LaTeX toolchain on every machine, I built Aitoword—a free, browser-based converter that turns AI Markdown and supported LaTeX into editable .docx files entirely on the client side.

Here is a breakdown of the formatting problems it solves, how the in-browser pipeline works, and the trade-offs involved.

Standard Markdown math parsers usually look for $...$ and $$...$$. However, most LLMs default to LaTeX-style \(...\) and \[...\] delimiters unless explicitly prompted otherwise.

A naive regex replacement across the whole document will accidentally corrupt escaped brackets inside fenced code blocks or inline code spans (for example, array indexing or regex literals in JavaScript).

Before building the .docx document tree, the parser has to isolate code blocks and inline code tokens first, and only normalize math delimiters in prose nodes:

function normalizeMathOutsideCode(markdown) {
  // Split by fenced code blocks and inline code spans first
  const segments = markdown.split(/(```
{% endraw %}
[\s\S]*?
{% raw %}

|[^\n]+`)/g);

return segments

.map((segment, index) => {

  // Odd indices are code blocks/spans; leave them untouched

  if (index % 2 === 1) return segment;
  return segment
    // Convert \[ ... \] display math to $$ ... $$
    .replace(/\\\[([\s\S]*?)\\\]/g, (_, expr) => `$$${expr}$$`)
    // Convert \( ... \) inline math to $ ... $
    .replace(/\\\(([\s\S]*?)\\\)/g, (_, expr) => `$${expr}$`);
})
.join('');

}

Once normalized, supported expressions (fractions, roots, subscripts/superscripts, sums, integrals, and basic matrices) are parsed via KaTeX into MathML and mapped into OMML (Office Math Markup Language).

When you open the downloaded .docx in Word, the equations are native Word math objects—you can click directly into a fraction or integral and edit the variables using Word's native equation editor. If an expression uses an unsupported macro, the converter does not silently drop it; it preserves the original LaTeX string in the document and flags a notice in the preview panel. (I wrote a more detailed breakdown on how AI LaTeX equations map to editable Word math here.)

When you paste a raw Markdown table into Word, you get lines of pipe characters (|). When you copy an HTML table from a chat window, column widths often overflow the page margins.

By compiling the Markdown AST directly to Office Open XML (.docx) in the browser:

Headings (H1–H6) map to native Word heading styles, so they immediately show up in Word's Navigation Pane and can be used to generate an automatic Table of Contents.

Markdown tables become native Word table cells with clean borders and header shading. (See the Markdown tables to Word troubleshooting guide for handling wide tables and long cell text.)

Fenced code blocks are kept in a monospace font with preserved indentation rather than collapsing into a single paragraph.

Comparison of Export Methods

Method Headings & Bold LaTeX Math ($...$ / [...]) Tables Privacy & Setup
Select & Copy from Web UI Keeps styles, but often brings gray background shading Usually pasted as plain text or uneditable DOM fragments Borders and column widths frequently break Zero setup; requires manual "Clear Formatting" in Word
Click AI "Copy" Button -> Word Leaves literal ### and ** characters Leaves raw LaTeX source code Leaves raw pipe characters
Local Pandoc CLI Native Word styles Native OMML equations Native Word tables High privacy, but requires CLI setup and reference .docx templates
Aitoword (In-Browser) Native Word H1–H6 & inline styles Editable native Word equations (OMML) Native bordered Word tables No login, 100% client-side in browser, zero server uploads

Many "free online document converters" work by up your text or .md file to a backend server, running a Python or LibreOffice worker, and returning a download link. If you are converting internal work notes, unpublished research, or client drafts, up that text to a third-party server is a non-starter.

Aitoword runs the entire conversion pipeline locally inside your browser tab:

No server round-trip: Whether you paste text or import a local .md / .txt file, the .docx Blob is packed in memory using JavaScript and downloaded directly via URL.createObjectURL().

No external image requests: Markdown pasted from web tools sometimes contains external image links (). Automatically fetching and embedding those images from the browser would leak your IP address to external image hosts and hit CORS errors. Instead, Aitoword deliberately converts external image links into plain text descriptions so no outbound requests are triggered.

Starting layout presets: Rather than forcing you to use a bloated web-based rich text editor, the tool provides three clean presets (General Report, Academic / Long-form, and Compact Print) with explicit font, line-spacing, and margin parameters, plus a read-only layout preview. Once downloaded, you do your final tweaks and pagination checks in Word itself.

If you regularly need to move ChatGPT, DeepSeek, or Markdown notes into Word without spending twenty minutes fixing equations and stripping # symbols, you can try it here (no account or signup required):

Guide on fixing hashtags, asterisks, and gray backgrounds: How to Copy ChatGPT to Word and Fix Formatting Problems

Feedback on edge-case LaTeX expressions or Markdown structures that trip up the parser is very welcome!

── more in #ai-tools 4 stories · sorted by recency
── more on @aitoword 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/why-copying-ai-answe…] indexed:0 read:5min 2026-10-25 · —