/workflows:law-econ-docxfrom workflows
Builds submission-ready Word manuscripts from markdown for law-and-economics journals (JLE, JLS, JLEO, ALER) with Chicago author-date citations, double spacing, and Latin Modern typography.
Ships in workflows. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
What this skill carries — grep references/ for any subject the names below miss:
!d=${CLAUDE_SKILL_DIR}; command -v skill-toc >/dev/null 2>&1 && exec skill-toc "$d"; s=$HOME/.claude/skills/plugin-utils/bin/skill-toc; [ -x "$s" ] && exec "$s" "$d"; echo "(skill-toc unavailable: references and scripts are NOT listed here — install the plugin-utils plugin, or start a new session so its bin/ reaches PATH)"
Build a submission-ready Word manuscript from markdown for the Chicago-style law-and-economics journals (JLE, JLS, JLEO, ALER) and for job market papers written for that audience.
These journals publish no official Word template. Their instructions amount to "double spaced throughout, Chicago Manual of Style, author-date with a reference list," and every template circulating online is third-party and mutually inconsistent. This skill is that missing template plus the pipeline that drives it.
NO L&E .docx WITHOUT build_le_docx.py. A bare pandoc -o out.docx gives
Calibri, single spacing, no reference list, numbered headings that collide with
the back matter, and pandoc's grid-bordered tables — a document that looks
finished and violates four separate JLE requirements. Reaching for raw pandoc to
"just get something quickly" is the efficiency drive producing an unusable
deliverable; it is slower than the script, not faster.
Agents without the Skill tool (most workflow subagents) can't invoke this
skill — run the script directly.
uv run python3 ${CLAUDE_SKILL_DIR}/scripts/build_le_docx.py PAPER.md [-o OUT.docx] [--pdf]
uv run python3 ${CLAUDE_SKILL_DIR}/scripts/build_le_docx.py PROJECT_DIR # drafts/*.md in numeric order
| Flag | Effect |
|---|---|
--acknowledgement "..." | Injects the unnumbered * acknowledgment note. JLE requires one, placed before note 1. |
--bibliography FILE | Default, resolved in the document project: references/sources.bib, references.bib, or sources.bib beside the source. |
--csl FILE | Default: the vendored assets/chicago-author-date.csl (CMOS 18e author-date). |
--spacing onehalf|single | Internal circulation only. Double is the JLE submission requirement and the default. |
--pdf | Renders via doc_render.convert after building. |
The build: assembles sources (first file's YAML frontmatter becomes the document
metadata, later files' footnote labels are namespaced), resolves
<!-- include: /abs/path.md --> sentinels, guarantees a ::: {#refs} reference
list, runs pandoc with --citeproc + pandoc-crossref + the L&E reference doc,
then retags back-matter headings, forces widow control, and restyles tables to
booktabs.
---
title: "Deterrence without Detection"
author:
- "Isabelle Marchand, University of Chicago Law School, [email protected]"
- "A. N. Coauthor, Northwestern University, [email protected]"
date: "January 2026"
abstract: |
... 150 words maximum, strictly enforced by the journal ...
---
JLE requires the title page to carry names, e-mail addresses, and
affiliations — put all three in each author entry. The build warns if the
abstract exceeds 150 words.
Full editorial spec — subhead ladder, citation forms, table/figure rules,
appendix numbering — is in references/jle-house-style.md. Read it before
answering any "how should X be formatted" question; do not answer from memory.
| Style | Use | Formatting |
|---|---|---|
Title / Author / Date | Title page | Centered; 14pt bold title |
Abstract Title / Abstract | Abstract block | Bold centered head; indented body |
Heading 1 | 1. Section | Bold, auto-numbered |
Heading 2 | 1.1. Subsection | Italic, auto-numbered |
Heading 3 | 1.1.1. Sub-subsection | Roman, auto-numbered |
Heading 4 | Run-in head | Italic, keepNext |
Unnumbered Heading | Abstract / References / Appendix | Bold, no section number |
Body Text / First Paragraph | Body | First-line indent; no indent after a heading |
Footnote Text | Footnotes | 12pt, double spaced |
Bibliography | Reference list | Hanging indent, double spaced |
Table Note | Note under a table | Double spaced |
Everything is Latin Modern Roman at 12pt, double spaced, on US Letter with 1-inch
margins and a centered page-number footer. Math is OMML with Latin Modern Math
as the math font, so $...$ and $$...$$ render as real Word equations.
Section numbers come from Word list numbering. Write # Introduction, never
# 1. Introduction.
The typography comes from WordTeX (tomwildenhain.com/wordtex). Its
WordTeX Template.dotx turned out to be a pandoc-shaped style set already —
Compact, Author, Abstract, BlockText, FootnoteText, TableCaption,
CaptionedFigure, SourceCode, VerbatimChar are all pandoc styleIds, and the
theme fonts are LM Roman 10 / Latin Modern Math. So the styles extracted
cleanly; no hand-rebuild fallback was needed.
What we did not take: the .dot/VSTO plugin, glossary/AutoText, and
autocorrect macros. Those are for authoring in Word; pandoc needs a plain
.docx that merely carries style definitions.
Where JLE and WordTeX conflict, JLE wins, and the divergence is commented in
scripts/make_le_template.py:
| WordTeX (LaTeX look) | Template (JLE) | Why |
|---|---|---|
w:line="204" (tight LaTeX leading) | w:line="480" (double) | "double spaced throughout" |
| 11pt body, 8pt footnotes, 10pt abstract | 12pt everywhere | "including footnotes, tables, and figure legends" |
Justified (jc=both) | Flush left | Chicago manuscript prep; justified + double spaced opens rivers |
Numbered Bibliography list | Hanging-indent reference list | Author-date, not numbered references |
The .docx is built, not hand-edited, so every choice is auditable in one file:
uv run python3 ${CLAUDE_SKILL_DIR}/scripts/make_le_template.py
It starts from pandoc --print-default-data-file reference.docx (guaranteeing
every part and styleId pandoc's writer emits is present), transplants the
Latin Modern typography, adds the JLE heading numbering and page-number footer,
and self-verifies. Output:
${CLAUDE_PLUGIN_ROOT}/references/templates/law_econ_template.docx.
Never open the template in Word and save it. Change make_le_template.py
and regenerate.
examples/sample/ is a small paper exercising headings, a table with a note, a
figure, display + inline math, footnotes, and author-date cites:
uv run python3 ${CLAUDE_SKILL_DIR}/scripts/build_le_docx.py \
${CLAUDE_SKILL_DIR}/examples/sample/paper.md -o /tmp/sample.docx --pdf
The build stamps Latin Modern Math in both places it has to go —
settings.xml's m:mathPr/m:mathFont (what Word uses; run properties do not
override it) and an explicit w:rFonts on every OMML run (for LibreOffice/x2t,
which ignore m:mathFont). Both are required: pandoc regenerates
settings.xml and drops the template's copy, so without the re-injection Word
renders math in Cambria Math even though the body text is correct.
LibreOffice ignores the run font too — it converts OMML to its own formula objects and uses its configured math font, so a LibreOffice render shows Latin Modern body text next to Liberation Serif math. x2t is worse (it misses Latin Modern entirely and falls back to Liberation Sans).
The .docx is correct; only the LibreOffice preview is off. On Linux, render
with word-render (below) — verified fully correct. Verified on the sample
via LibreOffice: body text is LMRoman10-Regular/Bold/Italic, math is the only
fallback.
Do not try to fix this by installing fonts or configuring LibreOffice — both have been tested and neither works.
| Attempted fix | Result |
|---|---|
| Install Latin Modern Math system-wide | No effect. The font is typically already installed (TeX/LaTeX pulls it in) and fc-match "Latin Modern Math" resolves to the real latinmodern-math.otf. Availability was never the problem. |
Override LO's Math module default fonts (/org.openoffice.Office.Math/Font → Variables, Functions, Numbers, Text) | No effect. Re-rendered with those forced to Latin Modern Math in a clean LO profile; byte-identical font list. The OOXML import fixes formula fonts at import time and consults neither m:mathFont nor the Math defaults. |
To confirm the fallback is math-only rather than a document-wide problem, map
glyphs to fonts instead of trusting pdffonts (which ignores -f/-l and
reports the whole document for every page) or a vision check (which misjudges
double spacing):
uv run --with pdfplumber python3 -c "
import pdfplumber, collections
for i, pg in enumerate(pdfplumber.open('OUT.pdf').pages, 1):
d = collections.defaultdict(str)
for ch in pg.chars: d[ch['fontname'].split('+')[-1]] += ch['text']
print(i, {f: (len(t) if 'LMRoman' in f else t[:60]) for f, t in d.items()})"
Expected: LiberationSerif carries only math glyphs (π ρ ∂ > = + etc.) and
appears only on pages with equations. OpenSymbol on page 1 is the *
acknowledgment marker, not a fallback. If Liberation shows up on a page with no
math, something else is wrong — that is a real bug, not this limitation.
Spacing is likewise verified from the XML, not by eye: every relevant style
(BodyText, FirstParagraph, FootnoteText, Bibliography, Abstract,
TableNote) must carry w:line="480" (double); 240 would be single.
Use word-render — the QEMU Windows guest driven over SSH (nix module
programs.wordRender, see ~/nix/modules/shared/word-render/README.md). It is
the only path on Linux that gets body text and math right:
word-render OUT.docx OUT.pdf
Verified on the sample: LMRoman10-{Regular,Bold,Italic} +
LatinModernMath-Regular, no Cambria/Calibri.
A fresh guest renders Cambria/Calibri and needs a one-time font install —
word-render-install-fonts. Stock lmodern does not work: Word will not
render CFF-flavoured OpenType, and it matches families on name ID 1, where
Latin Modern stores the optical size (LM Roman 10) rather than the
typographic family. Nix builds a converted/renamed set; the README has the full
diagnosis.
Other options:
word-render.tectonic via pandoc gives faithful Latin
Modern on Linux, but it is not the submission artifact and diverges from
the .docx.svgBlipReference the PNG in markdown —  — and keep a
same-stem .svg beside it. After pandoc, the build finds each embedded raster,
matches it to its SVG by content hash (pandoc rewrites media to rIdN.png,
so the filename is gone by then), and attaches the vector:
<a:blip r:embed="rIdPng">
<a:extLst>
<a:ext uri="{96DAC541-7B7A-43D3-8B79-37D633B846F1}">
<asvg:svgBlip xmlns:asvg="http://schemas.microsoft.com/office/drawing/2016/SVG/main"
r:embed="rIdSvg"/>
</a:ext>
</a:extLst>
</a:blip>
Word 2016+ draws the SVG with its own renderer; everything older falls back to
the PNG. No sibling .svg, no change — raster-only projects are unaffected.
The SVG is looked for beside the source files (the L&E layout keeps
figure1.png next to paper.md) as well as under the project's figures/ and
drafts/, so both the single-file and the PROJECT_DIR invocation find it.
Never reference a bare .svg from markdown. Pandoc embeds it as an image
part with no svgBlip, unzip -l shows the media happily, and Word renders
nothing — blank space under the caption, no error at any stage.
Never convert SVG→EMF with LibreOffice as a substitute. EMF is a real vector format and Word draws it, so the route looks correct. It is not: LibreOffice's SVG importer silently corrupts complex figures. A five-facet histogram came back missing an entire facet row, every row label, both axis labels, the tick numbers and the zero line — still a plausible-looking chart, so nothing downstream flagged it. Simple one-panel figures convert fine, which is what makes it dangerous: verifying one figure proves nothing about the rest.
Verification — count images in the RENDERED PDF, never in the DOCX:
pdfimages -list manuscript.pdf | tail -n +3 | wc -l # 0 == every figure is vector
A media part exists for formats Word cannot draw, so a word/media/ count is not
evidence the figure reached the page. Check the most structurally complex figure
against its source, not the first one.
IDENTIFY the output → RUN the render → READ the pages → VERIFY → CLAIM.
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/doc_render.py OUT.docx OUT.pdf (--renderer word
for anything a human reads — see the docx-render skill's Iron Law).pdftoppm -r 110 -png OUT.pdf pg.1., 1.1.; References and Appendix headings carry no number; the table
is a real grid with booktabs rules and no word broken mid-token; the figure
rendered; the * acknowledgment note is on page 1.pandoc exiting 0 is not verification. It exits 0 on a document with a
missing figure, a collapsed table, and Calibri fallback.
| Action | Why Wrong | Do Instead |
|---|---|---|
About to run pandoc -o out.docx yourself → STOP | No template, no citeproc, no reference list; wrong on four JLE requirements at once | build_le_docx.py |
About to use law-review-docx for an L&E paper → STOP | Footnote/Bluebook citations, small caps, TOC — wrong discipline and wrong citation model | This skill |
About to write # 1. Introduction → STOP | Word adds its own number: "1. 1. Introduction" | # Introduction |
| About to put a bare citation in a footnote → STOP | JLE: footnotes must be substantive; simple citations go in the text | [@key] inline |
About to add cases to the .bib → STOP | JLE: "Do not include cases in the reference list" | Cite in text: (332 U.S. 392 [1947]) |
About to build with --spacing single for a submission → STOP | Desk-reject risk; double spacing is explicit and non-negotiable | Default double |
| About to report success on "pandoc exited 0" → STOP | Exit 0 hides missing figures and collapsed tables | Run the verification gate |
| About to edit the template in Word → STOP | Next regeneration silently reverts it | Edit make_le_template.py |
Part of the document skill group:
build_le_docx.py imports its helpers;
see that script's header for why this is a sibling and not a --style flag.--renderer word for deliverables).assets/chicago-author-date.csl (opens in a new tab)examples/sample/figure1.png (opens in a new tab)examples/sample/paper.md (opens in a new tab)examples/sample/references/sources.bib (opens in a new tab)references/jle-house-style.md (opens in a new tab)scripts/build_le_docx.py (opens in a new tab)scripts/build_le_docx_test.py (opens in a new tab)scripts/make_le_template.py (opens in a new tab)scripts/make_le_template_test.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Claude Code refuses to install this plugin
As a github or url source: Failed to clone repository: fatal: clone of '[email protected]:edwinhu/bmll-skill.git' into submodule path 'skills/bmll' failed
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
86 skills in this plugin
/afkUse when the user says '/afk', 'afk', 'going to bed', 'I'm going to sleep', 'work autonomously', 'work on this overnight', 'don't ask me questions', 'while I'm away', or 'do whatever you think is best'. NOT for questions about overnight returns, rates or anything financial; NOT for asking how the mode works./ai-anti-patternsALWAYS load before finalizing ANY written prose, and whenever text is suspected of being machine-written - "does this sound like AI", "make this sound human", "clean up the AI-isms", "did a bot write this", "check this draft before I send it", "review this for AI tells", "this reads like ChatGPT", "review this for mannered prose", "is this too writerly", "is this student paper AI-generated", or before handing back any draft, memo, email, or article you wrote. Use proactively even if the user never mentions AI writing./batch-routerUse when the user says 'bulk LLM job', 'batch job', 'submit a batch job', 'run this prompt over all the documents', 'process thousands of PDFs', 'extract fields from every filing', 'code each filing', 'label / annotate these documents', 'hand-code these', 'have agents read each document', 'which batch provider', 'cheapest way to run this over N rows', 'spend my API credits', 'Claude or OpenAI or Gemini for this batch', or needs any per-row LLM extraction, classification or enrichment over many inputs./bib-manageALWAYS use when a manuscript's BIBLIOGRAPHY is the thing being fixed, or when a cite's PDF turns out to be wrong — 'link my bib entries to the PDFs', 'which sources am I missing a PDF for', 'audit my sources.bib', 'my bib entry has no file field', 'fetch the Federal Register PDFs', 'why can't pincite find this source'. WRONG FILE: 'is this PDF the published version or the preprint', 'this PDF is a book review, not the book', 'the file field points at the wrong paper', 'the PDF doesn't match the citation'. METADATA: 'reconcile my bib against Paperpile', 'these entries were extracted by a model, check them', 'fix the metadata in sources.bib', 'my bib has no DOIs and the fields look wrong', 'pull the real author/journal/volume from my library', 'where did this bib entry's metadata come from'. PAGE RANGES: 'does my bib have page ranges', 'my bib only has start pages', 'backfill the page ranges', 'pull the pages from the DOI', 'add DOIs to my bibliography'. Use proactively before any pincite run — pincite resolves footnotes through `file = {...}` and silently skips entries that lack one. NEGATIVE ROUTING: the page number inside a footnote is pincite, but whether that footnote's PDF is the version of record or the wrong document is THIS skill, mid-pincite-run included; whether a cited source says what the footnote claims is source-verify; Bluebook FORM is bluebook or bluebook-audit; finding or downloading a paper is fetch-paper or paperpile./blaw-edgar-searchUse when the user wants to search SEC filings or exhibits on Bloomberg Law — 'search EDGAR on Bloomberg Law', 'BLAW EDGAR search', 'find exhibits with this clause', 'which 8-Ks attach a consulting agreement', 'pull the Bloomberg Law results list', 'capture the BLAW results' — or needs exhibit-level phrase search with proximity operators that the SEC and WRDS full-text routes handle badly./bluebookALWAYS use for ANY legal citation question, even if the user never says 'Bluebook' - 'cite this case', 'how do I cite a statute', 'is this footnote formatted right', 'id. or supra here', 'cite a law review article', 'what signal goes here', 'format these footnotes', 'short form for this cite', 'block quote this', 'where does the ellipsis go', 'is this quote altered right', or writing or checking any citation or quotation in a legal manuscript. NOT for auditing a whole manuscript's footnotes (use bluebook-audit) and NOT for rendering these rules in Typst (use docx-typst).Other plugins' skills for the same job