biblatex + verbose - urldate 被忽略

biblatex + verbose - urldate 被忽略

我正在使用biblatex基于详细样式的自己的 Bibstyle。

\usepackage[bibstyle=mystyle,citestyle=mystyle,natbib=true]{biblatex}

现在我需要 cite 中显示的 urldate。但我找不到办法做到这一点。

我试过

\printfield{urldate}

但什么也没有。

\DeclareFieldFormat{url}{\url{#1}}
\DeclareFieldFormat{formaturl}{\newline #1}
\DeclareFieldFormat{abrufurl}{\addcomma\space Abruf am #1}

\renewbibmacro*{url+urldate}{%
     \printtext[formaturl]{%
   \printfield{url}}%
     \printtext[abrufurl]{%
       \printfield{urldate}}%
}

有人可以帮忙吗?

答案1

至少在标准verbose样式下,如果你用 替换 ,它就可以工作\printfield{urldate}\printurldate你可能还想更改 的格式urldate并加载(如biblatex手册中建议的那样)babel包,这里有ngerman选项。

\documentclass{article}

\usepackage[ngerman]{babel}

\usepackage[style=verbose]{biblatex}

\DeclareFieldFormat{url}{\url{#1}}
\DeclareFieldFormat{urldate}{#1}
\DeclareFieldFormat{formaturl}{\newline #1}
\DeclareFieldFormat{abrufurl}{\addcomma\space Abruf am #1}

\renewbibmacro*{url+urldate}{%
     \printtext[formaturl]{%
   \printfield{url}}%
     \printtext[abrufurl]{%
       \printurldate}%
}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
  url = {tex.stackexchange.com},
  urldate = {2012-05-22},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\nocite{*}

\begin{document}

\printbibliography

\end{document}

除了定义包含字符串“Abruf am”的新格式之外,您还可以重新定义现有的参考书目字符串:

\documentclass{article}

\usepackage[ngerman]{babel}

\usepackage[style=verbose]{biblatex}

\DeclareFieldFormat{url}{\newline\url{#1}}
\DeclareFieldFormat{urldate}{\addcomma\space\bibstring{urlseen}\space#1}

\DefineBibliographyStrings{german}{%
  urlseen = {Abruf am},
}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
  url = {tex.stackexchange.com},
  urldate = {2012-05-22},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\nocite{*}

\begin{document}

\printbibliography

\end{document}

两个示例的输出:

enter image description here

相关内容