Works with the AI Agents you already use

    Thai Word Layout Fixer

    by Tee K.

    1

    Fixes Thai Word document layouts by resolving stretched whitespace and broken syllables in tables via ZWSP injection.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Thai Word Layout Fixer

    Thai Word Layout Fixer

    Example session with this skill installed

    ช่วยจัดหน้าเอกสาร Word นี้หน่อยครับ ช่องไฟมันห่างมาก แล้วคำในตารางโดนตัดครึ่งคำด้วย ตัวเนื้อความอยากได้แบบ Thai Distributed ครับ

    • Read your context and instructions
    • Compiled the thai word layout

    สรุป

    จัดหน้าเรียบร้อยแล้ว สาเหตุคือข้อความไทยไม่มีจุดให้ Word ตัดบรรทัด วลียาวจึงถูกดันลงบรรทัดถัดไปทั้งก้อน บรรทัดบนเลยถูกยืดห่าง และคำในคอลัมน์แคบถูกตัดกลางพยางค์ ไม่ได้แก้ข้อความหรือตัวเลขใด ๆ

    รายการผล
    ย่อหน้าเนื้อความที่ตั้ง Thai Distributed18 ย่อหน้า
    หัวข้อ/ย่อหน้าชิดซ้ายที่แทรกจุดตัดคำ (คงการจัดแนวเดิม)6 ย่อหน้า
    ตารางที่แทรกจุดตัดคำทุกเซลล์2 ตาราง (41 เซลล์)
    ตารางที่ปรับความกว้างไม่ให้ล้นขอบตารางที่ 2: จาก 512pt เหลือ 453pt ขยายคอลัมน์ "ผู้รับผิดชอบ"

    การตัดคำ

    • ตรวจปลายบรรทัด 64 จุด พบคำถูกตัดครึ่ง 2 คำ แก้แล้ว: "ยุทโธ|ปกรณ์" และ "เมีย|นมา" (เพิ่มเข้ารายการคำห้ามตัดแล้ว)
    • ใช้จุดตัดสำรอง 1 จุดเพื่อลดช่องไฟ: "ขีด|ความสามารถ" ในข้อ 2.3 ถ้าไม่ต้องการให้แยก สั่งห้ามตัดคำนี้ได้

    ช่องไฟ (ค่าประมาณ)

    • ประเมิน 112 บรรทัด ห่างเล็กน้อย (10–15%) 4 บรรทัด
    • ห่างเห็นชัด (เกิน 15%) 1 บรรทัด: ข้อ 3.1 ยืด 19% เพราะคำถัดไปคือ "ยุทธศาสตร์" ซึ่งเป็นคำเดียว ห้ามตัด ทางเลือก: ยอมรับ, อนุญาตให้ตัดเฉพาะจุดนี้ หรือปรับถ้อยคำเอง
    • ข้อ 4.2 "ร้อยละ" กับ "๘๕" แยกบรรทัดกันตรงช่องว่าง ให้คุณตัดสินใจว่าจะแก้หรือไม่

    ข้อควรรู้

    • ไฟล์นี้เป็น

    ฉบับพิมพ์ มีจุดตัดคำซ่อนอยู่ ถ้าจะพิมพ์แก้เองใน Word ให้สั่ง "เตรียมแก้ไข" ก่อน แล้วสั่ง "จัดหน้า" อีกครั้งเมื่อแก้เสร็จ ถ้าให้ผมแก้ให้ สั่งได้เลย

    • ค้นหาวลีหลายคำด้วย Ctrl+F อาจไม่เจอ แต่ค้นทีละคำได้ตามปกติ
    • ค่าช่องไฟเป็นค่าประมาณ กรุณาเปิดดูใน Word แล้วแจ้งข้อหรือตารางที่ยังห่างหรือคำยังขาด

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Word documents in Thai often suffer from unsightly gaps when using Thai Distributed alignment, or broken syllables in narrow table cells. This skill fixes these layout issues by programmatically inserting invisible Zero-Width Spaces (ZWSP) at correct word boundaries, preventing Word from breaking words in the middle of a syllable. It handles the complex logic of Thai word segmentation, ensuring compound words stay together while distributing whitespace evenly.

    What it does

    • Smart Word Breaking inserts ZWSPs only at valid word boundaries to prevent mid-syllable breaks in tables and paragraphs.
    • Thai Distributed Alignment applies thaiDistribute to body text so lines fill the full width, while the word-break points keep the extra spacing small.
    • Table Overflow Correction recalculates and fixes tables that exceed page margins or have narrow, broken-text columns.
    • Spacing Evaluation simulates the TH Sarabun font family to estimate how much each line stretches and report lines that are visibly too wide (an estimate, so a final check in Word is still recommended).
    • Mode Switching toggles between "Print Ready" (with ZWSPs) and "Edit Ready" (clean text) to avoid red underlines during manual editing.
    • Smart Text Modification cleans invisible markers before making content changes and re-applies layout rules to ensure consistency.

    How it works

    1. Analyze Document scans paragraphs and tables to categorize content into body text, headers, and table cells.
    2. Apply Layout Logic uses a multi-tier segmentation strategy involving Intl.Segmenter and a refined exclusion list to insert ZWSPs.
    3. Verify and Refine runs a simulated line-break check to identify and fix remaining gaps or illegal word breaks.
    4. Final Sync writes the optimized OOXML back to the document while preserving fonts, bolding, and existing styles.

    Frameworks & tools

    This skill utilizes Office JavaScript API (Word) and Intl.Segmenter for linguistic analysis. It includes custom logic tuned for the TH Sarabun font family and OOXML manipulation.

    Why this beats prompting it yourself

    Standard LLM prompts cannot "see" where Word will break a line or handle the invisible characters needed to fix Thai justification. This skill estimates line breaks from TH Sarabun character widths and uses 3-layer word-segmentation logic to prevent errors like "งบ|ประมาณ" that generic prompts ignore.

    Use cases

    • Fixing Thai Word documents where sentences are stretched so wide they become unreadable.
    • Repairing tables where Thai text is cut off or broken vertically in narrow columns.
    • Preparing a document for professional printing or PDF export with clean Thai justification.
    • Cleaning up "hidden character" issues that cause the cursor to skip or red underlines to appear in Thai text.

    Known limitations

    Requires an agent that can run Office.js inside Microsoft Word (for example Claude for Word). It will not work in coding agents that only read and write files. Line spacing estimation is optimized for TH Sarabun fonts; accuracy may vary with other font families. It does not support nested tables or documents with non-standard default tab stops.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Frequently Asked Questions

    This skill fixes the common 'stretched whitespace' and broken syllable issues in Thai Word documents by programmatically inserting invisible Zero-Width Spaces (ZWSP) at precise linguistic boundaries.

    The skill is optimized for the TH Sarabun font family, though it works with other Thai fonts; however, it does not currently support nested tables or documents with non-standard tab stops.

    Yes, the skill includes a 'Mode Switching' feature that allows you to toggle between a 'Print Ready' version with ZWSPs and an 'Edit Ready' version that removes them for easy manual editing without red underlines.

    Your purchase includes the full Thai Doc Layout skill set, featuring smart word breaking, table overflow correction, and the multi-tier segmentation logic designed for professional Thai justification.

    The skill utilizes the Office JavaScript API and the Intl.Segmenter tool to handle complex Thai word segmentation, ensuring it works seamlessly within the Microsoft Word environment.

    New in Productivity

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Productivity.