Compare commits

..

No commits in common. "f78b8e674c0995ead97031f0f82cbffdf19d2ef3" and "7f00d7b0f7ceea5c23f1cdffdae7e28f6a522052" have entirely different histories.

12 changed files with 31 additions and 83 deletions

3
.gitignore vendored
View File

@ -21,8 +21,7 @@ figures/src/*.pdf
build/ build/
figures/build/ figures/build/
main.pdf main.pdf
main-conf.pdf main.pdf.tmp
*.pdf.tmp
# Downloads waiting to be moved to context/related-papers/ # Downloads waiting to be moved to context/related-papers/
ingest/* ingest/*

View File

@ -37,7 +37,7 @@ Follow `writing-style-guide.md` in papers and in conversation alike; its "Talkin
- 🔴 **NEVER BYPASS A SOURCE**. A bypass is any copy other than the one you were sent to — another site's posting, a preprint for the published version, a publisher's or university's record, a citing paper's account — and any summary, including the fetch tool's. Reading a source means having its complete text on disc and reading it there. **A session whose shell reaches the network fetches the source itself**: `curl -L -o <root>/context/related-papers/<name>.pdf <url>`, and then verify what landed before anything reads it — the page count and a line of the text, a short or wrong file being the normal failure, and `file` having once reported a 26-page PDF as two pages. Where the shell cannot reach it, or a Cloudflare bot check blocks it, ask the person in one line to open the link in Firefox and save the file in `<root>/ingest/` — the document and the link — say which it was, then STOP that part of the task and do the rest. Once the file is in `ingest/`, move it to `context/related-papers/` under its name and verify it there. - 🔴 **NEVER BYPASS A SOURCE**. A bypass is any copy other than the one you were sent to — another site's posting, a preprint for the published version, a publisher's or university's record, a citing paper's account — and any summary, including the fetch tool's. Reading a source means having its complete text on disc and reading it there. **A session whose shell reaches the network fetches the source itself**: `curl -L -o <root>/context/related-papers/<name>.pdf <url>`, and then verify what landed before anything reads it — the page count and a line of the text, a short or wrong file being the normal failure, and `file` having once reported a 26-page PDF as two pages. Where the shell cannot reach it, or a Cloudflare bot check blocks it, ask the person in one line to open the link in Firefox and save the file in `<root>/ingest/` — the document and the link — say which it was, then STOP that part of the task and do the rest. Once the file is in `ingest/`, move it to `context/related-papers/` under its name and verify it there.
- 🔴 **Sources are kept in `context/related-papers/`, on the pattern of `~/library`.** A source is named `<year>-<first-author-surname>-<title-slug>.pdf`, for example `1985-chaum-security-without-identification.pdf`; a related file has the same name with a suffix, for example `1985-chaum-security-without-identification-presentation.pdf`. Each source has a sidecar file with the same name and the extension `.md`: between two `---` lines, `venue: <venue>`, `tags: ["<tag>", ...]` and `authors: ["<author>", ...]`, and after them notes on the source, written from its complete text. - 🔴 **Sources are kept in `context/related-papers/`, on the pattern of `~/library`.** A source is named `<year>-<first-author-surname>-<title-slug>.pdf`, for example `1985-chaum-security-without-identification.pdf`; a related file has the same name with a suffix, for example `1985-chaum-security-without-identification-presentation.pdf`. Each source has a sidecar file with the same name and the extension `.md`: between two `---` lines, `venue: <venue>`, `tags: ["<tag>", ...]` and `authors: ["<author>", ...]`, and after them notes on the source, written from its complete text.
- 🔴 **Work only from the complete original source**, never from a summary, an excerpt, a fragment, memory or a secondary account, and never present such a thing as a finding. - 🔴 **Work only from the complete original source**, never from a summary, an excerpt, a fragment, memory or a secondary account, and never present such a thing as a finding.
- 🔴 **Fetch every reference through the dblp MCP server, which `.mcp.json` registers**: `search_publications` finds the entry and `get_bibtex` returns its BibTeX, which goes in `bib/dblp.bib`. Where the server is not connected, use the shell: `dblp-cli search <query>` and `dblp-cli bibtex <key>`. A reference dblp does not find goes in `bib/refs.bib`, with the BibTeX doi.org returns for its DOI: `curl -LH "Accept: application/x-bibtex" https://doi.org/<doi>`. A reference with no DOI is reported to the person, never written by hand. 🔴 **Never update its index**: never run `dblp-cli update` or `dblp-cli index`. - 🔴 **Fetch every reference through the dblp MCP server, which `.mcp.json` registers**: `search_publications` finds the entry and `get_bibtex` returns its BibTeX. Where the server is not connected, use the shell: `dblp-cli search <query>` and `dblp-cli bibtex <key>`. A reference `dblp-cli` does not find is reported to the person, never written by hand. 🔴 **Never update its index**: never run `dblp-cli update` or `dblp-cli index`.
- **Never produce false content.** Verify every claim against a source. No hand-waving: if you cannot state something precisely, say so. - **Never produce false content.** Verify every claim against a source. No hand-waving: if you cannot state something precisely, say so.
- 🔴 **Never ask permission to read.** Read everything the job needs. A file under a granted folder you read yourself, in the mount. - 🔴 **Never ask permission to read.** Read everything the job needs. A file under a granted folder you read yourself, in the mount.
- Files uploaded to a Claude.ai project (`/mnt/project/`) are zip archives of pre-extracted pages, not PDFs: `unzip -o /mnt/project/<file>.pdf -d /home/claude/papers/<file>/` and read `N.txt` and `N.jpeg`. - Files uploaded to a Claude.ai project (`/mnt/project/`) are zip archives of pre-extracted pages, not PDFs: `unzip -o /mnt/project/<file>.pdf -d /home/claude/papers/<file>/` and read `N.txt` and `N.jpeg`.
@ -70,7 +70,7 @@ Follow `writing-style-guide.md` in papers and in conversation alike; its "Talkin
- 🔴 **Edit a paper only when the person asks for the edit.** When they point out a fault, the answer is a proposal --- formatted text in chat if it is short or simple, otherwise edited on disc, by the rule above --- and it is theirs to accept or reject. - 🔴 **Edit a paper only when the person asks for the edit.** When they point out a fault, the answer is a proposal --- formatted text in chat if it is short or simple, otherwise edited on disc, by the rule above --- and it is theirs to accept or reject.
- 🔴 **A proposal shown in chat is precise and in textual order**: insert, delete or replace, with only enough context to locate it, as formatted text and never as source, except for the diff of `/tighten-prose`. When the paper is OK, say so. - 🔴 **A proposal shown in chat is precise and in textual order**: insert, delete or replace, with only enough context to locate it, as formatted text and never as source, except for the diff of `/tighten-prose`. When the paper is OK, say so.
- 🔴 **Never modify, reword, paraphrase or restyle text the person wrote** without their explicit authorisation for that change; typo fixes only. 🔴 **Never delete existing text without their consent.** 🔴 **Never write anything in the person's name without their express consent.** When they paste text or say "use my text", paste it verbatim; typographic normalisations are flagged. Do not invent content; when building sections, copy existing content verbatim and mark new content with TODO comments. - 🔴 **Never modify, reword, paraphrase or restyle text the person wrote** without their explicit authorisation for that change; typo fixes only. 🔴 **Never delete existing text without their consent.** 🔴 **Never write anything in the person's name without their express consent.** When they paste text or say "use my text", paste it verbatim; typographic normalisations are flagged. Do not invent content; when building sections, copy existing content verbatim and mark new content with TODO comments.
- 🔴 **Edit the paper, never clone it**: no parallel main file, no duplicated sections directory, for any variant. 🔴 **Never two versions of the same text**: the full version is the text; the short version hides with `\iffull ... \fi`, or replaces point-wise with `\full{...}{...}` only where hiding will not do, and is made only after the paper is done. A proof is written once, in its own file in `appendix/`, and placed with `\proofhere` after its theorem and `\appendixproof` in `appendix/proofs.tex`: the full version has it in the body, the short version in the appendix. `macros/version.tex` defines these commands; `make conf` builds the short version. - 🔴 **Edit the paper, never clone it**: no parallel main file, no duplicated sections directory, for any variant. 🔴 **Never two versions of the same text**: the full version is the text; the short version hides with `\iffull ... \fi`, or replaces point-wise with `\full{...}{...}` only where hiding will not do, and is made only after the paper is done.
- 🔴 **No PDFs** unless the person asks; vimtex compiles theirs, and a session compiles only to check page limits and errors, in its own sandbox and never in the project directory, where vimtex's latexmk writes its build files. 🔴 **Never present a file to the person**: write the change to disc. - 🔴 **No PDFs** unless the person asks; vimtex compiles theirs, and a session compiles only to check page limits and errors, in its own sandbox and never in the project directory, where vimtex's latexmk writes its build files. 🔴 **Never present a file to the person**: write the change to disc.
- **A paper's arXiv version is its living authority**; a camera-ready is a fixed snapshot and never blocks a change. A paper under review is re-uploaded to arXiv after its referee reports and the revision. - **A paper's arXiv version is its living authority**; a camera-ready is a fixed snapshot and never blocks a change. A paper under review is re-uploaded to arXiv after its referee reports and the revision.
- **Publication strategy: submit to the next reasonable deadline**, not the ideal venue. - **Publication strategy: submit to the next reasonable deadline**, not the ideal venue.

View File

@ -1,28 +1,19 @@
# vimtex and make watch write into build/ (set in .latexmkrc); make writes into build/make/, so it can run while a watch is compiling. make builds the full version into main.pdf and the conference version into main-conf.pdf. # vimtex and make watch write into build/ (set in .latexmkrc); make writes into build/make/, so it can run while a watch is compiling.
LATEXMK := latexmk LATEXMK := latexmk
FLAGS := -interaction=nonstopmode -halt-on-error -file-line-error FLAGS := -interaction=nonstopmode -halt-on-error -file-line-error
FULL := build/make/full BUILD := build/make
CONF := build/make/conf
ARXIV := build/arxiv ARXIV := build/arxiv
FIG_SRC := $(wildcard figures/src/*.tex) FIG_SRC := $(wildcard figures/src/*.tex)
FIG_PDF := $(FIG_SRC:figures/src/%.tex=figures/build/%.pdf) FIG_PDF := $(FIG_SRC:figures/src/%.tex=figures/build/%.pdf)
FIG_DATA := $(wildcard figures/data/*) FIG_DATA := $(wildcard figures/data/*)
.PHONY: all full conf figures watch clean arxiv wordcount .PHONY: all figures watch clean arxiv wordcount
all: full conf all: figures
$(LATEXMK) $(FLAGS) -outdir=$(BUILD) main.tex
full: figures cp $(BUILD)/main.pdf main.pdf.tmp && mv main.pdf.tmp main.pdf
$(LATEXMK) $(FLAGS) -outdir=$(FULL) main.tex
cp $(FULL)/main.pdf main.pdf.tmp && mv main.pdf.tmp main.pdf
# The conference version defines \conference before main.tex is read; the last line prints the page on which its References heading lands.
conf: figures
$(LATEXMK) $(FLAGS) -outdir=$(CONF) -usepretex='\def\conference{}' main.tex
cp $(CONF)/main.pdf main-conf.pdf.tmp && mv main-conf.pdf.tmp main-conf.pdf
@sed -n 's/^\\newlabel{references}{{[^}]*}{\([^}]*\)}.*/Conference version: References on page \1/p' $(CONF)/main.aux
figures: $(FIG_PDF) figures: $(FIG_PDF)
@ -44,12 +35,12 @@ watch: figures
clean: clean:
rm -rf build figures/build rm -rf build figures/build
# The tarball holds the full version: main.tex, sections/, appendix/, macros/, bib/, the compiled figures, the .bbl and the files of venue/; context/, scratch/, ingest/, .claude/, CLAUDE.md, writing-style-guide.md, claudese.md and .mcp.json stay out. # The tarball takes main.tex, sections/, appendix/, macros/, bib/, the compiled figures, the .bbl and the files of venue/; context/, scratch/, ingest/, .claude/, CLAUDE.md, writing-style-guide.md, claudese.md and .mcp.json stay out.
arxiv: full arxiv: all
rm -rf $(ARXIV) && mkdir -p $(ARXIV)/figures/build rm -rf $(ARXIV) && mkdir -p $(ARXIV)/figures/build
cp -r main.tex sections appendix macros bib $(ARXIV)/ cp -r main.tex sections appendix macros bib $(ARXIV)/
cp figures/build/*.pdf $(ARXIV)/figures/build/ cp figures/build/*.pdf $(ARXIV)/figures/build/
cp $(FULL)/main.bbl $(ARXIV)/ cp $(BUILD)/main.bbl $(ARXIV)/
find venue -type f ! -name .gitkeep -exec cp {} $(ARXIV)/ \; find venue -type f ! -name .gitkeep -exec cp {} $(ARXIV)/ \;
tar -czf build/arxiv.tar.gz -C $(ARXIV) . tar -czf build/arxiv.tar.gz -C $(ARXIV) .
@echo "Wrote build/arxiv.tar.gz" @echo "Wrote build/arxiv.tar.gz"

View File

@ -4,16 +4,12 @@ This repository is a template for an academic paper in LaTeX, written with Claud
## Layout ## Layout
`main.tex` uses the article class; a marked block at its top switches it to a venue class, whose files go in `venue/`. It loads the macros in `macros/` and inputs the sections in `sections/` and the proofs in `appendix/`. Every symbol of the paper is a macro in `macros/notation.tex`, listed with its meaning in `context/notation.md`. Figures are standalone TikZ files in `figures/src/` that read their data from `figures/data/`, and the paper includes their compiled PDFs from `figures/build/`. The references are in `bib/dblp.bib` and `bib/refs.bib`, processed by biblatex with biber. `main.tex` uses the article class; a marked block at its top switches it to a venue class, whose files go in `venue/`. It loads the macros in `macros/` and inputs the sections in `sections/` and the proofs in `appendix/`. Every symbol of the paper is a macro in `macros/notation.tex`, listed with its meaning in `context/notation.md`. Figures are standalone TikZ files in `figures/src/` that read their data from `figures/data/`, and the paper includes their compiled PDFs from `figures/build/`. The references are in `bib/refs.bib`, processed by biblatex with biber.
`context/` contains the material Claude Code works from: the outline with the claims of the paper and the goal of each section, the notation table, and referee reviews, which Claude Code does not edit; and the related papers, which Claude Code downloads into `context/related-papers/` as `<year>-<first-author-surname>-<title-slug>.pdf`, each with a `.md` file of notes. When a download is blocked, you save the file from Firefox into `ingest/`, and Claude Code moves it to `context/related-papers/`. `scratch/` contains explorations, one dated folder each, indexed in `scratch/README.md`. `.claude/` contains the permissions of Claude Code and the commands `/review-section`, `/check-notation`, `/tighten-prose` and `/new-scratch`. `CLAUDE.md` contains the rules Claude Code follows and imports two files: `writing-style-guide.md`, the style guide, and `claudese.md`, the list of banned words and phrases. `.mcp.json` registers the dblp MCP server. `context/` contains the material Claude Code works from: the outline with the claims of the paper and the goal of each section, the notation table, and referee reviews, which Claude Code does not edit; and the related papers, which Claude Code downloads into `context/related-papers/` as `<year>-<first-author-surname>-<title-slug>.pdf`, each with a `.md` file of notes. When a download is blocked, you save the file from Firefox into `ingest/`, and Claude Code moves it to `context/related-papers/`. `scratch/` contains explorations, one dated folder each, indexed in `scratch/README.md`. `.claude/` contains the permissions of Claude Code and the commands `/review-section`, `/check-notation`, `/tighten-prose` and `/new-scratch`. `CLAUDE.md` contains the rules Claude Code follows and imports two files: `writing-style-guide.md`, the style guide, and `claudese.md`, the list of banned words and phrases. `.mcp.json` registers the dblp MCP server.
Entries from dblp, through the dblp MCP server or `dblp-cli bibtex <key>`, go in `bib/dblp.bib` and may be added at any time. A reference not in dblp goes in `bib/refs.bib`, with the BibTeX doi.org returns for its DOI. Entries from dblp, through the dblp MCP server or `dblp-cli bibtex <key>`, may be added to `bib/refs.bib` at any time.
## Full and conference versions
The full version is the text, and the conference version is built from the same sources. Text of the full version only is hidden in the conference version, and a passage that differs as a whole, such as the abstract, is swapped; `macros/version.tex` defines the commands for both. Each proof is written once, in its own file in `appendix/`: the full version reads it in the body after its theorem, and the conference version restates the theorem in the appendix and reads the proof there. In the class block at the top of `main.tex`, each version can use its own class.
## Building ## Building
`make` compiles the figures, then the full version with latexmk into `build/make/full/` and the conference version into `build/make/conf/`, copies their PDFs to `main.pdf` and `main-conf.pdf`, and prints the page on which the References heading of the conference version lands. `make full` and `make conf` build one version each. `make figures` compiles each `figures/src/*.tex` into `figures/build/`, and recompiles a figure when its source or a file in `figures/data/` has changed. `make watch` runs latexmk in continuous mode on the full version into `build/`, the folder vimtex also uses through `.latexmkrc`; since `make` writes into `build/make/`, it can run while vimtex or `make watch` is compiling. `make clean` removes `build/` and `figures/build/`. `make arxiv` writes `build/arxiv.tar.gz` with the sources, the compiled figures and the `.bbl` file of the full version, without `context/`, `scratch/`, `ingest/`, `.claude/`, `CLAUDE.md`, `writing-style-guide.md`, `claudese.md` and `.mcp.json`. `make wordcount` runs texcount over `sections/` and `appendix/`. `make` compiles the figures, then the paper with latexmk into `build/make/`, and copies the PDF to `main.pdf`. `make figures` compiles each `figures/src/*.tex` into `figures/build/`, and recompiles a figure when its source or a file in `figures/data/` has changed. `make watch` runs latexmk in continuous mode into `build/`, the folder vimtex also uses through `.latexmkrc`; since `make` writes into `build/make/`, it can run while vimtex or `make watch` is compiling. `make clean` removes `build/` and `figures/build/`. `make arxiv` writes `build/arxiv.tar.gz` with the sources, the compiled figures and the `.bbl` file, without `context/`, `scratch/`, `ingest/`, `.claude/`, `CLAUDE.md`, `writing-style-guide.md`, `claudese.md` and `.mcp.json`. `make wordcount` runs texcount over `sections/` and `appendix/`.

View File

@ -1,4 +0,0 @@
% Proof of Theorem~\ref{thm:example}: in the body in the full version, in the appendix in the conference version (macros/version.tex).
\begin{proof}
Placeholder proof.
\end{proof}

View File

@ -1,5 +1,2 @@
\section{Proofs}\label{app:proofs} \section{Proofs}\label{app:proofs}
% The complete proofs of the results stated in the body. % The complete proofs of the results stated in the body.
% In the conference version, each theorem whose proof the full version has in the body is restated here with its proof. A proof that is in the appendix in both versions goes after them, as it is.
\appendixproof{examplethm}{proof-example}

View File

@ -1,14 +0,0 @@
% Entries from dblp, through the dblp MCP server or dblp-cli bibtex <key>; they may be added to this file at any time.
@article{DBLP:journals/jcss/GoldwasserM84,
author = {Shafi Goldwasser and Silvio Micali},
title = {Probabilistic Encryption.},
journal = {J. Comput. Syst. Sci.},
volume = {28},
number = {2},
pages = {270-299},
year = {1984},
doi = {10.1016/0022-0000(84)90070-9},
url = {https://doi.org/10.1016/0022-0000(84)90070-9},
biburl = {https://dblp.org/rec/journals/jcss/GoldwasserM84.html},
}

View File

@ -1 +1,14 @@
% References not in dblp, each with the BibTeX that doi.org returns for its DOI: curl -LH "Accept: application/x-bibtex" https://doi.org/<doi> % Entries from dblp, through the dblp MCP server or dblp-cli bibtex <key>, may be added to this file at any time.
@article{DBLP:journals/jcss/GoldwasserM84,
author = {Shafi Goldwasser and Silvio Micali},
title = {Probabilistic Encryption.},
journal = {J. Comput. Syst. Sci.},
volume = {28},
number = {2},
pages = {270-299},
year = {1984},
doi = {10.1016/0022-0000(84)90070-9},
url = {https://doi.org/10.1016/0022-0000(84)90070-9},
biburl = {https://dblp.org/rec/journals/jcss/GoldwasserM84.html},
}

View File

@ -1,4 +1,4 @@
% Theorem environments. The proof environment is the one amsthm defines; thmtools provides the restatable environment that macros/version.tex uses to restate a theorem in the appendix. % Theorem environments. The proof environment is the one amsthm defines.
\usepackage{amsthm} \usepackage{amsthm}
\theoremstyle{plain} \theoremstyle{plain}
@ -8,5 +8,3 @@
\theoremstyle{definition} \theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition} \newtheorem{definition}[theorem]{Definition}
\usepackage{thmtools}

View File

@ -1,8 +0,0 @@
% Full and conference versions. The full version is the text, and \iffull, defined at the top of main.tex, is true in it. Text of the full version only goes in \iffull ... \fi; a passage that hiding cannot handle, such as an abstract that differs as a whole, goes in \full{<full>}{<conference>}.
\newcommand{\full}[2]{\iffull#1\else#2\fi}
% A proof is written once, in its own file appendix/<file>.tex, and its theorem is a restatable environment (thmtools). \proofhere{<file>}, right after the theorem in the body, reads the proof there in the full version and points to the appendix in the conference version. \appendixproof{<restatable name>}{<file>}, in appendix/proofs.tex, restates the theorem and reads the proof there in the conference version, and does nothing in the full version.
\newcommand{\proofhere}[1]{\iffull\input{appendix/#1}\else\noindent The proof is in Appendix~\ref{app:proofs}.\fi}
\newcommand{\appendixproof}[2]{\iffull\else\csname #1\endcsname*\input{appendix/#2}\fi}

View File

@ -1,17 +1,7 @@
% ===== Version switch ========================================================
% The full version is the text. make conf defines \conference before reading this file and builds the conference version; vimtex, make watch and make full build the full version. macros/version.tex defines the commands that hide or swap text in the conference version.
\newif\iffull
\ifdefined\conference \fullfalse \else \fulltrue \fi
% ===== Document class: article by default =================================== % ===== Document class: article by default ===================================
% To switch a version to a venue class, put the class files in venue/ (.latexmkrc adds venue/ to the TeX search path), comment out the article line of that version and uncomment its venue line. A venue class that defines its own theorem environments replaces macros/theorems.tex. % To switch to a venue class, put its files in venue/ (.latexmkrc adds venue/ to the TeX search path), comment out the article line and uncomment the venue line. A venue class that defines its own theorem environments replaces macros/theorems.tex.
\iffull
\documentclass[11pt]{article} \documentclass[11pt]{article}
% \documentclass{llncs} % \documentclass{llncs}
\else
\documentclass[11pt]{article}
% \documentclass{llncs}
\fi
% ===== End of document class ================================================ % ===== End of document class ================================================
\usepackage[T1]{fontenc} \usepackage[T1]{fontenc}
@ -23,13 +13,9 @@
\input{macros/theorems} \input{macros/theorems}
\input{macros/algorithms} \input{macros/algorithms}
\input{macros/notation} \input{macros/notation}
\input{macros/version}
\usepackage[backend=biber,style=numeric-comp]{biblatex} \usepackage[backend=biber,style=numeric-comp]{biblatex}
\addbibresource{bib/dblp.bib}
\addbibresource{bib/refs.bib} \addbibresource{bib/refs.bib}
% make conf reads this label to print the page on which the References heading lands.
\defbibheading{bibliography}[\refname]{\section*{#1}\label{references}}
\usepackage{hyperref} \usepackage{hyperref}
@ -42,7 +28,6 @@
\maketitle \maketitle
\begin{abstract} \begin{abstract}
% Sentences of the full version only go in \iffull ... \fi; an abstract that differs as a whole goes in \full{<full abstract>}{<conference abstract>}.
Abstract. Abstract.
\end{abstract} \end{abstract}

View File

@ -1,7 +1,2 @@
\section{Security}\label{sec:security} \section{Security}\label{sec:security}
% The security theorems, with their proofs here or in the appendix. % The security theorems, with their proofs here or in the appendix.
\begin{restatable}{theorem}{examplethm}\label{thm:example}
Placeholder theorem.
\end{restatable}
\proofhere{proof-example}