# PasteMD — Paste Markdown and AI Chat into Office Documents > A one-click utility that converts Markdown, LaTeX, and AI chat responses into rich formatting and pastes them perfectly into Word, WPS, and Excel. ## Install Save in your project root: # PasteMD — Paste Markdown and AI Chat into Office Documents ## Quick Use ```bash pip install pastemd # Copy any Markdown or AI chat output to clipboard, then: pastemd # Your clipboard now contains rich-formatted content ready to paste into Word ``` ## Introduction PasteMD bridges the gap between Markdown-native tools and office documents. It takes Markdown text, AI chat output, or LaTeX formulas from your clipboard and converts them into rich formatting that pastes cleanly into Microsoft Word, WPS Office, and Excel without manual reformatting. ## What PasteMD Does - Convert clipboard Markdown to rich text for Word and Excel paste - Preserve code blocks with syntax highlighting in the pasted output - Render LaTeX math formulas as formatted equations - Handle tables, lists, headings, and inline formatting automatically - Work with AI chat responses from ChatGPT, Claude, and other tools ## Architecture Overview PasteMD is a Python application that monitors or processes clipboard content. When triggered, it parses Markdown using a CommonMark-compatible parser, renders it to HTML with syntax highlighting via Pygments, converts math expressions with a LaTeX renderer, and places the resulting rich text onto the clipboard in a format that office applications accept natively. ## Self-Hosting & Configuration - Install via pip on Windows, macOS, or Linux - Run as a CLI command or set it up as a system tray application - Configure default code highlighting theme in the config file - Set keyboard shortcuts for quick clipboard conversion - Optionally enable auto-conversion mode that watches the clipboard ## Key Features - One-command conversion from Markdown to office-ready rich text - LaTeX formula rendering produces properly formatted mathematical expressions - Code block syntax highlighting supports 100+ programming languages - Table conversion maintains column alignment and cell formatting - Works with any application that accepts rich text paste ## Comparison with Similar Tools - **Pandoc** — general document converter but requires file I/O; PasteMD works directly with the clipboard - **Typora export** — requires opening a Markdown editor; PasteMD converts from any source - **Copy as Markdown** — browser extension for the reverse direction; PasteMD converts Markdown to rich text - **Notion copy/paste** — works within Notion only; PasteMD handles any Markdown source ## FAQ **Q: Does it work with Google Docs?** A: Rich text paste works with Google Docs for basic formatting. Complex tables and LaTeX may require adjustment. **Q: Which AI chat tools does it support?** A: Any tool that outputs Markdown, including ChatGPT, Claude, DeepSeek, and Gemini web interfaces. **Q: Can I customize the code highlighting theme?** A: Yes. Choose from any Pygments theme in the configuration file. **Q: Does it handle images embedded in Markdown?** A: Image references are converted to placeholders. Inline base64 images are preserved in the rich text output. ## Sources - https://github.com/RICHQAQ/PasteMD --- Source: https://tokrepo.com/en/workflows/asset-459e6ea6 Author: AI Open Source