我是西班牙语使用者。我的 TeX 文件中有我所用语言的所有常用内容。我还使用 lstlistings,现在我想使用 biblatex(前 bibtex 用户)。但是我无法让这两个一起工作……这里是最简单的示例:
\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[spanish,es-tabla]{babel}
\AtBeginDocument{
\spanishdecimal{.}
}
\usepackage[
style=numeric-comp,
firstinits=true,
sorting=none,
doi=false,
isbn=false,
url=false,
eprint=false,
backend=bibtex,
maxnames=99
]{biblatex}
%\usepackage{listings}
\addbibresource{library.bib}
\begin{document}
\begin{refsection}
Hola \cite{El-sayed2005}
Buen día \cite{Voter2002a}
\printbibliography[heading=subbibliography]
\end{refsection}
\end{document}
当我取消注释 lstlistings 时出现以下错误:
(/usr/share/texmf/tex/latex/biblatex/lbx/spanish.lbx)
Package biblatex Warning: 'babel' detected but 'csquotes' missing.
(biblatex) Loading 'csquotes' recommended.
(./main.aux)
Package biblatex Warning: Data encoding is 'utf8'.
(biblatex) Use backend=biber.
No file main.bbl.
(./main1-blx.bbl)
./main.tex:33: Undefined control sequence.
<to be read again> \edef \lbx@tempa {m.z
a.el-sayed}
l.33 \printbibliography[heading=subbibliography]
./main.tex:33: ==> Fatal error occurred, no output PDF file produced!
Transcript written on main.log.
我能做什么?我需要这两个包... :S。这是 library.bib
@inproceedings{Voter2002a,
address = {San Juan, Puerto Rico, USA},
author = {Voter, Arthur F.},
booktitle = {Int. Conf. Comput. Nanosci. Nanotechnol.},
pages = {128 -- 131},
publisher = {Computational Pubns},
title = {{Introduction to the time scale problem}},
volume = {836},
year = {2002}
}
@article{El-sayed2005,
author = {El-Sayed, Ivan H and Huang, Xiaohua and El-Sayed, Mostafa A},
journal = {Nano Lett.},
number = {5},
pages = {829--834},
volume = {5},
year = {2005}
}
谢谢。
答案1
您refsection
必须bibtex
使用子文件运行:
bibtex <file>1-blx
“1” 表示refsection
。您可以在终端输出或日志文件中看到应该运行哪个文件。在上面的输出中,它是./main1-blx
:
bibtex main1-blx
创建 subbib。
但是,您使用的是 UTF-8 编码。之所以backend=bibtex8
使用bibtex8
或(最佳解决方案,backend=biber
(是默认设置))并运行biber
.biber
可以自行检测是否存在子文件。
当然,主要问题是文档中的活动字符“。”(点)。尝试
\usepackage[english,spanish,es-tabla]{babel}
进而:
\begin{refsection}
Hola \cite{El-sayed2005}
Buen día \cite{Voter2002a}
\selectlanguage{english}
\printbibliography[heading=subbibliography]
\end{refsection}
或者
\foreignlanguage{english}{%
\printbibliography[heading=subbibliography]}