thesis-docx-sync

Sync Markdown thesis chapters into a styled DOCX master document.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/LmjYiyi/thesis --skill thesis-docx-sync
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: thesis-docx-sync
Source: https://github.com/LmjYiyi/thesis/tree/main/skills/thesis-docx-sync
Command: npx skills add https://github.com/LmjYiyi/thesis --skill thesis-docx-sync

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires lxml, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enables researchers to update a master DOCX thesis by syncing revised Markdown chapters back into Word while preserving the template's heading and paragraph styles, reducing manual copy-paste and formatting drift.

Core Features & Use Cases

  • Section-level sync: Replaces a single heading-bounded block in the DOCX without altering surrounding chapters.
  • Front-matter anchors: Supports non-numbered sections like 摘要 and ABSTRACT.
  • Style-preservation: Maintains the Word template's heading and body styles across the sync process.
  • Use Case: A graduate student updates Chapter 2 in Markdown, runs the sync, and the DOCX reflects changes with correct styling and captions.

Quick Start

Run the sync on a Markdown chapter to update the corresponding section in the master DOCX.

Frequently Asked Questions about thesis-docx-sync

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I sync Markdown content into a Word DOCX without losing my existing thesis styles?

To sync Markdown to DOCX while preserving styles, use pandoc rendering with a reference-DOCX and a post-processing pass to remap styles, captions, and tables. This updates your master document without altering the template's heading and paragraph formatting.

Can I update a single chapter in Markdown and sync only that section into the master DOCX?

Yes, section-level sync replaces a single heading-bounded block in the DOCX without altering surrounding chapters. You can update individual Markdown chapters and run the sync to reflect changes in the master document.

Does this Markdown to DOCX sync method support non-numbered front-matter sections like abstracts?

Yes, the sync process supports front-matter anchors for non-numbered sections like 摘要 and ABSTRACT. This ensures front-matter content updates correctly within the master DOCX document structure.

What do I need to set up before syncing Markdown chapters to a Word thesis template?

You need a stable Word outline or master DOCX template, Markdown content, pandoc for rendering, and the lxml dependency. A reference-DOCX is required to map and preserve the existing heading and paragraph styles during sync.

Why does my Markdown to DOCX conversion lose table and caption formatting?

Standard conversions often lose formatting because they lack a post-processing pass. This Skill applies a comprehensive post-processing step after pandoc rendering to remap styles, captions, headers, and tables correctly into the DOCX output.

Is pandoc alone sufficient for maintaining complex thesis document boundaries during Markdown to DOCX sync?

No, pandoc handles rendering but requires a reference-DOCX and comprehensive post-processing to remap styles and manage complex chapter boundaries. This ensures the master DOCX structure and styling remain intact across the synchronization process.