我正在使用 TeXnicCenter,我设置了一个项目文件,并使用 biblatex 创建了我的输出 pdf 文件和参考书目。一切运行良好,文档看起来应该正常……现在出现了问题:我无法让 \cite{}(实际上是任何引用命令)的自动完成功能正常工作。我甚至没有在参考选项卡(稳定版 TeXnicCenter)或文献窗口(Alpha 版)中看到参考文献。这有点烦人,因为我的 .bib 文件中有大量的参考文献。有人知道如何解决这个问题吗?也许可以说明一下,我最近刚刚切换到 biblatex,在开始使用它之前,我可以看到参考文献,并且自动完成功能正在运行。
这是我的代码的一个最小示例:
\documentclass[12pt,a4paper,twoside]{report}
\usepackage{geometry}
\usepackage[latin1]{inputenc}
\usepackage[american]{babel}
\usepackage{filecontents}
\usepackage{csquotes}
\usepackage[style=authoryear-comp,%
natbib=true, % enable natbib macros
bibencoding=ascii,
url=false,
sorting=nyt,
uniquename=false,
firstinits=true, % use initials as first names
uniquelist=false,
dashed=false, % do not use a dash instead of author name in case of several publications
maxnames=99, % in the bibliography show all names
maxcitenames=2, % in the text use et al. for more than 2
backref=true, % have backrefs in the bibliography
backend=bibtex8,
refsegment=section]{biblatex}
\addbibresource{PhDall.bib}
\usepackage[T1]{fontenc}
\usepackage{fancyhdr}
\usepackage{setspace}
\usepackage[intoc]{nomencl}
\usepackage[colorlinks]{hyperref}
\usepackage[figure,table]{hypcap}
%-------Main-Document-Body---------
\begin{document}
\chapter{test}\label{testchapter}
lets see if this works: \parencite{albergel_evaluation_2012} and \parencite{maltese_event_2010}
\printbibliography
\end{document}
我从 zotero (编码西方-ISO8859-1) 获得的书目如下:
@inproceedings{maltese_event_2010,
title = {Event detection of hydrological processes with passive L-band data from {SMOS}},
volume = {7824},
shorttitle = {Event detection of hydrological processes with passive L-band data from {SMOS}},
url = {http://dx.doi.org/10.1117/12.865074},
doi = {10.1117/12.865074},
booktitle = {{SPIE}},
publisher = {{SPIE}},
author = {Maltese, Antonio and Al Bitar, Ahmad and Jacquette, Elsa and Kerr, Yann and Mialon, Arnaud and Cabot, Francoise and Quesney, Arnaud and Merlin, Olivier and Richaume, Phillipe},
year = {2010},
pages = {78240J}
},
@article{albergel_evaluation_2012,
title = {Evaluation of remotely sensed and modelled soil moisture products using global ground-based in situ observations},
volume = {118},
shorttitle = {Evaluation of remotely sensed and modelled soil moisture products using global ground-based in situ observations},
url = {http://www.sciencedirect.com/science/article/pii/S0034425711004147},
doi = {10.1016/j.rse.2011.11.017},
journal = {Remote Sensing of Environment},
author = {Albergel, Clement and de Rosnay, Patricia and Gruhier, Claire and {Mu\~{n}oz-Sabater}, Joaquin and Hasenauer, Stefan and Isaksen, Lars and Kerr, Yann and Wagner, Wolfgang},
year = {2012},
pages = {215--226}
}
有什么建议可以干扰自动完成选项吗?谢谢
答案1
通过添加这三行
\makeatletter
\@ifpackageloaded{biblatex}{\addbibresource{literatur.bib}}{\bibliography{literatur}}
\makeatother
而不仅仅是
\addbibresource{}
TeXnicCenter 认为您正在使用
\bibliography{}
并将其集成到 GUI 中并实现自动完成。
该解决方案的优点是可以同时与biblatex
(+biber) 和经典 BibTeX 配合使用,并且在编译之前不需要取消任何注释。
答案2
正如评论中提到的文本学习者,这里的技巧是:
尝试使用
\bibliography{example.bib}
before\end{document}
进行自动完成,并在运行 pdflatex 之前对其进行注释