Logo Paper Tex

Paper Tex

Cộng đồng
scdenney
paper-tex

Typesets a working paper or journal submission in house-style LaTeX from Markdown, Word (.docx), TeX, ODT, RTF, or HTML. Converts with pandoc, wraps the body in an EB Garamond template, builds the PDF with latexmk, and sets journal-specific spacing, page limits, anonymization, disclosures, and citation style. Use to format or convert a paper to LaTeX, make a working paper, or prepare a submission to a named journal.

Tổng quan

Nhà phát hànhscdenney
Kho mãopen-science-skills
Tên kỹ năngpaper-tex
Sao
69
Bản fork
3
Tệp đi kèm
4
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 4 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được scdenney công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Paper Tex trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/scdenney/open-science-skills/tree/main/plugin/skills/paper-tex
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/scdenney/open-science-skills.git /tmp/open-science-skills
mkdir -p .claude/skills
cp -r /tmp/open-science-skills/plugin/skills/paper-tex .claude/skills/paper-tex
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Paper Tex trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Paper Tex ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Paper Tex với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Paper formatter (LaTeX)

Turn a draft in any common format into a clean, house-style LaTeX paper and build the PDF. The mechanical work runs through a committed driver, scripts/format_paper.py: it detects the input format, converts the body with pandoc, wraps it in the EB Garamond template under assets/, and builds with latexmk. The house-specific finishing — captions with notes, disclosure sections, SI cross-references — is done by hand afterward, and the steps are below.

The house style: 12pt EB Garamond, 1-inch margins, author-date citations (apsr), numbered sections with unnumbered subsections, a single-spaced title block, the introduction on its own page, figures and tables placed where they are written ([H]), and every exhibit carrying a title with an italic Note: beneath it (\figcap).

Paths below are relative to this skill directory — the folder containing this SKILL.md. You know its absolute path from having just read this file; set SKILL to it once:

bash
SKILL=/path/to/.../skills/paper-tex   # the directory this SKILL.md lives in

Step 0 — Settle the journal parameters

Formatting is journal-dependent. Take the parameters below from the request and the journal's current author guide, and ask only for a value that changes the output and cannot be inferred (usually the target journal itself). With no journal named, use the working-paper profile and list the defaults applied in the report. Running the driver, building into build/, and cleaning build byproducts there need no confirmation. The parameters that change the output:

ParameterDriver flagDefaultNotes
Target journal / working paper—working papersets the rest
Body spacing--spacing single|doublesinglesingle fits tight page limits; do not double-space past a hard limit
Page / word limit—noneif a limit binds, prefer single spacing and tighten \bibsep before cutting content
Anonymized for review--anonoffblanks the author; keep identifying disclosures on a separate title page
Intro placement--cover-pageintro on its own pageonly pass --cover-page if the venue requires the intro on the title page
Citation styleedit \bibliographystyle in assets/preamble.texapsrswap the .bst per journal
Fontedit \usepackage{ebgaramond}EB Garamondswap only if a journal mandates a family
Required disclosuresadded by handnonedata availability, ethics, funding, COI — see house-finishing

A few profiles to start from (confirm against the current author guide):

  • Working paper — --spacing double, named author, \today, intro on its own page.
  • Journal of Politics (short article) — --spacing single, --anon, 15-page limit, data-availability + ethics in the manuscript, other disclosures on a separate title page.
  • Generic double-anonymous submission — --anon, --spacing double, no acknowledgments or funding in the body.

Prerequisites

Verified on macOS with TeX Live 2025 and pandoc 3.8. Required on PATH: pandoc, latexmk + pdflatex (a full TeX distribution), and pdfinfo/pdftoppm (poppler) for page counts and proof renders. The ebgaramond, apsr (texlive harvard collection), calc, booktabs, threeparttable, xr-hyper, and newunicodechar packages must be installed — all ship with a full TeX Live / MacTeX.

bash
# macOS
brew install pandoc poppler        # TeX via MacTeX (basictex users: tlmgr install ebgaramond harvard collection-latexextra)
# Debian/Ubuntu
# apt-get install -y pandoc texlive-full poppler-utils

Run the driver (primary path)

One command converts and builds. These are the exact invocations used to validate the skill:

bash
# Markdown -> single-spaced PDF, intro on its own page. A sibling references.bib
# and any figure the draft references by a relative path are staged automatically.
python3 "$SKILL/scripts/format_paper.py" draft.md --out build \
  --title "Democracy and Nationalism, Reconsidered" \
  --author "Jane Q. Researcher" \
  --abstract "Do citizens who value democracy reject nationalism? ..." \
  --keywords "nationalism; democratic values; national identity; ISSP" \
  --spacing single --build

