Biblatex 定制和 Babel 问题

Biblatex 定制和 Babel 问题

当我尝试通过更新 url+urldate 宏来更改 biblatex 中的 url 和 url 日期的顺序时,会出现错误。但是当我禁用 babel 时,它工作正常。

错误:

./mwe.tex:43: Use of \\blx@imc@bibstring doesn't match its definition. [\end]
./mwe.tex:43: Extra }, or forgotten \endgroup. [\end]
./mwe.tex:43: Argument of \@gobble has an extra }. [\end]
./mwe.tex:43: Paragraph ended before \@gobble was complete. [\end]

以下是我:

\documentclass[11pt,a4paper,oneside]{article}
    \usepackage[utf8]{inputenc}
    \usepackage[T1]{fontenc}
    \usepackage[a4paper, top=2.5cm, right=2.5cm, bottom=2.5cm, left=4cm]{geometry}
    \usepackage[backend=biber, style=authoryear, date=year, firstinits=true, natbib=true]{biblatex}
    \usepackage{csquotes}
    \usepackage[turkish, shorthands=off]{babel}
    \usepackage{filecontents}


\renewbibmacro*{url+urldate}{%
  \iffieldundef{urlyear}
    {}
    {\setunit*{\addcomma\addspace}%
     \printurldate}
  \printfield{url}}


\begin{filecontents*}{\jobname.bib}
  @online{doe2014,
    author = {John Doe},
    title  = {Lorem Ipsum},
    date   = {2014},
    url    = {http://www.invalidurl.com},
    urldate = {2014-06-19}
}

\end{filecontents*}


\addbibresource{\jobname.bib}


\begin{document}

\section{mwe}
{
 Lorem ipsum dolor sit amet, consectetur adipiscing elit \cite{doe2014}. Vivamus a fermentum tortor. Curabitur lacinia feugiat eros. Aenean sagittis pulvinar orci id sodales. Aenean vulputate leo elit, vitae euismod odio cursus sed. Integer nec risus semper, lobortis arcu nec, sodales urna. Sed convallis vitae justo nec vehicula. Maecenas eleifend, erat sit amet ultricies ultricies, mi nibh hendrerit arcu, in consequat leo dui vitae eros.  
}

\printbibliography
\end{document}

mwe.bbl

% $ biblatex auxiliary file $
% $ biblatex bbl format version 2.3 $
% Do not modify the above lines!
%
% This is an auxiliary file used by the 'biblatex' package.
% This file may safely be deleted. It will be recreated by
% biber as required.
%
\begingroup
\makeatletter
\@ifundefined{[email protected]}
  {\@latex@error
     {Missing 'biblatex' package}
     {The bibliography requires the 'biblatex' package.}
      \aftergroup\endinput}
  {}
\endgroup


\refsection{0}
  \sortlist{entry}{nyt}
    \entry{doe2014}{online}{}
      \name{labelname}{1}{}{%
        {{uniquename=0,hash=bd051a2f7a5f377e3a62581b0e0f8577}{Doe}{D\bibinitperiod}{John}{J\bibinitperiod}{}{}{}{}}%
      }
      \name{author}{1}{}{%
        {{uniquename=0,hash=bd051a2f7a5f377e3a62581b0e0f8577}{Doe}{D\bibinitperiod}{John}{J\bibinitperiod}{}{}{}{}}%
      }
      \strng{namehash}{bd051a2f7a5f377e3a62581b0e0f8577}
      \strng{fullhash}{bd051a2f7a5f377e3a62581b0e0f8577}
      \field{sortinit}{D}
      \field{labelyear}{2014}
      \field{datelabelsource}{}
      \field{labeltitle}{Lorem Ipsum}
      \field{title}{Lorem Ipsum}
      \field{urlday}{19}
      \field{urlmonth}{06}
      \field{urlyear}{2014}
      \field{year}{2014}
      \verb{url}
      \verb http://www.invalidurl.com
      \endverb
    \endentry
  \endsortlist
\endrefsection
\endinput

相关内容