Paper / Document Writing
Local, keyless typesetting with Pandoc (+ LaTeX for PDF). Detect:
command -v pandoc pdflatex xelatex 2>/dev/null. Install: brew install pandoc basictex /
apt install pandoc texlive-xetex / choco install pandoc miktex.
Author in Markdown
Write the document as markdown with a YAML metadata block:
---
title: A Study of X
author: Jane Doe
date: 2026-06-03
bibliography: refs.bib
---
# Introduction
As shown by prior work [@smith2024] ...
Convert
pandoc paper.md -o paper.pdf --pdf-engine=xelatex # PDF (needs LaTeX)
pandoc paper.md -o paper.docx # Word
pandoc paper.md -o paper.tex # LaTeX source
pandoc report.docx -o report.md # reverse: docx → markdown
Citations
- Keep references in
refs.bib(BibTeX). Cite with[@key]. - Render with
--citeprocand a style:pandoc paper.md --citeproc --csl=ieee.csl -o paper.pdf. - Fetch BibTeX for a DOI/arXiv id via
@webfetch(e.g.https://doi.org/<doi>with
Accept: application/x-bibtex), then append to refs.bib.
Workflow
- Draft structure (sections), then prose.
- Insert citations as you go; collect them in
refs.bib. - Render to the requested format; if LaTeX errors, read the log and fix the offending markup.
Rules
- For PDF you need a LaTeX engine — if absent, offer DOCX/HTML instead of failing.
- Report the output path; for papers, do a final pass for figure/table/citation references.