Latex Document Skill 标志

Latex Document Skill

社区
ndpvt-web
latex-document-skill

通用 LaTeX 文档技能:创建、编译并转换各类文档,生成专业 PDF 和 PNG 预览。支持简历、报告、求职信、发票、学术论文、学位论文、学术 CV、演示文稿(Beamer)、科学海报、正式信函、考试/测验、书籍、速查表、参考卡片、考试公式表、可填写 PDF 表单(hyperref 表单字段)、条件内容(etoolbox 开关)、从 CSV/JSON 合并邮件(Jinja2 模板)、版本差异比较(latexdiff)、图表(pgfplots + matplotlib)、表格(booktabs + CSV 导入)、图片(TikZ)、Mermaid 图表、AI 生成图片、水印、横向页面、参考文献/引文(BibTeX/biblatex)、多语言/CJK(自动使用 XeLaTeX)、算法/伪代码、彩色文本框(tcolorbox)、SI 单位(siunitx)、Pandoc 格式转换(Markdown/DOCX/HTML ↔ LaTeX),以及将手写或印刷文档(数学、商务、法律及通用文档)中的 PDF 转换为 LaTeX。编译脚本支持 pdflatex、xelatex、lualatex(自动检测)、latexmk 后端、texfot 日志过滤、PDF/A 输出和详细程度控制(--verbose/--quiet)。经实测优化的处理规模:单个智能体处理 1–10 页,11–20 页拆分处理,21 页及以上使用 batch-7 流程。适用于用户要求:(1)创建简历/CV/求职信;(2)撰写 LaTeX 文档;(3)创建含表格/图表/图片的 PDF;(4)编译 .tex 文件;(5)制作报告/发票/演示文稿;(6)处理任何与 LaTeX 或 pdflatex 有关的内容;(7)将 PDF 转换/OCR 为 LaTeX;(8)转换手写笔记;(9)创建图表/图形/示意图;(10)制作幻灯片;(11)撰写学位论文;(12)创建学术 CV;(13)制作海报;(14)创建考试/测验;(15)创作书籍;(16)在文档格式之间转换(Markdown、DOCX、HTML 与 LaTeX 互转);(17)为 LaTeX 生成 Mermaid 图表;(18)撰写正式商务信函;(19)创建速查表或参考卡片;(20)制作考试公式表或小抄;(21)将讲义/PDF 精简为速查表;(22)创建带文本的可填写 PDF 表单

概览

发布者ndpvt-web
代码仓库latex-document-skill
技能名称latex-document-skill
星标数
785
复刻数
59
附带文件
184
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 184 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 ndpvt-web 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Latex Document Skill AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/ndpvt-web/latex-document-skill/tree/main
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ndpvt-web/latex-document-skill.git \
  .claude/skills/latex-document-skill
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Latex Document Skill,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Latex Document Skill。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Latex Document Skill 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

LaTeX Document Skill

Create any LaTeX document, compile to PDF, and generate PNG previews. Convert PDFs of any type to LaTeX.

