Citation manager

From bighardperson/computer-science-skills-collection · View interactive version

Citation manager is an AI agent skill from the GitHub repository bighardperson/computer-science-skills-collection. Add real references and standardize citations for research papers and theses. Supports CrossRef integration, multiple citation formats (APA/MLA/Chicago/GB-T), batch import, and auto-detection of citation needs.

How to use this skill

Skill file

Academic Citation Manager | 学术引用管理器

功能说明 | Function Description

【中文】

学术引用管理器是一个专业的科研论文引用管理工具,旨在为科研论文和毕业论文添加真实参考文献并规范引用标注。该工具支持多种国际通用的引用格式,包括APA、MLA、Chicago、GB/T 7714、IEEE、Harvard等,并与Crossref API集成以获取真实的文献元数据。

核心功能包括:

【English】

Academic Citation Manager is a professional research paper citation management tool designed to add real references and standardize citations for research papers and theses. The tool supports multiple internationally used citation formats, including APA, MLA, Chicago, GB/T 7714, IEEE, Harvard, etc., and integrates with Crossref API to retrieve authentic bibliographic metadata.

Core features include:

支持的引用格式 | Supported Citation Formats

【中文】

本工具支持以下主要引用格式:

APA 7th Edition

MLA 9th Edition

Chicago 17th Edition

GB/T 7714-2015

IEEE

Harvard

【English】

This tool supports the following major citation formats:

APA 7th Edition

MLA 9th Edition

Chicago 17th Edition

GB/T 7714-2015

IEEE

Harvard

使用方法 | Usage

【中文】

Python API 使用

from academic_citation_skill import AcademicCitationManager

# 创建管理器实例
manager = AcademicCitationManager()

# 方法1:通过DOI获取文献信息
doi = "10.1000/xyz123"
reference = manager.fetch_reference_by_doi(doi)
print(f"标题: {reference['title']}")
print(f"作者: {reference['authors']}")

# 方法2:通过ISBN获取图书信息
isbn = "9780262033848"
reference = manager.fetch_reference_by_isbn(isbn)

# 方法3:通过标题和作者搜索
results = manager.search_references(
    title="Artificial Intelligence",
    author="Russell",
    year=2020
)

# 添加到本地文献库
manager.add_to_library(reference)

# 生成文中引用
citation = manager.generate_citation(
    reference_id=reference['id'],
    style='apa',
    citation_type='author-date'
)
print(f"文中引用: {citation}")

# 生成参考文献列表
bibliography = manager.generate_bibliography(
    style='apa',
    sort_by='alphabetical'
)

# 检查引用完整性
issues = manager.check_citation_integrity(document_text="your document content")
for issue in issues:
    print(f"问题: {issue}")

# 格式转换
converted = manager.convert_citation_style(
    references=[reference],
    from_style='apa',
    to_style='ieee'
)

命令行使用

# 通过DOI获取文献信息
python academic_citation_skill.py --fetch-doi 10.1000/xyz123

# 通过ISBN获取图书信息
python academic_citation_skill.py --fetch-isbn 9780262033848

# 批量导入参考文献
python batch_import.py --input references.bib --format bibtex

# 格式转换
python format_converter.py --input apa_refs.txt --from-style apa --to-style ieee

# 检查引用完整性
python citation_checker.py --document paper.docx --bibliography refs.txt

# 生成参考文献列表
python academic_citation_skill.py --generate-bib --style apa --input citations.txt

集成到写作工作流

# 在LaTeX中使用
from academic_citation_skill import AcademicCitationManager

manager = AcademicCitationManager()

# 生成BibTeX格式
bibtex = manager.export_bibtex()
with open('references.bib', 'w') as f:
    f.write(bibtex)

# 在Word中使用
from academic_citation_skill import WordCitationPlugin

plugin = WordCitationPlugin()
plugin.insert_citation(reference_id="ref1", style="apa")
plugin.generate_bibliography(style="apa")

# 在Markdown中使用
from academic_citation_skill import MarkdownCitationFormatter

formatter = MarkdownCitationFormatter()
formatted_text = formatter.format_markdown(
    text="Your document with @[ref1] citations",
    style="apa"
)

【English】

Python API Usage

from academic_citation_skill import AcademicCitationManager

# Create manager instance
manager = AcademicCitationManager()

