render-manuscript-draft-4

Render MANUSCRIPT_DRAFT.md to PDF via typst (cargo install + pandoc>=3.1.2)

Metadata

Statusdone
Assignedagent-740
Agent identity46f6237a65ec4f1002c4d3fb201dc8633638d0947c276be7008c227e1051ba5e
Created2026-05-05T18:13:40.229531672+00:00
Started2026-05-05T18:14:12.854845566+00:00
Completed2026-05-05T18:19:41.537074444+00:00
Tagspaper-prep, render, typst, eval-scheduled
Eval score0.85
└ blocking impact0.90
└ completeness0.90
└ constraint fidelity0.70
└ coordination overhead0.85
└ correctness0.85
└ downstream usability0.85
└ efficiency0.75
└ intent fidelity0.60
└ style adherence0.80

Description

GOAL: produce paper_prep/synthesis/MANUSCRIPT_DRAFT.pdf from paper_prep/synthesis/MANUSCRIPT_DRAFT.md using typst (NOT xelatex/pdflatex — those have a broken texlive format file in this guix profile).

CONTEXT: Two prior attempts (render-manuscript-draft-2, render-manuscript-draft-3) failed because xelatex.fmt was compiled against a different xelatex binary version. User chose to pivot to typst because it's a single statically-linked Rust binary that handles PDF figures natively and avoids texlive entirely.

PIPELINE: markdown -> (pandoc) -> typst -> (typst compile) -> PDF

ENVIRONMENT (already verified by coordinator):

  • cargo 1.94.1 at /home/erikg/.cargo/bin/cargo (use this to install typst)
  • pandoc 2.19.2 at /home/erikg/.guix-profile/bin/pandoc — TOO OLD (typst writer landed in pandoc 3.1.2). Need to upgrade.
  • typst not yet installed
  • paper_prep/synthesis/MANUSCRIPT_DRAFT.md exists (~34KB)
  • paper_prep/synthesis/REFERENCES.bib exists (~18KB)
  • Figures: paper_prep/figures/{fig1..fig4,ed1..ed8}/*.pdf (typst handles PDF figures natively)

TASK — log every step with 'wg log':

  1. Install typst via cargo: cargo install --locked typst-cli This may take several minutes to compile. Verify with 'typst --version'.
  2. Install a newer pandoc (>=3.1.2 needed for typst writer). Try in this order: a. Download static binary from GitHub releases: curl -L -o /tmp/pandoc.tar.gz https://github.com/jgm/pandoc/releases/download/3.5/pandoc-3.5-linux-amd64.tar.gz tar -xzf /tmp/pandoc.tar.gz -C /tmp export PATH=/tmp/pandoc-3.5/bin:$PATH pandoc --version # verify >=3.1.2 b. Fallback: 'guix install pandoc' if guix has a recent enough version (check 'guix show pandoc' first)
  3. Convert markdown to typst: cd paper_prep/synthesis pandoc MANUSCRIPT_DRAFT.md
    --citeproc --bibliography=REFERENCES.bib
    -t typst
    -o MANUSCRIPT_DRAFT.typ 2>&1 | tee pandoc_convert.log If --citeproc fails, retry without it (we will fix bibliography integration later) and log the error.
  4. Inspect MANUSCRIPT_DRAFT.typ briefly — make sure figure references resolve relative to paper_prep/synthesis/. If figure paths look wrong, adjust them in the .typ file (typst expects forward-slash relative paths).
  5. Compile to PDF: typst compile MANUSCRIPT_DRAFT.typ MANUSCRIPT_DRAFT.pdf 2>&1 | tee render.log If typst complains about a figure path or font, fix in the .typ working copy and retry. Typst native PDF figure embedding should Just Work for paper_prep/figures//.pdf.
  6. Verify: 'file paper_prep/synthesis/MANUSCRIPT_DRAFT.pdf' reports 'PDF document'; 'pdfinfo paper_prep/synthesis/MANUSCRIPT_DRAFT.pdf' shows >= 5 pages.
  7. Record paper_prep/synthesis/MANUSCRIPT_DRAFT.pdf as a wg artifact. DO NOT git add (gitignored).
  8. Save render.log + pandoc_convert.log + MANUSCRIPT_DRAFT.typ in paper_prep/synthesis/. Do NOT git add the .pdf.

ACCEPTANCE: paper_prep/synthesis/MANUSCRIPT_DRAFT.pdf exists, file reports 'PDF document', pdfinfo >= 5 pages, wg artifact recorded. If unrecoverable, 'wg fail' with the SPECIFIC error from each pipeline step (paste error lines).

Depends on

Required by

Log