{"data":{"slug":"discovered-3c1b1d80d03301e7a1c77e191926ebcfdda07eec4a4532c4","title":"Generate Chinese C++ Competitive Programming Lesson Handouts as A4 PDF","summary":"Create A4 portrait Chinese C++ competitive programming lesson handouts in PDF format using a specified XeLaTeX typography, color palette, code highlighting, diagrams, and lesson\/problem structure.","url":"https:\/\/skillshunter.net\/skills\/discovered-3c1b1d80d03301e7a1c77e191926ebcfdda07eec4a4532c4","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/discovered-3c1b1d80d03301e7a1c77e191926ebcfdda07eec4a4532c4","markdown_url":"https:\/\/skillshunter.net\/skills\/discovered-3c1b1d80d03301e7a1c77e191926ebcfdda07eec4a4532c4.md","download_url":"https:\/\/skillshunter.net\/skills\/discovered-3c1b1d80d03301e7a1c77e191926ebcfdda07eec4a4532c4\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Ensure the use of the reference `templates\/main.tex` and preserve the two-section structure: `\u4e00\u3001\u77e5\u8bc6\u70b9\u8bb2\u89e3` followed by `\u4e8c\u3001\u8bfe\u5802\u7ec3\u4e60`. Use XeLaTeX with `scripts\/build.sh` (Linux\/macOS) or `scripts\/build.ps1` (Windows) for compilation. Confirm that C++ code has no line numbers or reserved numbering gutter and that all PDF pages pass text extraction and rendering checks.","instructions":"---\nname: cpp-lesson-pdf\ndescription: Generate Chinese C++ competitive programming lesson handouts as A4 PDF using the reference topology-sorting handout's XeLaTeX typography, color palette, code highlighting, diagrams and lesson\/problem structure.\n---\n\n# C++ Lesson PDF Skill\n\n## Trigger\nUse for Chinese C++ lesson handouts, algorithm explanations, classroom exercises, and homework PDFs when the user requests this template style.\n\n## Inputs\nAsk for the topic, knowledge points, full problem statements, sample I\/O, constraints and optional reference code. If a source PDF is provided, inspect all relevant pages and preserve the actual problem statement. Never fabricate constraints, samples or judge acceptance.\n\n## Workflow\n1. Read `references\/PROMPT.md` and the sample `templates\/main.tex`.\n2. Preserve the lesson's two-section structure: `\u4e00\u3001\u77e5\u8bc6\u70b9\u8bb2\u89e3` then `\u4e8c\u3001\u8bfe\u5802\u7ec3\u4e60`.\n3. Replace content in `templates\/main.tex`, keeping `lesson-style.sty` and `diagram-styles.tex` intact.\n4. Use XeLaTeX, run `scripts\/build.sh` (Linux\/macOS) or `scripts\/build.ps1` (Windows).\n5. Render every PDF page to images and inspect text overflow, confirm **C++ code has no line numbers or reserved numbering gutter**, diagram correctness and font availability.\n6. Compare representative pages against the reference PDF, especially the first page, analysis\/code pages, and table-heavy pages. Iterate until the style is consistent.\n7. Provide the compiled PDF and optionally the edited source files.\n\n## Requirements\n- A4 portrait, white, Song font, title #22598D, section headings #18766E, analysis headings #B4661D.\n- Main title ~24pt, major section ~14.3pt, subsection 12pt, body ~10.9pt, code ~9pt.\n- C++ code uses a white bordered listing with **no line numbers**, no numbering gutter, and editor-style syntax colors.\n- Each exercise: problem statement, input\/output, examples, constraints, summary, stepwise reasoning, sample derivation, key code modules, complexity, complete C++ solution.\n- Avoid adding covers, dates, institutions or logos unless requested.\n- If the original Fandol fonts are unavailable, configure a local Song-style font and disclose that the result is a visual approximation.\n\n## Validation\nRun PDF info check, visually render all pages, inspect compilation warnings, and test the C++ reference solution with samples when possible. A successful PDF compilation alone does not prove layout fidelity or algorithm correctness.\n\n\n## v1.3 mandatory reasoning and visual derivation upgrade\n\nRead `references\/DEEP-REASONING-STEPS.md` and `references\/VISUAL-DERIVATION-STANDARD.md` before generating any nontrivial C++ algorithm handout. In every exercise, explain **what each state means and when it becomes final**, why each loop bound and guard exists, and how each candidate transition is computed. Generate a reproducible chain **initial state \u2192 current choice \u2192 arithmetic and validity decision \u2192 updated state \u2192 final state \u2192 counterexample when applicable**.\n\nUse the smallest meaningful diagram\/table for syntax exercises; for DP\/tree\/backpack\/graph exercises include input provenance, old and new state snapshots, rejected candidates with reasons, a numeric transition table, and a mapping to the complete annotated C++ solution. Distinguish source-test samples from fabricated-for-teaching illustrative data. Never invent state changes.\n\nFor the tree-knapsack example described in the user's `\u89e3\u6790.pdf`, run `python scripts\/trace_dp_merge.py --markdown output\/merge-trace.md` to verify candidate `j\/k` updates and the forward-order bug. This is for in-place 0\/1 child merge; do not assert that all DP implementations must use descending order. All numeric visuals must be checked, and PDFs must still pass text extraction and page rendering review.\n\nProject-level Web Codex installations use `.agents\/skills\/cpp-lesson-pdf\/` as the canonical v1.3 copy. The files in this legacy directory are maintained for local installation compatibility.\n\n\n## v1.3.1 graph visualization workflow\n\nRead `references\/TOPOSORT-TRACE-WORKFLOW.md` when generating topological-sort lessons. Run `scripts\/trace_toposort.py --markdown output\/toposort-trace.md --latex output\/toposort-tables.tex` to produce per-step queue\/indegree updates and verified LaTeX tables. Do not confuse FIFO order with lexicographically smallest topo sort. On a cycle, explicitly state that a complete ordering is impossible. Preserve source\/sample provenance and complete C++ solutions with Chinese comments.\n\nThe canonical Codex Web project-level Skill is `.agents\/skills\/cpp-lesson-pdf\/`; this legacy directory retains a compatible copy of the graph-tracing data, script and documentation.\n\n\n## v1.3.2 \u7528\u6237\u660e\u786e\u6307\u5b9a\u7684\u4ee3\u7801\u9875\u89c4\u5219\uff08\u9ad8\u4f18\u5148\u7ea7\uff09\n\n- \u6700\u7ec8\u5b66\u751f PDF \u4e2d**\u5220\u9664\u201c\u6392\u7248\u8bf4\u660e\u201d\u677f\u5757**\uff0c\u4e0d\u6dfb\u52a0\u6e90\u7801\u5f15\u5165\u65b9\u5f0f\u3001\u4ee3\u7801\u989c\u8272\u3001\u884c\u53f7\u663e\u793a\u3001\u7f16\u8bd1\/\u6e32\u67d3\u8fc7\u7a0b\u7b49\u5236\u4f5c\u5143\u8bf4\u660e\u3002\u4ee3\u7801\u6807\u9898\u540e\u76f4\u63a5\u8fdb\u5165\u4ee3\u7801\u6846\u3002\n- C++ \u4ee3\u7801\u5757\u5de6\u4fa7\u548c\u53f3\u4fa7\u90fd\u4e0d\u663e\u793a\u884c\u53f7\uff0c\u4e0d\u4fdd\u7559\u7a7a\u767d\u7f16\u53f7 gutter\u3002\n- \u4fdd\u7559\u6b63\u5e38 C++ \u7f16\u8f91\u5668\u8bed\u6cd5\u9ad8\u4eae\u3001\u7b49\u5bbd\u5b57\u4f53\u3001\u4e2d\u6587\u6838\u5fc3\u6ce8\u91ca\u3001\u767d\u5e95\u6d45\u7070\u84dd\u8fb9\u6846\u548c\u5b8c\u6574\u6e90\u7801\u3002\n- `templates\/lesson-style.sty` \u5fc5\u987b\u4f7f\u7528 `numbers=none`\uff1b\u7981\u6b62 `numbers=left\/right`\u3002\n- \u8fd9\u4e9b\u8981\u6c42\u8986\u76d6\u5386\u53f2\u53c2\u8003 PDF \u66fe\u7ecf\u4f7f\u7528\u884c\u53f7\u7684\u505a\u6cd5\u3002\n","use_cases":["Generate Chinese C++ lesson handouts for classroom use","Create algorithm explanation PDFs with detailed problem statements and solutions","Produce homework and exercise PDFs with structured content and visual aids"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/rongbore\/informatics-algorithm-ppt\/blob\/3d75702cbdee6953a3d7aad7952a6ff72ffbe222\/skills\/cpp-lesson-pdf\/SKILL.md","source_commit":"3d75702cbdee6953a3d7aad7952a6ff72ffbe222","license":null,"version":null,"listing_approved_at":"2026-11-30","created_at":"2026-11-29T10:49:50.000000Z","updated_at":"2026-11-30T06:51:11.000000Z","seo_title":"Generate Chinese C++ Lesson PDFs with XeLaTeX","seo_description":"Create professional Chinese C++ competitive programming lesson handouts in A4 PDF format using XeLaTeX, with specific typography, code highlighting, and diagram styles.","seo_keywords":["C++ lesson PDF","XeLaTeX lesson template","Chinese programming handout","competitive programming PDF","algorithm explanation PDF"]}}