Generation of Chinese Software Copyright Application Materials
Core Principles
All documents are directly generated as
files and compiled into PDF using XeLaTeX.
Quick Start
- Environment Check and Installation Guidance
- Collect Copyright Owner Information and Key Parameters
- Analyze Project Structure and Code
- Generate Four LaTeX Documents + Compilation Script
- Generate Screenshot List
- Run Consistency Check
Workflow
Step 0: Environment Check
Before starting generation, proactively ask the user if the XeLaTeX environment is already installed. Execute
for detection.
If already installed: Proceed to the next step.
If not installed: Inform the user that a LaTeX environment is required to compile .tex files into PDF, and ask if they want to install it immediately. If the user agrees, execute the following commands:
- macOS:
brew install --cask basictex && sudo tlmgr update --self && sudo tlmgr install ctex xecjk fancyhdr lastpage fancyvrb tabularx enumitem float xcolor longtable collection-fontsrecommended
- Linux:
sudo apt install texlive-xetex texlive-lang-chinese texlive-latex-extra texlive-fonts-recommended
- Windows: Guide the user to install the full version of TeX Live (https://www.tug.org/texlive/)
Step 1: Information Collection
Collect information in two rounds.
Round 1: Copyright Owner Information
First, check if
exists in the project root directory or the user's working directory.
If exists: Read the file content, display it to the user and confirm if there are any changes. If the user confirms it is correct, use it directly and proceed to the second round.
If not exists: For first-time use, guide the user to provide information and save it. First ask whether the copyright owner is an individual or an enterprise, then collect corresponding information.
For individuals, required information: Name, ID Card Number, Address, Postal Code, Contact Person, Phone Number, Email.
For enterprises, required complete industrial and commercial information (refer to the "Copyright Owner Information" section in requirements.md): Full Company Name, Unified Social Credit Code, Enterprise Type, Legal Representative, Registered Capital, Domicile Address, Registration Authority, Business License Registration Date, Contact Person, Phone Number, Email.
After collecting the information, save it as
in the following format:
json
{
"type": "Enterprise",
"name": "Star Technology (Beijing) Co., Ltd.",
"credit_code": "91110108MA01EXAMPLE",
"enterprise_type": "Limited Liability Company",
"legal_representative": "Zhang San",
"registered_capital": "Five Million Yuan",
"address": "No.1, Zhongguancun Street, Haidian District, Beijing",
"registration_authority": "Haidian District Market Supervision and Administration Bureau of Beijing",
"license_date": "June 15, 2022",
"contact": "",
"phone": "",
"email": ""
}
This file can be directly reused for subsequent applications, and the copyright owner information only needs to be filled in once.
Round 2: Key Software Parameters
Automatically analyze the project and pre-fill suggested values for the user to confirm:
| Parameter | Description |
|---|
| Full Software Name | Must end with "Software" (e.g., "Smart Accounting Software"), with distinctiveness, and be completely consistent across all documents. If the name provided by the user does not end with "Software", automatically append it |
| Version Number | V1.0 (Unified use for first-time applications) |
| Development Completion Date | Actual date when software development was completed |
| First Publication Date | Date when the software was first launched/published (≥ Development Completion Date) |
| Source Code Volume | Actual total number of code lines in the project (can be automatically counted and confirmed by the user) |
Date Constraints: Development Completion Date ≤ First Publication Date < Application Date. Automatically verify during generation and remind the user to modify if invalid.
Step 2: Project Analysis and Source Code Generation
Run
scripts/analyze_and_generate_source.py
to complete project analysis and source code .tex file generation:
bash
python3 scripts/analyze_and_generate_source.py <project-path> \
--name "Full Software Name" \
--version "V1.0" \
--owner "Copyright Owner Name" \
--date "April 30, 2025" \
--output copyright-materials/
The script automatically completes:
- Detect project type (WeChat Mini Program/Web/Node.js, etc.)
- Traverse code files, exclude irrelevant directories such as node_modules
- Count valid code lines (exclude blank lines and pure comment lines), output line count distribution by file type
- Sort by file priority, extract first 30 pages + last 30 pages of code after removing blank lines, generate source code .tex file
- Output for reference in subsequent document generation
Typesetting Experience Values (10pt +
Verbatim + 2cm top/bottom margins, 1.5cm left/right margins, calibrated based on actual measurement):
| Parameter | Value | Description |
|---|
| Standard Page Capacity | 50 lines/page | Number of code lines per full page |
| First Page Capacity | 40 lines | Title area occupies about 10 lines of space |
| First Page of Last 30 Pages | 48 lines | Separator title occupies about 2 lines of space |
| Target for First 30 Pages | 1490 lines | 40 + 29×50 |
| Target for Last 30 Pages | 1498 lines | 48 + 29×50 |
| Total Target | 2988 lines | Number of code lines after removing blank lines |
If the code volume is less than 2988 lines, the script uses all code and does not force it to 60 pages.
The
output by the script is the "Source Code Volume" in the application form.
Step 3: Generate Four Documents
LaTeX writing specifications for all documents can be found in
references/requirements.md. Templates for each document are in the corresponding
template files in the references directory.
Output Folder and Naming
Create the directory structure before generating documents:
bash
mkdir -p copyright-materials/images
File naming convention: "Full Software Name + Document Type", example:
Smart Accounting Software Copyright Registration Application Form.tex
/
Smart Accounting Software Source Code.tex
/
Smart Accounting Software User Manual.tex
/
Smart Accounting Software Design Specification.tex
/
- (Image directory, where users will place screenshots later)
3.1 Copyright Registration Application Form
Template: application-form-template.tex
Format Requirements:
- documentclass:
- Use environment for tables
- Divided into: Basic Information, Copyright Owner Information, Developer Information, Software and Hardware Environment Information, Basic Software Information, Software Technical Features, Software Function Introduction, Remarks
- Strict word count limits for application form fields (see the "Word Count Limits" section in requirements.md), must be verified after generation
Quick Reference for Word Count Limits:
- Hardware Environment/Operating System/Development Tools/Running Platform/Support Environment: Each ≤50 characters
- Development Purpose/Target Field: Each ≤50 words
- Main Functions: ≤200 words
- Technical Features: ≤100 words
3.2 Source Code
Automatically generated by the script in Step 2, no manual writing required. Generation rules can be found in the "Source Code Document Requirements" section of requirements.md.
3.3 User Manual
Template: user-manual-template.tex
Content Structure:
- Software Introduction (Overview + Main Features)
- Function Overview (Function List + Application Scenarios)
- Installation and Usage Instructions (System Requirements + Access Method + Login Instructions)
- Main Function Instructions (Operation steps for each function, with screenshots)
- Notes
- Technical Support
Screenshot Requirements:
- Define the
\screenshot{filename}{title}
macro with width 0.35\textwidth
- For screenshots not yet provided, still place the call in LaTeX
- Output a screenshot list at the same time (see Step 4)
3.4 Design Specification
Template: design-doc-template.tex
Content Structure:
- Software Overview (Introduction + Development Background + Design Objectives)
- Requirements Analysis (Functional/Performance/Security Requirements)
- Overall Design (System Architecture + Module Division + Technology Selection + Running Environment)
- Detailed Design (Functions and processing flow of each module, with screenshots)
- Data Structure Design
- Interface Design (Internal Interfaces + External API List)
- Interface Design (with screenshots)
- Security Design
- Test Design
Step 4: Screenshot Management
Analyze project code (page files, pop-up components, modal boxes, etc.) to generate the screenshot list
:
| No. | File Name | Description | Trigger Method | Usage Location |
|------|--------|------|----------|----------|
| 01 | Figure1-Homepage Empty State.png | Homepage empty state | First entry to homepage | User Manual §3, Design Specification §4.1 |
| 02 | Figure2-Search Result List.png | Search results | Enter keywords to search | User Manual §4.1, Design Specification §4.1 |
The
\screenshot{filename}{title}
macro in LaTeX documents has a built-in
path prefix. Users only need to place screenshots in the
directory with filenames consistent with those in the list, and they will be automatically found during compilation.
Assign Screenshot Task to User
After the initial version of the documents is generated,
pause the automatic process and output the following operation guide to the user (replace
with the actual path):
The initial version of all documents has been generated. Next, you need to manually capture screenshots of the software interface.
Screenshot save path:
<output directory>/images/
Please follow the screenshot list above to capture the corresponding software interface screenshots one by one and save them to this directory. Keep the file names consistent with the "File Name" column in the list (e.g.,
).
Please let me know after adding all screenshots, and I will recompile all documents to generate the final PDF.
Continue to Step 5 (Compilation) and Step 6 (Verification) after the user confirms that screenshots are completed.
Step 5: Compilation Script
Generate
, template can be found in
references/build-script-template.sh.
Key Points of the Script:
- Set PATH to include TeX path
- Compile each .tex file twice (to ensure correct page number references)
- Clean up temporary files such as .aux/.log/.out
- Output the file size of each PDF
Step 6: Consistency Check
After generating all documents, automatically verify the following content and output a verification report:
| Verification Item | Verification Location |
|---|
| Full Software Name | Application form, source code header and first page, user manual title/header, design specification title/header |
| Version Number | Headers and main text of all documents |
| Source Code Volume | Number in application form = Number marked on the first page of the source code document |
| Copyright Owner Name | First page of each document |
| Date | Dates referenced in each document are consistent |
| Word Count Limits | All fields in the application form do not exceed limits |
Output "✓ Consistency Check Passed" if verified successfully, otherwise list inconsistent items.
Unified LaTeX Typesetting Specifications
The following specifications apply to the application form, user manual, and design specification (source code documents are exceptions with dedicated specifications):
Page Settings
latex
\documentclass[a4paper,12pt]{article}
\usepackage[UTF8,heading=true]{ctex}
\usepackage[top=2.5cm,bottom=2.5cm,left=2.5cm,right=2.5cm]{geometry}
Header and Footer
latex
\pagestyle{fancy}
\fancyhf{}
\fancyhead[C]{Full Software NameV1.0\quad Document Type}
\fancyfoot[C]{Page \thepage\quad Total \pageref{LastPage} Pages}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0.5pt}
\fancypagestyle{plain}{\pagestyle{fancy}}
Header format:
Full Software NameVVersion Number Document Type
(e.g., Smart Accounting SoftwareV1.0 User Manual)
Footer format:
Both header and footer have separators (0.5pt)
Chinese Typesetting
latex
\setlength{\parindent}{2em} % First-line indent of 2 characters
\setlength{\parskip}{0.3em}
\renewcommand{\baselinestretch}{1.3} % 1.3 line spacing
Lists
latex
\begin{itemize}[leftmargin=2em]
\begin{enumerate}[leftmargin=2em]
Screenshot Macro
Set the image search path in the document preamble and define the screenshot macro:
latex
\graphicspath{{images/}}
\newcommand{\screenshot}[2]{%
\begin{figure}[H]
\centering
\includegraphics[width=0.35\textwidth]{#1}
\caption{#2}
\end{figure}
}
When calling, just use
\screenshot{Figure1-Homepage.png}{Homepage}
, and LaTeX will automatically find the image file in the
directory.
First Page Structure of Documents
Unified format for the first page of each document:
latex
\begin{center}
{\LARGE\bfseries Full Software Name\quad Document Type}
\vspace{0.8em}
{\large Copyright Owner: Full Company Name}
\vspace{0.3em}
Software Version: V1.0\qquad Release Date: YYYY-M-D
\end{center}
Special Project Type Handling
WeChat Mini Program
- Software Category: Mobile Application Software — Mini Program
- Running Platform: iOS, Android, Windows, macOS, HarmonyOS (WeChat Client)
- Running Support Environment: WeChat Client (any version that supports Mini Programs)
- Technical Feature Type Selection: Mini Program
Web Application
- Software Category: Application Software — Web Application
- Running Platform: Windows, macOS, Linux (Browser)
- Running Support Environment: Browsers such as Chrome/Firefox/Safari
Mobile App
- Software Category: Mobile Application Software — App
- Running Platform: List according to actual support (iOS/Android/HarmonyOS, etc.)
Cross-Platform Projects
- Electron Application: Windows, macOS, Linux
- Flutter/React Native: iOS, Android (add Windows, macOS, Linux if desktop support is available)
LaTeX Environment Dependencies
Environment check and installation process can be found in "Step 0".
Required Packages: ctex, xecjk, fancyhdr, lastpage, fancyvrb, tabularx, enumitem, float, xcolor, longtable, graphicx, hyperref, array, geometry
Compilation Command:
xelatex -interaction=nonstopmode filename.tex
(run twice)
Reference Documents
- Detailed Application Requirements
- LaTeX Template for Application Form
- LaTeX Template for Source Code
- LaTeX Template for User Manual
- LaTeX Template for Design Specification
- Compilation Script Template