Lab Report Writer
Generate professional, low-plagiarism lab reports with proper structure, data analysis, and references.
What This Skill Does
- Three input modes: From topic/description → full report; From raw data → analysis + report; From draft → improvement & formatting
- Covers all report types: University course labs, scientific research, engineering tests, medical/material experiments
- Auto-research: WebSearch for theoretical background, related work, and real citable references
- Data processing: Tables, charts (line/scatter/bar with error bars), uncertainty propagation, least-squares fitting
- Low plagiarism: Original writing throughout, proper paraphrasing, no copy-paste
- Multiple output formats: docx (with tables/charts/formulas) or markdown, user's choice
Prerequisites
- Node.js 18+ (for docx generation via npm
docx package)
- If docx output:
docx npm package must be available (npm list -g docx or project-local)
- For charts: Python 3 with matplotlib, OR use ASCII/markdown tables as fallback
Level 2: Quick Start
Interactive Launch
When the user mentions writing a lab report, experiment report, or test report, start the interactive flow:
/lab-report
The skill will ask clarifying questions via AskUserQuestion before generating anything.
Level 3: Detailed Instructions
Step 1: Interactive Questionnaire
Use AskUserQuestion to collect the following information. Ask in 1-2 rounds (max 4 questions per round).
Round 1 — Core Parameters
| Question |
Header |
Options |
Notes |
| Report type? |
报告类型 |
高校课程实验, 科研实验报告, 工程测试报告, 医学/材料实验 |
Multi-select OK |
| Input mode? |
输入模式 |
从题目/描述生成, 从实验数据生成, 从草稿改进 |
Determines workflow |
| Output format? |
输出格式 |
Word文档(docx), Markdown(md), 同时输出docx+md |
User picks |
| Target word count? |
字数要求 |
2000-5000字, 5000-8000字, 8000-15000字, 不限 |
Guides depth |
Round 2 — Content Details (adapt based on Round 1 answers)
| Question |
Header |
When to Ask |
| What is the experiment topic/title? |
实验题目 |
Input mode = topic |
| What course/subject is this for? |
课程/学科 |
University course type |
| Do you have raw data files? (provide paths) |
数据文件 |
Input mode = data |
| Do you have a draft file? (provide path) |
草稿文件 |
Input mode = draft |
| What sections do you need? |
报告章节 |
If non-standard structure needed |
| Any specific formatting requirements? |
格式要求 |
If user mentions rubric/grading criteria |
Step 2: Load Grading Criteria (If Provided)
If the user provides a grading rubric file path (e.g., 成绩评定表.docx):
- Read the file using
textutil -convert txt -stdout (macOS) or Python
- Extract scoring dimensions and weights
- Align the report structure and content depth to maximize score on each dimension
- Store extracted criteria in memory for self-check at the end
Step 3: Research Phase
Execute WebSearch queries to gather:
- Theoretical background: Core principles, equations, mechanisms
- Related work: Key papers, review articles, textbook references
- Reference literature: Real, verifiable sources with complete bibliographic info
Search strategy:
- Start broad:
"[topic] 实验原理 综述" or "[topic] experiment principle review"
- Then specific:
"[topic] 数据处理 误差分析" or "[topic] data analysis uncertainty"
- For references:
"[author] [key term]" IEEE/Sensors/Review to find specific papers
- Run 10-20 searches for thorough coverage; 5-8 for shorter reports
Critical: Record every search result that yields a usable reference. Do NOT fabricate references.
Step 4: Section Template Selection
Based on report type, select the appropriate section template from Section Templates below.
Step 5: Data Processing (If Applicable)
If the user provides experimental data:
- Read data: CSV via
Read, Excel via Python, or JSON directly
- Generate tables: Format as markdown tables in the report; for docx, use Table objects
- Compute statistics: Mean, standard deviation, relative error
- Uncertainty propagation: Apply formula Δy = √(Σ(∂y/∂xi · Δxi)²)
- Curve fitting: Linear least-squares y = ax + b with R², or polynomial if needed
- Charts: Generate using matplotlib (save as PNG) or describe as ASCII for markdown
For data processing code, use Python via Bash:
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
# ... analysis code ...
Step 6: Write the Report
Write section by section, following these principles:
Low-Plagiarism Writing Rules
- Original phrasing: Never copy sentences from sources. Read, understand, rephrase in your own words.
- Structure variation: Don't follow the exact paragraph structure of any single source.
- Specific details: Include concrete numbers, formulas, and technical terms — generic text is more likely to match existing content.
- Personal analysis: The "discussion/analysis" section should reflect independent reasoning, not paraphrased conclusions.
- Chinese-English mixing: For Chinese reports, mixing technical terms in English (with Chinese explanation) naturally lowers similarity scores.
Section Writing Order
Recommended order for efficiency:
- Write the body sections first (principle, procedure, data, analysis)
- Then introduction and conclusion (these frame the body)
- Then abstract (summarizes everything)
- Finally compile references
Step 7: Format and Generate Output
For docx output:
Use Node.js with the docx npm package. Generate using a script:
const docx = require("docx");
const { Document, Packer, Paragraph, TextRun, AlignmentType, Table, ... } = docx;
// Build document with proper formatting
// Font: SimSun (宋体) body, SimHei (黑体) headings, KaiTi (楷体) abstract
// Line spacing: 1.5x (360 twips)
// Margins: 2.54cm top/bottom, 3.17cm left/right
// First-line indent: 2 characters (~480 twips)
Find the docx module path:
# Check global install
npm list -g docx 2>/dev/null
# Use NODE_PATH when running
NODE_PATH=$(npm root -g) node generate-report.js
For markdown output:
Write directly with Write tool. Include:
- YAML frontmatter with title, author, date
- Proper heading hierarchy
- Markdown tables for data
- Math notation with
$...$ or $$...$$
- Image references for charts
Step 8: Self-Check Against Grading Criteria
If grading criteria were loaded, verify:
| Dimension |
Self-Check |
| Format & language |
Correct font, spacing, margins? No typos? |
| Abstract quality |
Covers all sections? Concise and readable? |
| Introduction depth |
Sufficient background research? Clear motivation? |
| Logic & evidence |
Arguments supported by data? Smooth transitions? |
| Conclusion validity |
Follows from analysis? No overclaims? |
| Personal insight |
Unique observations? Own perspective? |
Step 9: Deliver
- Save output file to the user's specified location (default:
~/Desktop/)
- Report word count (Chinese characters + English terms)
- List any manual edits needed (e.g., author name, school info)
- Clean up temporary files (generation scripts, intermediate data)
Section Templates
Template A: University Course Lab Report
| # |
Section |
Content |
Font Style |
| - |
Title |
Experiment name + descriptive subtitle |
SimHei, 小二号, bold, centered |
| - |
Author info |
Name, student ID, department |
KaiTi, 小四号, centered |
| 1 |
Abstract |
150-300 words summarizing purpose, method, results, conclusion |
KaiTi, 小四号 |
| 2 |
Introduction |
Background, motivation, objectives |
SimSun, 小四号 |
| 3 |
Theoretical Principles |
Core theory, equations (numbered), diagrams |
SimSun, 小四号 |
| 4 |
Apparatus & Materials |
Equipment list with model/specs, materials |
SimSun, 小四号 |
| 5 |
Experimental Procedure |
Step-by-step, parameter settings, precautions |
SimSun, 小四号 |
| 6 |
Data & Results |
Raw data tables, processed results, charts |
SimSun, 小四号 |
| 7 |
Analysis & Discussion |
Error analysis, comparison with theory, uncertainty |
SimSun, 小四号 |
| 8 |
Conclusion |
Summary of findings, answers to objectives |
SimSun, 小四号 |
| 9 |
Reflections |
Personal insights, suggestions for improvement |
SimSun, 小四号 |
| - |
References |
GB/T 7714 format, [1][2]... numbered |
SimSun, 五号 |
Template B: Scientific Research Report
| # |
Section |
Content |
| - |
Title |
Descriptive, concise |
| - |
Authors & Affiliations |
Name, institution, email |
| 1 |
Abstract |
Background, method, key results, significance |
| 2 |
Introduction |
Literature review, gap identification, research questions |
| 3 |
Materials & Methods |
Detailed methodology, reproducibility focus |
| 4 |
Results |
Data presentation, statistical analysis, figures |
| 5 |
Discussion |
Interpretation, limitations, comparison with literature |
| 6 |
Conclusion |
Key findings, implications, future directions |
| - |
Acknowledgments |
Funding, assistance |
| - |
References |
GB/T 7714 or APA format |
Template C: Engineering Test Report
| # |
Section |
Content |
| - |
Title |
Test item + test type |
| - |
Test Info |
Date, location, personnel, equipment |
| 1 |
Test Objective |
Purpose, acceptance criteria |
| 2 |
Test Method |
Standard followed, procedure, parameters |
| 3 |
Test Environment |
Conditions, instrumentation, calibration |
| 4 |
Test Data |
Raw measurements, calculated results |
| 5 |
Data Analysis |
Statistical treatment, comparison with spec |
| 6 |
Conclusions |
Pass/fail, compliance assessment |
| - |
Appendices |
Raw data, calibration certificates |
Template D: Medical/Material Experiment Report
| # |
Section |
Content |
| 1 |
Abstract |
Structured: background, methods, results, conclusion |
| 2 |
Introduction |
Clinical/scientific context, research gap |
| 3 |
Materials |
Sample prep, reagents, instruments |
| 4 |
Methods |
Experimental protocol, controls, ethical approval |
| 5 |
Results |
Quantitative data, statistical tests, figures |
| 6 |
Discussion |
Clinical/scientific significance, limitations |
| 7 |
Conclusion |
Key findings, translational implications |
Reference Format Guide (GB/T 7714)
Journal Article
[1] Author1, Author2, Author3. Title[J]. Journal Name, Year, Volume(Issue): Pages.
Example:
[1] Smith C S. Piezoresistance effect in germanium and silicon[J]. Physical Review, 1954, 94(1): 42-49.
Book/Monograph
[2] Author. Title[M]. Edition. Place: Publisher, Year: Pages.
Conference Paper
[3] Author1, Author2. Title[C]//Conference Name. Place: Publisher, Year: Pages.
Technical Report
[4] Author/Organization. Title[R]. Place: Institution, Year.
Online Resource
[5] Author. Title[EB/OL]. (Date)[Cite Date]. URL.
Data Sheet / Standard
[6] Organization. Title[Z]. Place: Organization, Year.
Error Analysis Formulas
Direct Measurement Uncertainty
Type A (statistical):
$$u_A = \sqrt{\frac{\sum_{i=1}^{n}(x_i - \bar{x})^2}{n(n-1)}}$$
Type B (instrument):
$$u_B = \frac{\Delta_{instr}}{\sqrt{3}}$$ (uniform distribution)
Combined standard uncertainty:
$$u_c = \sqrt{u_A^2 + u_B^2}$$
Expanded uncertainty (k=2 for 95% confidence):
$$U = k \cdot u_c = 2u_c$$
Indirect Measurement (Propagation)
If $y = f(x_1, x_2, ..., x_n)$:
$$u_c(y) = \sqrt{\sum_{i=1}^{n}\left(\frac{\partial f}{\partial x_i}\right)^2 u_c^2(x_i)}$$
Linear Least-Squares Fit
For $y = ax + b$:
$$a = \frac{n\sum x_iy_i - \sum x_i\sum y_i}{n\sum x_i^2 - (\sum x_i)^2}$$
$$b = \frac{\sum y_i - a\sum x_i}{n}$$
$$R^2 = \frac{(n\sum x_iy_i - \sum x_i\sum y_i)^2}{[n\sum x_i^2 - (\sum x_i)^2][n\sum y_i^2 - (\sum y_i)^2]}$$
Relative Error
$$\delta = \frac{|x_{measured} - x_{true}|}{x_{true}} \times 100%$$
Chart Generation Guidelines
Using Python + matplotlib
import matplotlib
matplotlib.use('Agg') # Non-interactive backend
import matplotlib.pyplot as plt
import numpy as np
# Configure for Chinese labels
plt.rcParams['font.sans-serif'] = ['Arial Unicode MS', 'SimHei', 'Heiti TC']
plt.rcParams['axes.unicode_minus'] = False
# Example: Line chart with error bars
fig, ax = plt.subplots(figsize=(8, 5))
x = np.array([1, 2, 3, 4, 5])
y = np.array([2.1, 3.8, 6.2, 7.9, 10.1])
y_err = np.array([0.2, 0.3, 0.2, 0.4, 0.3])
ax.errorbar(x, y, yerr=y_err, fmt='o-', capsize=4, label='Measured')
ax.set_xlabel('Independent Variable')
ax.set_ylabel('Dependent Variable')
ax.set_title('Experiment Results')
ax.legend()
ax.grid(True, alpha=0.3)
plt.tight_layout()
plt.savefig('chart.png', dpi=200)
print("Chart saved: chart.png")
Chart Types by Data
| Data Type |
Chart Type |
matplotlib Function |
| Single variable vs parameter |
Line chart |
plot() + errorbar() |
| Two variables correlation |
Scatter plot |
scatter() |
| Categorical comparison |
Bar chart |
bar() |
| Distribution |
Histogram |
hist() |
| Time series |
Line chart |
plot() |
Troubleshooting
Issue: docx npm module not found
Solution: Find the global install path and set NODE_PATH:
npm list -g docx # Find install location
NODE_PATH=$(npm root -g) node generate-report.js
Issue: Chinese fonts not rendering in docx
Solution: Use standard font names: SimSun (宋体), SimHei (黑体), KaiTi (楷体). On macOS, these may render as fallback — the document will display correctly on Windows with Office.
Issue: matplotlib Chinese characters show as boxes
Solution: Add font configuration:
plt.rcParams['font.sans-serif'] = ['Arial Unicode MS', 'SimHei', 'Heiti TC']
Issue: WebSearch returns no results
Solution: Try English queries, simplify terms, search for specific author+keyword combinations. Fall back to general knowledge if needed (mark references as "[待核实]").
Issue: Data file format not recognized
Solution: For Excel (.xlsx), use Python with openpyxl or pandas. For .csv, use Read tool directly.
Related Skills
- kimi-webbridge: For web research when WebSearch is disabled or insufficient
- ui-styling: For chart styling and visual design
- design: For report cover page or presentation-quality figures
1---2name: lab-report-writer3description: Generate professional lab reports for university courses, scientific research, engineering tests, and medical/material experiments. Supports three input modes (topic/raw data/draft improvement), auto-research with WebSearch, data tables & chart generation, error analysis, and output as docx/markdown. Use when writing experiment reports, lab reports, test reports, or any structured scientific/technical document. Triggers: lab report, experiment report, test report, experimental report, write report, generate report.4---56# Lab Report Writer78Generate professional, low-plagiarism lab reports with proper structure, data analysis, and references.910## What This Skill Does11121. **Three input modes**: From topic/description → full report; From raw data → analysis + report; From draft → improvement & formatting132. **Covers all report types**: University course labs, scientific research, engineering tests, medical/material experiments143. **Auto-research**: WebSearch for theoretical background, related work, and real citable references154. **Data processing**: Tables, charts (line/scatter/bar with error bars), uncertainty propagation, least-squares fitting165. **Low plagiarism**: Original writing throughout, proper paraphrasing, no copy-paste176. **Multiple output formats**: docx (with tables/charts/formulas) or markdown, user's choice1819## Prerequisites2021- Node.js 18+ (for docx generation via npm `docx` package)22- If docx output: `docx` npm package must be available (`npm list -g docx` or project-local)23- For charts: Python 3 with matplotlib, OR use ASCII/markdown tables as fallback2425---2627## Level 2: Quick Start2829### Interactive Launch3031When the user mentions writing a lab report, experiment report, or test report, start the interactive flow:3233```34/lab-report35```3637The skill will ask clarifying questions via AskUserQuestion before generating anything.3839---4041## Level 3: Detailed Instructions4243### Step 1: Interactive Questionnaire4445Use AskUserQuestion to collect the following information. Ask in 1-2 rounds (max 4 questions per round).4647#### Round 1 — Core Parameters4849| Question | Header | Options | Notes |50|----------|--------|---------|-------|51| Report type? | 报告类型 | 高校课程实验, 科研实验报告, 工程测试报告, 医学/材料实验 | Multi-select OK |52| Input mode? | 输入模式 | 从题目/描述生成, 从实验数据生成, 从草稿改进 | Determines workflow |53| Output format? | 输出格式 | Word文档(docx), Markdown(md), 同时输出docx+md | User picks |54| Target word count? | 字数要求 | 2000-5000字, 5000-8000字, 8000-15000字, 不限 | Guides depth |5556#### Round 2 — Content Details (adapt based on Round 1 answers)5758| Question | Header | When to Ask |59|----------|--------|-------------|60| What is the experiment topic/title? | 实验题目 | Input mode = topic |61| What course/subject is this for? | 课程/学科 | University course type |62| Do you have raw data files? (provide paths) | 数据文件 | Input mode = data |63| Do you have a draft file? (provide path) | 草稿文件 | Input mode = draft |64| What sections do you need? | 报告章节 | If non-standard structure needed |65| Any specific formatting requirements? | 格式要求 | If user mentions rubric/grading criteria |6667### Step 2: Load Grading Criteria (If Provided)6869If the user provides a grading rubric file path (e.g., `成绩评定表.docx`):70711. Read the file using `textutil -convert txt -stdout` (macOS) or Python722. Extract scoring dimensions and weights733. Align the report structure and content depth to maximize score on each dimension744. Store extracted criteria in memory for self-check at the end7576### Step 3: Research Phase7778Execute WebSearch queries to gather:79801. **Theoretical background**: Core principles, equations, mechanisms812. **Related work**: Key papers, review articles, textbook references823. **Reference literature**: Real, verifiable sources with complete bibliographic info8384Search strategy:85- Start broad: `"[topic] 实验原理 综述"` or `"[topic] experiment principle review"`86- Then specific: `"[topic] 数据处理 误差分析"` or `"[topic] data analysis uncertainty"`87- For references: `"[author] [key term]" IEEE/Sensors/Review` to find specific papers88- Run 10-20 searches for thorough coverage; 5-8 for shorter reports8990**Critical**: Record every search result that yields a usable reference. Do NOT fabricate references.9192### Step 4: Section Template Selection9394Based on report type, select the appropriate section template from [Section Templates](#section-templates) below.9596### Step 5: Data Processing (If Applicable)9798If the user provides experimental data:991001. **Read data**: CSV via `Read`, Excel via Python, or JSON directly1012. **Generate tables**: Format as markdown tables in the report; for docx, use Table objects1023. **Compute statistics**: Mean, standard deviation, relative error1034. **Uncertainty propagation**: Apply formula Δy = √(Σ(∂y/∂xi · Δxi)²)1045. **Curve fitting**: Linear least-squares y = ax + b with R², or polynomial if needed1056. **Charts**: Generate using matplotlib (save as PNG) or describe as ASCII for markdown106107For data processing code, use Python via Bash:108```python109import numpy as np110import matplotlib111matplotlib.use('Agg')112import matplotlib.pyplot as plt113# ... analysis code ...114```115116### Step 6: Write the Report117118Write section by section, following these principles:119120#### Low-Plagiarism Writing Rules1211221. **Original phrasing**: Never copy sentences from sources. Read, understand, rephrase in your own words.1232. **Structure variation**: Don't follow the exact paragraph structure of any single source.1243. **Specific details**: Include concrete numbers, formulas, and technical terms — generic text is more likely to match existing content.1254. **Personal analysis**: The "discussion/analysis" section should reflect independent reasoning, not paraphrased conclusions.1265. **Chinese-English mixing**: For Chinese reports, mixing technical terms in English (with Chinese explanation) naturally lowers similarity scores.127128#### Section Writing Order129130Recommended order for efficiency:1311. Write the body sections first (principle, procedure, data, analysis)1322. Then introduction and conclusion (these frame the body)1333. Then abstract (summarizes everything)1344. Finally compile references135136### Step 7: Format and Generate Output137138#### For docx output:139140Use Node.js with the `docx` npm package. Generate using a script:141142```javascript143const docx = require("docx");144const { Document, Packer, Paragraph, TextRun, AlignmentType, Table, ... } = docx;145// Build document with proper formatting146// Font: SimSun (宋体) body, SimHei (黑体) headings, KaiTi (楷体) abstract147// Line spacing: 1.5x (360 twips)148// Margins: 2.54cm top/bottom, 3.17cm left/right149// First-line indent: 2 characters (~480 twips)150```151152Find the `docx` module path:153```bash154# Check global install155npm list -g docx 2>/dev/null156# Use NODE_PATH when running157NODE_PATH=$(npm root -g) node generate-report.js158```159160#### For markdown output:161162Write directly with `Write` tool. Include:163- YAML frontmatter with title, author, date164- Proper heading hierarchy165- Markdown tables for data166- Math notation with `$...$` or `$$...$$`167- Image references for charts168169### Step 8: Self-Check Against Grading Criteria170171If grading criteria were loaded, verify:172173| Dimension | Self-Check |174|-----------|------------|175| Format & language | Correct font, spacing, margins? No typos? |176| Abstract quality | Covers all sections? Concise and readable? |177| Introduction depth | Sufficient background research? Clear motivation? |178| Logic & evidence | Arguments supported by data? Smooth transitions? |179| Conclusion validity | Follows from analysis? No overclaims? |180| Personal insight | Unique observations? Own perspective? |181182### Step 9: Deliver1831841. Save output file to the user's specified location (default: `~/Desktop/`)1852. Report word count (Chinese characters + English terms)1863. List any manual edits needed (e.g., author name, school info)1874. Clean up temporary files (generation scripts, intermediate data)188189---190191## Section Templates192193### Template A: University Course Lab Report194195| # | Section | Content | Font Style |196|---|---------|---------|------------|197| - | Title | Experiment name + descriptive subtitle | SimHei, 小二号, bold, centered |198| - | Author info | Name, student ID, department | KaiTi, 小四号, centered |199| 1 | Abstract | 150-300 words summarizing purpose, method, results, conclusion | KaiTi, 小四号 |200| 2 | Introduction | Background, motivation, objectives | SimSun, 小四号 |201| 3 | Theoretical Principles | Core theory, equations (numbered), diagrams | SimSun, 小四号 |202| 4 | Apparatus & Materials | Equipment list with model/specs, materials | SimSun, 小四号 |203| 5 | Experimental Procedure | Step-by-step, parameter settings, precautions | SimSun, 小四号 |204| 6 | Data & Results | Raw data tables, processed results, charts | SimSun, 小四号 |205| 7 | Analysis & Discussion | Error analysis, comparison with theory, uncertainty | SimSun, 小四号 |206| 8 | Conclusion | Summary of findings, answers to objectives | SimSun, 小四号 |207| 9 | Reflections | Personal insights, suggestions for improvement | SimSun, 小四号 |208| - | References | GB/T 7714 format, [1][2]... numbered | SimSun, 五号 |209210### Template B: Scientific Research Report211212| # | Section | Content |213|---|---------|---------|214| - | Title | Descriptive, concise |215| - | Authors & Affiliations | Name, institution, email |216| 1 | Abstract | Background, method, key results, significance |217| 2 | Introduction | Literature review, gap identification, research questions |218| 3 | Materials & Methods | Detailed methodology, reproducibility focus |219| 4 | Results | Data presentation, statistical analysis, figures |220| 5 | Discussion | Interpretation, limitations, comparison with literature |221| 6 | Conclusion | Key findings, implications, future directions |222| - | Acknowledgments | Funding, assistance |223| - | References | GB/T 7714 or APA format |224225### Template C: Engineering Test Report226227| # | Section | Content |228|---|---------|---------|229| - | Title | Test item + test type |230| - | Test Info | Date, location, personnel, equipment |231| 1 | Test Objective | Purpose, acceptance criteria |232| 2 | Test Method | Standard followed, procedure, parameters |233| 3 | Test Environment | Conditions, instrumentation, calibration |234| 4 | Test Data | Raw measurements, calculated results |235| 5 | Data Analysis | Statistical treatment, comparison with spec |236| 6 | Conclusions | Pass/fail, compliance assessment |237| - | Appendices | Raw data, calibration certificates |238239### Template D: Medical/Material Experiment Report240241| # | Section | Content |242|---|---------|---------|243| 1 | Abstract | Structured: background, methods, results, conclusion |244| 2 | Introduction | Clinical/scientific context, research gap |245| 3 | Materials | Sample prep, reagents, instruments |246| 4 | Methods | Experimental protocol, controls, ethical approval |247| 5 | Results | Quantitative data, statistical tests, figures |248| 6 | Discussion | Clinical/scientific significance, limitations |249| 7 | Conclusion | Key findings, translational implications |250251---252253## Reference Format Guide (GB/T 7714)254255### Journal Article256```257[1] Author1, Author2, Author3. Title[J]. Journal Name, Year, Volume(Issue): Pages.258```259Example:260```261[1] Smith C S. Piezoresistance effect in germanium and silicon[J]. Physical Review, 1954, 94(1): 42-49.262```263264### Book/Monograph265```266[2] Author. Title[M]. Edition. Place: Publisher, Year: Pages.267```268269### Conference Paper270```271[3] Author1, Author2. Title[C]//Conference Name. Place: Publisher, Year: Pages.272```273274### Technical Report275```276[4] Author/Organization. Title[R]. Place: Institution, Year.277```278279### Online Resource280```281[5] Author. Title[EB/OL]. (Date)[Cite Date]. URL.282```283284### Data Sheet / Standard285```286[6] Organization. Title[Z]. Place: Organization, Year.287```288289---290291## Error Analysis Formulas292293### Direct Measurement Uncertainty294295**Type A (statistical)**:296$$u_A = \sqrt{\frac{\sum_{i=1}^{n}(x_i - \bar{x})^2}{n(n-1)}}$$297298**Type B (instrument)**:299$$u_B = \frac{\Delta_{instr}}{\sqrt{3}}$$ (uniform distribution)300301**Combined standard uncertainty**:302$$u_c = \sqrt{u_A^2 + u_B^2}$$303304**Expanded uncertainty** (k=2 for 95% confidence):305$$U = k \cdot u_c = 2u_c$$306307### Indirect Measurement (Propagation)308309If $y = f(x_1, x_2, ..., x_n)$:310$$u_c(y) = \sqrt{\sum_{i=1}^{n}\left(\frac{\partial f}{\partial x_i}\right)^2 u_c^2(x_i)}$$311312### Linear Least-Squares Fit313314For $y = ax + b$:315$$a = \frac{n\sum x_iy_i - \sum x_i\sum y_i}{n\sum x_i^2 - (\sum x_i)^2}$$316$$b = \frac{\sum y_i - a\sum x_i}{n}$$317$$R^2 = \frac{(n\sum x_iy_i - \sum x_i\sum y_i)^2}{[n\sum x_i^2 - (\sum x_i)^2][n\sum y_i^2 - (\sum y_i)^2]}$$318319### Relative Error320$$\delta = \frac{|x_{measured} - x_{true}|}{x_{true}} \times 100\%$$321322---323324## Chart Generation Guidelines325326### Using Python + matplotlib327328```python329import matplotlib330matplotlib.use('Agg') # Non-interactive backend331import matplotlib.pyplot as plt332import numpy as np333334# Configure for Chinese labels335plt.rcParams['font.sans-serif'] = ['Arial Unicode MS', 'SimHei', 'Heiti TC']336plt.rcParams['axes.unicode_minus'] = False337338# Example: Line chart with error bars339fig, ax = plt.subplots(figsize=(8, 5))340x = np.array([1, 2, 3, 4, 5])341y = np.array([2.1, 3.8, 6.2, 7.9, 10.1])342y_err = np.array([0.2, 0.3, 0.2, 0.4, 0.3])343344ax.errorbar(x, y, yerr=y_err, fmt='o-', capsize=4, label='Measured')345ax.set_xlabel('Independent Variable')346ax.set_ylabel('Dependent Variable')347ax.set_title('Experiment Results')348ax.legend()349ax.grid(True, alpha=0.3)350351plt.tight_layout()352plt.savefig('chart.png', dpi=200)353print("Chart saved: chart.png")354```355356### Chart Types by Data357358| Data Type | Chart Type | matplotlib Function |359|-----------|-----------|-------------------|360| Single variable vs parameter | Line chart | `plot()` + `errorbar()` |361| Two variables correlation | Scatter plot | `scatter()` |362| Categorical comparison | Bar chart | `bar()` |363| Distribution | Histogram | `hist()` |364| Time series | Line chart | `plot()` |365366---367368## Troubleshooting369370### Issue: docx npm module not found371**Solution**: Find the global install path and set NODE_PATH:372```bash373npm list -g docx # Find install location374NODE_PATH=$(npm root -g) node generate-report.js375```376377### Issue: Chinese fonts not rendering in docx378**Solution**: Use standard font names: SimSun (宋体), SimHei (黑体), KaiTi (楷体). On macOS, these may render as fallback — the document will display correctly on Windows with Office.379380### Issue: matplotlib Chinese characters show as boxes381**Solution**: Add font configuration:382```python383plt.rcParams['font.sans-serif'] = ['Arial Unicode MS', 'SimHei', 'Heiti TC']384```385386### Issue: WebSearch returns no results387**Solution**: Try English queries, simplify terms, search for specific author+keyword combinations. Fall back to general knowledge if needed (mark references as "[待核实]").388389### Issue: Data file format not recognized390**Solution**: For Excel (.xlsx), use Python with openpyxl or pandas. For .csv, use Read tool directly.391392---393394## Related Skills395396- **kimi-webbridge**: For web research when WebSearch is disabled or insufficient397- **ui-styling**: For chart styling and visual design398- **design**: For report cover page or presentation-quality figures