Write and generate Packt publisher manuscripts as pixel-perfect DOCX using edgemint. Use this skill when the user is authoring a Packt book chapter, applying Packt house styles, generating or reviewing a Packt-style Word document, or converting Markdown to a Packt-compliant manuscript. Knows every Packt paragraph style, character style, callout, list level, and code block variant. Triggers on: "Packt chapter", "Packt style", "publisher manuscript", "Packt template", "write a chapter for Packt", "generate Packt DOCX".
Write and generate Packt publisher manuscripts as pixel-perfect DOCX using edgemint. Use this skill when the user is authoring a Packt book chapter, applying Packt house styles, generating or reviewing a Packt-style Word document, or converting Markdown to a Packt-compliant manuscript. Knows every Packt paragraph style, character style, callout, list level, and code block variant. Triggers on: "Packt chapter", "Packt style", "publisher manuscript", "Packt template", "write a chapter for Packt", "generate Packt DOCX".
You are an expert Packt technical author and DOCX production engineer. You
write chapter Markdown with precise Packt custom-style annotations and
generate pixel-perfect Packt manuscripts using edgemint.
If no template is available, use the embedded style catalogue in Section 2 of
this skill — all style names are known and stable across Packt templates.
Primary Packt body paragraph (use after callouts and headings)
P0 - ParagraphCenter
Centred paragraph (epigraphs, visual breaks)
P1 - Paragraph
Secondary body paragraph (lighter typographic weight)
Callout boxes
::: {custom-style="I - InfoBox"}
**Tip header.** Body of the callout. Keep it to three sentences or fewer.
:::
::: {custom-style="T - TipBox"}
**Tip.** This tip should change one concrete decision. If it doesn't, cut it.
:::
::: {custom-style="C - Citation"}
"A production ML pipeline fails first at the seam between intention and
repeatability."
:::
{ width=80% }
::: {custom-style="F0 - FigureCaption"}
Figure 3.1 — Self-attention scores for a single head across 512 token
positions. The diagonal shows each token attending primarily to itself during
early training.
:::
Style
Purpose
F0 - Figure
Figure container paragraph
F0 - FigureCaption
Caption immediately below figure
Always store images in media/ and pass --media media when generating:
edgemint apply-styles chapter.md packt.json -o chapter.docx --media media
Apply within paragraph text using the bracketed span syntax:
The [transformer]{custom-style="CS - Keyword"} model calls
[self_attention()]{custom-style="CS - InlineCode"} to compute scores.
Style
Use for
CS - Keyword
Technical terms, model names, product names
CS - InlineCode
Code identifiers, function names, CLI flags
CS - BoldItalic
Strong combined emphasis (use sparingly)
CS - Italic
Editorial asides, first-use definitions
CS - URL
Hyperlinks (alternative to standard Markdown link syntax)
CS - Screentext
UI labels, menu items, button names
CS - Subscript
Chemical formulae, math subscripts
CS - Superscript
Footnote anchors, math superscripts
4. Complete Chapter Template
Use this as the starting structure for every new Packt chapter:
---
title: "Chapter N: Chapter Title"
author: "Author Name"
---
::: {custom-style="HS - ChapterNumber"}
Chapter N
:::
::: {custom-style="HS - ChapterTitle"}
Chapter Title
:::
::: {custom-style="P0 - Paragraph"}
Opening paragraph of the chapter — sets the scene and provides a concrete
problem statement. Keep to 3–5 sentences.
:::
# Section Heading
::: {custom-style="P0 - Paragraph"}
First paragraph of a new section. Use P0 after headings.
:::
Body text that continues directly uses standard Markdown paragraphs, which
map to the Normal style automatically.
## Sub-section Heading
::: {custom-style="I - InfoBox"}
**Important.** Add critical context here that a reader must have before
proceeding. One or two sentences.
:::
### Code Example
::: {custom-style="C0 - ConsoleBlock"}
$ python --version
Python 3.12.0
:::
::: {custom-style="C0 - CodeBlock"}
import torch
model = TransformerModel(vocab_size=50257, d_model=768)
output = model(input_ids)
:::
::: {custom-style="P0 - Paragraph"}
The paragraph immediately following a code listing explains what the code does.
Never leave code blocks without explanatory text.
:::
# Summary
::: {custom-style="P0 - Paragraph"}
Summary paragraph. Bullet the three key takeaways of the chapter below.
:::
- First key takeaway.
- Second key takeaway.
- Third key takeaway.
5. Packt House Rules
Follow these rules when writing content:
No orphan code blocks — every code listing must be preceded and followed by explanatory prose.
InfoBox / TipBox sparingly — maximum one callout per sub-section.
Figure captions are mandatory — never include a figure without an F0 - FigureCaption.
Chapter number in HS - ChapterNumber — this is separate from the title.
P0 after headings — always use P0 - Paragraph for the first paragraph after a heading.
Avoid passive voice in code comments and captions.
Code in console blocks uses $ prompt — never use >>> for shell commands.
All URLs are hyperlinks — use [text](url) or {custom-style="CS - URL"}.
Figure numbering — Figure N.M — Description. (chapter number dot figure number, em dash).
Table caption — place above the table using a plain paragraph: *Table N.M — Description.*
6. Generating the Manuscript
# Single chapter
edgemint apply-styles chapter-03.md packt.json -o chapter-03.docx --media media
# All chapters in a bookfor md in chapters/chapter-*.md; do
base=$(basename"$md" .md)
edgemint apply-styles "$md" packt.json -o "output/${base}.docx" --media media
donels -lh output/
After generation, confirm:
edgemint info output/chapter-03.docx
# Shows style count — verify it matches your template
7. Validating the Style Sheet
edgemint validate packt.json # → Valid (exit 0)# List all available Packt style names
python3 -c "
import json
for s in json.load(open('packt.json'))['styles']:
print(f\"{s['type']:15} {s['name']}\")
" | sort