Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'd like to have "(n.d.)" printed for a bibliography entry when no date is given. So far have already found a solution here, but the rest of my style code apparently changes something. Could anyone change that specific part? Currently it works just fine for the references, but not at all in the bibliography.

enter image description here

MWE

\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 http://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}
share|improve this question
    
Maybe by making your example a little "more" minimal, your issue could be more easily located; have you read this great guide on minimal working examples? –  henrique Aug 3 '13 at 17:06
3  
My answer to that post is outdated due to changes in date labels as of 2.6. These are currently under revision as they have introduced a few other issues. A solution will depend on these changes. For now you can load biblatex with mergedate=false and use \restorefield{labelyear} in the \AtEveryBibitem hook. –  Audrey Aug 3 '13 at 17:14
    
@Audrey Unfortunately the year is printed twice for entries with given year/date now. See here for a better MWE due to henrique's request and here for a screenshot of the output. –  henry Aug 4 '13 at 8:59
1  
This should automatically be the case in biblatex 2.6+ with biber. "nodate" is now a localisation string and it is the default fallback when there is no date in the .bib entry. You shouldn't need any special code to deal with this if you use 2.6+biber 1.6. –  PLK Aug 4 '13 at 9:49
4  
@henry You're likely having trouble getting this answered because the MWE is too long and the underlying question keeps changing. Since you're now OK with using biber, just remove urldate as a fallback date label: \DeclareLabeldate{\field{date}\field{eventdate} \field{origdate}\literal{nodate}} –  Audrey Aug 7 '13 at 14:01

1 Answer 1

up vote 8 down vote accepted
+100

As Audrey said in the comments, the answer is to remove urldate as a fallback date label

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

Here's a 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}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.