使用biblatex实现(作者,年份)引用格式及可跳转参考文献的问题
LaTeX文献引用功能调整方案
你需要对现有代码做三处核心修改即可满足需求:
- 优化
biblatex宏包加载参数:补充hyperref=true配置项确保引用跳转功能正常生效,原有style=authoryear已经默认覆盖citestyle=authoryear配置,可以删除冗余参数。另外注意你现有导言区重复加载了caption包,可删除重复项避免潜在冲突。 - 替换引用命令:开启
natbib兼容选项后,使用\citep{文献键名}替代原有\cite命令,即可直接输出(作者, 年份)格式的带括号引用。 - 添加参考文献生成命令:在文档末尾、
\end{document}之前加入\printbibliography命令,即可生成完整参考文献列表。
以下是修改后的完整可运行代码:
\documentclass[12pt]{article} % 移除重复加载的caption包,保留其余原有宏包 \usepackage{amssymb,amsmath,amsfonts,eurosym,geometry,ulem,graphicx,caption,color,setspace,sectsty,comment,footmisc,pdflscape,subfigure,array,booktabs,dcolumn,threeparttable,adjustbox,dirtytalk,multirow,tabularx,longtable,placeins,tikz} % 调整biblatex参数,补充跳转支持 \usepackage[backend=biber,natbib,style=authoryear,hyperref=true]{biblatex} \usepackage{float} \restylefloat{table} \usepackage{pgfplots} \pgfplotsset{width=12cm,compat=1.9} \usepackage{pst-func} \psset{unit=2cm} \usepackage[english]{babel} \usepackage{hyperref} \hypersetup{colorlinks=true,urlcolor=blue,citecolor=blue,linkcolor=red} \addbibresource{segmentation.bib} \begin{document} This is a sample \citep{sample}. % 生成参考文献列表 \printbibliography \end{document}
编译注意事项
修改完成后需要按「LaTeX → Biber → LaTeX × 2」的顺序编译,才能正常生成引用格式、参考文献列表以及跳转链接。
内容的提问来源于stack exchange,提问作者Anisha Garg
相关产品推荐
相关产品推荐