# Word (.docx) -> same; embedded images are extracted into build/media automatically
python3 "$SKILL/scripts/format_paper.py" draft.docx --out build --title "..." --build

# Existing TeX (full document or a body fragment) -> rewrapped in the house template
python3 "$SKILL/scripts/format_paper.py" draft.tex --out build --title "..." --build

# Main text + SI together (SI gets SI-A.. section labels, SI-1.. float numbers,
# and an \externaldocument cross-reference so \ref reaches SI from the main text)
python3 "$SKILL/scripts/format_paper.py" main.md --si si.md --out build --build

Output lands in build/: main.tex, body.tex, preamble.tex (and si.tex/si_body.tex with --si), plus main.pdf when --build is set. The driver prints the page count and the house-finishing checklist. With --si, the SI builds first so \externaldocument{si} resolves SI cross-references on main's first pass.

After a successful build the driver deletes the latexmk/bibtex byproducts (.aux, .log, .bbl, .blg, .fls, .fdb_latexmk, .out, .toc, .synctex.gz, …) so the folder holds only the sources, the staged .bib and figures, and the PDFs. Pass --keep-aux while debugging a failed-then-fixed build; with --si, si.aux is kept because xr-hyper reads it when main.tex is rebuilt by hand.

Full options: python3 "$SKILL/scripts/format_paper.py" --help. Notable flags: --anon, --cover-page, --spacing, --bib NAME, --engine pdflatex|xelatex, --no-here-floats, --keep-aux.

The author block

--author is inserted verbatim into \author{...}, so pass the full LaTeX for multiple authors. The house pattern is \and-separated names, each with its own \thanks footnote — \maketitle spaces the names evenly and assigns sequential markers (*, †, ‡, …). The corresponding author's \thanks carries the institutional email (mailto: link); co-authors carry the affiliation only.

bash
--author 'Steven Denney\thanks{Leiden University. Corresponding author: \href{mailto:name@inst.edu}{name@inst.edu}.} \and Remco Breuker\thanks{Leiden University.} \and Aron van de Pol\thanks{Leiden University.}'

Keep the affiliation in the footnote, not under the name. Use the institutional email, not a personal one. For --anon, the driver blanks the whole block. (Watch shell quoting: single-quote the value so \thanks and \and survive.)

House-finishing (by hand, after the driver)

The driver gets the structure right; these five steps make it house style. Do them in build/body.tex (and si_body.tex), then rebuild with latexmk -pdf -bibtex main.tex in build/.

  1. Captions → \figcap{title}{note}. Replace every plain \caption{...} with a title and a note that makes the exhibit self-contained. Put confidence-interval, N, and source details in the note only — never baked into the figure image, and never stated in both the figure and the note. Example:

    latex
    \figcap{Cross-national heterogeneity in the rights--exclusion slope}%
      {Points are country-specific within-country slopes, adjusted for age, gender,
       education, and left--right placement; bars are 95\% confidence intervals.
       Colors denote region-regime group. $n = 43{,}517$ in 29 countries.}
  2. Disclosures as \section*{} with full sentences — never a bold word and a period. Add what the journal requires:

    latex
    \section*{Data availability}
    The ISSP 2023 module (ZA10010) is available from the GESIS Data Archive; replication
    code accompanies the submission and will be deposited on acceptance.
    
    \section*{Ethics}
    This study analyzes secondary, publicly archived, de-identified survey data and did
    not require human-subjects review.

    Identifying disclosures (funding, acknowledgments, ORCID, COI) go on a separate, non-anonymous title page for double-anonymous review, not in the body.

  3. Thread SI cross-references. With --si, \externaldocument{si} is already set, so plain \ref{} reaches SI labels (the preamble does not load cleveref, so do not write \Cref). Make sure the main text actually points readers to the supplementary tables and figures where they support a claim.

  4. Remove bold-period run-in subheaders. Convert \textbf{Multi-group CFA.}-style leads into a real \subsection{} (or spell the point into the sentence). Bold-text-with-period headings are banned house style; the formatter does not auto-catch them.

  5. Leave the folder clean. Hand rebuilds recreate the latexmk byproducts the driver cleaned. When the PDF is final, remove them so the folder holds only sources, staged assets, and PDFs:

    bash
    python3 "$SKILL/scripts/format_paper.py" --clean --out build

    This deletes .aux/.bbl/.blg/.fdb_latexmk/.fls/.log/.out/.toc/.synctex.gz and friends, and never touches sources or PDFs. If you rebuild main.tex again later with an SI, build si.tex first so \externaldocument{si} finds a fresh si.aux.

Two more house rules the formatter cannot enforce for you: tables get a title and note beneath them (use \figcap inside threeparttable/table, booktabs rules, no vertical lines), and case or country names that carry the argument are written plainly — not bolded or otherwise over-emphasized — even when they do special work.