# Method 1: Fetch reference by DOI
doi = "10.1000/xyz123"
reference = manager.fetch_reference_by_doi(doi)
print(f"Title: {reference['title']}")
print(f"Authors: {reference['authors']}")

# Method 2: Fetch book information by ISBN
isbn = "9780262033848"
reference = manager.fetch_reference_by_isbn(isbn)

# Method 3: Search by title and author
results = manager.search_references(
    title="Artificial Intelligence",
    author="Russell",
    year=2020
)

# Add to local library
manager.add_to_library(reference)

# Generate in-text citation
citation = manager.generate_citation(
    reference_id=reference['id'],
    style='apa',
    citation_type='author-date'
)
print(f"In-text citation: {citation}")

# Generate bibliography list
bibliography = manager.generate_bibliography(
    style='apa',
    sort_by='alphabetical'
)

# Check citation integrity
issues = manager.check_citation_integrity(document_text="your document content")
for issue in issues:
    print(f"Issue: {issue}")

# Convert citation style
converted = manager.convert_citation_style(
    references=[reference],
    from_style='apa',
    to_style='ieee'
)

Command Line Usage

# Fetch reference by DOI
python academic_citation_skill.py --fetch-doi 10.1000/xyz123

# Fetch book information by ISBN
python academic_citation_skill.py --fetch-isbn 9780262033848

# Batch import references
python batch_import.py --input references.bib --format bibtex

# Format conversion
python format_converter.py --input apa_refs.txt --from-style apa --to-style ieee

# Check citation integrity
python citation_checker.py --document paper.docx --bibliography refs.txt

# Generate bibliography
python academic_citation_skill.py --generate-bib --style apa --input citations.txt

Integration into Writing Workflow

# Using with LaTeX
from academic_citation_skill import AcademicCitationManager

manager = AcademicCitationManager()

# Generate BibTeX format
bibtex = manager.export_bibtex()
with open('references.bib', 'w') as f:
    f.write(bibtex)

# Using with Word
from academic_citation_skill import WordCitationPlugin

plugin = WordCitationPlugin()
plugin.insert_citation(reference_id="ref1", style="apa")
plugin.generate_bibliography(style="apa")

# Using with Markdown
from academic_citation_skill import MarkdownCitationFormatter

formatter = MarkdownCitationFormatter()
formatted_text = formatter.format_markdown(
    text="Your document with @[ref1] citations",
    style="apa"
)

配置选项 | Configuration Options

【中文】

引用格式配置 (citation_styles.json)

主要配置项:

{
  "apa": {
    "name": "APA 7th Edition",
    "in_text": {
      "format": "parenthetical",
      "separator": ", ",
      "year_position": "after_author",
      "page_number_format": "p. {page}"
    },
    "bibliography": {
      "sort_by": "alphabetical",
      "author_format": "last_first",
      "title_format": "sentence_case",
      "doi_required": true,
      "url_format": "available_at"
    },
    "document_type_codes": {
      "book": "",
      "journal": "",
      "conference": "",
      "thesis": "",
      "report": ""
    }
  },
  "gbt7714": {
    "name": "GB/T 7714-2015",
    "in_text": {
      "format": "numeric_bracket",
      "separator": ", ",
      "prefix": "[",
      "suffix": "]"
    },
    "bibliography": {
      "sort_by": "citation_order",
      "author_format": "chinese_name_order",
      "document_type_codes": {
        "book": "[M]",
        "journal": "[J]",
        "conference": "[C]",
        "thesis": "[D]",
        "report": "[R]",
        "newspaper": "[N]"
      }
    },
    "chinese_authors": {
      "name_order": "last_first",
      "separator": ", "
    }
  }
}

Crossref API配置 (crossref_config.json)

{
  "api_base": "https://api.crossref.org",
  "endpoints": {
    "works": "/works",
    "journals": "/journals",
    "types": "/types",
    "fields": "/fields"
  },
  "rate_limiting": {
    "requests_per_second": 10,
    "backoff_strategy": "exponential",
    "max_retries": 3
  },
  "filters": {
    "default": {
      "has_full_text": true,
      "state": "active"
    },
    "journals": {
      "type": "journal-article"
    },
    "books": {
      "type": "monograph"
    }
  },
  "cache": {
    "enabled": true,
    "ttl_seconds": 86400,
    "max_size": 1000
  }
}