Workflow: Create Documents

  1. Determine document type (resume, report, letter, invoice, article, thesis, academic CV, presentation, poster, exam, book, cheat sheet)
  2. If the target is an IEEE journal / Transactions / IEEE two-column paper: Read references/ieee-journal-twocolumn-guide.md before choosing a template. Start from examples/ieee-twocolumn-sample.tex for a working IEEEtran baseline and use examples/ieee-twocolumn.png / examples/ieee-twocolumn-p1.png / examples/ieee-twocolumn-p2.png as visual references.
  3. If poster: Run the poster sub-workflow (see Poster Sub-Workflow below), then skip to step 5.
  4. If cheat sheet / reference card: Run the cheat sheet sub-workflow (see Cheat Sheet / Reference Card Sub-Workflow below), then skip to step 5.
  5. Ask the user which enrichment elements they want (use AskUserQuestion tool with multiSelect). Offer relevant options based on document type:
    • AI-generated images -- custom illustrations, diagrams, photos (uses generate-image skill)
    • Charts/graphs -- bar, line, pie, scatter, heatmap (pgfplots or matplotlib)
    • Flowcharts/diagrams -- process flows, architecture, decision trees (TikZ or Mermaid)
    • Citations/bibliography -- academic references, footnotes, works cited (BibTeX/biblatex)
    • Tables with data -- comparison matrices, financial data, statistics (booktabs)
    • Watermarks -- DRAFT, CONFIDENTIAL, or company logo background
    • Skip this step for simple documents (cover letters, invoices) or when the user has already specified exactly what they want.
  6. Copy the appropriate template from assets/templates/ or write from scratch
  7. Customize content based on user requirements
  8. Generate external assets based on user's element choices:
    • AI images: python3 <skill_path>/../generate-image/scripts/generate_image.py "prompt" --output ./outputs/figure.png
    • matplotlib charts: python3 <skill_path>/scripts/generate_chart.py <type> --data '<json>' --output chart.png
    • Mermaid diagrams: bash <skill_path>/scripts/mermaid_to_image.sh diagram.mmd output.png
  9. For documents 5+ pages: Review the Long-Form Document Anti-Patterns section and run the Content Generation Checklist before compiling. Key rules: prefer prose over bullets, include global list compaction, escape </> in text mode, vary section formats, limit \newpage, size images at 0.75-0.85 textwidth.
  10. Compile with scripts/compile_latex.sh (auto-detects XeLaTeX for CJK/RTL, glossaries, bibliography)
  11. Show PNG preview to user, deliver PDF

Poster Sub-Workflow

When the user requests a poster: read references/poster-design-guide.md for the complete workflow including conference size presets (NeurIPS/ICML/CVPR/ICLR dimensions), layout archetypes (Traditional/BetterPoster/Visual-Heavy), color schemes, and typography standards. Use poster.tex (portrait) or poster-landscape.tex (landscape). Ask the user for conference/orientation, layout style, and color scheme using AskUserQuestion, then proceed to step 5.

Cheat Sheet / Reference Card Sub-Workflow

When the user requests a cheat sheet, reference card, or formula sheet:

  1. Read references/cheatsheet-guide.md for the complete workflow including template selection, content budgets, typography rules, and the PDF-to-cheatsheet pipeline.
  2. Select template: cheatsheet.tex (general, 3-col landscape), cheatsheet-exam.tex (exam formula, 2-col portrait), or cheatsheet-code.tex (programming, 4-col landscape).
  3. Follow the guide's workflow steps, then return to main workflow step 5.

Workflow: Mail Merge (Batch Personalized Documents)

Generate N personalized documents from a LaTeX template + CSV/JSON data source using scripts/mail_merge.py. Template syntax: {{variable}} for simple substitution, Jinja2 (<< >>, <% %>) for conditionals/loops. See assets/templates/mail-merge-letter.tex for an example. Full guide: references/interactive-features.md.

Workflow: Version Diffing (latexdiff)

Generate highlighted change-tracked PDFs using scripts/latex_diff.sh. Supports file-to-file diff, git revision diff, multi-file flatten, and custom markup styles. Full guide: references/interactive-features.md.

Workflow: Convert Document Formats

Convert between Markdown, DOCX, HTML, and LaTeX using scripts/convert_document.sh. Full guide: references/format-conversion.md.

Workflow: Convert PDF to LaTeX

Convert existing PDFs (handwritten notes, printed reports, legal docs) to LaTeX. Full pipeline: references/pdf-conversion.md.

Quick steps: Split PDF into page images (scripts/pdf_to_images.sh), select a conversion profile, create shared preamble, apply scaling strategy, validate with scripts/validate_latex.py, concatenate, compile.

Scaling strategy: 1-10 pages = single agent; 11-20 pages = split in half (2 agents); 21+ pages = batch-7 pipeline (ceil(N/7) agents with run_in_background: true).