What the template encodes (reference)

assets/preamble.tex and assets/main.template.tex already set: EB Garamond + T1; 1-inch margins; setspace; \setcounter{secnumdepth}{1}; \captionsetup{labelfont=bf, labelsep=colon, ...}; the \figcap macro; float for [H]; natbib + apsr; xr-hyper; a single-spaced {\singlespacing \maketitle ... abstract ... keywords} block followed by \newpage; and pandoc-compatibility shims (\tightlist, \real, a working \pandocbounded, calc, newunicodechar) so converted bodies build without hand-patching. To retarget a journal, edit the font and \bibliographystyle lines in the preamble; leave the body alone.

Gotchas (learned building this)

  • Figures from pandoc overflow the margin unless \pandocbounded is real. Pandoc emits width-less \includegraphics wrapped in \pandocbounded and, for a body fragment, does not emit the macro's definition. The preamble defines the genuine scaling version; a no-op \providecommand{\pandocbounded}[1]{#1} lets wide figures run off the page.
  • .docx tables need calc. Word tables carry explicit column widths, so pandoc writes p{(\columnwidth - ...) * \real{0.5}}. Without \usepackage{calc} this throws ! Missing number, treated as zero. The preamble loads it.
  • Extracted media must be out-relative. The driver runs pandoc with cwd=build/ and --extract-media=media, so the image path is media/... and resolves at build time. Running pandoc elsewhere writes a path that breaks when latexmk runs from build/ (File 'media/...png' not found).
  • Stage assets before building. --build needs the bibliography and any local figures in build/; a missing .bib shows up as Citation 'x' undefined. The driver auto-copies a sibling references.bib and any figure referenced by a relative path; supply --bib NAME if the file is named differently, and copy figures in by hand if they live elsewhere.
  • EB Garamond builds with pdflatex — no xelatex required. Use --engine xelatex only if you switch to an OpenType font or need CJK (below).
  • apsr.bst lives in the texlive harvard collection (bibtex/bst/harvard/apsr.bst); basictex users install it with tlmgr.
  • apsr.bst emits URLs through \harvardurl, which is undefined by default and tokenizes its argument with normal catcodes, so a URL with _ or ~ throws ! Missing $ inserted. Alias it with \let (not a wrapper) so \url rescans verbatim: \AtBeginDocument{\let\harvardurl\url}. And never put a literal % in a bib url/doi field — it starts a comment mid-.bbl and produces a runaway \harvardurl; truncate the URL to its directory or drop the query string instead.
  • Non-Latin scripts belong in romanization in the body, with the script in an SI glossary. Do not mix Korean/Chinese/Cyrillic glyphs into the main prose. Use a scholarly romanization (McCune-Reischauer for Korean, italicized on first use with an English gloss) and collect the script in a glossary appendix (English term / romanization / script). This keeps the body in one font and confines CJK to one place. When the glossary (or any exhibit) does carry script, build with --engine xelatex and load xeCJK conditionally so hosts without the CJK font still compile: \IfFontExistsTF{Noto Serif CJK KR}{\usepackage{xeCJK}\setCJKmainfont{Noto Serif CJK KR}}{}. M-R diacritics (ŏ ŭ, breves, apostrophes) render in EB Garamond under XeLaTeX.
  • Cross-references that run both ways need three passes. When the main text cites SI sections and the SI cites main tables, neither .aux exists on the other's first build. Build si → main → si (the last SI pass picks up main.aux); a plain main; si leaves ?? in the SI. Encode this in the Makefile's all target.
  • SI float and section numbering. Letter the appendices and prefix the floats: \renewcommand{\thesection}{\Alph{section}}, \numberwithin{figure}{section}, \numberwithin{table}{section} give sections A, B, C and floats A.1, B.1 (roc-natid-cbc house style; the si.template.tex uses the SI-A variant — pick one and keep it consistent within a project).

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Paper Tex làm được gì?

Typesets a working paper or journal submission in house-style LaTeX from Markdown, Word (.docx), TeX, ODT, RTF, or HTML. Converts with pandoc, wraps the body in an EB Garamond template, builds the PDF with latexmk, and sets journal-specific spacing, page limits, anonymization, disclosures, and citation style. Use to format or convert a paper to LaTeX, make a working paper, or prepare a submission to a named journal.

Vì sao nên dùng Paper Tex trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Paper Tex là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Paper Tex trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/scdenney/open-science-skills/tree/main/plugin/skills/paper-tex. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Paper Tex?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Paper Tex với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Paper Tex với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Paper Tex có miễn phí không?

Kỹ năng này được scdenney phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