nsfc-length-aligner

Checks NSFC proposal LaTeX files against configurable length budgets and generates gap reports.

2.7k|251|Updated Feb 12, 2024
One-click install
npx skills add https://github.com/huangwb8/ChineseResearchLaTeX --skill nsfc-length-aligner
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nsfc-length-aligner
Source: https://github.com/huangwb8/ChineseResearchLaTeX/tree/main/skills/nsfc-length-aligner
Command: npx skills add https://github.com/huangwb8/ChineseResearchLaTeX --skill nsfc-length-aligner

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pyyaml, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Writing a Chinese NSFC (National Natural Science Foundation) grant proposal requires meeting strict length constraints—especially the 2026+ rule limiting the main text to roughly 30 pages. Manually judging whether sections like the research basis, research content, or preliminary work are too long or too short is subjective and error-prone. This Skill turns length into a measurable, closed-loop metric: it checks your proposal against configurable budgets, reports deviations per file and per section, and guides meaning-preserving expansion or compression until the draft complies.

Core Features & Use Cases

  • Deterministic length checking: A Python script counts CJK characters in LaTeX sources, optionally follows the main.tex \input/\include dependency tree (ignoring commented-out inputs), and can count PDF pages as a hard constraint.
  • Configurable budgets: config.yaml defines per-file budgets (e.g., 立项依据 8000–10000 chars, 研究内容 12000–15000 chars) plus overall and page limits, aligned with 2026 NSFC guidelines.
  • Closed-loop rewriting guidance: Structured Markdown/JSON reports with file-level and section-level deltas drive targeted expansion or compression, followed by mandatory re-checking.
  • Use Case: You have a proposal built on the NSFC_Young template. Point the checker at the project root, receive a report showing the research content section is 3000 characters over budget, compress the redundant passages, then re-run the check to confirm compliance.

Quick Start

Ask the AI to run the length check on your NSFC proposal directory using the skill's config.yaml, read the generated length report, and suggest which sections to expand or compress to meet the budget.

Frequently Asked Questions about nsfc-length-aligner

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check the length of an NSFC LaTeX proposal?

Run the check_length.py script with --input pointing to your proposal directory and --config pointing to config.yaml. It counts CJK characters per file, compares them against configured budgets, and writes length_report.md and length_report.json to a hidden workspace directory.

How do I count pages of a compiled proposal PDF?

Pass the compiled PDF with the --pdf flag. The script counts pages using pypdf, PyPDF2, or the pdfinfo command-line tool, then compares the count against the configured page budget (recommended max 28, hard max 30 for 2026+ templates).

Does the checker work with NSFC_Young and NSFC_General templates?

Yes. When the input directory contains a main.tex with \documentclass and \begin{document}, the script follows \input, \include, and \subfile dependencies to count only files actually compiled into the PDF, ignoring commented-out inputs.

Can I customize the length budgets for my grant type?

Yes. Edit the length_standard section in config.yaml to set per-file min/max budgets, overall totals, and page limits. The defaults are example values aligned with 2026 guidelines and should be verified against the current year's official requirements.

Why are my Markdown notes not counted in the length report?

By default the checker only includes *.tex files via checker.include_globs in config.yaml, to avoid counting README files or notes as proposal content. Add *.md or *.markdown to include_globs if you intentionally want Markdown counted.