Conversion profiles (in references/profiles/): math-notes.md (equations, theorems -- has beautiful mode), business-document.md (reports, memos), legal-document.md (contracts, statutes), general-notes.md (handwritten, mixed content).

Workflow: Fill PDF Forms

Fill existing PDF forms -- both fillable (with form fields) and non-fillable (image-based). Full guide: references/pdf-operations.md.

Step 1: Check form type:

bash
python3 <skill_path>/scripts/pdf_check_form.py form.pdf

If fillable (has form fields):

bash
# Extract field metadata
python3 <skill_path>/scripts/pdf_extract_fields.py form.pdf field_info.json
# Create field_values.json with values for each field, then fill
python3 <skill_path>/scripts/pdf_fill_form.py form.pdf field_values.json output.pdf

If non-fillable (no form fields):

bash
# Convert to images for visual analysis
bash <skill_path>/scripts/pdf_to_images.sh form.pdf ./tmp/pages
# Visually identify fields, create fields.json with bounding boxes
# Validate bounding boxes (+ optional validation image)
python3 <skill_path>/scripts/pdf_validate_boxes.py fields.json --image page_1.png --output validation.png --page 1
# Fill with text annotations
python3 <skill_path>/scripts/pdf_fill_annotations.py form.pdf fields.json output.pdf

Workflow: Advanced PDF Operations

For text/table extraction (pdfplumber), OCR (pytesseract), programmatic PDF creation (reportlab), watermarking, page rotation/cropping, metadata extraction, JavaScript libraries (pdf-lib, pdfjs-dist), and batch processing, see references/pdf-operations.md.

Compile Script

bash
# Basic compile (auto-detects engine)
bash <skill_path>/scripts/compile_latex.sh document.tex

# Compile + generate PNG previews
bash <skill_path>/scripts/compile_latex.sh document.tex --preview

# Compile + PNG in specific directory
bash <skill_path>/scripts/compile_latex.sh document.tex --preview --preview-dir ./outputs

# Force a specific engine
bash <skill_path>/scripts/compile_latex.sh document.tex --engine xelatex
bash <skill_path>/scripts/compile_latex.sh document.tex --engine lualatex

# Use latexmk for automatic multi-pass (recommended for complex documents)
bash <skill_path>/scripts/compile_latex.sh document.tex --use-latexmk --preview

# PDF/A output for thesis submissions and archival compliance
bash <skill_path>/scripts/compile_latex.sh document.tex --pdfa

# Verbose output for debugging compilation issues
bash <skill_path>/scripts/compile_latex.sh document.tex --verbose

# Quiet mode for batch/CI jobs (only errors shown)
bash <skill_path>/scripts/compile_latex.sh document.tex --quiet

# Clean auxiliary files only (no compilation)
bash <skill_path>/scripts/compile_latex.sh document.tex --clean

Compilation Flags

FlagDescription
--previewGenerate PNG previews of each page after compilation
--preview-dir DIRDirectory for PNG output (default: same as .tex file)
--engine ENGINEForce engine: pdflatex, xelatex, or lualatex
--use-latexmkUse latexmk as compilation backend (auto multi-pass, bibliography, index)
--verboseShow full compilation output (all engine logs)
--quietSuppress all non-error output
--cleanRemove auxiliary files (.aux, .log, .bbl, .fdb_latexmk, etc.) and exit
--pdfaProduce PDF/A-2b compliant output (auto-injects pdfx package)
--auto-fixAuto-fix common compilation errors (float placement, encoding)

Compilation Backends

Manual multi-pass (default): Runs the engine multiple times with bibliography/index/glossary passes as needed. This is the traditional approach and works without latexmk installed.

latexmk (--use-latexmk): Uses latexmk for automatic dependency-driven compilation. Recommended for complex documents with bibliographies, indexes, glossaries, or cross-references -- latexmk determines the correct number of passes automatically. Requires latexmk (included with TeX Live).

