pdflatex+biblatex+biber 和特殊字符产生错误

pdflatex+biblatex+biber 和特殊字符产生错误

编辑:考虑到前 19 条评论,该帖子已更新

在我的 LaTeX 文档中

 \href{en.wikipedia.org/wiki/Pr%C3%A9lude_%C3%A0_l'apr%C3%A8s-midi_d'un_faune}{en.wikipedia.org/wiki/Prélude\_à\_l'après-midi\_d'un\_faune}

运行正常,并生成正确的链接。我.bib也想在我的文件中使用该链接,但我无法让它工作。仅凭

en.wikipedia.org/wiki/Pr%C3%A9lude_%C3%A0_l'apr%C3%A8s-midi_d'un_faune

在使用 进行编译时就足以产生错误biber。我不知道在哪里寻找错误。我认为biblatex与 结合biber能够产生utf8,所以这根本不是问题,对吧?

因此我准备了两个示例文件,但它们在我的系统(Ubuntu 13.04)上无法运行:请考虑:

bibfile.bib

@misc{wiki3,
author = {Wikipedia},
title = {Prélude à l’après-midi d’un faune},
howpublished = {\href{http://en.wikipedia.org/wiki/Pr%C3%A9lude_%C3%A0_l'apr%C3%A8s-midi_d'un_faune}{en.wikipedia.org/wiki/Prélude\_à\_l'après-midi\_d'un\_faune}},
note = "[Zugriff am 12. Mai 2013 um 19:35]"
}

test.tex

\documentclass{article}
\usepackage[style=numeric, backend=biber]{biblatex}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\addbibresource{bibfile.bib}
\usepackage{hyperref}
\begin{document}
EXAMPLE CONTENT
\nocite{*}
\printbibliography

\end{document}

运行pdflatex test.tex成功。运行biber test结果为:

INFO - This is Biber 0.9.9
INFO - Logfile is 'test.blg'
INFO - Reading 'test.bcf'
INFO - Using all citekeys in bib section 0
INFO - Processing bib section 0
INFO - Looking for bibtex format file 'bibfile.bib' for section 0
INFO - Decoding LaTeX character macros into UTF-8
INFO - Finished Decoding LaTeX character macros into UTF-8
INFO - Found BibTeX data source 'bibfile.bib'
INFO - Sorting list 'MAIN' keys
INFO - No sort tailoring available for locale 'en_US.UTF-8'
INFO - Sorting list 'SHORTHANDS' keys
INFO - No sort tailoring available for locale 'en_US.UTF-8'
INFO - Writing 'test.bbl' with encoding 'UTF-8'
INFO - Output to test.bbl

重新运行pdflatex test.tex输出(中间按几次 ENTER 键):

This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian)
restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation,         lo
aded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texmf/tex/latex/biblatex/biblatex.sty
(/usr/share/texmf/tex/latex/etoolbox/etoolbox.sty
(/usr/share/texlive/texmf-dist/tex/latex/etex-pkg/etex.sty))
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texmf/tex/latex/logreq/logreq.sty
(/usr/share/texmf/tex/latex/logreq/logreq.def))
(/usr/share/texlive/texmf-dist/tex/latex/base/ifthen.sty)
(/usr/share/texlive/texmf-dist/tex/latex/url/url.sty)
(/usr/share/texmf/tex/latex/biblatex/blx-compat.def)
(/usr/share/texmf/tex/latex/biblatex/biblatex.def)
(/usr/share/texmf/tex/latex/biblatex/bbx/numeric.bbx
(/usr/share/texmf/tex/latex/biblatex/bbx/standard.bbx))
(/usr/share/texmf/tex/latex/biblatex/cbx/numeric.cbx)
(/usr/share/texmf/tex/latex/biblatex/biblatex.cfg))
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/t1enc.def))
(/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
(/usr/share/texlive/texmf-dist/tex/latex/base/t1enc.dfu)
(/usr/share/texlive/texmf-dist/tex/latex/base/ot1enc.dfu)
(/usr/share/texlive/texmf-dist/tex/latex/base/omsenc.dfu)))
(/usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty))
(/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty)
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty)
(/usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def)
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/hyperref.cfg))

Package hyperref Message: Driver (autodetected): hpdftex.

(/usr/share/texlive/texmf-dist/tex/latex/hyperref/hpdftex.def
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty))
(/usr/share/texmf/tex/latex/biblatex/lbx/english.lbx) (./test.aux)     (./test.bbl)

