biblatex - 没有给出日期时为“nd”

biblatex - 没有给出日期时为“nd”

我想在没有给出日期的情况下将“(nd)”打印在参考书目条目中。到目前为止,已经找到了解决方案这里,但我的其余样式代码显然发生了一些变化。有人可以更改该特定部分吗?目前,它对于参考文献来说运行良好,但对于参考书目来说则完全不行。

在此处输入图片描述

平均能量损失

\documentclass[
12pt,
a4paper
]
{scrreprt}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}

\usepackage[
language=auto,
style=authoryear-ibid,
backend=biber,
hyperref=true,
isbn=false,
dashed=false,
doi=false,
citereset=chapter,
maxcitenames=3,
sorting=nyt,
firstinits=true,
uniquename=init,
ibidtracker=true,
maxbibnames=99,
urldate=iso8601,
%mergedate=true, %Audrey https://tex.stackexchange.com/questions/126584/biblatex-n-d-when-no-date-given?noredirect=1#comment284550_126584
labeldate=true
]{biblatex}
\usepackage{xpatch}

%%  parentheses around year in references
\renewbibmacro*{cite:labelyear+extrayear}{%
\iffieldundef{labelyear}
{}
{% 
\printtext[bibhyperref]{%
\printtext[parens]{%
\printfield{labelyear}%
\printfield{extrayear}}}}}

%% no date given
\newcommand{\mkbibnodate}{n\adddot d\adddot}
\AtEveryCitekey{\iffieldundef{labelyear}{\restorefield{labelyear}{\mkbibnodate}}{}}
\AtEveryBibitem{\iffieldundef{year}{\restorefield{labelyear}{\mkbibnodate}}{}}

%% correct order of publisher and location
\renewbibmacro*{publisher+location+date}{%
\newunit
\printlist{publisher}%
\newunit
\printlist{location}%
\newunit}

%%  right order of words 'volume' und 'issue' with comma in front
\renewbibmacro*{journal+issuetitle}{%
  \usebibmacro{journal}%
  \setunit*{\addspace}%
  \iffieldundef{series}
    {}
    {\newunit
     \printfield{series}%
     \setunit{\addspace}}%
  \usebibmacro{volume+number+eid}
  \setunit{\addcomma\space}% THIS LINE CHANGED to add comma
  \usebibmacro{issue+date}%
  \setunit{\addcolon\space}%
  \usebibmacro{issue}%
  \newunit}
%taken from standard.bbx
\renewbibmacro*{issue+date}{%
  \printtext{%   REMOVED parenthesis here
    \iffieldundef{issue}
      {\usebibmacro{date}}
      {\printfield{issue}%
       \setunit*{\addspace}%
       \usebibmacro{date}}}%
  \newunit}


%% linebreak before URLs and colon before date of last visit
\xpretobibmacro{url+urldate}{\setunit{\newunitpunct\par\nobreak}}{}{}
\DefineBibliographyStrings{english}{%
urlseen = {last visit\addcolon}
}

%% colon before date of last visit
\DeclareFieldFormat{urldate}{\mkbibparens{\bibstring{urlseen}\addcolon\space#1}}

\begin{filecontents*}{lit.bib}
@Online{ctan,
label         = {CTAN},
hyphenation   = {american},
title         = {CTAN},
subtitle      = {The Comprehensive TeX Archive Network},
url       = {http://www.ctan.org},
urldate   = {2006-10-01}
}
@Book{augustine,
hyphenation   = {american},
author    = {Augusteine, Robert L.},
title         = {Heterogeneous catalysis for the synthetic chemist},
shorttitle    = {Heterogeneous catalysis},
publisher     = {Marcel Dekker},
location      = {New York},
edition={5}
}
@Article{bertram,
author       = {Bertram, Aaron and Wentworth, Richard},
title        = {Gromov invariants for holomorphic maps on Riemann surfaces},
journaltitle = jams,
year         = 1996,
volume       = 9,
number       = 2,
pages        = {529-571}
}
@InCollection{hyman,
author       = {Arthur Hyman},
editor       = {O'Meara, Dominic J.},
title        = {Aristotle's Theory of the Intellect and its Interpretation by
                                Averroes},
booktitle    = {Studies in Aristotle},
series       = {Studies in Philosophy and the History of Philosophy},
number       = 9,
publisher    = {The Catholic University of America Press},
location     = {Washington, D.C.},
pages        = {161-191}
}

\end{filecontents*}

\addbibresource{lit.bib}

\begin{document}
\chapter{First Chapter}
\begin{itemize}
    \item This is a test for the case if no year was given for \verb+@online+ source.\footcite[See][p. 3]{ctan}.
    \item Another sentence for the parentheses.\footnote{\cite[See][p. 456.]{augustine}}
    \item Words for the \verb+article+-type.\footnote{\cite[See][p. B.]{bertram}}
    \item Soem stuff for \verb+incollection+.\footnote{\cite[See][p. 456.]{hyman}}
\end{itemize}
\printbibliography
\end{document}

答案1

正如奥黛丽在评论中所说,答案是删除urldate作为后备日期的标签

\DeclareLabeldate{\field{date}\field{eventdate} \field{origdate}\literal{nodate}}

以下是 MWE:

\documentclass{article}
\begin{filecontents*}{\jobname.bib}
@Online{ctan,
label         = {CTAN},
hyphenation   = {american},
title         = {CTAN},
subtitle      = {The Comprehensive TeX Archive Network},
url       = {http://www.ctan.org},
urldate   = {2006-10-01}
}
@Book{augustine,
hyphenation   = {american},
author    = {Augusteine, Robert L.},
title         = {Heterogeneous catalysis for the synthetic chemist},
shorttitle    = {Heterogeneous catalysis},
publisher     = {Marcel Dekker},
location      = {New York},
edition={5}
}
@Article{bertram,
author       = {Bertram, Aaron and Wentworth, Richard},
title        = {Gromov invariants for holomorphic maps on Riemann surfaces},
journaltitle = {jams},
year         = 1996,
volume       = 9,
number       = 2,
pages        = {529-571}
}
@InCollection{hyman,
author       = {Arthur Hyman},
editor       = {O'Meara, Dominic J.},
title        = {Aristotle's Theory of the Intellect and its Interpretation by
                                Averroes},
booktitle    = {Studies in Aristotle},
series       = {Studies in Philosophy and the History of Philosophy},
number       = 9,
publisher    = {The Catholic University of America Press},
location     = {Washington, D.C.},
pages        = {161-191}
}
\end{filecontents*}
\usepackage[style=authoryear-ibid]{biblatex}
\addbibresource{\jobname.bib}
\DeclareLabeldate{
  \field{date}
  \field{eventdate} 
  \field{origdate}
  \literal{nodate}
}
\begin{document}
\autocites[See][3]{ctan}[See][456]{augustine}[See][B]{bertram}[See][456]{hyman}
\printbibliography
\end{document}

在此处输入图片描述

相关内容