论文阅读 / Paper reader
A DeepSeek Harness plugin that adds a 论文阅读 entry to the left sidebar: a three-column panel with the paper library, a PDF reader, and a side panel for chat and notes.

What it does
- Library — every PDF under
libraryDir, grouped by folder. Import by arXiv id/link, by paper URL, by picking a file, or by dragging a PDF onto the library column. Create categories (+in the sidebar header), drag a paper onto a folder — or use the row's ➜ action — to file it, rename papers and folders, delete to a trash folder and restore, and search the full text of the library (not just file names). Chats and notes follow a moved paper. - Reader — pdf.js continuous scroll with only visible pages rasterized, fit-width and 25–400% zoom (Ctrl+wheel anchors on the pointer), a real selectable text layer, and a page box: type a number and press Enter to jump.
- Chat — every question is answered from the paper: full text when it fits the context budget, outline plus BM25-retrieved passages when it does not. The streamed answer shows reasoning, phase and token usage, can be stopped, and keeps a per-paper history. Copy any question or answer, and export the conversation as Markdown or JSON. A model picker in the chat bar switches between the DSH default and any number of saved profiles (provider + model + optional reasoning effort).
- Notes — save the current selection with a page number and a Markdown
comment (live preview), grouped by page, collapsed by default with an
explicit 展开全文 / 收起 toggle, copyable, and editable in place. Clicking a
note jumps to the page and highlights the passage; clicking anything else clears
the highlight. The notes travel with every question as
<notes>. - Chinese edition (optional bundle) —
dsh-paper-panel-latextranslates the arXiv LaTeX source and recompiles it with XeLaTeX, keeping the authors' layout, figures, formulas and citation links. It requires a local TeX installation, so it is a separate download; the core never imports it.
Two bundles
| Directory | Package | Contents | Needs |
|---|---|---|---|
. |
dsh-paper-panel |
core panel | nothing beyond DSH |
latex/ |
dsh-paper-panel-latex |
Chinese edition backend | MiKTeX or TeX Live with ctex, a Song font |
The core publishes the paperReaderTranslation service lookup; the optional
bundle provides it. Without the bundle the panel says
翻译扩展未安装:中文版需要 LaTeX… in place of the translate button.
Install
See docs/INSTALL.md for the local-directory, npm, and GitHub
release paths, the requirements, and a troubleshooting table for every
无法翻译 reason.
Short version: Plugins → Add plugin → Local directory and choose this
directory; then, optionally, add latex/ the same way. A restart loads a fresh
Host module generation.
When is the translate button shown?
Only when all of these pass, so that a visible button really produces a Chinese edition:
- the paper's arXiv id is known (import metadata, link, file name, or an arXiv title search);
xelatexexists and runs;ctexis installed;- the e-print downloads and contains a main
.tex; - the untouched source has been compiled once with this machine's TeX (cached per paper; ~30–60 s the first time).
Any failure is shown as 无法翻译:<reason> with the full message and LaTeX log
excerpts in the tooltip. Compile warnings of a finished edition appear as
⚠ n next to 原文 / 中文.
Configuration
The core row (see cordis.patch.yml):
| Field | Meaning |
|---|---|
libraryDir |
Folder scanned for .pdf files. Empty means <home>/Documents/DSH Papers; the ⚙ dialog can point it elsewhere (stored in ~/.paper-reader/config.json), and this row wins over both. |
provider / model |
Optional chat override; empty follows the chat-bar model picker and then the DSH default. |
reasoningEffort |
Optional thinking effort; validated against the model, falling back to its default. |
The latex row (latex/cordis.patch.yml):
| Field | Meaning |
|---|---|
texPath |
Absolute path to xelatex when it is not on PATH. |
cjkFont |
CJK body font family (default SimSun / 宋体). Bold is emboldened from that same face, because Song has no bold cut. |
cjkBold / cjkBoldFactor |
Optional bold face name, or the synthetic emboldening amount (default 2). |
cjkLinespread |
Leading ratio for the Chinese body (default 1.2; ctex's 1.3 makes the paper noticeably airier than the original). |
Reader length policy, model profiles, the Chinese-edition font/leading and the
notes-context budget are stored per library in .paper-reader/settings.json and
edited from the ⚙ dialog. A font override in that dialog wins over the latex
row, so typesetting can be retuned without editing YAML.
Development
npm install # uses package-lock.json
npm run build # regenerate the client bundle (client.js)
node scripts/package-check.mjs # manifests, locales, icon, files, no core↔latex imports
node scripts/smoke.mjs # client artifact + slot registration
node scripts/host-smoke.mjs # routes, library, Range, path escape, no-extension reply
node scripts/models-smoke.mjs # model profiles + /chat routing
node scripts/search-smoke.mjs # full-text search
node scripts/folders-smoke.mjs # categories, move + notes edit, home-relative label
node scripts/perf-smoke.mjs # 120-page extraction/search and a 400-paper library scan
node scripts/capability-smoke.mjs # trial compile gate + refusal reasons (needs TeX)
node scripts/compile-failure-smoke.mjs # uncompilable source is reported, not attempted
node scripts/source-translate-smoke.mjs # full pipeline: source → Chinese → PDF (needs TeX)
docs/STATUS.md lists every check and what still needs a real-browser pass;
docs/DETAIL.md describes the architecture. docs/UNIMPLEMENTED.md is the single
list of what is missing or unverified, including the roadmap items that are
explicitly out of scope.
The first open against the default folder asks once where the library should
live; the answer is remembered in ~/.paper-reader/config.json.
The client half is built with esbuild into client.js, which is committed so a
local-directory install works without a build step.
Release
- Bump
versioninpackage.json(andlatex/package.json), updateCHANGELOG.md, commit. git tag v0.4.0 && git push --tags..github/workflows/release.ymlbuilds, validates, packs both bundles, and attaches the tarballs to the GitHub release. Set anNPM_TOKENsecret to also publish both packages to npm.- Users then install from npm, from a release tarball, or by cloning the repo
(see
docs/INSTALL.md). The exact publishing steps — npm login, the GitHub tag, and theawesome-dsh-pluginlisting the market reads — are indocs/PUBLISH.md.
CI (.github/workflows/ci.yml) builds the client bundle, runs the package
checks and the pure-Node tests on every push, and runs the LaTeX end-to-end
checks on pull requests when xelatex is available.
Known limitations
- Labels a document class hard-codes in its own
.sty/.cls(the CVPR template prints “Abstract” literally) stay English: style files are not translated. - The Chinese edition needs an arXiv LaTeX source; PDF-only submissions cannot be recompiled and are reported as such.
- Full-text search extracts each PDF the first time it is searched.
License
MIT. See LICENSE.
还没有评论,来写第一条。