本地文献库配置 (reference_database.json)

{
  "metadata": {
    "version": "1.0.0",
    "created_date": "2026-03-01",
    "last_updated": "2026-03-01"
  },
  "references": {
    "ref_001": {
      "id": "ref_001",
      "type": "journal_article",
      "title": "Deep Learning",
      "authors": [
        {
          "given": "Yann",
          "family": "LeCun",
          "sequence": "first"
        },
        {
          "given": "Yoshua",
          "family": "Bengio",
          "sequence": "additional"
        }
      ],
      "container_title": "Nature",
      "volume": "521",
      "issue": "7553",
      "page": "436-444",
      "published_date": "2015-05-27",
      "year": 2015,
      "doi": "10.1038/nature14539",
      "issn": ["0028-0836", "1476-4687"],
      "language": "en",
      "tags": ["machine learning", "neural networks"]
    }
  },
  "citation_mappings": {
    "ref_001": [
      {"document_id": "doc1", "positions": [45, 89, 234]},
      {"document_id": "doc2", "positions": [12, 156]}
    ]
  }
}

【English】

Citation Style Configuration (citation_styles.json)

Main configuration items:

{
  "apa": {
    "name": "APA 7th Edition",
    "in_text": {
      "format": "parenthetical",
      "separator": ", ",
      "year_position": "after_author",
      "page_number_format": "p. {page}"
    },
    "bibliography": {
      "sort_by": "alphabetical",
      "author_format": "last_first",
      "title_format": "sentence_case",
      "doi_required": true,
      "url_format": "available_at"
    },
    "document_type_codes": {
      "book": "",
      "journal": "",
      "conference": "",
      "thesis": "",
      "report": ""
    }
  },
  "gbt7714": {
    "name": "GB/T 7714-2015",
    "in_text": {
      "format": "numeric_bracket",
      "separator": ", ",
      "prefix": "[",
      "suffix": "]"
    },
    "bibliography": {
      "sort_by": "citation_order",
      "author_format": "chinese_name_order",
      "document_type_codes": {
        "book": "[M]",
        "journal": "[J]",
        "conference": "[C]",
        "thesis": "[D]",
        "report": "[R]",
        "newspaper": "[N]"
      }
    },
    "chinese_authors": {
      "name_order": "last_first",
      "separator": ", "
    }
  }
}

Crossref API Configuration (crossref_config.json)

{
  "api_base": "https://api.crossref.org",
  "endpoints": {
    "works": "/works",
    "journals": "/journals",
    "types": "/types",
    "fields": "/fields"
  },
  "rate_limiting": {
    "requests_per_second": 10,
    "backoff_strategy": "exponential",
    "max_retries": 3
  },
  "filters": {
    "default": {
      "has_full_text": true,
      "state": "active"
    },
    "journals": {
      "type": "journal-article"
    },
    "books": {
      "type": "monograph"
    }
  },
  "cache": {
    "enabled": true,
    "ttl_seconds": 86400,
    "max_size": 1000
  }
}

Local Reference Database Configuration (reference_database.json)

{
  "metadata": {
    "version": "1.0.0",
    "created_date": "2026-03-01",
    "last_updated": "2026-03-01"
  },
  "references": {
    "ref_001": {
      "id": "ref_001",
      "type": "journal_article",
      "title": "Deep Learning",
      "authors": [
        {
          "given": "Yann",
          "family": "LeCun",
          "sequence": "first"
        },
        {
          "given": "Yoshua",
          "family": "Bengio",
          "sequence": "additional"
        }
      ],
      "container_title": "Nature",
      "volume": "521",
      "issue": "7553",
      "page": "436-444",
      "published_date": "2015-05-27",
      "year": 2015,
      "doi": "10.1038/nature14539",
      "issn": ["0028-0836", "1476-4687"],
      "language": "en",
      "tags": ["machine learning", "neural networks"]
    }
  },
  "citation_mappings": {
    "ref_001": [
      {"document_id": "doc1", "positions": [45, 89, 234]},
      {"document_id": "doc2", "positions": [12, 156]}
    ]
  }
}

使用示例 | Usage Examples

【中文】

示例1:通过DOI获取文献并生成APA格式引用

from academic_citation_skill import AcademicCitationManager

manager = AcademicCitationManager()