Log Filtering (texfot)

When texfot is installed (included with TeX Live), compilation output is automatically filtered to show only relevant warnings and errors, suppressing noisy package loading messages. This applies in the default verbosity mode. Use --verbose to see unfiltered output, or --quiet to suppress all non-error output.

Engine auto-detection: If the .tex file uses fontspec, xeCJK, or polyglossia, the script automatically uses xelatex. If it uses luacode or luatextra, it uses lualatex. Otherwise defaults to pdflatex. Override with --engine.

The script auto-installs texlive (including texlive-science, texlive-xetex, texlive-luatex, biber) and poppler-utils if missing. It auto-detects \bibliography{} (runs bibtex), \addbibresource{} (runs biber), \makeindex (runs makeindex), \makeglossaries (runs makeglossaries), runs the correct number of passes, generates PNG previews with pdftoppm, and cleans auxiliary files.

Script & Tool Reference

For PDF utilities (encrypt, merge, optimize, extract pages, pdf-to-images), LaTeX quality tools (lint, word count, analysis, package check, citations), compilation auto-fix, bibliography fetching, and diagram scripts (Mermaid, Graphviz, PlantUML), see references/script-tools.md.

Templates

Copy from assets/templates/ and customize.

Resume Templates (5 ATS-Compatible Options)

Select based on experience level, industry, and ATS requirements. See references/resume-ats-guide.md for full ATS guidance.

TemplateBest ForKey FeatureATS Score
resume-classic-ats.texFinance, law, government, any ATS portalZero graphics, plain text only, maximum parse safety10/10
resume-modern-professional.texTech, corporate, general professionalSubtle color accents, clean design, good ATS + human appeal9/10
resume-executive.texVP, Director, C-suite (5-15+ years)Two-page, executive summary, board roles, P&L focus9/10
resume-technical.texSoftware, data, engineering rolesSkills-first hybrid, projects section, tech stack emphasis9/10
resume-entry-level.texNew graduates, career startersEducation-first, one page, coursework, activities9/10

All 5 templates follow ATS rules: single-column, no graphics/images, no tables for layout, standard section headings, contact info in body (not header/footer).

STEM Student Templates

  • homework.tex -- Homework/assignment submission template (article class, 11pt) with toggle-able solutions (\showsolutionstrue/\showsolutionsfalse), custom problem/solution environments, honor code section, fancyhdr headers, amsmath+amssymb+amsthm math, listings code highlighting (Python, Java, C++, Matlab styles), enumitem for (a), (b), (c) sub-parts, hyperref. Customization via \coursename, \assignmentnumber, \studentname, \studentid, \duedate. Example problems: calculus, proof by induction, Python coding, matrix algebra, kinematics, Java OOP.
  • lab-report.tex -- STEM lab report template (article class, 11pt) with siunitx for uncertainties and SI units, pgfplots for data visualization, booktabs for professional tables, amsmath for equations, fancyhdr headers, caption+subcaption for figures. Structured sections: abstract, theory, procedure, data/results (with uncertainty tables), analysis (pgfplots graphs), discussion (error analysis), conclusion, references, appendix. Example: pendulum period measurement with error propagation.

