Проблема с исходным отображением biber

Проблема с исходным отображением biber

Ниже приведено mwe:

\begin{filecontents}[overwrite]{\jobname.bib}
@customa{a,
  author = {Author},
  eventdate = {1000-01-01},
  title = {Title},
  journaltitle = {Journaltitle},
  date = {3000},
}
@customa{b,
  author = {Author},
  eventdate = {2000-01-01},
  title = {Title},
  journaltitle = {Journaltitle},
  date = {1000},
}
@customa{c,
  author = {Author},
  eventdate = {3000-01-01},
  title = {Title},
  journaltitle = {Journaltitle},
  date = {2000},
}
@article{article,
  author = {Author},
  title = {Title},
  journaltitle = {Journaltitle},
  date = {2000},
}
\end{filecontents}

\documentclass{article}
\usepackage[style=authortitle]{biblatex}
\addbibresource{\jobname.bib}

\DeclareStyleSourcemap{
  \maps{
    \map{
      \pertype{customa}
      \step[fieldsource=eventdate, match=\regexp{\A(\d+)}]
      \step[fieldset=sortyear, fieldvalue={$1}]
    }
  }
}

\DeclareBibliographyDriver{customa}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \printnames{author}%
  \newunit
  \printeventdate
  \newunit
  \usebibmacro{title}%
  \newunit\newblock
  \bibstring{in}%
  \printunit{\intitlepunct}
  \usebibmacro{journal+issuetitle}%
  \usebibmacro{finentry}}

\begin{document}
\nocite{*}
\printbibliography
\end{document}

МВЕ работает отлично.

Насколько я понимаю, если <datetype>dateопределено, biber/biblatex автоматически генерирует поля <datetype>year, <datetype>monthи <datetype>day.

Таким образом, код сопоставления исходного кода также должен быть написан следующим образом.

\DeclareStyleSourcemap{
  \maps{
    \map{
      \pertype{customa}
      \step[fieldsource=eventyear]
      \step[fieldset=sortyear, origfieldval]
    }
  }
}

Но это второе решение не работает. Почему? В чем ошибка? Спасибо.

решение1

Шаг сопоставления источников, на котором Biber применяет ваши изменения к данным, происходит на самом раннем этапе обработки файла .bib. В частности, он происходит перед шагом, на котором Biber разделяет поля даты на их компоненты.

Поэтому при \DeclareStyleSourcemapвыполнении поле даты по-прежнему остается eventdate(как указано в .bibфайле), eventyearа друзья пока недоступны.

Связанный контент