mcpField
B
biblatex

biblatex

github.com/igbuend文档处理940 次安装33 周前更新
代码仓库

关于 biblatex

biblatex 是与 biber 后端配合使用的 LaTeX 文献与引文系统。本指南面向学术和技术文档作者,介绍样式配置、参考文献管理及文献表生成。

主要功能

  1. 01配置引文和文献表样式
  2. 02支持多种条目类型与字段
  3. 03提供引文命令及选项
  4. 04生成筛选或多个文献表
  5. 05说明 biber 编译流程与常见错误

适用场景

  1. 01管理 LaTeX 论文中的参考文献
  2. 02按指定样式格式化引文
  3. 03按类型或关键词拆分文献表
  4. 04排查文献表编译失败

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/igbuend/grimbard --skill biblatex

安装后在 Claude Code 中输入/biblatex确认已加载。

详细介绍

biblatex + biber — 现代文献管理

CTAN: https://ctan.org/pkg/biblatex
手册: texdoc biblatex

设置

\usepackage[
  backend=biber,        % modern backend (not bibtex)
  style=authoryear,     % citation + bibliography style
  sorting=nyt,          % name-year-title
  maxbibnames=99,       % show all authors in bibliography
  maxcitenames=2,       % truncate in citations
]{biblatex}

\addbibresource{references.bib}   % .bib file (include extension!)

% At end of document:
\printbibliography

编译工作流

pdflatex  main.tex    # 1. Generate .bcf file
biber     main        # 2. Process bibliography (no extension!)
pdflatex  main.tex    # 3. Resolve references
pdflatex  main.tex    # 4. Final pass (page numbers, back-refs)

也可以使用 latexmk:latexmk -pdf main.tex(自动处理所有步骤)。

.bib 文件格式

@article{einstein1905,
  author    = {Einstein, Albert},
  title     = {On the Electrodynamics of Moving Bodies},
  journal   = {Annalen der Physik},
  year      = {1905},
  volume    = {322},
  number    = {10},
  pages     = {891--921},
  doi       = {10.1002/andp.19053221004},
}

@book{knuth1984,
  author    = {Knuth, Donald E.},
  title     = {The {\TeX}book},
  publisher = {Addison-Wesley},
  year      = {1984},
  isbn      = {0-201-13447-0},
}

@inproceedings{smith2023,
  author    = {Smith, John and Doe, Jane},
  title     = {Deep Learning for Everything},
  booktitle = {Proceedings of ICML},
  year      = {2023},
  pages     = {100--110},
  doi       = {10.1234/icml.2023.100},
}