Other Templates

  • lecture-notes.tex -- Beautiful lecture notes (scrartcl KOMA-Script class) with Palatino font, microtype typography, color-coded tcolorbox theorem environments (blue theorems, green definitions, orange examples, purple remarks), TikZ graph theory diagram styles and macros (\CompleteGraph, \CycleGraph, \PathGraph), styled section headings with titlesec, fancyhdr headers, hyperref + cleveref navigation. Ideal for converting handwritten math/science notes to beautiful PDFs. Includes graph theory custom commands (\V, \E, \deg, \chr). Used by the math-notes conversion profile in beautiful mode.
  • thesis.tex -- Thesis/dissertation (book class) with title page, declaration, abstract, acknowledgments, TOC, list of figures/tables, chapters, appendices, bibliography. Front matter uses roman numerals, main matter uses arabic. Includes theorem environments.
  • academic-cv.tex -- Multi-page academic CV with publications (journal/conference/preprint sections), grants and funding, teaching, advising (current/graduated students), awards, professional service, invited talks. ORCID and Google Scholar links.
  • book.tex -- Full book (book class) with half-title, title page, copyright page, dedication, preface, acknowledgments, TOC, list of figures/tables, parts, chapters, appendix, bibliography, index. Custom chapter headings, epigraphs, fancyhdr, microtype.
  • poster.tex -- Conference poster (tikzposter class, A0 portrait) with 2-column layout, QR code, 5 color schemes, tikzfigure charts, tables, coloredbox highlights. Includes commented #BetterPoster layout variant (central billboard + sidebars). Portrait is standard for most conferences. See poster design guide for conference size presets.
  • poster-landscape.tex -- Landscape conference poster (tikzposter class, A0 landscape) with 3-column (30/40/30) layout, QR code, tech purple color scheme. For CS/ML conferences (NeurIPS, ICML, CVPR, ICLR). Includes commented \geometry{} presets for CVPR/NeurIPS custom sizes.
  • cheatsheet.tex -- General reference card (extarticle class, landscape A4, 7pt base font) with 3-column multicols layout, tcolorbox colored section boxes, tight spacing. For command references, concept summaries, quick-reference guides. Supports front+back printing.
  • cheatsheet-exam.tex -- Exam formula sheet (extarticle class, portrait A4, 6pt base font) with 2-column layout, maximum content density, black-and-white printer-safe. For university exam "allowed cheat sheets" with formulas, theorems, definitions. Optimized for single-sided printing.
  • cheatsheet-code.tex -- Programming reference card (extarticle class, landscape A4, 7pt base font) with 4-column layout, minted syntax highlighting, monospace font emphasis. For language syntax, API reference, CLI commands, keyboard shortcuts.
  • letter.tex -- Formal business letter with colored letterhead bar, TikZ logo placeholder, company info, recipient block, date, subject line, signature. Professional corporate appearance.
  • exam.tex -- Exam/quiz (exam class) with grading table, multiple question types (multiple choice, true/false, fill-in-blank, matching, short answer, essay), point values, solution toggle via \printanswers.
  • report.tex -- Business report with TOC, headers/footers, data tables, bar chart (pgfplots), process flowchart (TikZ), recommendations
  • cover-letter.tex -- Professional cover letter with sender/recipient blocks
  • invoice.tex -- Invoice with company header, line items table, subtotal/tax/total
  • academic-paper.tex -- Research paper with abstract, sections, bibliography, figures. Includes example .bib file (references.bib) for BibTeX citations.
  • examples/ieee-twocolumn-sample.tex -- IEEE Transactions / journal example using \documentclass[journal,10pt]{IEEEtran} with abstract, keywords, single-column figure, single-column table, full-width table, and numeric bibliography. Use with references/ieee-journal-twocolumn-guide.md. Preview PNGs: examples/ieee-twocolumn.png, examples/ieee-twocolumn-p1.png, examples/ieee-twocolumn-p2.png.
  • presentation.tex -- Beamer presentation with title slide, content frames, columns
  • fillable-form.tex -- Fillable PDF form (article class) with hyperref form fields: text inputs, checkboxes, radio buttons, dropdowns, push buttons. Two-column layout with tabularx. Custom \FormField, \FormCheck, \FormDropdown helper commands. Requires Adobe Reader for full form support (browser PDF viewers have limited form capabilities).
  • conditional-document.tex -- Configurable document (article class) with etoolbox toggle system: show/hide TOC, appendix, watermark, draft mode, confidential marking, abstract. Template variables via \providecommand (title, author, org, version). Three visual profiles (corporate, academic, minimal). Supports command-line variable passing for CI/CD.
  • mail-merge-letter.tex -- Mail merge letter template with {{variable}} placeholders for use with scripts/mail_merge.py. Company-branded letterhead, recipient address block, body text with data-driven personalization. Pair with CSV/JSON data source.
  • resume.tex -- Legacy resume template (has photo area and tables -- not ATS-optimized)

