我怎样才能将在缺少日期的情况下生成的“nd”字母更改为自定义字母(例如“o. J.”)?
最低工作示例:
% ==== PREAMBEL =============================================================
\documentclass{scrbook}
\usepackage[
citestyle=numeric,
style=authoryear,
natbib=true,
backend=biber
]{biblatex} % Use Biber and BibLaTex instead of BibTex
\usepackage{filecontents}
% ==== BIBLIOGRAPHY ========================================================
\begin{filecontents}{\jobname.bib}
@book{Doe,
author = {Doe, Jon},
title = {How to cite a literature-entry containing date},
date = {2015},
}
@book{Dae,
author = {Dae, Liz},
title = {How to cite a literature-entry with missing date},
date = {date},
}
\end{filecontents}
\bibliography{\jobname}
% ==== DOCUMENT ============================================================
\begin{document}
\chapter{Experimental chapter}
This is a text for testing how to cite a literature-entry containing date \parencite[look at][]{Doe}.
This is a text for testing how to cite a literature-entry with missing date \parencite[look at][]{Dae}.
\printbibliography
\end{document}
文内引用截图:
参考书目截图:
非常感谢您的帮助!
答案1
给你:
% ==== PREAMBEL =============================================================
\documentclass{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[german]{babel}
\usepackage{csquotes}
\usepackage[
citestyle=numeric,
style=authoryear,
natbib=true,
backend=biber
]{biblatex} % Use Biber and BibLaTex instead of BibTex
\usepackage{filecontents}
% ==== BIBLIOGRAPHY ========================================================
\begin{filecontents}{\jobname.bib}
@book{Doe,
author = {Doe, Jon},
title = {How to cite a literature-entry containing date},
date = {2015},
}
@book{Dae,
author = {Dae, Liz},
title = {How to cite a literature-entry with missing date},
% 日期 = {日期}, }
@online{Lear,
title ={Edward Lear Home Page},
url = {http://www.nonsenselit.org/Lear/pstories/cm/cm.html},
urldate = {2015-07-16},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\DefineBibliographyStrings{german}{%
nodate = {{}o\adddot\addnbthinspace J\adddot}
}%
\DeclareLabeldate{%
\field{date}
\field{eventdate}
\field{origdate}
\literal{nodate}
}
%
\renewbibmacro*{date+extrayear}{%
\iffieldundef{\thefield{datelabelsource}year}
{\printtext[parens]{\printfield{labelyear}}}
{\printtext[parens]{%
\printfield{\thefield{datelabelsource}year}%
\printfield{extrayear}}}}% ==== DOCUMENT ============================================================
\begin{document}
\chapter{Experimental chapter}
This is a text for testing how to cite a literature-entry containing date \parencite[look at][]{Doe}.
This is a text for testing how to cite a literature-entry with missing date \parencite[look at][]{Dae}.
Edward Lear revisited Roman history \parencite[look at]{Lear}
\printbibliography
\end{document}