@online{wiki2024,
  author    = {{Wikipedia contributors}},
  title     = {LaTeX},
  url       = {https://en.wikipedia.org/wiki/LaTeX},
  urldate   = {2024-01-15},
  year      = {2024},
}

@thesis{jones2020,
  author    = {Jones, Alice},
  title     = {Quantum Computing Applications},
  type      = {phdthesis},
  institution = {MIT},
  year      = {2020},
}

@manual{pgfmanual,
  author    = {Tantau, Till},
  title     = {The TikZ and PGF Packages},
  year      = {2023},
  url       = {https://ctan.org/pkg/pgf},
}
常见条目类型
类型用途
@article期刊文章
@book图书
@inproceedings会议论文
@incollection编著中的章节
@thesis博士/硕士论文(使用 type 字段)
@online网站、网络资源
@manual技术文档
@techreport技术报告
@misc其他内容
@unpublished未发表的手稿
@patent专利
@software软件包
常见字段
字段描述
author作者——{Last, First and Last, First}
title标题——使用 {NASA} 保护大写字母
year/date出版年份或完整日期(2023-06-15)
journal期刊名称
booktitle会议/文集名称
publisher出版商
volume/number卷号和期号
pages页码范围(10--20)
doi数字对象标识符
url网页 URL
urldate在线来源的访问日期
isbn/issn标识符
editor编辑
edition版次({2nd})
note附加注释
abstract摘要(默认不打印)
keywords用于筛选的关键词
langid语言(english、german)——用于断词
作者姓名格式
author = {Last, First},                    % single
author = {Last, First and Last, First},    % multiple
author = {Last, Jr., First},               % suffix
author = {{World Health Organization}},    % corporate (double braces)
author = {da Silva, João},                 % name particles

引用命令

命令输出(作者-年份)输出(数字)
\cite{key}Einstein 1905[1]
\parencite{key}(Einstein 1905)[1]
\textcite{key}Einstein (1905)Einstein [1]
\autocite{key}取决于样式取决于样式
\fullcite{key}行内显示完整的参考文献条目—
\footcite{key}脚注引用—
\citeauthor{key}EinsteinEinstein
\citeyear{key}19051905
\citetitle{key}On the Electro...—
使用选项
\parencite[see][p.~42]{einstein1905}
% Output: (see Einstein 1905, p. 42)

\parencite[p.~42]{einstein1905}
% Output: (Einstein 1905, p. 42)

% Multiple citations
\parencite{einstein1905, knuth1984}
% Output: (Einstein 1905; Knuth 1984)

参考文献样式

样式引用参考文献用途
authoryearEinstein (1905)按作者字母顺序排列人文学科、社会科学
numeric[1]按引用顺序编号科学、工程
alphabetic[Ein05]字母数字标签数学、计算机科学
authortitleEinstein, "On the..."作者-标题人文学科
verbose脚注中显示完整引用详细格式法律、历史
ieee[1]IEEE 格式工程(需要 biblatex-ieee)
apa(Einstein, 1905)APA 第 7 版心理学(需要 biblatex-apa)
chicago-authordate(Einstein 1905)Chicago 格式人文学科(需要 biblatex-chicago)
nature¹Nature 格式自然科学(biblatex-nature)
% For IEEE:
\usepackage[style=ieee, backend=biber]{biblatex}

% For APA:
\usepackage[style=apa, backend=biber]{biblatex}
% Also needs: \DeclareLanguageMapping{english}{english-apa}

排序选项

值排序顺序
nty姓名、标题、年份(authoryear 的默认值)
nyt姓名、年份、标题
none引用顺序(用于数字样式)
ynt年份、姓名、标题
anyt字母数字标签、姓名、年份、标题

打印参考文献

% Simple
\printbibliography

% With title
\printbibliography[title={References}]

% As section (not chapter)
\printbibliography[heading=subbibliography]

% Filtered
\printbibliography[type=article, title={Journal Articles}]
\printbibliography[keyword=primary, title={Primary Sources}]
\printbibliography[notkeyword=primary, title={Secondary Sources}]
多个参考文献列表
% By type
\printbibliography[type=book, heading=subbibliography, title={Books}]
\printbibliography[type=article, heading=subbibliography, title={Articles}]

% By keyword
% In .bib: keywords = {primary}
\printbibliography[keyword=primary, title={Primary Sources}]
\printbibliography[notkeyword=primary, title={Other Sources}]

% Per chapter (refsection)
\begin{refsection}
\chapter{First Chapter}
Text \cite{something}.
\printbibliography[heading=subbibliography]
\end{refsection}

实用选项

\usepackage[
  backend=biber,
  style=authoryear,
  sorting=nyt,
  maxbibnames=99,      % all authors in bibliography
  maxcitenames=2,      % "Smith et al." after 2 authors
  mincitenames=1,      % show at least 1 before "et al."
  uniquelist=false,    % don't disambiguate with more names
  uniquename=false,    % don't disambiguate with initials
  dashed=false,        % repeat author name (vs dash for same author)
  doi=true,            % print DOIs
  isbn=false,          % hide ISBNs
  url=false,           % hide URLs (except @online)
  eprint=false,        % hide eprint info
  date=year,           % show only year
]{biblatex}

对比:biblatex 与 natbib/BibTeX

特性biblatex + bibernatbib + BibTeX
Unicode✅ 完全支持❌ 支持有限
样式灵活(LaTeX 宏).bst 文件(难以编辑)
条目类型更多(@online、@software)更少
筛选keyword、type 筛选器手动
多个参考文献表内置需要 multibib 等
精细引用\textcite、\parencite 等\citet、\citep
日期处理完整日期、日期范围仅年份
姓名处理精细基础
编译pdflatex → biber → pdflatex²pdflatex → bibtex → pdflatex²
期刊要求有些期刊要求使用 BibTeX✅ 传统方式

建议: 新文档使用 biblatex。只有在期刊模板要求时才使用 natbib。

常见问题

问题原因解决方法
"I found no \citation commands"未运行 biber第一次运行 pdflatex 后运行 biber
"I found no \bibstyle command"将 bibtex 与 biblatex 混用使用 biber,不要使用 bibtex
引用显示为 [key]尚未运行 biber/发生错误检查 biber 日志,然后重新运行
未找到 .bib 文件\addbibresource 中缺少扩展名添加 .bib 扩展名
.bib 中的 Unicode 无法正常使用使用了 BibTeX 后端使用 backend=biber
作者的 "et al." 不正确maxcitenames 设得太低调整 maxcitenames
找不到样式缺少软件包安装 biblatex-ieee、biblatex-apa 等
Refsection 为空引用位于 refsection 外部每个 refsection 都是独立的
姓名排序错误姓名中的前缀词(van、de)使用 \DeclareNameAlias 或检查 useprefix
"Runaway argument".bib 中缺少逗号检查 .bib 语法(字段之间需用逗号分隔)

评论

支持 Markdown