Usage:

bash
cp <skill_path>/assets/templates/resume-classic-ats.tex ./outputs/my_resume.tex
# Edit content, then compile
bash <skill_path>/scripts/compile_latex.sh ./outputs/my_resume.tex --preview --preview-dir ./outputs

Document Type Selection

User RequestTemplateDocument Class
Resume, CV (ATS-safe)resume-classic-ats.texarticle
Resume (modern look)resume-modern-professional.texarticle
Resume (senior/executive)resume-executive.texarticle
Resume (technical/engineering)resume-technical.texarticle
Resume (new graduate)resume-entry-level.texarticle
Homework, assignment, problem sethomework.texarticle
Lab report, experiment writeuplab-report.texarticle
Lecture notes, math notes (beautiful)lecture-notes.texscrartcl
Thesis, dissertationthesis.texbook
Academic CV (publications, grants)academic-cv.texarticle
Report, analysisreport.texarticle
Cover lettercover-letter.texarticle
Invoiceinvoice.texarticle
Academic paperacademic-paper.tex + references.bibarticle
IEEE journal, IEEE Transactions, IEEE two-column paperexamples/ieee-twocolumn-sample.tex + ieee-journal-twocolumn-guide.mdIEEEtran
Bookbook.texbook
Scientific poster (portrait)poster.textikzposter
Scientific poster (landscape)poster-landscape.textikzposter
Cheat sheet, reference cardcheatsheet.texextarticle
Exam formula sheet, crib sheetcheatsheet-exam.texextarticle
Programming reference cardcheatsheet-code.texextarticle
Formal business letterletter.texarticle
Exam, quiz, testexam.texexam
Slides, presentationpresentation.texbeamer
Fillable PDF formfillable-form.texarticle
Conditional/configurable documentconditional-document.texarticle
Mail merge, batch lettersmail-merge-letter.tex + scripts/mail_merge.pyarticle
Version diff (latexdiff)Use scripts/latex_diff.sh + see interactive-features.mdvaries
Convert PDF to LaTeXSelect profile + see pdf-conversion.mdvaries
Convert formatsUse scripts/convert_document.sh + see format-conversion.mdvaries
Mail merge from CSV/JSONUse scripts/mail_merge.py + see interactive-features.mdvaries

Key LaTeX Patterns

Escaping Special Characters

Always escape: % → \%, $ → \$, & → \&, # → \#, _ → \_

Angle brackets in text mode: < and > are NOT valid in LaTeX text mode with T1 encoding. They render as inverted question marks (¡ or ¿). Always use math mode or text commands:

  • <5% → $<$5\% or \textless 5\%
  • >50 → $>$50 or \textgreater 50
  • <$300 → $<$\$300
  • >= → $\geq$, <= → $\leq$

This is one of the most common silent errors in generated LaTeX — the document compiles without errors but the PDF shows garbage characters.

Date ranges use en-dash: 2019--2025 (double hyphen).

Standard Preamble

