I drafted a recent Utah reply brief as a pile of Markdown files instead of one Word document. Some of it worked well. Some of it bit me. And one problem, what to name the files, is still open.

This is one brief’s experience, not a standard I’ve adopted. I have a design for a fuller Markdown drafting setup, but as of today it’s a proposal. It isn’t what I used here.

One file per section

Each argument section got its own Markdown file, plus a sidecar notes file holding that section’s drafting history: what I cut, why, and what I was still unsure about. A couple of extra notes files covered the whole brief—a style guide and an assembly plan.

The payoff was that each issue’s changes stayed readable. In Word, tracked changes bury the actual edit in markup. In a Markdown diff, I could see which sentence moved.

Git on the drafts only

I put Git on the drafts folder and nothing else. Not the whole matter folder.

The record, the filed briefs, and the converted text don’t need version history. They don’t change, and they’re big. The prose I was writing changes constantly, so that’s what got tracked. That scoping kept the repository small and the history about the thing I actually cared about.

One house-style note if you try this: keep each paragraph on a single line rather than hard-wrapping. Wrapped lines make a one-word edit look like a rewrite of the whole paragraph. A word-level diff makes it better still:

# show what changed word by word, not line by line
git diff --word-diff=color

Building the filing

This was the part I expected to be hard, and it was a script rather than a miracle. I’d assumed an automatic table of authorities needed Word’s citation-marking feature, or some special mechanism in a typesetting tool. It doesn’t. It’s scriptable in any renderer:

  1. Pull every citation out of the Markdown by pattern.
  2. Render the brief once.
  3. Extract the text of each PDF page and find which pages each citation lands on.
  4. Generate the table of contents and table of authorities from that.
  5. Assemble the final document.

The build was a Python script driving python-docx, headless LibreOffice, and pdftotext. The page-finding step is the heart of it:

# one page's text at a time, so a citation can be matched to a page number
pdftotext -f 12 -l 12 brief.pdf -

For styles and page numbering, I cloned the DOCX of my own filed opening brief. That way the reply inherited the court’s formatting, including roman numerals for the front matter and Arabic numbers restarting at 1 for the body. I’d looked at Typst for this brief and didn’t use it.

For a quick Word export of a single file, a plain Pandoc call with a reference document does the job. It applies only the template’s styles, not its content:

pandoc section.md -o section.docx --reference-doc=template.docx

That’s a generic sketch of the idea, not the build I used for the filing.

The final Word pass flips the source of truth

Here’s what didn’t work the way I wanted. On filing day, I edited the generated DOCX directly, in OnlyOffice. There were formatting touch-ups and some real substantive rewrites, and the clock was running.

From that moment, the DOCX was the authoritative text. The Markdown was stale.

Porting those edits back is real work. I diffed the two rendered texts, applied changes by hand, and had to judge each difference: edit, or just reflow? It’s not a formality, and I wouldn’t pretend a clean source-to-output pipeline survives contact with a filing deadline. If you go this route, plan for the reconciliation. Don’t assume the Markdown will stay the master.

The naming problem I haven’t solved

I numbered sections like 01-topic.md, 02-topic.md, so they’d sort in order. That broke the first time something had to come before Issue I. The introduction became 00-introduction.md, which fell outside the 0[1-9]-*.md glob my word-count check used. It was silently left out of the count until I widened the glob.

A reply brief has few sections, so that was an annoyance. An opening brief, with a pile of front-matter sections ahead of the argument, would make it worse. I’m weighing two fixes and haven’t picked:

  • Subfolders by section type—front matter, argument issues, notes. This avoids number collisions.
  • Decimal numbering—sections and subsections like 1.1. But string sorting puts 1.10 before 1.2.

Whatever I choose has to survive an opening brief, and the dumb checks I actually use: ls and wc -w. If a naming scheme only works with a clever tool, it’s the wrong scheme.

What I’d tell another lawyer

Try it on one brief, and keep the stakes low. Git on the drafts only is an easy win, and so is one file per section. The table of authorities is a scripting job, not a software purchase.

But decide up front what happens on filing day. If you’ll make last-minute edits in Word—and you will—budget time to carry them back. And name your files for the brief you haven’t written yet, not the one in front of you.