Runaway argument?
{\href {en.wikipedia.org/wiki/Pr\field {note}{[Zugriff am 12. Mai 201\ETC.
! File ended while scanning use of \field.
<inserted text>
            \par
l.7 \begin{document}

?
! Undefined control sequence.
<argument> \blx@bbl@data

l.7 \begin{document}

?
! Missing number, treated as zero.
<to be read again>
               \xdef
l.7 \begin{document}

?
! Missing = inserted for \ifnum.
<to be read again>
               \xdef
l.7 \begin{document}

?
! Missing number, treated as zero.
<to be read again>
               \xdef
l.7 \begin{document}

?
! Undefined control sequence.
<argument> \blx@bbl@data

l.7 \begin{document}

?
! Undefined control sequence.
<argument> \blx@bbl@data

l.7 \begin{document}

?
! You can't use `\xdef' after \advance.
<argument> \xdef
             \csname\endcsname{\expandonce \csname\endcsname\csname c@1\...
l.7 \begin{document}

?
(/usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/gettitlestring.sty)
! Undefined control sequence.
<argument> \blx@bbl@data

l.133 \newcounter{section@level}

?
! Missing number, treated as zero.
<to be read again>
               \xdef
l.133 \newcounter{section@level}

?
! Missing = inserted for \ifnum.
<to be read again>
               \xdef
l.133 \newcounter{section@level}

?
! Missing number, treated as zero.
<to be read again>
               \xdef
l.133 \newcounter{section@level}

?
! Undefined control sequence.
<argument> \blx@bbl@data

l.133 \newcounter{section@level}

?
! Undefined control sequence.
<argument> \blx@bbl@data

l.133 \newcounter{section@level}

?
! You can't use `\xdef' after \advance.
<argument> \xdef
             \csname\endcsname{\expandonce \csname\endcsname\csname c@1\...
l.133 \newcounter{section@level}

?
) (./test.out) (./test.out)
! Undefined control sequence.
<argument> \blx@bbl@data

l.7 \begin{document}

?
! Missing number, treated as zero.
<to be read again>
               \xdef
l.7 \begin{document}

?
! Missing = inserted for \ifnum.
<to be read again>
               \xdef
l.7 \begin{document}

?
! Missing number, treated as zero.
<to be read again>
               \xdef
l.7 \begin{document}

?
! Undefined control sequence.
<argument> \blx@bbl@data

l.7 \begin{document}

?
! Missing number, treated as zero.
<to be read again>
               \xdef
l.7 \begin{document}

?
! Undefined control sequence.
<argument> \blx@bbl@data

l.7 \begin{document}

?
! You can't use `\xdef' after \advance.
<argument> \xdef
             \csname\endcsname{\expandonce \csname\endcsname\csname c@1\...
l.7 \begin{document}

?
[1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map
}] (./test.aux)

Package rerunfilecheck Warning: File `test.out' has changed.
(rerunfilecheck)                Rerun to get outlines right
(rerunfilecheck)                or use package `bookmark'.


LaTeX Warning: There were undefined references.


Package biblatex Warning: Please (re)run Biber on the file:
(biblatex)                test
(biblatex)                and rerun LaTeX afterwards.

 )
(\end occurred inside a group at level 2)

### semi simple group (level 2) entered at line 7 (\begingroup)
### semi simple group (level 1) entered at line 7 (\begingroup)
### bottom level </home/user/.texmf-        var/fonts/pk/ljfour/jknappen/ec/ecrm1000.60
0pk>
Output written on test.pdf (1 page, 6365 bytes).

沒有提供任何參考。

我的目标是获得如下结果:

@misc{wiki3,
author = {Wikipedia},
title = {Prélude à l’après-midi d’un faune},
howpublished = {\href{http://en.wikipedia.org/wiki/Pr%C3%A9lude_%C3%A0_l'apr%C3%A8s-midi_d'un_faune}{en.wikipedia.org/wiki/Prélude\_à\_l'après-midi\_d'un\_faune}},
note = "[Zugriff am 12. Mai 2013 um 19:35]"
}

在我的bibfile.bib

如果有人能帮助我,我会非常非常高兴,因为我已经尝试了所有能想到的方法,但没有解决方案。也许我的代码对你有用,但我的安装有问题?

编辑2: 在查看该问题时发现并报告了一个错误: https://sourceforge.net/p/biblatex-biber/bugs/144/

答案1

我认为问题在于您没有在文件中插入http://内部,同时您必须在每个文件之前插入。\href.bib\%

尝试以这种方式修改它,它似乎对我有用:

@misc{wiki3,
author = {Wikipedia},
title = {Prélude à l’après-midi d’un faune},
howpublished = {\href{http://en.wikipedia.org/wiki/Pr\%C3\%A9lude_\%C3\%A0_l'apr\%C3\%A8s-midi_d'un_faune}{en.wikipedia.org/wiki/Prélude\_à\_l'après-midi\_d'un\_faune}},
note = "[Zugriff am 12. Mai 2013 um 19:35]"
}

附录

这只是一个建议。

当您的参考书目项目是网上资源时,online可以使用 条目代替misc

然后你可以替换

@misc{wiki3,

@online{wiki3,

howpublished = {\href{http://en.wikipedia.org/wiki/Pr\%C3\%A9lude_\%C3\%A0_l'apr\%C3\%A8s-midi_d'un_faune}{en.wikipedia.org/wiki/Prélude\_à\_l'après-midi\_d'un\_faune}},

url = {http://en.wikipedia.org/wiki/Prélude_à_l'après-midi_d'un_faune},

请注意,无论如何,该字段url可以在任何条目类型内使用,misc包括。

相关内容