latex
\documentclass[11pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{geometry}
\usepackage{hyperref}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{colortbl}
\usepackage{enumitem}
\usepackage{titlesec}

Code Patterns (load as needed)

For ready-to-use LaTeX code snippets (tables, charts, flowcharts, bibliography, watermarks, landscape pages, multi-language, images, Mermaid diagrams, matplotlib charts, CSV tables, AI images, fillable forms, conditional content, mail merge, version diff), read references/code-patterns.md.

Visual Elements in Reports

When creating reports, use the enrichment elements the user selected in step 4. For the quick reference table of visual element tools (charts, flowcharts, AI images, tables, timelines) and sizing guidelines, see references/advanced-features.md. Use \begin{figure}[H] (from float package) to prevent figures from floating. Size TikZ diagrams with width=0.8\textwidth or smaller.

Reference Guides (load as needed)

When uncertain about LaTeX patterns, compilation issues, or document quality, consult this table and load relevant files.

TopicFileWhen to Read
Long-Form Best Practiceslong-form-best-practices.mdMUST READ for 5+ page documents: 9 anti-patterns, report preamble, content generation checklist
Code Patterns (LaTeX snippets)code-patterns.mdReady-to-use LaTeX code: tables, charts, flowcharts, bibliography, watermarks, landscape, multi-lang, images, forms, mail merge, diffs
Script & Tool Referencescript-tools.mdPDF utilities (encrypt, merge, optimize, extract), LaTeX quality tools (lint, wordcount, analysis), compilation auto-fix, bibliography, diagrams
Bibliography/Citationsbibliography-guide.mdBibTeX/biblatex, citation styles, .bib format
Advanced Features & Visual Elementsadvanced-features.mdWatermarks, landscape, multi-lang, code, algorithms, tcolorbox, siunitx, advanced charts, AI images, visual elements reference table
Mermaid Diagramsmermaid-diagrams.mdFlowcharts, sequence, class, ER, Gantt, pie, mindmap
Python Charts (matplotlib)python-charts.mdBar, line, scatter, pie, heatmap, box, histogram, area, radar
Format Conversion (Pandoc)format-conversion.mdMarkdown/DOCX/HTML to/from LaTeX
Tables and Imagestables-and-images.mdColored rows, multi-row/column, booktabs, long tables, images, TikZ
Charts and Graphs (pgfplots)charts-and-graphs.mdLine plots, bar charts, scatter plots, pie charts in pgfplots
IEEE Journal Two-Column Typographyieee-journal-twocolumn-guide.mdIEEEtran journal layout, float rules, XeLaTeX vs. pdfLaTeX, bibliography, Markdown-to-IEEE workflow, sample PNGs in examples/ieee-twocolumn*.png
LaTeX Packagespackages.mdCommon packages reference
Poster Design Guideposter-design-guide.mdConference size presets, typography, color schemes, layout archetypes, content guidelines
Resume ATS Guideresume-ats-guide.mdATS rules, LaTeX pitfalls, keywords
PDF-to-LaTeX Pipelinepdf-conversion.mdFull conversion pipeline, scaling strategy, worker agents, validation
Interactive Featuresinteractive-features.mdFillable PDF forms, conditional content, mail merge from CSV/JSON, latexdiff version tracking
Cheat Sheet Designcheatsheet-guide.mdTemplate selection, typography, density optimization, PDF-to-cheatsheet pipeline
PDF-to-Cheatsheet Promptspdf-extraction-prompts.mdLLM prompts for extraction stages: structure analysis, subject-specific extraction, compression, formatting
Visual Packages (TikZ)visual-packages.md24 installed TikZ/visualization packages with working examples
Graphviz & PlantUMLgraphviz-plantuml.md.dot to PDF/PNG, .puml to PDF/PNG, LaTeX integration
Debugging & Errorsdebugging-guide.mdReading LaTeX errors, 20 common errors, .log analysis, silent failures
Accessibility & PDF/Aaccessibility-guide.mdPDF/A for thesis, PDF/UA for screen readers, tagged PDFs, alt text
Beamer Presentationsbeamer-guide.mdThemes, overlays/animations, code slides, handouts, presenter notes
Font Selectionfont-guide.mdFont families, fontspec, mathematical fonts, fontawesome5, microtype, CJK
Collaboration & CI/CDcollaboration-guide.mdGit for LaTeX, GitHub Actions, Docker, multi-author workflows
PDF Operationspdf-operations.mdForm filling (fillable + non-fillable), text/table extraction (pdfplumber), OCR (pytesseract), programmatic PDF creation (reportlab), watermarking, rotation/cropping, metadata, JavaScript (pdf-lib, pdfjs-dist), batch processing, performance tips

Critical Notes and Common Mistakes

Compile & Output

  • Run compile script from the directory containing the .tex file, or use absolute paths
  • Place output .tex files in ./outputs/ for user visibility
  • After compilation, read the PNG preview files to show the user how the document looks
  • PNG previews require poppler-utils (auto-installed by script)

Package Dependency Errors (MUST READ)

These cause Undefined control sequence -- always include the required package:

If you use...You MUST includeError without it
\rowcolor{}\usepackage{colortbl}Undefined control sequence \rowcolor
\url{} in .bib with natbib\usepackage{url}Undefined control sequence \url
\checkmark\usepackage{amssymb}Undefined control sequence \checkmark
\begin{figure}[H]\usepackage{float}Unknown float option H
\rowcolors{}{}{}\usepackage[table]{xcolor} or \usepackage{colortbl}Undefined control sequence

hyperref Package

  • hyperref is fine for normal documents (most templates use it).
  • Only avoid it in PDF-to-LaTeX converted documents with theorem environments, where it causes \set@color errors.

Compilation Environment

  • If texlive is not installed, the compile script auto-installs it. Do NOT run multiple compile commands in parallel before texlive is installed -- they will all try to install simultaneously, causing dpkg lock contention. Install once first or run compiles sequentially.
  • The compile script uses -interaction=nonstopmode (not -halt-on-error) to ensure PDFs are produced even with warnings. This is intentional -- many documents produce warnings on first pass that resolve on subsequent passes.
  • latexmk and texfot are included with TeX Live. The setup script (setup.sh) verifies their availability. latexmk is used when --use-latexmk is passed; texfot is used automatically when available (default verbosity mode).
  • A .chktexrc configuration file is included at the skill root to suppress common false positives when linting generated LaTeX documents. The latex_lint.sh script uses it automatically.

Long-Form Document Anti-Patterns

For documents 5+ pages (reports, theses, books), read references/long-form-best-practices.md for 9 critical anti-patterns, the report preamble best practices, and the content generation checklist. This is MUST-READ material before generating any long document.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

还有 124 个文件。

常见问题

Latex Document Skill AI 技能有什么作用?

通用 LaTeX 文档技能:创建、编译并转换各类文档,生成专业 PDF 和 PNG 预览。支持简历、报告、求职信、发票、学术论文、学位论文、学术 CV、演示文稿(Beamer)、科学海报、正式信函、考试/测验、书籍、速查表、参考卡片、考试公式表、可填写 PDF 表单(hyperref 表单字段)、条件内容(etoolbox 开关)、从 CSV/JSON 合并邮件(Jinja2 模板)、版本差异比较(latexdiff)、图表(pgfplots + matplotlib)、表格(booktabs + CSV 导入)、图片(TikZ)、Mermaid 图表、AI 生成图片、水印、横向页面、参考文献/引文(BibTeX/biblatex)、多语言/CJK(自动使用 XeLaTeX)、算法/伪代码、彩色文本框(tcolorbox)、SI 单位(siunitx)、Pandoc 格式转换(Markdown/DOCX/HTML ↔ LaTeX),以及将手写或印刷文档(数学、商务、法律及通用文档)中的 PDF 转换为 LaTeX。编译脚本支持 pdflatex、xelatex、lualatex(自动检测)、latexmk 后端、texfot 日志过滤、PDF/A 输出和详细程度控制(--verbose/--quiet)。经实测优化的处理规模:单个智能体处理 1–10 页,11–20 页拆分处...

为什么在 TypingMind 中使用 Latex Document Skill?

因为您只需安装一次,就能搭配任何模型使用。Latex Document Skill 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Latex Document Skill?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/ndpvt-web/latex-document-skill/tree/main。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Latex Document Skill?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Latex Document Skill 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Latex Document Skill 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Latex Document Skill AI 技能免费吗?

ndpvt-web 已在 GitHub 上发布了该技能。请查看代码仓库了解许可条款。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