# 获取文献信息
ref = manager.fetch_reference_by_doi("10.1038/nature14539")

# 生成文中引用
in_text = manager.generate_citation(
    reference_id=ref['id'],
    style='apa',
    citation_type='author-date'
)
print(f"文中引用: {in_text}")
# 输出: (LeCun, Bengio, & Hinton, 2015)

# 生成参考文献条目
bib_entry = manager.format_bibliography_entry(ref, style='apa')
print(f"参考文献条目: {bib_entry}")
# 输出: LeCun, Y., Bengio, Y., & Hinton, G. (2015). Deep learning. Nature, 521(7553), 436–444. https://doi.org/10.1038/nature14539

示例2:批量导入和格式转换

# 从BibTeX文件导入
from batch_import import BatchImporter

importer = BatchImporter()
references = importer.import_from_file('references.bib', format='bibtex')

# 添加到文献库
for ref in references:
    manager.add_to_library(ref)

# 转换为IEEE格式
from format_converter import FormatConverter

converter = FormatConverter()
ieee_refs = converter.convert_references(
    references=references,
    from_style='bibtex',
    to_style='ieee'
)

# 保存到文件
converter.save_to_file(ieee_refs, 'references_ieee.txt')

示例3:检查论文引用完整性

from citation_checker import CitationChecker

checker = CitationChecker()

# 加载论文和参考文献
with open('paper.txt', 'r') as f:
    paper_text = f.read()

# 检查引用完整性
report = checker.check_paper(
    document_text=paper_text,
    bibliography_file='references.txt'
)

# 打印报告
print(f"总引用数: {report['total_citations']}")
print(f"参考文献数: {report['total_references']}")
print(f"不一致项: {report['inconsistencies']}")

if report['missing_in_bibliography']:
    print("\n文中引用但参考文献列表缺失:")
    for item in report['missing_in_bibliography']:
        print(f"  - {item}")

if report['unused_references']:
    print("\n参考文献列表中未使用的条目:")
    for item in report['unused_references']:
        print(f"  - {item}")

示例4:处理中文文献(GB/T 7714格式)

# 添加中文文献
chinese_ref = {
    'type': 'journal_article',
    'title': '深度学习在自然语言处理中的应用',
    'authors': [
        {'family': '张', 'given': '三'},
        {'family': '李', 'given': '四'}
    ],
    'container_title': '计算机学报',
    'year': 2023,
    'volume': 46,
    'issue': 3,
    'page': '1-15',
    'language': 'zh'
}

manager.add_to_library(chinese_ref)

# 生成GB/T 7714格式引用
bib_entry = manager.format_bibliography_entry(
    chinese_ref,
    style='gbt7714'
)
print(f"GB/T 7714格式: {bib_entry}")
# 输出: 张三, 李四. 深度学习在自然语言处理中的应用[J]. 计算机学报, 2023, 46(3): 1-15.

【English】

Example 1: Fetch Reference by DOI and Generate APA Format Citation

from academic_citation_skill import AcademicCitationManager

manager = AcademicCitationManager()

# Fetch reference information
ref = manager.fetch_reference_by_doi("10.1038/nature14539")

# Generate in-text citation
in_text = manager.generate_citation(
    reference_id=ref['id'],
    style='apa',
    citation_type='author-date'
)
print(f"In-text citation: {in_text}")
# Output: (LeCun, Bengio, & Hinton, 2015)

# Generate bibliography entry
bib_entry = manager.format_bibliography_entry(ref, style='apa')
print(f"Bibliography entry: {bib_entry}")
# Output: LeCun, Y., Bengio, Y., & Hinton, G. (2015). Deep learning. Nature, 521(7553), 436–444. https://doi.org/10.1038/nature14539

Example 2: Batch Import and Format Conversion

# Import from BibTeX file
from batch_import import BatchImporter

importer = BatchImporter()
references = importer.import_from_file('references.bib', format='bibtex')

# Add to library
for ref in references:
    manager.add_to_library(ref)

# Convert to IEEE format
from format_converter import FormatConverter

converter = FormatConverter()
ieee_refs = converter.convert_references(
    references=references,
    from_style='bibtex',
    to_style='ieee'
)

# Save to file
converter.save_to_file(ieee_refs, 'references_ieee.txt')

Example 3: Check Paper Citation Integrity

from citation_checker import CitationChecker

checker = CitationChecker()

# Load paper and references
with open('paper.txt', 'r') as f:
    paper_text = f.read()

# Check citation integrity
report = checker.check_paper(
    document_text=paper_text,
    bibliography_file='references.txt'
)

# Print report
print(f"Total citations: {report['total_citations']}")
print(f"Total references: {report['total_references']}")
print(f"Inconsistencies: {report['inconsistencies']}")

if report['missing_in_bibliography']:
    print("\nCited in text but missing from bibliography:")
    for item in report['missing_in_bibliography']:
        print(f"  - {item}")

if report['unused_references']:
    print("\nUnused entries in bibliography:")
    for item in report['unused_references']:
        print(f"  - {item}")

Example 4: Process Chinese Literature (GB/T 7714 Format)

# Add Chinese reference
chinese_ref = {
    'type': 'journal_article',
    'title': '深度学习在自然语言处理中的应用',
    'authors': [
        {'family': '张', 'given': '三'},
        {'family': '李', 'given': '四'}
    ],
    'container_title': '计算机学报',
    'year': 2023,
    'volume': 46,
    'issue': 3,
    'page': '1-15',
    'language': 'zh'
}

manager.add_to_library(chinese_ref)

# Generate GB/T 7714 format citation
bib_entry = manager.format_bibliography_entry(
    chinese_ref,
    style='gbt7714'
)
print(f"GB/T 7714 format: {bib_entry}")
# Output: 张三, 李四. 深度学习在自然语言处理中的应用[J]. 计算机学报, 2023, 46(3): 1-15.

注意事项 | Notes

【中文】

使用建议

  1. DOI使用
  1. 文献类型选择
  1. 中文文献处理
  1. 引用完整性
  1. 格式转换注意事项

限制说明

  1. API限制
  1. 元数据准确性
  1. 格式兼容性
  1. 性能考虑

常见问题

Q: 如何获取文献的DOI?

A: DOI通常可以在以下位置找到:

Q: 支持哪些文献导入格式?

A: 当前支持:

Q: 如何处理没有DOI的文献?

A: 可以使用以下方法:

  1. 使用ISBN(仅适用于图书)
  2. 使用标题和作者信息搜索
  3. 手动输入完整文献信息
  4. 从PDF或其他来源提取元数据

Q: 转换格式后需要人工检查吗?

A: 是的,强烈建议:

  1. 核对所有作者姓名
  2. 检查标题的大小写格式
  3. 验证卷号、期号、页码的格式
  4. 确认DOI或URL的显示方式
  5. 检查特殊字符和非拉丁文字符的显示

【English】

Usage Recommendations

  1. DOI Usage
  1. Document Type Selection
  1. Chinese Literature Processing
  1. Citation Integrity
  1. Format Conversion Considerations

Limitations

  1. API Limitations
  1. Metadata Accuracy
  1. Format Compatibility
  1. Performance Considerations

Frequently Asked Questions

Q: How to get the DOI of a reference?

A: DOIs can usually be found in the following locations:

Q: Which bibliography import formats are supported?

A: Currently supported:

Q: How to handle references without DOI?

A: You can use the following methods:

  1. Use ISBN (applicable only to books)
  2. Search using title and author information
  3. Manually enter complete reference information
  4. Extract metadata from PDF or other sources

Q: Is manual review needed after format conversion?

A: Yes, strongly recommended:

  1. Verify all author names
  2. Check title case formatting
  3. Validate volume, issue, and page number formats
  4. Confirm DOI or URL display
  5. Check display of special characters and non-Latin characters

更新日志 | Changelog

Version 1.0.0 (2026-03-01)

【中文】

【English】

许可证 | License

【中文】

本项目采用 MIT 许可证。详见 LICENSE 文件。

【English】

This project is licensed under MIT License. See LICENSE file for details.

联系方式 | Contact

【中文】

【English】

致谢 | Acknowledgments

【中文】

感谢Crossref提供免费的DOI元数据查询服务,以及所有为学术引用管理工具做出贡献的开发者。特别感谢开源社区在citation-style-language等项目上的贡献。

【English】

Thanks to Crossref for providing free DOI metadata query services, and all developers who have contributed to academic citation management tools. Special thanks to the open source community for their contributions to projects like citation-style-language.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.